wp/bibliography.html0000644000106600010660000015227411075151276012005 0ustar Bibliography - Joe Nick Patoski
Joe Nick Patoski - joenickp.com
Google
 

Bibliography | Joe Nick Patoski

Each year is organized alphabetically by article name.

2007 |2006 |2005 |2004 | 2003 | 2002 | 2001 |2000 | 1999 | 1997 | 1995

2008

  • Willie Nelson: An Epic Life The book is in many ways the culmination of my writings about music, Texas, and Texans. [Little, Brown & Company, April 2008] Order the book from Amazon here.
  • "Big time in Cowtown" In 1965, Willie Nelson came home to Panther Hall, a country-music oasis deep in the heart of Cowtown, to record a live album his way [Fort Worth Star-Telegram, April 14, 2008]
  • "Radio Days" Fort Worth was where the quest began for a hungry young musician who worked as a DJ named Willie Nelson [Fort Worth Star-Telegram, Music Feature, April 13, 2008]

2007

  • Big Bend Field Notes The author jumps over a watery passage in the Chihuahuan Desert. Two and a half million acres (one million hectares) of this desert straddle the Texas-Mexico border in a block of protected land known as El Carmen–Big Bend Transboundary Megacorridor. [National Geographic, Texas Feature, February 2007]
  • BLOG, Joe Nick's original Selina, Ladybird Johnson, Obama, Sam the Sham and more. [active 2004-2007]
  • Border Crossing in the Chihuahua Desert Cross-boundary conservation efforts secure North America's hidden wilderness. [Nature Conservancy, Winter 2007, pdf file]
  • Desolate Majesty: Preserving beauty without borders Straddling Texas and Mexico, the Big Bend region is high in biodiversity and low in footprints. It's a place so untamed that if something doesn't bite, stick, or sting, it's probably a rock. [National Geographic, Texas Feature, February 2007] Listen to National Geographic staffer Kathleen Ridgely read "Desolate Majesty: Beyond Big Bend."
  • The Great Divide Habitat destruction vs. clean fuel. Is wind power the scourge its critics claim it is? Joe Nick reports from Texas on the big brawl in the Nation's wind power capital. [The Land Report, Texas Feature, November 2007]
  • Saved by the Belle She rose from welfare mom to Nashville queen. No wonder Naomi Judd has so much to tell the world about healing, finding joy, and beating the disease that nearly took her life. [AARP The Magazine, Music Feature, May & June 2007]

2006

  • Back in Black With or without a stocking program, the black bear is returning to East Texas. [Texas Parks and Wildlife Magazine, Texas Feature, February 2006]
  • Big Bend National Park The land has many names: El Despoblado. The Empty Space on the Map. The Chisos. El Rio. La Frontera. Sky Island in a Desert Sea. The Last Frontier. For more than fifty years, the heart of it has been officially known as Big Bend National Park. [University of Texas Press, October 2006, Hardcover: 112 pages, 82 color phots, ISBN-10: 0-292-71441-6; ISBN-13: 978-0-292-71441-0]
  • The Boys with the Bands Joe Nick Patoski interviews Roland Swenson, Nick Barbaro, and Louis Black - founders of the infamous SXSW Festival. [The Texas Observer, Music Feature, March 10, 2006]
  • The Fall and Rise of Blaze Foley Mike Fuller loved his friends, drank too much, applied duct tape liberally, and was shot to death in 1989. His songs have made him a legend. [No Depression, Music Festures, September-October 2006] blog Blaze Letters
  • Fighting for Independence The Nature Conservancy, along with a few determined individuals, struggled for years to save this one-of-a-kind desert wetland. [Texas Parks and Wildlife Magazine, Water Feature, July 2006]
  • Hi Fi Nation The first time I saw High Fidelity, I thought my life story had been put on the big screen. [Southwest Spirit Magazine, Music Feature, July 2006]
  • Isles and isles of Greece Whether you crave the serenity of Syros or the merriment of Mykonos, there's a Greek island -- with fabulous food and views -- waiting for you. [The Austin American-Statesman, Travel Feature, September 10, 2006]
  • Keeping Up With Jones The King of Country Music shows us his Nashville [AARP The Magazine, Music Feature, July & August 2006]
  • Okie Dokie Stomp Clifford Antone called the tune and the world danced. [Austin Chronicle, Music Feature, May 26, 2006]
  • Park and Parcel The underfunded Texas Parks and Wildlife Department struggles to sell itself [The Texas Observer, Texas Feature, April 7, 2006]
  • Rita's Wakeup Call While the hurricane carved a path of destruction, it also helped shine a spotlight on a more insidious problem -- human impact on wetlands. [Texas Parks and Wildlife Magazine, Water Feature, July 2006]

2005

  • About Them Shoes, Hubert Sumlin [Harp Magazine, Music Review, May 2005] view article
  • And the Hot Tub Goes to . . . Austin When Mayor Will Wynn of Austin announced last December that MTV's "Real World" would be filming its 16th season in his city, he did so with the enthusiasm of a civic leader who had just persuaded a Fortune 500 company to move to his neighborhood. [The New York Times, Music Feature, June 19, 2005]
  • Far Out Far West Texas When the bumpy dirt road to this Far West Texas ghost town was coated with asphalt four years ago, Terlingua became convenient. Its days as a sleepy, unpretentious, off-the-beaten-path reinvented mining town were over. [The Texas Observer, Texas Feature, December 16, 2005]
  • Billy F Gibbons: Rock + Roll Gearhead [Austin Chronicle, Music Review, December 2, 2005] view article
  • Eliza Gilkyson The Long Way Around - extended feature. [No Depression, Music Feature, Issue No. 59 September-October 2005]
  • Grant Street, Sonny Landreth Artists [Harp Magazine, Music Review, March/April 2005] view article
  • Russell Graves: Pied Piper of Ag Science The "Home of Champions" sign in front of Childress High School refers to its National FFA Organization chapter, not the football team. One of the reasons for the agriculture program's success is that teacher Russell Graves has led his ag students out of the box...way out of the box. [Texas Co-op Power, Texas Feature, August 2005] Read the story as a PDF document using Adobe Acrobat Reader.
  • Hill Country Review: Live at Bonnaroo, North Mississippi All-Stars [Harp Magazine, Music Review, January/February 2005] view article
  • Hotel, Moby [Harp Magazine, Music Review, May 2005] view article
  • Hotwalker - Tom Russell Outsider art commands bully pulpit "I'm a frustrated writer," Tom Russell confessed to me a couple years ago. He finally did something about it. [Harp Magazine, Music Review, May 2005]
  • Katrina Mississippi Coast Report When I got the call, I agreed to help cover the hurricane with the stipulation I go to Mississippi. I was listening to Talk of the Nation on NPR and a caller complained she'd heard zero coverage about Waveland, which was in Katrina's bulls-eye. [Misc. Feature, September 8, 2005] [Katrina photos] [Listen to NPR's Day to Day (Sept. 12, 2005) "Weathering Katrina at the Log Cabin Bar".
  • Los Super Seven The Long Way Around - extended feature. [No Depression, Music Feature, Issue No. 56 March-April 2005]
  • The Only Honest Lake in Texas It looks like a winner has emerged in the struggle for Caddo Lake. [Texas Observer, Water Feature, July 8, 2005]
  • The Park That Time Forgot Boasting the world's largest spring-fed pool and a retro-cool motel, Balmorhea State Park is the great oasis of the Chihuahuan Desert. [Texas Parks and Wildlife Magazine, Water Feature, April 2005] blog Kinney Water Wars
  • Paging Dr. Frankendeer A controversy over cloned deer erupts in Texas. [Field & Stream, Texas Feature, November 30, 2005]
  • Seadrift Nation "Unreasonable Woman: A True Story of Shrimpers, Politicos, Polluters, and the Fight For Seadrift, Texas" [Texas Observer, Books and the Culture, November 04, 2005]
  • Texas Coast This beautiful book combines Laurence Parent's magnificent photographs with Joe Nick Patoski's entertaining text to create a one-of-a-kind portrait of the Texas coast. [University of Texas Press, October 2005, Hardcover: 108 pages, 68 color photos, ISBN: 029270299X]
  • Top 10 Swimming Holes [Texas Parks and Wildlife Magazine, Water Feature, July 2005]
  • The Ultimate Big Bend Hike Six days and 70 miles of aching backs, oozing blisters, lost toenails, lightning storms and unimaginable beauty. [Texas Parks and Wildlfe magazine, Travel Feature, August 2005]
  • Water Wars How growing demand, fuzzy legal rulings and plain old stubbornness have turned Kinney County into a hotbed of water politics. [Texas Parks and Wildlife Magazine, Water Feature, July 2005] blog Kinney Water Wars
  • Windblown, Kimmie Rhodes [Harp Magazine, Music Review, March/April 2005] view article
  • You Ain't Talkin' to Me: Charlie Poole and the Roots of Country Music, Charlie Poole [Harp Magazine, Music Review, June 2005] view article
2004
  • Guad is Good; Guad is Great It's the finest recreational river in Texas, but how long can it last? [Texas Parks and Wildlife Magazine, Water Feature, July 2004]
  • It's a Texas Thang - Or Is It? From the Texas Observer's 50th Anniversary issue...It was on a trip to my mother's native country of Greece that I realized there really is such a thing as Texas culture. [The Texas Observer, Texas Feature, December 3, 2004]
  • Resentments: Sunday Evening Coming Down How the Resentments rose from under-the-radar lark to become a real band with a higher place and purpose. [No Depression, Music Feature, March-April, 2004]
  • The Ride - Los Lobos When it comes to defining American music over the past quarter century, no band comes close to Los Lobos. [Harp Magazine, Music Review, September/October 2004]
  • Stay All Night - Buddy Holly's Country Roots [West Texas Roots, Music Review, July 2004]
  • Up Close and Texan Visitors for the big 'fooba' game have their own ways. So listen up, all y'all. [The Los Angeles Times, Texas Feature, December 30, 2004]
  • Walk Like Cleto H-town's Chingo Bling slings tamale beats [Austin Chronicle, Music Feature, June 11, 2004]
  • Willie Nelson How much is one picker's word worth. And whatever happened to peace on earth? [No Depression, Music Feature, September-October, 2004]
2003
  • Catching a Break: Surf City Texas It's too flat to surf the beach and not quite warm enough to chase oil tankers in the bay. [The Dallas Morning News, Water Feature]
  • Cool, clear water The sweetest pleasure of a Texas summer is the swimming hole. [The Dallas Morning News, Water Feature, August 31, 2003] plus Swimming Holes Across Texas
  • The Cult of Ray Ray Benson steps out from behind the Wheel. [Austin Chronicle, Music Feature, July 18, 2003]
  • A Force of Nature a 4-part series of articles about the Guadalupe covering issues at the headwaters around Canyon Lake to Victoria and rural areas, and on to the Gulf Coast. [San Antonio Current, Water Feature, December 4, 2003]
  • The House That Judd Built Late artist Donald Judd worked and lived at the busy corner of Mercer and Spring Streets. His building and its contents–the art collection Judd accrued over a lifetime-may soon be available for public viewing. [Time Out New York, Misc Feature, August 14-21, 2003]
  • My Obsession Joe Nick Patoski leaves this terrestrial plane -- radio plane, that is. [Austin Chronicle, Music Feature, December 19, 2003]
  • A Night at the Opry The Celeste Opry features old-fashioned jamborees with country-fried fun for the whole family. [The Dallas Morning News, October 18, 2003]
  • Pit Stops; The Best of the Best; Top Fifty Where are the best places to eat barbecue in Texas? Six years ago we published a highly subjective-and hotly debated- list of our fifty favorite joints, and now we've gone back for seconds. [Texas Monthly, Travel Feature, May 2003]
  • Pom-pom and Circumstance Why you can't spell "cheerleader" without "leader." [Texas Monthly, My Life, Texas Feature, February 2003 ]
  • The Real Texas: Caprock Canyons Trailway History pulses along the Caprock Canyons Trailway as it courses by ancient flatlands, wild canyons and authentic, old Texas towns. [Rails to Trails, Travel Feature, Winter 2003]
  • 60-Minute Man Leaving on a Jet Plane, the pop hit by Peter, Paul and Mary, may have put the romance in flying. [The Dallas Morning News, Travel Feature, October 24, 2003]
  • See the Forest of Cooperation for the Trees The first shot marking a new phase in the great American environmental war was fired last week -- in Fort Worth, of all places. But hardly anyone heard it. [Fort Worth Star-Telegram, Texas Feature, May 19, 2003]
  • Songwriter helps lead the fight against development Mr. Russell and five of his neighbors managed to reroute massive overhead power lines. [The Dallas Morning News, Music Feature, December 12, 2003]
  • Texas Water Safari: 260 miles of rowing your boat To finish the Texas Water Safari, you have to paddle nonstop in a canoe or kayak for 260 miles from Aquarena Center. [The Dallas Morning News, Water Feature, June 27, 2003]
  • A Time to Drill? Last year the feds went toe-to-toe with environmentalists over allowing natural-gas drilling on Padre Island, but neither side has scored a knockout. Here's what to expect in the next few rounds. [Texas Monthly, Texas Feature, March 2003]
2002
  • Alive and Kicking; Boot Anatomy; 25 Top Custom Bootmakers Nothing advertises your Texas bona fides more these days than a pair of handmade cowboy boots. Here's everything you need to know about them - how to tell a vamp from a pull, which toe style is right with a suit - and where to buy the best. [Texas Monthly, Texas Feature, June 2002]
  • Alternate Routes [Texas Monthly, May 2002]
  • Big Adventure Senior editor Joe Nick Patoski tells the story behind this month's cover story, "Big Bend 2002." [Texas Monthly, March 2002]
  • Big Bend 2002 Whether you want to hike it, raft it, drive it, or all of the above, here's everything you need to know to get the most out of a trip to Texas' greatest treasure. [Texas Monthly, Travel Feature, March 2002]
  • James Luther Dickinson [Austin Chronicle, Music Review, October 18, 2002]
  • Driving Music [Texas Monthly, May 2002]
  • Get Your Groove Back A new book on dance halls explains why Texans are itching to go boot-scootin'. [Texas Monthly, August 2002]
  • It's Simply a Matter of Taste For some of us, there's nothing better than a cold longneck bottle of Big Red. [Texas Monthly, March 2002]
  • The Next 25 Bootmakers More of the best bootmakers in the state. [Texas Monthly, June 2002]
  • Paper Chase Read all about it: Alpine residents win big during the town's newspaper war. [Texas Monthly, January 2002 Media]
  • Pass The Bass, Por Favor Barra Del Tordo, a jungly sanctuary on the San Rafael River. [Outside Magazine, Travel Feature, December 2002]
  • Pretty Drives [Texas Monthly, May 2002]
  • Reliant Stadium Tackling the ins and outs of Reliant Stadium. [Texas Monthly, September 2002 Reporter]
  • Rough Roads These drives are sure to get your attention. [Texas Monthly, May 2002]
  • Survival Guide Everything you need to know about getting around in Big Bend, from where to stay inside the park to where to get diesel fuel. [Texas Monthly, March 2002]
  • Touchdown! Houston kicks off with a new NFL team and a state-of-the-art stadium. [Texas Journey, Sports Feature, July/August 2002]
  • Two Towns Still Terrific A family's summer trip to Washington and New York finds unexpected enrichment in the poignant aftermath of 9-11. [San Antonio Express-News, Travel Feature, July 28, 2002]
  • Tune In, Turn On Why Grand Prarie's Bobby Patterson of KKDA-AM is my favorite deejay in Texas. [Texas Monthly, May 2002 Media]
  • Undammed and Unforgiving Why would a veteran paddler go through hell and low water to take on the last wild river? The Devils made him do it. [Texas Parks and Wildlife Magazine, Water Feature, July 2002]
  • Water Foul When the City of Marshall wanted to pump millions of gallons of water out of Caddo Lake and sell them to the highest bidder, the state said, "Sure." Residents of Karnack, Uncertain, and other tiny northeast Texas towns said, "Hell, no." [Texas Monthly, Water Feature, October 2002]
  • Water Hazard The mayor of San Antonio says a 2,600-acre golf resort on top of the Edwards Aquifer Recharge Zone won't ruin the city's sole source of drinking water. Who wants to tee off on that one? [Texas Monthly, November 2002 Environment] Prairie Dogma Birders and their allies want to preserve the vanishing grassland of the farm and ranch country west of Houston, but time is running out. [Texas Monthly, September 2002 Environment]
  • West Side Horns [Austin Chronicle, Music Review, September 13, 2002] Texas Platters
  • Which Side of the Fence Are You On? All over Texas, ranchers are putting up eight-foot fences to keep their deer from roaming so they can charge more for hunting leases. Purists say shooting such deer doesn't amount to "fair chase." [Texas Monthly, February 2002]
  • Yelapa [Texas Monthly, October 2002]
  • You Cheated [Austin Chronicle, Music Feature, November 8, 2002]
2001
  • A Ballad of the West by Bobby Bridger [Texas Monthly, March 2001]
  • Book Drive Colleyville's library plot. [Texas Monthly, April 2001 Reporter]
  • Boone Pickens Wants To Sell You His Water And you're going to need it, eventually, since Texas' most precious natural resource is being depleted at an alarming rate. His plan is to pump vast amounts from his land in the Panhandle and pipe it to parched cities like El Paso and San Antonio-for a hefty price, of course. [Texas Monthly, August 2001]
  • Laura Canales [Texas Monthly, September 2001 Culture]
  • David Clyde [Texas Monthly, September 2001 Sports]
  • Dead On Deadline Why reporters who cover the border are finding themselves more and more under the gun. [Texas Monthly, May 2001 Media]
  • Joe Dealey [Texas Monthly, September 2001 Business]
  • Distress Signal San Antonio's Clear Channel Communications may dominate Texas' airways, but the way it does business is tuning out to the best things on the radio. [Texas Monthly, November 2001 Media]
  • Extra! Extra! Bob Mong knows he's facing many challenges, and he certainly didn't ask me what I'd do if I were in charge of the Dallas Morning News. I thought I'd offer some nickel advice anyway. [Texas Monthly, August 2001]
  • 50 Things Every Texan Should Do Have you gotten lost in the Big Thicket? Attended a South Texas pachanga? [Texas Monthly, March 2001]
  • Guad Is Great Forget about the Rocky Mountains. For first-class kayaking, fishing, and bird-watching, head to the Lower Guadalupe after Labor Day, when the drunken armada of tubers retreats to shore and nature returns in full strength. [Texas Monthly, Water Feature, December 2001 Great Outdoors]
  • Hot Box Notes on notable musicians. [Texas Monthly, December 2001]
  • Liberalism Lives! In a state that's becoming more conservative, two young editors at the Texas Observer are reenergizing a magazine that won't leave the left behind. [Texas Monthly, July 2001 Media]
  • The New Guy What's the story on Bob Mong, the new editor of the The Dallas Morning News? He has a newshound's instinct, an insider's touch, and his work cut out for him. [Texas Monthly, August 2001 Media]
  • Nifty Fifty Senior editors Anne Dingus and Joe Nick Patoski tell the story behind this month's cover story, "50 Things Every Texan Should Do." [Texas Monthly, March 2001]
  • Old-Fashioned Texas Texas is changing before our eyes, but fried pies, drive-in movie theaters, and other vestiges of earlier days are all around. To find these treasures, we risked life, limb, and cholesterol count-and had a blast from the past. [Texas Monthly, August 2001]
  • On the Water Front Summer's blast furnace is firing up. Luckily, Texas is a paradise of spring-fed pools, sparkling beaches, and more. [Texas Monthly, June 2001]
  • The Original Dallas Cowboy Cheerleaders [Texas Monthly, September 2001 Texana]
  • The Reformer The El Paso mayor's race. [Texas Monthly, April 2001 Reporter]
  • Riding High McAllen's terminal condition. [Texas Monthly, April 2001 Reporter]
  • Scenes From Nowhere by Will Sexton [Texas Monthly, February 2001]
  • Talking Ed Fort Worth's horse play. [Texas Monthly, April 2001 Reporter]
  • Tall Tales Photographer Laurence Parent and senior editor Joe Nick Patoski talk about climbing, the best shot, and their new book, Texas Mountains. [Texas Monthly Interview, November 2001]
  • Texas Ranges In an excerpt from their forthcoming book, Texas Mountains, senior editor Joe Nick Patoski and freelance photographer Laurence Parent celebrate the wild beauty of the state's sierras. [Texas Monthly Feature, November 2001]
  • Tropical Paradise Jeff Henry believes his new Schlitterbahn on South Padre Island will be a success. It just might take a while-but, hey, that's okay. [Texas Monthly, July 2001]
  • True Story When one of his reporters turned up missing in Mexico, the editor of the San Antonio Express-News took on one of the most important assignments of his life. [Texas Monthly, Media, October 2001]
  • What Would Donald Judd Do? Seven years after Donald Judd's death, the residents of a cow town in far west Texas are caught in the middle of an estate war between the renowned artist's former lover and his children. [Texas Feature, July 2001]
  • The Widow's Pique In Lubbock they call her the "Spanish Yoko Ono," and Mara Elena Holly, Buddy Holly's widow, has always had a troubled relationship with his conservative hometown. Some folks rave on that it's her greed that has killed the city's Buddy Holly Music Festival. [Texas Monthly, February 2001]
  • The Wild Coast The untamed beach of Boca Chica, the birds of High Island, and the wilderness of Matagorda Island--these and other hidden treasures await you--if you know where to look. [Texas Bound, Travel Feature, May 2001]
2000
  • Angels & Outlaws What is Texas music? [Texas Monthly, May 2000 Behind the Lines]
  • Airport 2000 These days, a plane trip can entail more time in the terminal than in the air. But why get stressed when you can have a massage, taste Texas wines, go for a jog, check your e-mail-even eat gumbo while watching (other people's) planes take off? [Texas Monthly, November 2000]
  • Bigger Bend Rising high above the floor of the Chihuahuan Desert, Mexico's Museo Maderas del Carmen nature reserve is like a whole other country. Plus: information on how to visit the park. [Texas Monthly, October 2000 Travel]
  • Catfish, Carp, and Diamonds: 35 Years of Texas Blues [Texas Monthly, February 2000]
  • The Coast Explore 620 miles of fun and sun on the Texas Gulf Coast. [Texas Bound, Travel Feature, Spring/Summer 2000]
  • Contigo by La Mafia [Texas Monthly, December 2000]
  • Crashed At heart, Dewey Winburne was an educator, not an entrepreneur; he saw technology as a tool for doing good rather than doing well. Even so, he was able to survive in Austin's heady new economy - until the pressure got to him. [Texas Monthly, March 2000]
  • Environment * Steve Manning For the birds. [Texas Monthly, September 2000]
  • Executive Ranch Life around the town of Crawford sure was slow until George W. Bush bought a ranch there. [Texas Monthly, June 2000 Reporter]
  • Hot Night Tonight by Barbara Lynn [Texas Monthly, October 2000]
  • Jacksboro Highway by Rob Roy Parnell [Texas Monthly, February 2000]
  • The King of Clubs The longtime impresario of the coolest chain of nightlife spots in Texas remembers well what it was like to be a Cellar dweller. Me too. [Texas Monthly, April 2000 Profile]
  • Land That I Love City folks with money to burn are driving up the cost of living in the Davis Mountains and the state's other pretty places. What's a rancher to do? [Texas Monthly, March 2000]
  • Live at the Austin Outhouse by Blaze Foley [Texas Monthly, January 2000]
  • Most Requested by Mean Gene Kelton [Texas Monthly, February 2000]
  • Noise and Smoke by Little Jack Melody and His Young Turks [Texas Monthly, February 2000]
  • One Endless Night by Jimmie Dale Gilmore [Texas Monthly, February 2000]
  • Jimmy Reed, Emancipator of the South: An Oral History The quest begins with the discovery of a black and white photograph taken in 1961. [Blues Access magazine, Music Feature, Summer 2000, Issue No. 42]
  • Places in Between by Terri Hendrix [Texas Monthly, June 2000]
  • Play Ball, Y'all Meet eight Texas teams that are bringing America's pastime-the gimmicky, anything-goes minor league version-to a stadium near you. [Texas Monthly, April 2000]
  • Quiero Un Camaro by Los #3 Dinners [Texas Monthly, February 2000]
  • The Return of Wayne Douglas by Doug Sahm [Texas Monthly, August 2000]
  • Chris Rybak by Chris Rybak [Texas Monthly, April 2000]
  • SRV by Stevie Ray Vaughan and Double Trouble [Texas Monthly, November 2000]
  • Doug Sahm To Sir, with love: Why Doug Sahm was my hero. [Texas Monthly, January 2000 Texas Primer] reporter
  • San Antonio Rock: The Harlem Recordings, 1957-1961 by Doug Sahm [Texas Monthly, May 2000]
  • Sand Dollars The economics of beach tourism. [Texas Monthly, June 2000]
  • Splendor in the Grass Thirty years ago J. David Bamberger bought "the worst piece of land in Blanco County," then cleared the cedar and planted native trees and grasses. [Texas Monthly, October 2000]
  • Superfast by Dynamite Hack [Texas Monthly, March 2000]
  • Tomorrow People Meet the senior class of what might be called Texas Music U. - four up-and-coming acts that should graduate to the big time. [Texas Monthly, May 2000]
  • Tuned Out Five years after Selena's death, tejano music is struggling to be heard. [Texas Monthly, May 2000 Reporter]
  • Y'all in the Family How did Lloyd Maines get to be a revered guitarist and record producer? How did his daughter Natalie find fame as a Dixie Chick? [Texas Monthly, May 2000]
  • Zoolgico Tropical by Rodolfo "Fito" Olivares [Texas Monthly, September 2000]
1999
  • Team Player How George W. Bush ran the Texas Rangers and became, finally, a successful businessman. [Texas Monthly, Texas Feature, June 1999]
  • My Wimberley Why Wimberley is not Columbine. [Texas Monthly, Behind the Lines, Texas Feature, June 1999]
  • The Show Must Go On Its stars may be senior citizens, but The Fabulous Palm Springs Follies rivals any spectacular in Vegas or on Broadway.[American Way, Misc. Feature, October 15, 1999]
  • Wind, Rain, Sleet or Snow Go behind the scenes at The Weather Channel, the cable empire whose seventy-two million households depend on it come hell or high water. [American Way, Misc. Feature, March 1, 1999]
  • Wasted Days, Wasted Nights The night in 1974 when Doug Sahm brought Freddy Fender to Soap Creek to play. [Austin Chronicle, Music Feature, November 26, 1999]

1997

  • The Road to Nowhere For a singular West Texas adventure, take a drive through Pinto Canyon to tiny Candelaria. [Texas Monthly, Travel, October 1997]
  • Mr. Robinson Means Business David Robinson is back – healthy, stronger and glad that Tim Duncan is on his side. [NBA Inside Stuff, Sports Feature, November 1997]
  • Rough and Ready The remote backcountry of Big Bend Ranch State Park is finally open to the public. Welcome to the best wilderness getaway in Texas. [Texas Monthly, Travel Feature, October 1997]
  • Sweating It Out How I learned to love the poisonous plants, treacherous terrain, and hellish heat of the Chihuahuan Desert. [Texas Monthly, Travel, October 1997]

1995

  • The Queen Is Dead Selena Quintanilla Perez, tejano's first superstar, was about to become an international pop sensation. Instead, she's another victim of gun violence in Texas. [Texas Monthly, Music Feature, May 1995]

1990

  • The Passing of Grass Domed ballparks all commit the one sin: The good Lord never intended the great game of baseball to he played on carpet. [Americay Way, Sports Feature, October 15, 1990]

Home - Contact - News/Appearances - Notes & Musings - Bio
Bibliography - Books - Music - Texas - Travel
Water - Misc - Photos - Links -

Copyright 2008 © Joe Nick Patoski, All Rights Reserved. - Website design: Jodi Jenkins

wp/bio.html0000644000106600010660000004144511075151276010100 0ustar Bio - Joe Nick Patoski
Joe Nick Patoski - joenickp.com
Google
 

Bio | Joe Nick Patoski

 
Wyatt McSpadden, photographer

JOE NICK PATOSKI is in his fourth decade writing about Texas and Texans. He has authored and co-authored biographies on Selena and Stevie Ray Vaughan, both published by Little, Brown and Company and the coffeetable books Texas Mountains, Texas Coast, and Big Bend National Park all published by the University of Texas Press. He spent 18 years as a staff writer for Texas Monthly and more recently has written for the Texas Observer, National Geographic, No Depression, People magazine, Texas Parks & Wildlife Magazine, Field & Stream, the Los Angeles Times, the New York Times, the Big Bend Sentinel, Southwest Spirit, American Way, the Austin Chronicle, Harp, and TimeOut New York, and other publications. He also contributed an essay to the photo book Conjunto by John Dyer, also published by University of Texas Press.

In 2003-4, he recorded the oral histories of B.B. King, Clarence Fountain of the Blind Boys of Alabama, Memphis musician and producer Jim Dickinson, Tejano superstar Little Joe Hernandez, and 15 other subjects for the Voice of Civil Rights oral history project, some of which appeared in the book My Soul Looks Back in Wonder by Juan Williams, published by Sterling, and rode on the The Voices of Civil Rights bus tour, a 70 day journey across the nation where personal oral histories on civil rights were collected for the Library of Congress.

His biography of Willie Nelson will be published this spring by Little, Brown & Company. An avid swimmer and kayaker, he lives near the village of Wimberley in the Texas Hill Country.

Books:

  • Willie Nelson: An Epic Life The book is in many ways the culmination of my writings about music, Texas, and Texans. [Little, Brown & Company, April 2008] Order the book from Amazon here.
  • Big Bend National Park University of Texas Press, 2006
  • Texas Coast University of Texas Press, 2005
  • Texas Mountains, University of Texas Press, 2001
  • Selena: Como La Flor, Little, Brown & Company, 1996 ("If you're going to buy one Selena biography, this one is it," Cristina Saralegui, the Cristina Show, Univision; excerpted for VH1's "Behind The Music")
  • Stevie Ray Vaughan: Caught in the Crossfire, Little, Brown & Company, 1993 (with Bill Crawford); optioned by Miramax Films, 1993-present
  • Southern Rock chapter, Rolling Stone Illustrated History of Rock & Roll, Random House, revised 1992
  • contributed chapter on Tex-Mex music for The Book of Tex-Mex by Robb Walsh, 2004
  • currently collaborating with Eddie Wilson, founder of the Armadillo World Headquarters, on his memoirs.
  • contributed a chapter on the cumbia for the Oxford U.S. Latino/Latina Encyclopedia, Oxford Press, 2004

Selected album liner notes:

  • From Hell to Gone and Back: Texas Blues (Vanguard) 2003
  • Lightnin' Hopkins, The Tradition Masters (Rykodisc, 2002)
  • Freda & The Firedogs (Plug Music) 2002
  • Robert Ealey, Turn Out the Lights (Black Top) 1996
  • Joe Ely, Letter to Laredo (Rounder) 1995
  • The Best of the Texas Tornados (Warners) 1994
  • The Voice: Freddy Fender's Greatest Hits, the Crazy Cajun Recordings (Edsel/UK), 1999
  • Texas Monthly Presents: Honed On the Range: Texas Music, Volumes 1-5, 1989 to present (Texas Monthly magazine special products)
  • Flaco Jimenez, El Sonido de San Antonio (Arhoolie) 1980

Magazine experience:

  • Staff writer, Texas Monthly magazine, 1985-2003

Freelance experience:

  • 2002-2006 articles in No Depression, Harp, Austin Chronicle, Dallas Morning News (including profile on Mathew Knowles, father and manager of Beyonce Knowles and Destiny's Child). Also contributed to Rolling Stone, Spin, and Country Music magazines, among other publications.

Radio:

  • Radio commentary, Joe Nick is a weekly guest on Kevin & Kevin KGSR in the Morning, Austin, 1991-present
  • Radio personality and co-producer of two 12 hour Texas music specials, KUT-FM, Austin, 1975-1979
  • Radio personality, KFAD-FM, Arlington, 1971

Newspapers

  • Austin American-Statesman, 1977-1978
  • Dallas Morning News, 2003

Management

  • Joe King Carrasco & the Crowns, recording artists for Stiff, MCA, Big Beat, and New Rose records, 1979-1985
  • True Believers, recording artists for Rounder/EMI records, 1985-1986

Membership:


Home - Contact - News/Appearances - Notes & Musings - Bio
Bibliography - Books - Music - Texas - Travel
Water - Misc - Photos - Links -

Copyright 2008 © Joe Nick Patoski, All Rights Reserved. - Website design: Jodi Jenkins

wp/books/0000755000106600010660000000000011075151302007534 5ustar wp/books/texascoast.html0000644000106600010660000006072311075151301012607 0ustar Texas Coast - Joe Nick Patoski
Joe Nick Patoski - joenickp.com
Google
 

Texas Coast | Reviews

Texas Coast - inside photo Texas Coast - inside photo Texas Coast - inside photo Texas Coast - cover

TEXAS COAST
Buy Now from UT PRESS
View photos

TEXAS COAST
Text by Joe Nick Patoski
Photographs by Laurence Parent

Buy Now from UT PRESS

The Texas coast attracts everyone—children playing in the surf and building sand castles; high school and college students partying at spring break; adults easing workaday stresses by beachcombing, birding, fishing, or just watching the waves roll in one after another. In the coast's elemental landscape of low dunes, sandy beaches, salt water, and sea breezes, life itself seems simpler. There's time to watch the seagulls fighting over a fish, bodysurf in the waves, pick up shells on the beach, and reconnect with the healing rhythms of nature.

This beautiful book combines Laurence Parent's magnificent photographs with Joe Nick Patoski's entertaining text to create a one-of-a-kind portrait of the Texas coast. Parent's images capture Texas beaches, bays, estuaries, and salt marshes from Sabine Pass near the Louisiana border to Boca Chica, where the Rio Grande (sometimes) enters the Gulf of Mexico. He records all the familiar and distinctive scenes—sunrise over the Gulf of Mexico and sunset over the bays, sand dunes covered in goat-foot morning glories, historic lighthouses, shrimp boats and sailboats in harbor, and our favorite destinations of Galveston, Port Aransas, Corpus Christi, and South Padre Island. He also highlights lovely, lesser-known places you may not have discovered yet, such as Brazos Bend State Park.

Joe Nick Patoski takes you on a verbal tour of the Texas coast. He describes the irresistible allure of this undramatic yet somehow unforgettable chain of barrier islands and bays. He also acknowledges the human activity that has always been a part of the coastal story—the arrival of immigrants to settle Texas; Civil War battles at Sabine Pass, Galveston, and Palmetto Ranch; towns, such as Indianola, that flourished and then suddenly folded after devastating hurricanes; the building of a huge petrochemical industry; and the successful effort to create wildlife refuges to sustain migrating birds and endangered species such as whooping cranes and Kemp's ridley sea turtles.

Together, Parent and Patoski make it plain why people return to the coast as regularly as waves lap the beach. Looking through Texas Coast may well be where your next visit begins.

Buy Now from UT PRESS


 


Excerpt from Texas Coast

The long, languid coastline of Texas takes her own sweet time seducing the senses. Lacking the immediate drama of an initial encounter with California's Big Sur, where the Pacific crashes against craggy cliffs and rugged outcroppings, or the soothing tropical ambience of the Florida Keys, she is not a stunner at first sight. But give her time, and that fine line where Texas meets the sea will steal your heart.

The Texas coast is the essence of the shore: sun, sand, surf, dunes, flats, wetlands, bays, estuaries, islands, and peninsulas. On the whole, it is a complex soup rich in marine life, shorebirds, and waterfowl. Industry is abundant along the same coastline for different reasons, mainly the easy access to the Gulf and the world beyond. Many of the more scenic parts of the coast have been obscured by resorts, condos, homes, and businesses. But even with those distractions and diversions, the Texas coast, that precise point at which sand, sky, and water converge, nourishes the soul like no other physical place on Earth.

***

The Texas coast emerges out of the murky swamps of southwest Louisiana at Sabine Pass and makes a near perfect crescent for 377 miles all the way to the dry, desiccated flats of Boca Chica, where the Rio Grande enters the Gulf of Mexico. Along that path, the story of a state, its people, and the natural world surrounding them unfolds.

***

The Gulf of Mexico is the most American of all waters, encompassing 596,000 square miles. It is the ninth-largest body of water in the world. Five states including Texas, five states in Mexico, and the island nation of Cuba share its waters, utilizing it as a source of sustenance and a means of getting around.

The Gulf is the primary supplier of water vapor that brings rain to the central and eastern United States. It produces a quarter of the United States' commercial fish and shrimp catch. Nine-tenths of the country's offshore oil and gas production comes from the Gulf. In return, it receives sediment and pollution from two-thirds of the United States, mostly from the Mississippi River.

The Texas coast plays a critical role in this productivity. Most migrating birds traveling the eastern and midwestern flyways leave and reenter the country via the Texas coast. Seventy-five percent of the migratory fowl in the United States depend on the wetlands of the Texas coast. So do the nation's automobiles and trucks—two-thirds of the country's petrochemical refineries are located near the Texas coastline.

Seven major bays, some as much as thirty-five miles in length or breadth, define the landmass behind the beaches along the Texas coast. Except during storm events, the Gulf's waves are relatively insignificant, though constant enough to work like a washboard to form three sets of sandbars off the shore.

***

The actual beginning of the Texas coast is an ill-defined spit of salt marsh called Texas Point, on the west side of Sabine Pass, where the Sabine River, separating Texas from Louisiana, meets the Gulf. Land's end is most easily reached by boat. A small two-lane bridge spans the river several miles above the pass, linking Louisiana Highway 82 to downtown Port Arthur, where it intersects Texas Highway 87. Highway 87 cuts through a major refinery zone before reaching open land and the town of Sabine Pass. Dowling Road and Jetty Road lead past a collection of rock pilings and mud flats to the pass proper, where the old lighthouse on the Louisiana side is the most prominent landmark. Sabine Pass Battleground State Park, upriver, is where Lieutenant Dick Dowling and a band of forty-six tough Irish dockhands from Galveston on behalf of the Confederacy used six cannons to destroy four Union gunboats in a notorious Civil War battle back in 1863. Sabine Pass was initially envisioned as a major port, but its exposure to hurricanes ultimately made Port Arthur (farther inland) the port of preference. The town of Sabine Pass later became famous for a messy culinary specialty called barbecued crab. (Blue crab is one of the culinary delicacies of the Texas coast, exported to restaurants around Chesapeake Bay when the local fare there is out of season.)

***

The upper Texas coast goes underappreciated, in no small part because of its steadily eroding shoreline. Highway 87, which once hugged the beach from Sabine Pass to the Port Bolivar (pronounced BALL-iver) Lighthouse and the Galveston ferry, no longer exists along a twenty-mile stretch. High Island, where the road resumes, marks the beginning of the Bolivar Peninsula, a slim sandbar twenty-seven miles long and no more than three miles wide, the first in a succession of offshore barrier islands that define the coast. The communities of High Island, Port Bolivar, Crystal Beach, Gilchrist, and Caplen aren't real towns so much as scattered clusters of beach homes and fishing businesses. Bolivar is renowned for its fishing, crabbing, hunting, and, increasingly, its birding. High Island is directly across the Gulf from the Yucatán Peninsula, which explains its world-class reputation for observing the spring and fall migrations. The biggest landowner on the peninsula is the Houston Audubon Society.

Bolivar's illustrious past is not evident. The Karankawa and Orcoquisa Indians lived on the peninsula as far back as 10,000 years ago, and it served as the gateway to Galveston Island for tribes from East Texas. Cabeza de Vaca, the Spanish explorer who provided the first written descriptions of Texas, walked around Bolivar after washing ashore on Galveston Island in November of 1528. Rebels waging a private war against Spanish rule and pirates used Bolivar as a base of operations. The French-Creole pirate Jean Lafitte, who headquartered in Galveston after fighting on behalf of the United States in the 1815 Battle of New Orleans, used the peninsula to move African slave traffic via slave runners, including Jim Bowie, from Galveston to the Sabine River, where Louisiana sugar planters paid one dollar a pound for the human cargo. Cotton, cattle, oysters, and watermelon have been mainstays of the peninsula's economy at one time or another. The salt dome of High Island and other nearby domes store the bulk of the United States' strategic oil reserves.

The Port Bolivar Ferry to the island is the longest ferry ride in Texas linking public roadways. It takes eighteen minutes to travel 2.7 miles across the maw of busy Galveston Bay. It's the best free ride in the state, passing Civil War bunkers and the black cast-iron Bolivar lighthouse, a parade of shipping traffic, and Sea Wolf Park.

***

In Galveston, you're somebody if you're BOI—Born on the Island—especially if you're a Moody, a Kempner, or a Maceo. Galveston is old Texas, and those families are old Galveston money.

Galveston used to be the state's biggest port until the Houston Ship Channel became a deepwater port in 1919. The city was once upon a time synonymous with high times and high rolling until May 30, 1957, when new sheriff Paul Hopkins raided the Balinese Room, a storied nightclub on stilts that extended several hundred feet into the Gulf, where illegal gambling was a long-tolerated tradition. The gift shop and museum that now occupy the space capitalize on those faded memories.

This is a real port town, the most urban beach resort in Texas, and a cloudy dream version of a New Orleans that hardly exists even in New Orleans anymore. Cruise down Broadway under the elderly palms, by the streetcar line flanked by elegant mansions, and you could just as well be on St. Charles Avenue. Galveston is where cutting-edge research is conducted on biological terrorism at a University of Texas lab and where marine science is studied at Texas A&M facilities.

Galveston bore the brunt of the Great Storm of 1900, a stealth hurricane that drowned the island and killed six thousand people, more than any other disaster in Texas history. Galveston is the Seawall, the location of the original spring break, Alpha weekend, Stewart Beach, the tall ship Elissa and the Texas Seaport Museum, and the Flagship Pier. Galveston is the biggest Mardi Gras this side of the Crescent City and the Moody Gardens rain-forest-under-glass, IMAX included.

Enough remnants of the past survive to qualify the city as Texas's most historic, though San Antonians might quibble with that brag. The Hotel Galvez is still a grande dame. The Strand, several city blocks of sturdy red-brick and cast-iron structures, has been gussied up and now bustles more than it has since it was the Wall Street of the South back at the close of the nineteenth century. But there's still just enough funk between the city's toes, such as the Poop Deck, "Where the Elite Meet in Their Bare Feet," and the stepped-up rice and turnip greens at Leon's World's Finest In and Out B-B-Q House, to keep the place honest, just as the jalousies of the weathered French provincial homes on the back streets keep the Bishop's Palace, perhaps the most majestic edifice in Texas, and the ancient Rosenberg Library in perspective.

TEXAS COAST
Buy Now from UT PRESS

Home - Contact - News/Appearances - Notes & Musings - Bio
Bibliography - Books - Music - Texas - Travel
Water - Misc - Photos - Links -

Copyright 2008 © Joe Nick Patoski, All Rights Reserved. - Website design: Jodi Jenkins

wp/books/williereviews.html0000644000106600010660000004554411075151303013331 0ustar Reviews of Willie Nelson: An Epic Life - Joe Nick Patoski
Joe Nick Patoski - joenickp.com
Google
 

Willie Nelson: An Epic Life | Reviews

Read my MVP Q&A with Mickey Raphael. You can read a chapter from the book. [ Chapter 1, 2, 3 ]

Order Willie Nelson: An Epic Life from Amazon here.


Joe Nick PatoskiREVIEWS -- REVIEWS -- REVIEWS -- REVIEWS -- REVIEWS

4 Star Review in American Songwriter by Holly Gleason

American Way: Always on His Mind The product of several years of intense research, Patoski's nearly 500-page opus charts the breadth of Nelson's 75 years, from the depths of his hardscrabble upbringing to the peaks of his fame to his falls -- numerous falls -- from grace. Patoski effectively captures Nelson's transformation from struggling songwriter to American musical icon. But more importantly, he shows what Nelson's career has meant to Nelson's and Patoski's native state: Texas. By Bob Mehr

CMT News: Nashville Skyline: What Would Willie Nelson Do? by Chet Flippo

Creative Loafing: The red-headed wild-ass by John Grooms

Dallas Morning News: New Willie Nelson biography offers intimate details but light on revelations by Mario Tarradell

Entertainment Weekly: Freewheeling Willie Willie Nelson fans will have their blue eyes cryin' in the rain -- with joy -- over the arrival of such a richly reported bio. Willie might be the least conflicted hero in biographical history, once he trades being a ''bad drunk'' for placid pot and metaphysics. (When he cries after a snub from girlfriend Amy Irving, it's practically his only vulnerable moment in 500 pages.) But despite Joe Nick Patoski's reluctance to psychoanalyze his beatific subject in Willie Nelson, there are scores of funny firsthand stories in his account of how a ramshackle hillbilly career sparked an unlikely convergence of redneck, hippie, and Hollywood culture. B+ By Chris Willman

Los Angeles Times: How the boy from a hardscrabble Texas town became a country music icon. By Robert Hilburn

The Village Voice: "Willie Nelson's Trigger Cuts: Shotgun Willie gets the respect he deserves" by Michael Hoinski

San Antonio Express-News: "Biography tackles larger-than-life Willie Nelson" by Steve Bennett

Rolling Stone: "Excellent... Patoski, who's been writing Willie's story for thirty-five years for publications ranging from Texas Monthly to Rolling Stone, seamlessly weaves together the good, the bad and the ugly to form a three-dimensional portrait of the singer.... For Nelson, his hit 1980 single 'On the Road Again' isn't just a silly song he wrote for the movie Honeysuckle Rose--it's literally the story of his life. And Patoski has fleshed it out beautifully."

Publishers Weekly: This impressive, entertaining chronicle of Willie Nelson's life is replete with exactly what you'd expect--honky-tonk, long nights on the open road, whiskey, womanizing and weed--but Texas writer Patoski (Stevie Ray Vaughan: Caught in the Crossfire, Texas Mountains) looks beyond country music trappings to find the funny, talented, determined man who became an unlikely icon. Raised in Abbott, Texas, by impoverished grandparents, Nelson was writing songs about "love, betrayal and cheating" by the age of seven, but was told throughout his life that he couldn't sing, play or keep a beat. As an adult, Nelson worked odd jobs--encyclopedia salesman among them--while selling songs in Nashville; he had an early hit in 1961 with Patsy Cline's "Crazy," and soon began recording for RCA. Fourteen albums later, "with not much to show," Nelson fled to Austin, Texas, a move many viewed as career suicide; instead, it was a launching pad to stardom, propelled by the up-and-coming hippie movement and the strength of his groundbreaking album Red Headed Stranger. Patoski conducted over a hundred interviews for this thorough, well-noted "epic," peopling it with "pickers, gypsies, pirates, vagabonds, wanderers and carneys," including fellow performers like Kris Kristofferson, Kinky Friedman and Leona Williams. Writing with an affectionate country twang, Patoski gives his subject the consideration he deserves in a fine, fluid piece of storytelling that any Nelson fan will appreciate.

Austin American-Statesman: Austin writer Joe Nick Patoski's epic biography includes everything you'd ever need to know about the Red Headed Stranger by Rich Kienzle

Houston Chronicle: Willie Nelson: a life in full Ups, downs, booze, pot, wives, ex-wives and Julio Iglesias figure in Joe Nick Patoski's biography by Bob Ruggiero

Fort Worth Star-Telegram:

"Radio Days" Fort Worth was where the quest began for a hungry young musician who worked as a DJ named Willie Nelson [Fort Worth Star-Telegram, April 13, 2008]

"Big time in Cowtown" In 1965, Willie Nelson came home to Panther Hall, a country-music oasis deep in the heart of Cowtown, to record a live album his way [Fort Worth Star-Telegram, April 14, 2008]

Texas-music writer tells Willie Nelson's story with warmth and simplicity [Fort Worth Star-Telegram, April 20, 2008]

Cowboy philosopher not pondering legacy [Fort Worth Star-Telegram, April 26, 2008]

*****


Home - Contact - News/Appearances - Notes & Musings - Bio
Bibliography - Books - Music - Texas - Travel
Water - Misc - Photos - Links -

Copyright 2008 © Joe Nick Patoski, All Rights Reserved. - Website design: Jodi Jenkins

 
wp/books/bigbend.html0000644000106600010660000004402111075151300012013 0ustar Big Bend National Park - Joe Nick Patoski
Joe Nick Patoski - joenickp.com
Google
 

Big Bend National Park | Reviews

BIG BEND NATIONAL PARK
Text by Joe Nick Patoski; Photographs by Laurence Parent

"Laurence Parent's work is superb. He is without a doubt one of the signature photographers of Texas. He has shot many of the iconic images of Big Bend National Park—images that have appeared in the New York Times, Texas Highways, Texas Monthly, and Texas Parks & Wildlife, as well as in books about the park and West Texas."
—Jack Lowry, Editor, Texas Highways

"Joe Nick Patoski's writing in Big Bend National Park is compelling and knowledgeable, done with great confidence and passion for the subject."
—Jan Reid, author of The Bullet Meant for Me and editor of Rio Grande

 

Big Bend National Park
Buy Now from UT PRESS

BIG BEND NATIONAL PARK
OCTOBER 2006

Big Bend National Park is one of the few places left in America where a person can literally get away from it all. Nestled in the great bend of the Rio Grande that forms one of the most distinctive features of the silhouette of Texas, the park is several hundred miles from any large city. Within its 1,250 square miles of mountains, canyons, desert, and river, Big Bend National Park offers visitors respite from the stresses of urban living—a place for taking stock and charting new courses. That's one reason why many people return to the park year after year.

This book is the first and only comprehensive photographic and word portrait of Big Bend National Park. Laurence Parent presents a magnificent photo gallery of park scenes. He portrays the mountain ranges—Chisos, Dead Horse, Rosillos, and Sierra del Carmen—from first light to moonrise and in all seasons and weather. He includes dramatic images of Santa Elena, Mariscal, and Boquillas canyons, as well as landmark features such as Mule Ears Peaks, Elephant Tusk, and the Chisos Basin Window. Parent also portrays the ephemeral beauty of Big Bend wildflowers, including giant bluebonnets and blooming prickly pear cactus, as well as the traces of human habitation at ghost towns scattered around the park.

Joe Nick Patoski complements Parent's images with a masterfully crafted word portrait of Big Bend National Park. Patoski describes the powerful geologic and volcanic forces that created the awe-inspiring landscape of the Big Bend. He reviews the park's natural history and also its human history, from the prehistoric hunter-gathers who ranged over the region to Cabeza de Vaca, who was probably the first European to see Big Bend, to the creation of the national park in the 1930s and 1940s. Patoski also summarizes recent conservation efforts that have led to the protection of 2.1 million acres on both sides of the Rio Grande.

Although no single book could ever hope to contain the vastness of Big Bend National Park between two covers, this one beautifully captures its essence.


 


EXCERPT from Big Bend National Park

The land has many names:

El Despoblado. The Empty Space on the Map.

The Chisos. El Rio. La Frontera.

Sky Island in a Desert Sea.

The Last Frontier.

For more than fifty years, the heart of it has been officially known as Big Bend National Park.

***

I first saw Big Bend as a young boy.

My father had taken my sister and me on a trip through Texas in his brand-new Studebaker Silver Hawk. We'd come directly from the Alamo, whose stature and location in downtown San Antonio was a big disappointment to a seven-year-old smitten with Fess Parker and all things Davy Crockett. Big Bend made up for that letdown. At first glance, I immediately realized I had found the Texas of my dreams. These were real mountains, magnificent and grand, rising abruptly from the dusty plain. There was no mistaking that this was a desert, not the greened-up prairies and woodlands I'd known in North Texas, where we lived. The scenery was thorny and prickly—and dangerous. The distances were long. The sun was hot. This was not the kind of place to be lost in. The higher and wetter Chisos was a whole other world. Real mountain country. In Texas.

Big Bend National Park has been an integral part of my life ever since—it's my salvation, my respite, my escape from the real world, my quiet space far from the static of humanity, where my mind can wander and my soul be replenished.

I have never witnessed a sunrise as illuminating as the ones lighting up the mighty Chisos, thrust skyward aeons ago by volcanic forces. The luminous light that paints the ruddy bands of the limestone face of the Del Carmen Mountains above Boquillas at the end of the day makes the term "Technicolor" too understated. From the top of South Rim, I can see all the way to tomorrow. More than once when I've been camping in Big Bend, I've gone to sleep wearing my glasses—in case I wake up in the middle of the night I want to be able to gaze into the infinity of the brightest star-showered skies on the continent.

I have floated in awe through Big Bend's majestic river canyons, climbed its mountains, and trekked its deserts. I've ridden on horseback through the tall grasses and oak woodlands, driven its pavement, and spun around its back roads. I've wandered its trails and spent a week backpacking across more than seventy miles just so I could say I'd walked across the big bend of Big Bend.

I have tried and failed to count the exact number of layers that constitute the surreal, not-of-this-earth walls of the Big Tinaja—each limestone slice a lingering bathtub ring marking centuries of changing water levels.

I've witnessed crude petroglyphs, delicate pictographs, petrified forests and yucca forests, palisades turned into raging waterfalls in violent thunderstorms outside the entrance of Santa Elena Canyon, too close lightning bolts on the Mesa de Anguila.

Not everybody gets Big Bend—which is fine for those of us who do. The great American folksinger Woody Guthrie wandered here. The great Southwestern writer Ed Abbey extolled its virtues.

Being a Big Bend true believer amounts to having an innate willingness to drive five hundred miles at the drop of a hat to see a sunset where sunsets really mean something and then cracking a smile when you realize that for all that distance and all those extraterrestrial sensations imparted, you're still in Texas.

The more I go, the more I realize I've just scratched the surface. Big Bend National Park is too huge and too complex to ever fully understand. Which are two good reasons to love the place all the more.

**********************************

BIG BEND NATIONAL PARK
Buy Now from
UT PRESS

Home - Contact - News/Appearances - Notes & Musings - Bio
Bibliography - Books - Music - Texas - Travel
Water - Misc - Photos - Links -

Copyright 2008 © Joe Nick Patoski, All Rights Reserved. - Website design: Jodi Jenkins

wp/books/willie-chapter1.html0000644000106600010660000003245611075151301013425 0ustar Willie Nelson, Chapter 1 - Books - Joe Nick Patoski
Joe Nick Patoski - joenickp.com
Google
 

Willie Nelson: An Epic Life| Chapter 1

You are here: Books » Willie Nelson: An Epic Life » Chapter 1, 2, 3

Order Willie Nelson: An Epic Life from Amazon here. Read REVIEWS here.


Joe Nick PatoskiSomewhere In America, 2007

Willie Nelson: An Epic Life
BY JOE NICK PATOSKI
April 2008

 

The sea of humanity swells and roils all the way to the horizon, a sea of thousands of eyes fixed on him, thousands of hands clapping, a chorus of voices cheering and yelling, lips whistling, feet stomping, smiles everywhere all because of him. Lone Star flags and arms thrusting skyward, hands clutching cigarette lighters and cans of beer above heads bobbing like buoys because of the music. The old man with the wild white eyebrows and crinkled skin, his long white hair pulled back into two braids tries to make eye contact with as many eyes as he can in ten seconds before glancing offhandedly over his shoulder at the musicians standing and sitting in place behind him, strapping on his guitar, and stepping to the microphone with a casualness that betrays a lifetime of going through the very same ritual night after night, year after year. He half-sings, half-talks five magic words that trigger a sonic roar.

 

Whisk-key Riv-verrr take my miiiiiind.

 

Copyright 2008 Joe Nick Patoski

Chapter 1, 2, 3

****************

Read my MVP Q&A with Mickey Raphael, which ran in the next to last issue of No Depression.

Those seeking all things Willie should visit willienelson.com and stillisstillmoving.com.

Order Willie Nelson: An Epic Life from Amazon here.


Home - Contact - News/Appearances - Notes & Musings - Bio
Bibliography - Books - Music - Texas - Travel
Water - Misc - Photos - Links -

Copyright 2008 © Joe Nick Patoski, All Rights Reserved. - Website design: Jodi Jenkins

 
wp/books/willie-chapter2.html0000644000106600010660000003365611075151301013431 0ustar Willie Nelson, Chapter 2 - Books - Joe Nick Patoski
Joe Nick Patoski - joenickp.com
Google
 

Willie Nelson: An Epic Life| Chapter 2

You are here: Books » Willie Nelson: An Epic Life » Chapter 1, 2, 3

Order Willie Nelson: An Epic Life from Amazon here. Read REVIEWS here.


Joe Nick PatoskiAbbott, 1938

Willie Nelson: An Epic Life
BY JOE NICK PATOSKI
April 2008

 

Eyes had been gazing at him wherever folks tended to gather ever since he could remember. His first audience was a group of families at the Brooken Homecoming, an all-day reunion, picnic, and songfest in a shady grove by the small community eight miles southeast of Abbott, Texas. His grandmother had dressed him up in a white sailor suit with matching shorts. The stage was the back of a flatbed truck. The five-year-old boy showed little sign of nervousness other than picking his nose, as young boys are known to do. There was praying, singing, eating, visiting, more singing and more praying and so much nose-picking that when it was his turn to stand and recite the Psalm his grandmother had taught him, the white Navy suit was splattered with blood redder than the boy's red hair. The boy acted like the nosebleed was no big deal. He followed the prayer with a poem he recited while holding one nostril shut with his hand. In a voice that was small but not shy, he said:

What are you looking at me for?

I ain't got nothin' to say.

If you don't like the looks of me,

You can look some other way.

The audience clapped and cheered. The boy beamed. He'd remembered all the words. The people seemed to like him. He liked the attention, all eyes on him. He liked making them smile. The people listening felt like family. He flashed a not-so-shy grin of gratitude. From that moment forward, Willie Hugh Nelson, who earned the nickname Booger Red for his bloody nose, was determined to give a good show.

Copyright 2008 Joe Nick Patoski

Chapter 1, 2, 3

****************

Read my MVP Q&A with Mickey Raphael, which ran in the next to last issue of No Depression.

Those seeking all things Willie should visit willienelson.com and stillisstillmoving.com.

Order Willie Nelson: An Epic Life from Amazon here.


Home - Contact - News/Appearances - Notes & Musings - Bio
Bibliography - Books - Music - Texas - Travel
Water - Misc - Photos - Links -

Copyright 2008 © Joe Nick Patoski, All Rights Reserved. - Website design: Jodi Jenkins

 
wp/books/talltales.html0000644000106600010660000005240111075151301012410 0ustar Tall Tales - Texas Mountains Interview - Joe Nick Patoski
Joe Nick Patoski - joenickp.com
Google
 

Texas Mountains| Interview

You are here: Books » Texas Mountains » Tall Tales Interview


Tall Tales

Texas Monthly
November 2001

Photographer Laurence Parent and senior editor Joe Nick Patoski talk about climbing, the best shot, and their new book, Texas Mountains. Interview with Laurence Parent and Joe Nick Patoski

Texas Mountains - Joe Nick Patoski

texasmonthly.com: When was the first time you saw a mountain? Do you remember where you were and what you thought?

Laurence Parent: I was born in the mountains of New Mexico, so I guess that I saw them when I was pretty young. They must have made an impression, although I sure don't remember my first thoughts.

Joe Nick Patoski: The mountains I remember seeing were in the Big Bend. We'd driven in my daddy's new ‘59 Studebaker Silver Hawk from Fort Worth to San Antonio one day, then from San Antonio to Ciudad Acuña and on to Marathon the next, arriving at night. The following morning we got up and drove to Big Bend National Park and up to the Chisos Basin. I thought it was pretty cool.

texasmonthly.com: Laurence, your father was a National Park Service ranger and your mother wrote travel pieces. Do you think you may have a different perspective on the outdoors because of their influence?

LP: My parents had a huge influence on me. Growing up in beautiful National Park Service sites with parents who loved the outdoors greatly shaped what I do for a living (outdoor photography) and what I love to do for fun (hike, run, camp, and climb).

texasmonthly.com: Why did you decide to publish a book on the Texas mountains?

LP: No one had ever done such a book. Some Texans don't even realize Texas has mountains. Many others don't realize that there are beautiful mountains in Texas besides the Guadalupe, Davis, and Chisos mountains. I wanted to surprise people. The Texas mountains have waterfalls, movie sets, pine forests, aspens, and many other surprises.

texasmonthly.com: How long did it take to come up with the material for your book and put it all together?

JNP: A little more than a couple years. I'd really been working on it for more than forty years, but just didn't realize.

LP: Some of the photos go back to the mid-nineties (they were shot for other projects). Most, however, were shot specifically for this book beginning around mid-1999. The West Texas drought didn't help. The schedule accelerated last fall, though, when rains finally came to West Texas. The grass greened, the air cleared, and the waterfalls flowed. I made two trips in October and November to wrap up the book that lasted 26 and 17 days each. After that, I was ready to be done.

Joe Nick Patoski at Coal Mine Ranch
Joe Nick Patoski
at Coal Mine Ranch.
Photo by Laurence Parent

texasmonthly.com: Joe Nick, what was involved in getting your information? Did you go on many climbs?

JNP: Lots of time was spent in libraries, online, and on the phone. But the best part of doing it was getting to go on-site. A lot of the ranges are on private land, so our research involved introducing ourselves to folks, asking permission for access, and in many cases, assuring sources that we wouldn't identify precisely where we were lest trespassers and poachers try to go where they're not welcome.

I should mention that the photography required getting to vantage points on peaks and pinnacles that were not necessarily the highest points in a particular range. Nonetheless, we climbed a bunch. There's one photo Laurence took of me standing on a smaller pinnacle in the Chinatis that ran in Texas Highways (Laurence needed a model and I was the only other human around). The picture is pretty great, capturing me standing on this high point overlooking the rugged, desolate valley of the Rio Grande, with no other human being or any man-made structure in sight. What you don't see is how I propped myself up on the rock, trying to maintain my balance, and how I was seized by a severe case of acrophobia while trying to stand still and remain calm. The wind was gusting, and I kept trying not to look down, because one false move and I was a goner. Standing across the way, on an equally perilous promontory, was Laurence, snapping away, changing cameras, loading film, trying to get the shot. It's one thing to ramble around high points and scurry up to the top; it's another thing to do that while carrying sixty pounds of equipment on your back. Laurence, I think, has a little mountain goat blood in him.

texasmonthly.com: Laurence, what type of format do you use? Why?

LP: I mostly use a large-format camera, 4x5, for my landscape work. Only a tiny handful of the photos in this book were done with a 35mm camera. A 4x5 reproduces larger, with greater sharpness, less grain, and potentially greater depth of field. I do use a 35mm for shooting outdoor sports, but there wasn't any of that in this book.

texasmonthly.com: Do you find the mountains in Texas that different from the mountains in Colorado? Why or why not?

LP: The mountains in Texas are significantly lower and drier that those in Colorado. However, many of the Texas mountains have considerable relief (above the surrounding plains) and are still very impressive.

JNP: Much different. As a University of Texas at Austin professor from Germany told me recently: "We in Germany know about the Rockies, the Cascades, the Sierra Nevadas, the Appalachians. We have mountains like that. But there's nothing in Germany like the Texas mountains. That's why we love to come here." It's the delicate combination of mountains and desert. Nowhere but Texas.

Joe Nick Patoski at Sierra Diablo
Joe Nick Patoski and Chris Gill
at Sierra Diablo.
Photo by Laurence Parent

texasmonthly.com: What is necessary to get such spectacular shots? Can you describe a shoot for me?

LP: First and foremost, you have to be a pack mule. My camera pack usually weighs between 35 and 40 pounds just for day hikes. A lot of strenuous hiking was required for this book to reach the photo locations that I wanted. Quite a few hikes were cross-country in areas with no trails. Several shots were taken on overnight trips, and my pack weighed 60 pounds or so. Besides dragging my gear to ideal locations, I have to anticipate the light and weather to try to get the best possible images. Many times the weather does not cooperate, requiring me to repeat a trip, often several times.

texasmonthly.com: When is the best time of day to take nature shots? Why?

LP: Most commonly, the light right before, during, and after sunset works best because contrast decreases, long shadows give depth, and the light turns gold and pink. However, weather is at least as big a factor. Dramatic skies, especially from breaking storms, add immeasurably to photos.

texasmonthly.com: What is your favorite photo in the book? Why?

JNP: I don't really have a favorite. I love‘em all. But when I first thumbed through the book, the shots of ZH Canyon really stirred me. Sunrise on a perfect June morning, seeing and hearing and witnessing all the life in this "isolated" spot—the canyon was a veritable aviary, choked with raptors and Neotropical songbirds. It was one of the more blessed moments in my life. The photos brought it all back.

LP: Tough question. I'm not sure that I have a particular favorite. I do like the cover, in part, I guess, because it was taken during a miserable windy sunrise in a spring dust storm, which is why the light is so red—not because of a filter. Another favorite is probably the aspens shot because it was such a bear to hike to them, plus it reminds me of the New Mexico mountains, where I did a lot of my growing up.

Joe Nick Patoski at Coal Mine Ranch
Joe Nick Patoski
at Coal Mine Ranch.
Photo by Laurence Parent

texasmonthly.com: What was your most difficult shoot? Why?

LP: Several are contenders. The aspens shot was difficult because it required carrying my heavy gear cross-country up and down very steep, loose, and treacherous slopes. I twisted my knee when a slope shifted under me; it still hasn't completely recovered. The shot of El Capitan taken from the summit of Guadalupe Peak required carrying my pack four and a half miles up a trail while gaining three thousand feet of elevation in a howling, frigid dust storm in January. After taking my sunset shots and getting almost hypothermic, I hiked all the way down in the dark.

texasmonthly.com: What is your favorite mountain range in Texas? Why?

JNP: My favorite ranges are the Franklin, Hueco, Guadalupe, Sierra Diablo, Sierra Vieja, Davis, Chinati, Chisos, Bofecillo, and Glass ranges. Each has qualities separate from the others. Laurence has convinced me that there is much more to the Quitmans than initially meets the eye. The Eagles, which parallel Interstate 10 to the south for twenty miles or so, west of Van Horn, are the most underappreciated. The view from Eagle peak was one of the most breathtaking of them all.

LP: I'm not sure that I have a single favorite. They're all really different. Some favorites are the Sierra Vieja, Davis, Guadalupe, Chisos, Beach, Quitman, and Sierra Diablo mountains.

texasmonthly.com: If you could climb any mountain in Texas, which would it be? Why?

JNP: North Franklin Mountain. Because I haven't done it yet.


Home - Contact - News/Appearances - Notes & Musings - Bio
Bibliography - Books - Music - Texas - Travel
Water - Misc - Photos - Links -

Copyright 2008 © Joe Nick Patoski, All Rights Reserved. - Website design: Jodi Jenkins

wp/books/willie.html0000644000106600010660000003661711230234257011730 0ustar Willie Nelson: An Epic Life - Joe Nick Patoski
Joe Nick Patoski - joenickp.com
Google
 

Willie Nelson: An Epic Life | Why I wrote this book

Read my MVP Q&A with Mickey Raphael. You can read a chapter from the book. [ Chapter 1, 2, 3 ]

Order Willie Nelson: An Epic Life from Amazon here. Read REVIEWS here.


Joe Nick PatoskiCelebrate Willie Nelson's 75th birthday
with Joe Nick Patoski
WILLIE NELSON: AN EPIC LIFE
In stores April 21st, 2008

The realization Texans are different from everybody else hit me about an hour after I'd first set foot on Texas soil. I was only two years old but I distinctly remember my father picking up my mother, my sister and me at the Greater Fort Worth International Airport and driving us to our new home in Fort Worth, stopping along the way at the Big Apple Barbecue on Highway 183. The waitresses talked funny and the smoked beef brisket covered in barbecue sauce we were served tasted like nothing I'd experienced, vaguely familiar and strange and exotic all once. Even as the hot spices set fire to my lips and the inside of my mouth, I immediately wanted more.

I've been trying to figure out Texas and Texans ever since. Fifty two years later, I realized the answer had been right in front of me for most of my life. There were vague memories of the smiling friendly face flickering on Channel 11 singing songs live from Panther Hall on the Cowtown Jamboree and on Ernest Tubb's show in a voice that could have only come from Texas. I grew familiar with the songs by listening KCUL, the Country & Western radio station, although versions of "Hello Walls" and "Crazy" by other people were Top 40 hits in Fort Worth. The first interview came in 1973 for Zoo World magazine. After thirty five years of writing about him and many others, I can now safely say no single public person living in the 20th or 21st century defines Texas or Texans better than Willie Hugh Nelson.

Texans by nature are independent, free-thinkers, open, outgoing and friendly. Iconoclasts, they respect tradition but are not beholden to it. Whether it's God or sin, they tend to embrace excess. The good ones have a whole lot of heart. They are creatures of geography, exuding a sense of place. They reflect their climate and sometimes are a little crazy from the heat. They are wanderers and explorers, keen to improvise, curious enough to discover They are loud and boisterous when they need to be. They seem to go out of their way to make friends with strangers. They are great storytellers and some of the most distinctive music makers on earth. You know Texas music when you hear it, just like you know Willie's music.

A certain red headed stranger was once said to say, "Don't let the truth get in the way of a good story." I tried my best to ignore that sage advice once I took on this project. On the back side, all I can say is that getting all the facts straight while piecing together the history of a culture considered too low, too sordid, and too wild to be worth documenting in print was no sure thing. Many characters were too busy living life to the fullest, sometimes under the influence of alcohol, nicotine, Dexedrine, Black Mollies, marijuana, boredom, and being caught up in the adage, "If you can remember the sixties, you weren't there" to remember the trivial details of time and place. Then there were those who were inclined to con for the pure sport of it.

Fortunately, my subject was accommodating and open - exactly the person I've always thought him to be. He's the story. I'm just the teller.

Copyright 2008 Joe Nick Patoski

*****


Home - Contact - News/Appearances - Notes & Musings - Bio
Bibliography - Books - Music - Texas - Travel
Water - Misc - Photos - Links -

Copyright 2008 © Joe Nick Patoski, All Rights Reserved. - Website design: Jodi Jenkins

 
wp/books/texasranges.html0000644000106600010660000004417611075151301012761 0ustar Texas Ranges - Texas Mountains Feature - Joe Nick Patoski
Joe Nick Patoski - joenickp.com
Google
 

Texas Mountains| Feature

You are here: Books » Texas Mountains » Texas Ranges Feature


Texas Mountains - coverTexas Ranges

Texas Monthly
by Joe Nick Patoski
November 2001

 

For most of their lives, senior editor Joe Nick Patoski and freelance photographer Laurence Parent have explored and chronicled the mountains of the Trans-Pecos. In this excerpt from their forthcoming book, Texas Mountains, they show and tell where their love of the outdoors is at its peak.

I GOT HOOKED ON THE TEXAS MOUNTAINS at the age of six, when I climbed to the top of a small hill adjacent to the Chisos Basin lodge in Big Bend National Park, rode on horseback to the Window, and peered over what seemed then to be the edge of the world. I became fixated on the idea that there was actually a place called the Christmas Mountains; it was visible through the Window's massive slickrock aperture, beyond the park's northwestern border.

The relationship continued through my youth, when I discovered that there wasn't a more enchanting city view in Texas than the twinkling lights of El Paso and Juárez at night, seen from Scenic Drive on Mount Franklin. I climbed the pilgrims' path to the top of Mount Christo del Rey and straddled the line between Texas, New Mexico, and Chihuahua. As an adult, I've touched the roof of Texas atop Guadalupe Peak, perched on the edge of the South Rim of the Chisos in Big Bend on a brilliantly clear day when objects two hundred miles distant were visible—the biggest view in the whole world—and watched a comet from the top of Mount Locke at McDonald Observatory, illuminated by more stars than the eye can comprehend in the darkest skies in America.

These mountains are located in the Trans-Pecos part of Texas, which stretches for some 250 miles east to west and extends about 200 miles north to south—about the size of South Carolina. It is the most sparsely populated part of the state. Save for the city of El Paso, where more than half a million people live, no more than 30,000 residents live here. "Wide-open spaces" is not just some catchphrase in this part of the state. They really do exist. Within the boundaries of the Trans-Pecos sprawl the thirty-odd named ranges of Texas. The Trans-Pecos is a region so expansive that several of its counties are bigger than entire states. This is the Texas of dreams.

The easternmost ranges, the Housetops and Spencers, flank U.S. 90 twenty miles east of Marathon like two sentinels. The Glass Mountains, the first range of significant height and breadth, swell up more than a mile above sea level between Marathon, Fort Stockton, and Alpine. From there all the way to the state and the international boundaries to the northwest, west, and southwest, mountains dominate the landscape. Some consider the Texas mountains to be the southern extension of the Rocky Mountains, tumbling out of Colorado and New Mexico. But only the Davis Mountains, the wettest and one of the highest ranges in the state, and the Guadalupes, the highest range of all, with the four tallest peaks in Texas, really resemble their Colorado neighbors.

These are not easy mountains to love. They lack the altitude and drama of either the Sierra Nevadas or the Rockies. The tallest mountain in Texas, the 8,751-foot Guadalupe Peak, would hardly rate a glance on the other side of the New Mexico line. They are located in one of the least accessible places in the continental United States, far from most population centers. As a result, few people even know they are here. Even though Interstate 10 cuts through several ranges, most travelers keep their eyes glued to the road and have no idea what they're passing through. The two most impressive ranges in the state, the Guadalupes and the Chisos, are protected as national parks, but most of the other ranges in the Trans-Pecos and the Big Bend remain unknown and unseen because they're off-limits. Unlike other western states, where federal lands sometimes comprise more than half of a given state's land area, Texas is mostly private property, mountains included.

This is a harsh country. Annual rainfall averages barely ten inches a year, and a severe drought persisted for almost a decade at the close of the twentieth century. Each of the four seasons has its own hellish peculiarity. The blistering winds of early spring are brutal. An ovenlike heat can set in as early as March. The soothing midsummer monsoons of July, August, and September, which can green up the countryside overnight, can bring killer floods with them too.

When the monsoons don't come—which happens more and more frequently these days—the furnace effect down on the desert floor of the Big Bend becomes so severe that every living thing, it seems, either burns, dies, or withers away. But even when that kind of heat is on, up on the Marfa Highlands or in the Davises and the Guadalupes, in August it's chilly enough at night to sleep with a blanket. The coolest summer nights in Texas are in the Texas mountains. Starting in mid-November, blue northers blast in the bitterest cold, dropping temperatures as much as fifty degrees in as little as an hour and occasionally leaving a dusting of snow on the mountaintops, stirring visions of the Rockies or the Alps if only for a day or two. Yet the same season can also bring temperatures above 100 degrees to the lower desert.

For the people who love these mountains, such realities are really blessings that have kept away the crowds. After all, who wants to share the stands of quaking aspen found in the Davis range, the maples of the Guadalupes and the Sierra Vieja, and the small slivers of greened-up high country that flourish on the mountaintops and in crevices and crannies, far from public view? If you're blowing through at 70 miles per hour on the interstate or peering out the window of a jet plane at 30,000 feet, you won't get it. Those of us who do get it like that just fine. We know, as I have learned, that there is much more than meets the eye. These mountains just require a little more patience and a whole lot more effort.

Many of the Texas ranges—the Guadalupes, the Delawares, the Huecos, and the Franklins—are largely devoid of vegetative cover because of a dearth of moisture. Because they are so naked, they expose thousands and millions of years in their layers and folds and are a playground for geologists. Within the Texas mountains are geological features and formations found nowhere else on the planet: a stone freak show of weird globs, jagged spires, gravity-defying balancing acts, marbled swirls, scoops of melted ice cream, and dribbled sand castles that wildly vary from extraterrestrial to lunar in appearance. In spite of their apparent desolation, the mountains harbor a huge variety of plant and animal species. The area is part of the Chihuahuan Desert, the largest and highest desert in North America. Here life flourishes in surprising places: on a remote cloud-catching ridgeline or under a rare canopy of shade in hidden canyons fed by springs and waterfalls.

Even though they are not the highest mountains around, these ranges offer some of the most striking panoramas anywhere. Range after range fades to the vanishing point, each separated from the next by vast desert floors that go on forever. From the top of Mount Livermore in the Davis Mountains, the highest peak in the second-highest range in Texas, mountain landmarks are clearly visible in every direction: the rectangular hump of Chinati Peak to the south; the long ridgeline of the Sierra Viejas bulging out of the flats to the south and toward the west, fading into the Van Horns, the Apaches, the Eagles, the Beaches, the Baylors, and the Sierra Diablos. Beyond them all is the lone sentinel of Sierra Blanca, marking the route to El Paso and the Pacific.

The last time I was in the Chisos Basin, I noticed that little hill by the lodge again. Forty-three years had passed since I first scaled it. For much of that time, the little hill didn't seem that big. It was but another example of how things shrink and diminish when you grow up. Lately though, it has started looking more like a mountain to me again, just like it did when I was a kid. Just like it does to kids scurrying up its rocks today, I'll bet.


Home - Contact - News/Appearances - Notes & Musings - Bio
Bibliography - Books - Music - Texas - Travel
Water - Misc - Photos - Links -

Copyright 2008 © Joe Nick Patoski, All Rights Reserved. - Website design: Jodi Jenkins

wp/books/mvpq.html0000644000106600010660000010336611075151301011415 0ustar Mickey Raphael Q&A - Joe Nick Patoski
Joe Nick Patoski - joenickp.com
Google
 

Willie Nelson: An Epic Life| Mickey Raphael Q&A

You are here: Books » Willie Nelson: An Epic Life » Mickey Raphael Q&A

Order Willie Nelson: An Epic Life from Amazon here.


Mickey Raphael Q&A

No Depression
BY JOE NICK PATOSKI
May-June 2008

Willie Nelson is known for his distinctive voice, the tone of his rugged Martin guitar named Trigger, and for the harmonica played by that tall lanky guy who imbues his sound with a timeless, rootsy quality.

The man playing that harmonica is Mickey Raphael, the tall, lanky Family Band stalwart who has stood to Willie's left for 35 years and remains by his side whenever Willie solos with orchestras or joins other musical ensembles such as the jazz trumpet player Wynton Marsalis and his quartet. If Mickey's not there, it's not Willie. While he has recorded outside the Willie Nelson orbit including several albums with Emmylou Harris and most recently with Kenny Chesney, Mickey's harmonica is joined at the hip with his boss.

When did you start playing harmonica?

My dad's lawyer played washtub bass in a little jug band and he gave me a harmonica when I was a kid. Every kid has a harmonica. I grew up in Dallas. I was a terrible guitar player, but I loved music. I played a little guitar in junior high. The folk scene was happening and the Beach Boys and the heavy stuff. I was really into Dylan, Pete Seeger, Dave Van Ronk, the acoustic blues guys, Sonny Terry and Brownie McGhee. I wanted to be a guitar player but just was not any good. I heard a guy play harmonica named Donnie Brooks at a tiny little coffeehouse called the Rubiyat where I used to hang out. Michael Murphey played there, Jerry Jeff Walker, Guy Clark. Donnie Brooks was playing with Johnny Vandiver [a Houston folkie later murdered in a drug deal gone bad]. When I heard Donnie Brooks, he just blew me away. I started to take this thing a little more seriously. I carried a harmonica with me wherever I went, I was always playing and listening to other harmonica players, blues records. And I had gone to a Canned Heat concert and was so inspired that I got home, was doodling around on my harmonica and was able to reproduce a lick that I heard "Blind" Al Wilson play. I thought, 'Wait. There's a pattern here. There is a method to the madness. I'd played a blues lick that I had heard in my mind. This is starting to make sense.' That night I had an epiphany.

What were you listening to?

Acoustic blues. Sonny Terry, John Hammond, Jr., James Cotton, Musselwhite. I think the first album I bought was the Siegel-Schwall Band. That folk scene because it was obtainable at the Rubiyat, the music I was able to see live. Jimmy Reed. Butterfield. I was committed to the harmonica at this point. I got with Donnie Brooks on the steps out in front of the Rubiyat and he showed me how to play the diatonic scale starting at the low end of the harmonica and how the pattern worked, how you play all the way to the top, how the notes work. It was just a little pattern, like Draw hole number one, Blow two and three, draw three and four. It's just a pattern, how the notes worked. It was my job to put those notes together.

Did you hear music on records or live?

Mostly records. I was still in school at the time. I'd go down to the Rubiyat when I first got my driver's license when I was junior in high school. By high school I was hanging around Sumet-Bernet Recording Studio and got some session work. There was an engineer there named Phil York and he'd let me know when there was work. Ed Bernet, one of the owners of the studio owned a club called the Levee and the music director at the club was Smokey Montgomery the banjo player from the Light Crust Doughboys. Smokey and the Levee band would do these demos, these country packages. One of their clients was Boxcar Willie. He would come in there with thirty songs. They paid me five bucks a song. We'd do as many as we could. I learned my recording chops from doing demos there.

Since Dallas was the world capital of radio jingles, did you do any jingle work in the studio?

I'd get a call every once in awhile from Euell Box who did commercials. The music would be written out. He would have a string section. His wife would take me into another room and play the part for me on the piano. Then we'd go and record.

Were you playing with anyone live?

When I went to El Centro Community College I played with a guy named Mike Ames. He played flat-pick guitar in the style of Doc Watson. I played harmonica. We played the split shift at the Cellar [a notorious afterhours beatnik club where Stevie Vaughan and Dusty Hill of ZZ Top earned their spurs] from 8 to 8:30 and 4-4:30. He wrote some, he did a couple of originals, we did "Deep River Blues," Michael Murphey songs, Steve Fromholz, Jerry Jeff Walker. I'd go to the Rubiyat and sit in with Michael Murphey, Guy Clark, Ray Wylie Hubbard. My playing wasn't very refined. I was listening to Donnie Brooks who was playing on Jerry Jeff's record and to Charlie McCoy. Then Donnie went to New York and was playing with Judy Collins. Murphey would bring me up from out of the audience to play a song or two.

After that in 1971 I got with B.W. Stevenson [a larger-than-life figure with a larger-than-life voice]. We played the same circuit, restaurant bars around Dallas, sports bars, and were loud. I remember playing these ballads and B.W. would get mad at the audience and tell them to 'Shut up.' They were not wanting to listen. We learned the hard way you can't argue with the audience.

Were you playing the same stylistically as you are now?

Yeah, except I didn't know how to listen and I was playing all the time. Now it's OK not to play all the time. My playing wasn't as refined. I didn't know much about country music. The only country I'd heard growing up was 'Blood on the Saddle' by Tex Ritter. I was listening to Charlie McCoy a lot.

B.W. got a record deal with RCA and we went on the road. I went to New York for the first time. We played Gerde's Folk City, opened up for NRBQ. We went all across the country in a van. I recorded with him too, did three albums.

When did Willie Nelson come into your life?

I was touring with B.W. but we didn't work all the time. When we were in Dallas, I hung around with Ronnie Dawson. He had been a rockabilly as a teenager known as the Blonde Bomber and was in a band called Steelrail with Bobby Rambo [an all-star player who'd recorded with the rock band the Five Americans and Ray Sharpe of "Linda Lu" fame]. They played the Silver Helmet [where Dallas Cowboys football players hung out]. Sitting in with them, I really honed my skills. I played with him when they taped a special for the local Public Broadcasting television station at McFarland Auditorium and Willie was on the show. He was two hours late and rolled up in an Open Road camper. It was just Willie and Paul [English, Willie's drummer and best friend]. Paul was wearing his cape. I didn't know much about Willie. I had gotten one record Willie Nelson and Family raiding the RCA storehouse with B.W. so I wanted to check him out. They did their show, the two of them, and just took off. I was going, 'What was that?' They made a strong impression.

I got a call a couple months later from Darrell Royal [the coach of the University of Texas Longhorns football team]. He said, 'I've seen you play and I want to meet you. We're having a little picking session in my hotel room after the ball game. Come on over and meet some of my friends.' Willie was there. Charley Pride was there, [storied Houston attorney] Joe Jamail, Finley Ewing who has the Mercedes dealership in Dallas. They're passing around the guitar and singing songs. I didn't know any of the tunes. A lot of the songs Willie had written. I think I'd learned 'I'm So Lonesome I Could Cry' off the Charlie McCoy album. I was this hippie kid with an Afro. I was into the Stones, the Band. But it was fun playing with them. Afterwards, Willie said, 'If you're ever around, come play with us.'

A couple weeks later I saw they were playing a benefit for the volunteer fire department in the high school gymnasium in Lancaster, just south of Dallas. I sat in with them even though I was totally lost. I didn't know these songs. But I fit in because there was a big hole. Jimmy Day [the pedal steel guitarist] had just left. There was room. There wasn't a fiddle. Willie was the only guitar player. Willie would give me a solo now and then. I was just hanging on for dear life because I didn't know the songs and even if I did know, it wouldn't have made any difference because Willie was playing the songs like Willie, not like anybody else. All the rules were broken. Anything I had built up in my arsenal about how to follow a song, those skills were out the window because Willie made up his own rules. B.W. and Murphey were in time. Willie was jazz, like playing with Miles Davis.

Willie wasn't that successful yet. He was still playing beer joints. B.W. and Murphey were bigger draws. Jerry Jeff was probably the biggest drawn. Willie was a little left of center. He was an old guy, 39.

We went to a truck stop after the Lancaster gig [in the spring of 1973] for breakfast. I stayed for one more cup of coffee and that's when Willie said, 'Hey, we're going to New York next month. Why don't you come with us?' [for the release of Willie's new album Shotgun Willie]. I was still playing with B.W. but he was drinking pretty heavily at that time. I wasn't digging that. So I'd see where Willie was playing and I'd go sit in with him. I realized when he played the Western Place in Dallas he had this incredible fan base I knew nothing about. We played Big G's in Round Rock, a cowboy joint north of Austin and they didn't like long hair. So I kept close to the bandstand and close to Paul because these were the kind of places where I'm thinking, 'Gee I hope I don't get my ass whupped when I get out of here' because I was a hippie.

I'd been playing three months with him when Willie asked Paul, 'What are we paying him?' Paul said, 'Nothing.' Willie said, 'Fine. Then double his salary.' I came aboard and was paid $50 a gig. We drove to gigs in our own cars. I carried Willie's guitar. Paul carried Willie's amp. I remember asking Paul how old he was. He said, 'Forty.' I was 21. He said, 'If you're lucky, you'll make it to 40.' Bee [Spears, the bassist] had left to go play with Waylon. I wanted to go play with Waylon. Donnie Brooks was playing harmonica with Waylon. I think because Waylon had a harmonica player that opened up the door [with Willie].

Your first Willie album was a live recording at the Texas Opry House in 1974 for Atlantic Records, but Atlantic's Nashville division folded before the album could be released. Released in Atlantic's Willie box set, it reveals a hard-charging, rocking band. But wasn't the second album you did with Willie that changed everything?

We were playing in Dallas. We were doing these four-hour sets because the crowds were getting so crazy, it was safer to stay on stage. When we were properly fueled, it just didn't end. Willie said, 'I've written this album called The Red Headed Stranger.' I told him, 'I know this studio in Dallas.' I called Phil York [the engineer Mickey had worked with at Sumet-Bernet studios]. He set us up. It only took a day or two. He would play a song, we'd listen to it, then play along with it. There wasn't a lot of preparation. He had it written out on a piece of paper. The record company thought it was a demo, it was so simple. That's the way Willie heard the songs. It was a concept record. I hadn't heard that before, where all the songs tied together and told a story. This went against all the rules. Willie didn't care. I thought it was pretty cool because it was so sparse. I thought there's something here. At that point, I felt like a contributing member Jody was in the band, Bobbie was playing piano, Bee came back from Waylon, and Paul. The album gave me some validity as a band member. Willie never said anything to me except when not to play.

Charlie McCoy was working a lot then, but mainly playing on record. I went back and listened to what he did with Tom T. Hall, Tammy Wynette, Roy Orbison, the old Willie stuff he did for RCA. I thought Charlie blazed the trail on record and I'd play it live.

Does the description sideman sing to you or not?

I like being a sideman. Jokingly, I asked Willie, 'When do I get to stand in the middle?'

He said, 'Any time you want.'

Where's the Mickey Rayfield album? (back when they first met, Coach Royal bubbafied Raphael into Rayfield)

I did a little instrumental record in 1988 with Ben Keith [the pedal steel guitarist best known for his work with Neil Young]. We turned on the tape machine and just played myself and this keyboard player and Ben. It was kind of a light jazz ethereal deal. I got tons of airplay in LA on The Wave [a New Age music formatted radio station] and was on one of their compilation CDs.

I've been in the studio with Tony Scher who's this wonderful guitar player in New York. He plays with Bill Frissell, he plays guitar on Norah Jones' record. We cut "Spanish Harlem" just messing around and also I'm doing some rock stuff here [Nashville] with Jay Joyce who co-produced and played on Patty Griffin's Flaming Red. .

There isn't a lot of call for a harmonica record by major labels. I'm doing it on my own. I don't have that much time off to jump on it. I want it to be good. I don't want it to be a bunch of instrumentals like "By The Time I Get To Phoenix."

Do you always go with him when he has outside projects?

Willie wouldn't pick favorites and say that I come and not Jody or Bobbie. It's usually the producer that asks me to come.

When did you start doing outside projects on your own?

Rodney Crowell got me out to LA when he was playing with Emmylou [Harris]. I ended up playing on four of her albums. I moved to LA because I was getting [outside] work and I wanted a change from Austin. We'd get back to Austin from touring and it was like the tour never ended. It was so wild and I needed a break. I wanted to know the difference between touring and home. I liked playing live but I enjoyed working in the studio with other people. I loved doing 'Here, There, and Everywhere' with Emmylou. I did some soundtracks with Ry Cooder and Jack Nietzsche including 'Blue Collar' a Hal Needham movie where he used the harmonica and saxophone as the main instrument for the whole film. Ry played guitar and John Hiatt was the rhythm guitar player and sat in the corner and never talked to anybody. The producers didn't like the soundtrack so they scrapped the whole thing and used fiddles and banjos.

I'll get a call every now and then to play a session and think, 'I don't hear any harmonica on this.' I'll ask what they want me to do and the producer will say, 'Just do whatever you want to do.'

And wherever you want evidently. I hear you record on your laptop in your hotel room.

Somebody will send me a file and I'll play it on the computer. I did that on Kenny Chesney's record. I recorded on five tracks; I think they used one. With the computer and Pro Tools, I can do an overdub easy.

What kind of microphone do you use?

I use a Beyer M160 ribbon microphone.

Your tools of the trade?

I use Hohner Marine Band. There's twelve keys so I have harmonicas for all the keys and with different tunings. I have an Echo Harp which is a double reed harmonica that sounds like an accordion. They're made in six keys. I have those. Then I have to have backups of everything because they go out of tune all the time. And I have some harps that are customized. Joe Filisko from Joliet, Illinois and Jimmy Gordon out of Vermont both customize Marine Bands for me. The body of the harp is like a composite material. The reeds are hand-tuned and set by hand. It's like having a master craftsman take apart a stock harmonica and put it back together. It sounds better and plays better. They're a lot more responsive.

What about the front man, does he keep you on your toes, do you know what to expect when you're playing with him?

I never know what to expect. There's no set list. I don't start any of the songs. He'll start the song. That's my tip off.

What happens when he pulls out something from 1964 that you've never heard (as he did last year at the Fillmore)?

It's unsaid, but if you don't know what to play, don't play. It's OK to lay out. If you listen to it, you have time to figure it out. If there's a question, don't do anything.

Are there songs he'll pull out that are technically hard to play?

We do some jazz standards that we play in soundcheck that I still struggle with or have to have written out in front of me like "All the Things You Are."

Any favorites?

I like to play "Still Is Still Moving." That's always a fun song to play. That really moves.

You involved in any other projects?

I helped edit the four-CD box set Sony Legacy just put out. They gave me a list of 200 songs and I picked 60 out of the 100 they used. I know what Willie likes. I wanted to stay away from the same choices that are on other box sets. I also wrote liners about what it is like to play in the band with Willie.

So what is it like to play with Willie Nelson?

It doesn't feel like a job. The guy's crazy but it doesn't feel like you're working for a lunatic. All you need up there is Willie and his guitar. All the rest is icing on the cake. The way it's always worked is, we listen to Willie, and we just play accordingly. You never want to cover him up and you always want to give him room to do what he does so well, which is play and sing. Grady Martin told me and he told Charlie McCoy in the studio: 'Do not play when the singer is singing. Make sure you don't cover up the words.' He gave me the best advice, although he wasn't very tactful in saying it. One night after a show he goes, 'Man, smoke a cigarette. Take that damn thing out of your mouth. You play too much.'

What's the Naked Willie project?

I love the music from the 60s that Willie did [for RCA], the tracks that are heavily covered with strings and voices. One day, Willie was saying, 'We went in and recorded and I really thought we had a hit. I really liked what we played. Then we'd come back a few days later and they had done the Nashville Sound [over the recordings].' The tracks had been heavily orchestrated and put backing vocals on it, which is what Nashville did at the time. They did it to everybody. RCA didn't know what to do with Willie.

So I thought it would be great to go back and see what these tracks sounded like without the heavy strings and backing vocals. Strip it down like they did with Beatles' Let It Be when they took Phil Spector's string parts off. I'm hearing some great stuff. Willie's playing some great guitar. Chet Atkins and Grady Martin are playing great guitar that was covered up on a lot of the tracks. With Willie's singing you don't really need a great big choir echoing what he's doing. Those strings were so overpowering. We took the strings off of 'Bring Me Sunshine' [a Bobby Darin-esque swing tune that was Willie's first Top 10 country single for RCA]. On some tracks, we couldn't take the strings out completely because there was leakage - the recordings were done on two or three tracks - so what strings you do hear are subtle. It might not be totally naked, but it's really quiet and it fits.

Are you tempted to add some harmonica?

No. If I did that, I'd use Charlie McCoy.

*********

I'm the author of the biography Willie Nelson: An Epic Life, published by Little, Brown & Company on April 21, 2008.

You can read a chapter from the book [ Chapter 1, 2, 3 ] and order it from Amazon here.


Home - Contact - News/Appearances - Notes & Musings - Bio
Bibliography - Books - Music - Texas - Travel
Water - Misc - Photos - Links -

Copyright 2008 © Joe Nick Patoski, All Rights Reserved. - Website design: Jodi Jenkins

 
wp/books/willie-chapter3.html0000644000106600010660000011040411075151302013416 0ustar Willie Nelson, Chapter 3 - Books - Joe Nick Patoski
Joe Nick Patoski - joenickp.com
Google
 

Willie Nelson: An Epic Life| Chapter 3

You are here: Books » Willie Nelson: An Epic Life » Chapter 1, 2, 3

Order Willie Nelson: An Epic Life from Amazon here. Read REVIEWS here.


Joe Nick PatoskiEast of Western Grove on Pindall Ridge, 1925

Willie Nelson: An Epic Life
BY JOE NICK PATOSKI
April 2008

 

Music was in the Nelson blood long before Texas, back into the rugged hills of north central Arkansas where the isolated communities of settlers could hardly be described settlements.

The rickety wooden shack on cedar blocks that passed for a one-room schoolhouse was hardly fit to be occupied. The floor sagged and creaked with every step taken. And yet, the room was packed to the rafters. Structural shortcomings were the last thing on the minds of those present, with smiling faces. They were just happy to be there.

Singing school was in session. Singing school was the social event of the year for many folks living in the hills, hollows, and backwoods of Searcy, Newton, Boone, and Marion counties in north central Arkansas. Sometimes singing school was the only social event of the year outside of church, a funeral or a barn-raising unless a wayward medicine show happened to pass through. Singing school brought out the whole community from babies to elders and everyone in between. For a week or two, the singing school students would learn music theory, how to sight read by recognizing music notations, how to write lyrics, and how to write multiple parts to a song for harmonizing. Mostly, they would sing exotic harmonies.

They were humble students dressed in sackcloth dresses and shirts, overalls if they were fortunate. Many went barefoot. They used frayed songbooks in which notes were represented by distinctive shapes: a triangle for Fa, an oval for Sol, a square for La, and a diamond for Mi. The major scale was sung in syllables- Fa Sol La Fa Sol La Mi Fa. Shapes made it easy for people who couldn't read words to follow the music. The songbooks featured spiritual hymns well-known to Baptist and Methodist congregations, the faiths of the God-fearing white folks attending the schools. Singers warmed up for each song by singing the words of the notes on the scale. Their voices were robust. No instrumental accompaniment was needed. When a particular song roused the gathering, they clapped hands and stomped feet, about as loose as Protestants got around Pindall, and sang with such power the whole building would shake.

At times like that Alfred and Nancy Nelson knew they were doing their job.

They were traveling singing school masters - teachers - and making a joyful noise was their mission. Teaching singing school was another means of putting beans in the larder and an opportunity to spread the gospel of music. Alfred was a blacksmith by trade, but . music was his pleasure. Nancy embraced music formally, earning a degree through mail correspondence from the Chicago School of Music. She gave lessons to children around Pindall Ridge throughout the year, and they both taught singing school in surrounding communities with names as lyrical as the music they taught: Western Grove, Union Y, Everton, Snowball, Gilbert, Morning Star, Lone Pine, Evening Star, Harriet, Canaan, Hasty, Erby, Valley Springs, Zinc, Canaan, and Eros.

Their love of teaching music came from Nancy's father, William Marion Smothers, a farmer born in Barren Creek, Marion County Arkansas whose people had emigrated from Carroll County, Tennessee. William had married twice, fathering 18 children, and learned music from his parents well enough to teach it himself.

For the first one hundred and fifty years of the United States, William Smothers, Nancy and Alfred Nelson and other singing school masters were the most influential music educators in America. Few folks in the hills and hollows and backwoods in and around Searcy, Newton, Marion and Boone counties could read, but shapes were familiar, easy to follow when cued by the teacher or in the songbooks. Shapes kept music alive.

The roots of singing schools and Shape Note singing, also known as Sacred Harp - white, rural choral music sung in unison - went back to congregational singing in reformist churches in the American colonies of New England (Alfred's people extended back to John Nelson, a major in the Revolutionary War) and to England and Scotland, and to Reformation psalmody and Renaissance polyphony. The term Sacred Harp refers to the tune book of 550 hymns and anthems sung in four-part harmony that was published in Philadelphia in 1844.

When pioneers fanned out across the southern United States, Shape Note evolved into a popular form of social recreation in Anglo Protestant communities into the early 20th Century. The sound endured into the 21st century in small pockets all over the United States; modern Shape Note singing conventions were held in churches, school houses, and campgrounds with singing sessions extending from hours into days with voices the sole musical instrument and the participants the audience. The singing was vigorous, sometimes bordering on shouts. Subtlety was no virtue.

Subtlety was not part of the curriculum in Arkansas singing schools. Alfred Nelson led the singing in his rich bass voice complemented by Nancy's alto. If there was a pump organ or piano where they gathered, Nancy played it while Alfred led the singing. If not, their voices led together. Either way, they made beautiful music.

Students paid their traveling teachers with shelter, food, other necessities and sometimes moneyjust enough for them to do it again when the opportunity arose, and when Alfred wasn't pounding hot steel into horseshoes, wagons, barrel staves, and fencing. The Nelsons lived in a hollow tucked back in the hills of the Boston Mountains, a vast woodlands of sharp ridge lines and steep valleys in the southwestern part of a highlands known as the Ozark Mountains, a vague western extension of the Appalachian Mountains rising out of the eastern landmass of the United States.

The sparsely-populated ridges were Caddo Indian territory until the 1600s when the Osage Nation moved in. In 1808, the Osage ceded the territory to the United States by signing a treaty with the white man [was the treaty with the gov't? YES]. For the next twenty years the land was a throughway of the Trail of Tears, the forced march by thousands of Cherokee people from their native lands in what became known as the American South. Most Cherokee eventually wound up in Oklahoma, but many just peeled away into the same woods that were the final destination for immigrants from Ireland, England, and Scotland, attempting to settle the same land from which the Indians were being removed.

The forebears of the Nelsons stopped in the Buffalo Mountains by the Buffalo River in the mid 19th century, along with a few thousand others -sufficient numbers to push the Cherokee Nation into Oklahoma "beyond the Permanent Indian Frontier" where many settlers eventually moved too. The ones who stayed were called Arkies or, more generically, hillbillies. Many of them had Cherokee blood.

Arkies were a curious mixture of self-reliance and self-denial. The caves on the bluffs above the Buffalo River were believed to shelter bears, Indians, and "carpet baggers and men of unknown character," or so folks said. Most settlers were religious. Even after prohibition ended, the counties around north central Arkansas continued to ban the sale of alcohol. At the time, moonshine stills proliferated in back hollows for those who took a nip of liquid corn or enjoyed gargling "White Mule." Few African-Americans lived among them; the farms were so small and farmers so poor that owning slaves was a luxury.

The one thing Pindall Ridge and most of north central Arkansas had going for it was water. The area's springs, caves, and sinkholes spawned grist mills, water mills, and stave mills through the valley. If you were near water, you could survive.

#

In 1882, Franklin C. Nelson paused at a spring in an area designated Prairie Township, between the settlements of Western Grove, Pindall, and Everton, where Newton, Searcy and Boone counties meet. He liked what he saw. He and his wife Prilly settled the land and fifteen years later, on June 11, 1887, made it official with a homestead declaration: Eighty acres, located at 1,320 feet above sea level near Boat Mountain in the Boston Mountains, half of Section 29 of Township 17N/ 18W of the Fifth Principal meridian. Enough for a man to make something out of himself and raise a family.

The Nelson homestead contained a grove of hardwoods shading a trickling stream that emerged from the pile of rocks marking the headwaters of Clear Creek, a stream that drained into the mighty Buffalo River a few miles away. A log house would be raised a few hundred paces east of the spring along with a barn and a smokehouse. Chickens, hogs, cows and mules were kept nearby. Franklin came to be called Uncle Peck, and his wife, Aprilla Ann, or "Prilly" Marshall, kept a sizeable garden and cultivated hollyhocks and other ornamental flowers around the home.

A small clearing was made near the path to Western Grove and Pindall by an old stagecoach stop under a towering walnut tree by the creek, 100 yards from the spring for Uncle Peck's blacksmith shop. Notorious for his persistent bad gas, neighbors swore you could taste his farts in the corn meal he ground for them with the one-lunger, the noisy, popping one cylinder engine he fired his forge with.

Uncle Peck mentored his son, William Alfred - Daddy Nelson - in making horseshoes, wagon wheels, staves for barrels, wheels, gates, plows, gigging poles, tools, whatever was needed to keep the whole grand enterprise of an agrarian and industrial society going in the hills and hollows.

William Alfred, one of Uncle Peck and Prilly's seven children, married an Arkansas girl with Tennessee roots named Nancy Elizabeth Smothers in 1900. They built their own log house over a rise on the other side of the creek on a gentle slope in a hardwood grove of walnut and red oak.

The Nelson family went back a ways in the Ozarks, around Boone, Marion, Newton and Searcy counties, and before then, to Tennessee, North Carolina, Rhode Island, England, and Ireland. They and all their relations had pretty much the same story: Anglo blood, Cherokee blood mixed in, everyone moving west, Arkies through and through.

Nancy gave birth to five children in Arkansas - Clara May, born in 1902, Rose Lusetta, born 1903, a stillborn child in 1904, a stillborn daughter 1909, and Ira Doyle, born July 9, 1913.

The youngest, Ira, the only boy to survive birth, was a free-spirit who enjoyed playing guitar and banjo and working with his father around his blacksmith forge. He had a striking presence and rode a jenny mule to school. "He was tall and handsome and would make music," recalled Irene Young who attended Pindall School with him through grade 8 - anyone seeking a higher education had to go somewhere else. Irene was one of dozens of children who took music lessons from Nancy Nelson. "She had a big ol' pump organ. She'd go all around teaching lessons at country schools. She taught at Glencoe school, Union Y school. Nobody had no money so sometimes she took chickens for teaching." Young admitted she didn't take to the lessons. "I was married, had a family, and worked at a grocery," she said. But she knew Miz Nelson was special. "She and the rest of the family was talented. They could sing. All the Nelsons and Smothers played guitars and French harp. All them Nelsons was musicians."

But (perhaps for the last time in their lives), music was not enough to sustain them in this tough place, and in the fading heat of the summer of 1929, a few weeks before Black Friday, the October day when the stock market would crash and send the economy of the United States tumbling into the Great Depression (not that the Nelsons would have noticed), Alfred, his wife, his son, and Mildred Turney, the niece they were raising, decided to go to Texas.

Alfred had lost his mother earlier in the year and he missed his daughter Rosa Lusetta badly. After Rosa married, she and her husband Ernest Nichols had moved to Hill County, Texas, a place where cotton grew tall and plentiful on the blackland prairie. The living was good down there, she informed her father and mother in letters. After their Ira came back from visiting his Texas kinfolks and declared he was ready to move, his parents were persuaded to go with him. The family needed to be closer together, Alfred reasoned. He left little behind except blacksmith customers, the land, and his parents; his father Frank - Uncle Peck - was determined to die on the homestead.

Before they left, Ira, the youngest of Alfred and Nancy's children, married his girlfriend, Myrle Greenhaw, on September 6, 1929 in Newton County and took her along.

Myrle's family, the Greenhaws, came from Western Grove a few miles west of Pindall Ridge and from all around Searcy and Newton counties. Some Greenhaws were store owners and business people in Marshall. Talmage Greenhaw started the Newton County Times at Mount Judea in 1908. Ephraim Greenhaw was a postmaster and social leader in the Big Creek Valley. His son Frank - who married Margaret Baker of Marcella Falls, Tennessee in 1868 - worked on improving schools and churches in and around Jasper, a rough and tumble cattle town in Newton County.

Like the Nelsons and just about everybody in this part of the Ozarks, a fair amount of Greenhaws were music people. Myrle's daddy, William, a noted moonshiner in the area, was an expert banjo player. Myrle's brother Carl played piano, and Myrle played guitar. The whole family sang. Myrle was a well-known flirt around Pindall with a wild streak attributed to her being three-quarters Cherokee. But if Ira was game for settling down, she was game, too.

The family left the rocky outcroppings and impenetrable thickets and headed south four hundred miles where the farm fields were like fertile river bottom. And just like that, the Nelsons were GTT. Gone To Texas.

Like tens of thousands of pioneer families before them who had been moving south and west since the first boat landed at Plymouth, the Nelsons had moved on. To some folks, GTT was a kiss-off pejorative, as in "Gone to Texas, catch me if you can," To others, GTT was merely a declaration of relocation to what was hoped to be a better place.

The Nelsons were gone to the part of Texas where the Great Plains descended into the Brazos River Valley. Gone to Hill County, more than 1,000 square miles of Blackland Prairie, Grand Prairie and Eastern Cross Timbers - a sprawling plain that opened up to the heavens in a way not seen back in Arkansas. The sky dominated the Texas landscape, there. Although the county was relatively flat, the white rock rise where Abbott was established at 712 feet above sea level was the highest point between Denison on the Oklahoma border and the Gulf of Mexico. The Brazos, the longest river in Texas, marked the county's western border on its 840 mile journey to the Gulf of Mexico. The county was lush with native grasses including buffalo grass, big bluestem, and switchgrass. Post oak, live oak, pecan, and hackberry were the most common trees. An average of 35 inches of rain fell on the prairie every year, enough to make one or two crops, although one quickly learned that in Texas, "average" was merely an arbitrary number halfway between drought and flood.

By 1929, 300 folks had settled Abbott around a railroad stop surrounded by open fields of corn, wheat, sorghum and especially cotton. Woodlands were limited to tree lines for windbreaks and small motts and thickets of pecan, elm, oak and hackberry. It was pretty country in the spring, when the fields turned electric with bluebonnets, Indian blankets, and a passel of wildflowers, but by the end of summer the land had typically been baked a harsh brown by the relentless sun, just in time for the cotton to come in.

Except for the cultivated crops, the small communities, the railroads and highways, the land had been little altered since the time when wooly mammoths and later buffalos rumbled through on seasonal migrations, eventually followed by native people who set up seasonal campgrounds to take advantage of the abundant wildlife before moving on. Indians knew better than to establish permanent settlements in a location subject to tornadoes and seasonal drought. The pioneers, who began arriving from the east in the 1830s, thought otherwise.

Human occupation of the Hill County region had been traced back to AD 1300. The Waco and Tawakoni groups of the Wichita tribe established hunting camps in and around Hill County through the early 1700s, followed by Spanish and French explorers. The first Anglo, Phillip Nolan, arrived in 1801, only to be killed by the Spanish the same year. Stephen F. Austin, the Father of Texas, made a survey map in 1822 that included the county, but in 1830, the Mexican government ruled the land belonging to Sterling Clack Robertson, another Anglo colonizer who laid claim to the land and who formed Robertson's Colony there six years before Texas declared independence from Mexico in 1836.

Comanche and Towash Indians had migrated into the area in the early 1820s, followed by Hasini and Anadarko Indians from East Texas. Although Indian raids on Anglo settlements were common outside the county, none were recorded within, affirming the land's status as a "council-spot" where treaties were made and safe passage guaranteed.

The county's Anglo settlers considered themselves Southerners. At the beginning of the Civil War of 1861-1865, voters in Hill County overwhelmingly approved secession from the United States by a vote of 376-63. But despite allegiance to the Confederacy and the county's future as farming country, Hill County was western in outlook too. The outlaw John Wesley Hardin arrived in 1869 to barter cotton and hides and murdered a citizen. Other outlaws, led by Kinch West and the Cox brothers, created more serious problems especially along The Chisholm Trail, the storied cattle route up the middle of Texas to the Kansas railheads that crossed the county's northwest corner in the early 1870s.

Abbott's destiny ultimately became intertwined with the rest of the world's with the arrival of the railroad in 1881. The need for a watering stop inspired a town site, named for Jo Abbott, a lawyer, banker, civic leader, judge and U.S. Congressman from Hill County. The 15 block plat of streets and alleysten blocks east of the railroad, five blocks west of the railroad-- was formally dedicated in April, 1891, nine years after the first building in town, Winston Treadwell's general store, managed by L.C. Barrett, opened. A hotel and a drugstore followed.

On September 15, 1896, in the middle of the cotton harvest, many locals dropped everything to join 40,000 spectators a few miles south of West to watch the Crash at Crush, a publicity stunt that was the world's first planned train wreck, in which two steam locomotives were intentionally crashed into each other near the Katy line. Two men and one woman were killed by flying debris while six others were seriously injured. Everyone who attended had a firsthand tutorial how to promote an event, draw a crowd, and put on a show.

The original town of Abbott burned the next year. Seed and steel were no match for the kind of fire that occasionally swept over the plain. The town was rebuilt, only to burn again in 1903.

#

In 1910, Hill County produced more cotton than any county or parish in the nation except Ellis County, the next county north. Sixty per cent of the cropland in the county was in cotton. Railroads followed. By 1913 two hundred miles of rail crisscrossed Hill County representing the Cotton Belt, the Gulf, Colorado and Santa Fe, the Trinity and Brazos Valley, and the Texas Electric lines. With the train came Germans and Eastern European farmersCzech immigrants in particularwho would have a major impact on the development of towns in southeastern Hill County such as Mertens, Penelope, and Abbott, and on the local culture including the night life.

Seed and steel were also no match for the boll weevil. The infestation of the pernicious insect that feasted on cotton sapped Hill County's upward spiral. What the weevil didn't waste, the Great Depression destroyed. As good as the town with three cotton gins looked to a newly-arrived Arkie, three-quarters of the farmers in the county were working land they did not own, and with the economic downturn, the train didn't stop in Abbott anymore. Riders had to flag it down.

By 1929, Abbott was in fact little more than a scattering of houses and barns, churches for Methodists, Baptists, and Disciples of Christ (the Catholic Church for the Czechs moving into town would come later), a Baptist church for the colored folks, a tabernacle for singing conventions and revivals, three cotton gins, and the three transportation routes bisecting town--Highway 81/77, the north-south border-to-border routes connecting Canada and Mexico, the Missouri-Kansas-Texas railroad which also ran north-south and the Interurban trolley which ran from Waco, 24 miles south, to Fort Worth and Dallas, 63 and 73 miles north, respectively. A traveler passing through might not give the town a second glance. For those who lived there, though, Abbott was something to be proud of. As native son Leo Ruzicka pointed [out in 19xx], "Abbott is the first town in Texas, alphabetically."

Copyright 2008 Joe Nick Patoski

Chapter 1, 2, 3

****************

Read my MVP Q&A with Mickey Raphael, which ran in the next to last issue of No Depression.

Those seeking all things Willie should visit willienelson.com and stillisstillmoving.com.

Order Willie Nelson: An Epic Life from Amazon here.


Home - Contact - News/Appearances - Notes & Musings - Bio
Bibliography - Books - Music - Texas - Travel
Water - Misc - Photos - Links -

Copyright 2008 © Joe Nick Patoski, All Rights Reserved. - Website design: Jodi Jenkins

 
wp/books/texasmountains.html0000644000106600010660000003363511075151301013515 0ustar Texas Mountains - Joe Nick Patoski
Joe Nick Patoski - joenickp.com
Google
 

Texas Mountains | Reviews

Texas Moutains - inside photo Texas Moutains - inside photo Texas Moutains - cover

Tall Tales
Texas Monthly
Read an interview with
Laurence Parent and Joe Nick Patoski
Look inside this book.

Buy Now from UT PRESS

Excerpt |Texas Ranges
Texas Monthly Feature, November 2001

For most of their lives, senior editor Joe Nick Patoski and freelance photographer Laurence Parent have explored and chronicled the mountains of the Trans-Pecos. In this excerpt from their forthcoming book, Texas Mountains, they show and tell where their love of the outdoors is at its peak.

Texas Mountains
University of Texas Press

In this book, Laurence Parent and Joe Nick Patoski join forces to offer breathtaking views of the Texas mountains. With magnificent images and words, they take us on a journey not only through the familiar Guadalupe, Davis, and Chisos mountains, but also through lesser-known ranges with evocative names such as Sierra Diablo, Eagle, Chinati, Beach, and Christmas.

Amazon.com: Books: Texas Mountains
A Magical Book
December 9, 2002 Reviewer: A reader from Dallas, TX
"I'm a photographer not easily impressed. This book is simply the best rendering of this breathtaking, little known part of Texas that I've seen. The essay is well written and together with the photography makes for a classic."

Pages as Presents
by Dan Oko December 7, 2001

These almost-too-gorgeous photos transcend the prettiness of postcards; the 10-by-11-inch, coffeetable format allows Parent to effectively hint at the scale of the landscape. By contrast, Patoski applies most of his able-bodied prose to the job of documenting the ranchers, restaurateurs, teachers, and scientists who people West Texas. Parent's full-color photographs, capturing the many moods of the Texas highlands -- rich tableaus of various ranges, valleys, and stony outcroppings documented in an array of seasons and under a variety of conditions. Patoski describes them as "a stone freak show of weird globs, jagged spires, gravity-defying balancing acts, marbled swirls, scoops of melted ice cream, and dribbled sandcastles that vary wildly from extraterrestrial to lunar in appearance."

Amarillo Globe-News
December 9, 2001

Takes the reader on a tour of some of the most magnificent views in Texas. Prepare to visit well-known sites in the Guadalupe, Davis, and Chisos Mountains and also less familiar but equally impressive views in areas identified as Sierra Diablo, Eagle, Chinati, and Christmas. In words and pictures, the book captures its subjects at all times of the day - dawn to dusk - and all seasons, summer drought to winter snow. Patoski's "field notes" are enlightening. According to the publisher, the work by Parent, Austin free-lance photographer, and Patoski, a senior editor of Texas Monthly, produces a result that is as close to being there as you can get without endless driving across the daunting distances of the Lone Star State.

Related Articles:

  • Big Bend 2002 Whether you want to hike it, raft it, drive it, or all of the above, here's everything you need to know to get the most out of a trip to Texas' greatest treasure. [Texas Monthly, Travel Feature, March 2002]


Home - Contact - News/Appearances - Notes & Musings - Bio
Bibliography - Books - Music - Texas - Travel
Water - Misc - Photos - Links -

Copyright 2008 © Joe Nick Patoski, All Rights Reserved. - Website design: Jodi Jenkins

wp/books/crossfire.html0000644000106600010660000003147011075151300012424 0ustar Caught in the Crossfire - Joe Nick Patoski
Joe Nick Patoski - joenickp.com
Google
 

Caught in the Crossfire | Reviews


In the Studio | Part 2
Read the radio interview
"The Best of Stevie Ray Vaughan"

Look inside this book
.

Amazon.com: Books
The best book on Stevie Ray Vaughan available right now

Caught in the Crossfire - book coverJuly 9, 2004 Reviewer: "rooster1956" from Harrison, Arkansas
This biography on Stevie Ray Vaughan is the best I have seen so far. To me, it is the defining biography until Dan Forte comes out with the "official" bio. It shows that while many view Stevie as a god, and thought that he was this mystical figure, it shows that he was just an average joe, who happened to have extraordinary abilities. The most interesting part of the book to me is when the fan presents him with a rubbing of Hendrix's gravestone, and he tells the fan to get rid of it, saying that it is too creepy. This book also shows how Stevie became who he was, and how the insecurities that he had enabled him to become the great guitar player that he was. I've reread this book 6 times since I owned it. It's like my favorite movie: I just keep going back to it again and again. Rave On Stevie Ray, may you rest in peace, and may you play a hell of a jam with Hendrix and Albert King in that Great Gig In The Sky.

Crawford/Patoski Stevie Ray Vaughan Biography Papers
Southwestern Writers Collection - Texas State University-San Marcos
ALBERT B. ALKEK LIBRARY - SPECIAL COLLECTIONS
Bill Crawford and Joe Nick Patoski have been involved in writing and the music industry for most of their adult lives. From 1990 to 1993, they combined their literary talents and connections with the music industry insiders to write an unauthorized biography of blues guitar legend Stevie Ray Vaughan (1954-1990), who died in a helicopter accident near East Troy, Wisconsin. read more

"It did not take long for Stevie Ray Vaughan the man to be replaced in the public eye by Stevie Ray Vaughan, the legend. Dying tragically at the age of thirty-five made him an immediate object of worship in the great rock-and-roll tradition. Dying under such tragic circumstances after overcoming his own personal battles with the demons of booze and drugs elevated him to something just short of sainthood."

--- Joe Nick Patoski and Bill Crawford, Caught in the Crossfire

Album Review: SRV by Stevie Ray Vaughan and Double Trouble [Texas Monthly, November 2000]


Home - Contact - News/Appearances - Notes & Musings - Bio
Bibliography - Books - Music - Texas - Travel
Water - Misc - Photos - Links -

Copyright 2008 © Joe Nick Patoski, All Rights Reserved. - Website design: Jodi Jenkins

wp/books/Willie-ST-2.pdf0000644000106600010660000016057111075151302012151 0ustar %PDF-1.4 % 9 0 obj <> endobj xref 9 40 0000000016 00000 n 0000001359 00000 n 0000001437 00000 n 0000001616 00000 n 0000001887 00000 n 0000002318 00000 n 0000002731 00000 n 0000003293 00000 n 0000003328 00000 n 0000003373 00000 n 0000003418 00000 n 0000003463 00000 n 0000003691 00000 n 0000003925 00000 n 0000004147 00000 n 0000004224 00000 n 0000005941 00000 n 0000006265 00000 n 0000007836 00000 n 0000007959 00000 n 0000009248 00000 n 0000010055 00000 n 0000010772 00000 n 0000011713 00000 n 0000012139 00000 n 0000012382 00000 n 0000013165 00000 n 0000014166 00000 n 0000016859 00000 n 0000020157 00000 n 0000020397 00000 n 0000020612 00000 n 0000021138 00000 n 0000021469 00000 n 0000022003 00000 n 0000022664 00000 n 0000046240 00000 n 0000046339 00000 n 0000046549 00000 n 0000001096 00000 n trailer <]>> startxref 0 %%EOF 48 0 obj <>stream xb```f`` AXa$Hr )IV!\F %RTAQyO @DY,7:.iAxւBLo{4;R\k:03+L \fa`8H3s00& endstream endobj 10 0 obj <> endobj 11 0 obj <> endobj 12 0 obj <>/ColorSpace<>/Font<>/ProcSet[/PDF/Text/ImageC/ImageI]/ExtGState<>>> endobj 13 0 obj <> endobj 14 0 obj <> endobj 15 0 obj <> endobj 16 0 obj [/ICCBased 36 0 R] endobj 17 0 obj [/Indexed 16 0 R 255 40 0 R] endobj 18 0 obj [/Indexed 16 0 R 255 42 0 R] endobj 19 0 obj [/Indexed 16 0 R 255 45 0 R] endobj 20 0 obj <> endobj 21 0 obj <> endobj 22 0 obj <> endobj 23 0 obj <> endobj 24 0 obj <>stream HlVY6~[blf&= CY-5:"3lo XZӊ0_F,i0#\x'HvTȕ0_8<߱8m>I:Pc? VHGf-sM0';7?liGwJ$_Y^\{:Fbޟh{4,,Bf܅yͨ"tX堟}\v|2OP6&Ql4& )$ҺJolM6WP?N#"o j;Cb%KNJEqIPtH\չrU#JApLNBO' ӛ:N#>9C G1-`o [Zy}D ë;5H~•BݞddAhyEuyΈ *C9ޱ 7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WQSu-Z-稲 &d<$xjxi{{ ? ZZePj'LݷXutlg%W<Ǭ~[=QNM|xjSRS9T.m3mbl-o==f94G+ӃY+ϺO\P:wIvKc|svךT,ig--*~}w)O_M(؞)D>n,R~Ftl,Js2qftY3sبgL=5sZ/s-m"P:;Bz9\d(ս0/v`}tXp\ڤ}LK|S@yv>]6ꧦ^mCTdo뮣䬶::{DzJax5t-"}Zӳcw%*|娳9ĒRX#3M4܌LGoO'2'3.bsKm-^f=oߖxy/3K8:~OQl~FD}8L}(IыJ/ E ,_\zMç4+X'J'׷㉳҉Ɣ}VT v'0 endstream endobj 4 0 obj <> endobj 5 0 obj <> endobj 6 0 obj <> endobj 7 0 obj <>stream Acrobat Distiller 8.1.0 (Windows) PScript5.dll Version 5.2 2008-04-16T16:51:47-05:00 2008-04-16T16:51:47-05:00 application/pdf http://www.star-telegram.com/books/story/579116.html jjenkins uuid:8198cfcd-ed37-4c56-99a2-77b1300d64c0 uuid:e140536f-7ed1-45cb-95eb-c730b949d6f6 endstream endobj 8 0 obj <> endobj xref 0 9 0000000000 65535 f 0000046773 00000 n 0000046899 00000 n 0000047054 00000 n 0000053428 00000 n 0000053462 00000 n 0000053486 00000 n 0000053544 00000 n 0000057237 00000 n trailer <> startxref 116 %%EOF wp/books/Willie-ST-1.pdf0000644000106600010660000020577111075151302012152 0ustar %PDF-1.4 % 14 0 obj <> endobj xref 14 41 0000000016 00000 n 0000001408 00000 n 0000001488 00000 n 0000001668 00000 n 0000001950 00000 n 0000002491 00000 n 0000002969 00000 n 0000003390 00000 n 0000003425 00000 n 0000003470 00000 n 0000003515 00000 n 0000003560 00000 n 0000003782 00000 n 0000004016 00000 n 0000004093 00000 n 0000004321 00000 n 0000006597 00000 n 0000006931 00000 n 0000007054 00000 n 0000009148 00000 n 0000010209 00000 n 0000011164 00000 n 0000012119 00000 n 0000012991 00000 n 0000013415 00000 n 0000013658 00000 n 0000014863 00000 n 0000016283 00000 n 0000018976 00000 n 0000022273 00000 n 0000022513 00000 n 0000022728 00000 n 0000023254 00000 n 0000023585 00000 n 0000024119 00000 n 0000024780 00000 n 0000047281 00000 n 0000049727 00000 n 0000049826 00000 n 0000050036 00000 n 0000001116 00000 n trailer <]>> startxref 0 %%EOF 54 0 obj <>stream xb```f``Y h  @QBfG0VS_.#2ᴆ3H8XFGL ?tE_`4A  % b2,2$:dL⺤ّXCՁ)YsxG0>wXw'~ 6@r1, endstream endobj 15 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <>/ColorSpace<>/Font<>/ProcSet[/PDF/Text/ImageC/ImageI]/ExtGState<>>> endobj 18 0 obj <> endobj 19 0 obj <> endobj 20 0 obj <> endobj 21 0 obj [/ICCBased 41 0 R] endobj 22 0 obj [/Indexed 21 0 R 255 45 0 R] endobj 23 0 obj [/Indexed 21 0 R 255 47 0 R] endobj 24 0 obj [/Indexed 21 0 R 255 51 0 R] endobj 25 0 obj <> endobj 26 0 obj <> endobj 27 0 obj <> endobj 28 0 obj <> endobj 29 0 obj <>stream HtWߓ۸ ~_ٗ[gdOͥxf2@[Ŭ,(j]7s{lwI@I",DNEb^x] &Ϣb׉u;/8tp$^k珍_=M '7:^b~P$q"_jAxH M029OFi/J2.(cN@&9 $(F'!w}x(=%TܙYIG+q@6mGX|jիv"UJ,OHt㤣eNO;†+V% I9$^ 1-E\QQ(Ƣ E ,FCtCL (-Ŏe{r/ur8]GoF! 0_Ep}U]R(>M- .MaS`L@Ѣd`= & lbG& ^_h(5+@PZzkK׍ŏ{ߥG2j*w@[Z\^źLozT@CBmAM:0jbG}3u!os )`_NU4֘}c;Z'D3bIݩֽ] U49&o%2Evpc_<9 mwZ<ɮՅ6-ԻGJ[Y*яP_&5`bSD1/ H=СZZK85c֟$cTH~r*\cju*!{<55*EN4lC;ُmN hyQ7 Ƅe]1B]|Q-%1XNaEPemԦW3"ahVPv&JGA*~qxs@:Sз2}~E0dMUp m1&sE7TWr_W768)gAXu tnC^u5HgA V k*ehO\49TE{iT'% ."'wViqP}\:O` ]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'v%3rv6%5?+!ա@aHyūTm3Y*m/&Ȳe.E/}"EpIfs2"[F8>%dMUb!Q<L!SŃ~$:/ ' @@a MAOs30 S{(V!b7]Պ =:/Cħv Wj eق OmP* Qp88ӭK6RHfy/E"w4uH GcRPv#emz)Ol ǰ"WU]D X|rg،Ix#4$hvl7 q~`A cšZ P޴.up/#~:qn$Y>[a/h endstream endobj 7 0 obj <> endobj 8 0 obj <> endobj 9 0 obj <> endobj 10 0 obj <> endobj 11 0 obj <> endobj 12 0 obj <>stream Acrobat Distiller 8.1.0 (Windows) PScript5.dll Version 5.2 2008-04-16T16:46:59-05:00 2008-04-16T16:46:59-05:00 application/pdf http://www.star-telegram.com/entertainment/story/579082.html jjenkins uuid:aeef4fee-3740-4860-9547-236a6f5ad088 uuid:8462c84c-a804-4ae3-90b3-511e07441ffa endstream endobj 13 0 obj <> endobj xref 0 14 0000000000 65535 f 0000050260 00000 n 0000050387 00000 n 0000050531 00000 n 0000059419 00000 n 0000059546 00000 n 0000059701 00000 n 0000063586 00000 n 0000063824 00000 n 0000064179 00000 n 0000064214 00000 n 0000064239 00000 n 0000064304 00000 n 0000068006 00000 n trailer <> startxref 116 %%EOF wp/books/selena.html0000644000106600010660000004604711075151301011703 0ustar Selena: Como La Flor - Joe Nick Patoski
Joe Nick Patoski - joenickp.com
Google
 

Selena: Como La Flor | Reviews

Selena: Como La Flor
Selena: Como La Flor - book coverSelena: less school, more fame
Houston Chronicle
Read excerpts from
Selena: Como la Flor
Look inside this book.

Amazon.com: Books: Selena
Still the Best Biography on Selena in Print!
July 31, 2003 Reviewer: Westoakland from Oakland, CA United States
"Although it's an unauthorized biography, Selena: Como La Flor remains the definitive book about the life and death of Selena. Patoski does a good job of explaining the history and development of Tejano, or Tex-Mex, music prior to Selena y los Dinos' arrival on the scene. Patoski also covers in detail, much of what the 1997 film bio skipped over: primarily the decade between Selena's beginnings as a regional performer, and her signing with EMI Latin/Capitol Records..." read more

Selena's Crossover Dream
Amor Prohibido by Sarah Wimer, Austin Chronicle
Selena had "it," whatever you call that indefinable but tangible star power -- charisma is the best word we have. Her innocent seductress image combined with an amazing voice, sexy dancing, and an obvious and exuberant joy tantalize. This book is a beautiful tribute that goes a long way towards explaining the phenomenon that was Selena and the South Texas Mexicano world from which she came... read more

In Search of Selena
by Abel Salas, Austin Chronicle Vol 15 No 43
You never knew her. Saw her a couple of times. Once at the corner of Riverside and Congress, in a club that changes names every season. She played to a packed house. Yet there was the wholesome girl-next-door as well. You caught a second glimpse when you were a fly, invisible, a less-than-minor presence at the Tejano Music awards in San Antonio. Starry-eyed, you roamed the floor at the Henry B. Gonzalez Convention Center... read more

La Onda Network
A regular visitor and contributor to the Tejano Home Page said:
"Mr. Patoski has written a brilliant book, the first one worthy of Selena. All the background material about Tejano music and prejudices that Mexican-Americans have endured really sets the stage for Selena's life very well. The author has done a meticulous job of collecting and arranging the mountains of detail, and has done so with a minimum of errors. This book is a keeper. I'll probably read it through a second time with greater care." read more

In the Spirit of Selena
by the Houston Chronicle Staff
Selena: Como la Flor, an unauthorized biography by Texas journalist Joe Nick Patoski, hits bookstores today. A year after her death, the spirit of Selena Quintanilla Perez still pervades Tejano music, and her admirers still mourn her loss. On March 31, 1995, Selena Quintanilla Perez, Tejano music's la reina del pueblo, was shot and killed in Corpus Christi. Fans first reacted with disbelief, then with a massive display of adoration... read more | read Selena's Legacy

Southwestern Writers Collection
Texas State University-San Marcos
ALBERT B. ALKEK LIBRARY - SPECIAL COLLECTIONS
The Selena materials are part of what is quickly becoming an important collection of Mexican American music at the Southwestern Writers Collection. This collection was created and maintained by Joe Nick in the process of writing the biography of Selena Quintanilla Perez. It is compiled of news clippings, manuscripts, interviews, photographs, court documents, notes, publicity materials, computer disks and ephemera. Dates range from 1961 to 1997. Joe Nick's research and writing processes, which began the day after Selena's death on March 31, 1995 and continued until January 1996, are reflected in this collection. read more

From tracking down the building permit for Selena's father's restaurant (where she debuted as a nine year old) to visiting the shooting range where Yolanda Saldivar purchased her gun. Patoski's detailed research built the foundation on which his biography stands.

An Exhibit of the Southwestern Writers Collection
Selena: Como La Flor
Dates: May 15, 1997 - July 31, 1997
Slain Tejano superstar Selena was the focus of an exhibit mounted by the Southwestern Writers Collection at Texas State University-San Marcos. The exhibit showcased items donated to the Writers Collection by Texas Monthly Senior Editor Joe Nick Patoski. Patoski's biography of Selena, titled Selena: Como La Flor is widely regarded as the most insightful portrayal of the beloved pop star. The Patoski archive includes early drafts of the book, extensive research into Selena's life, interviews with dozens of musicians and others who knew Selena, correspondence, hundreds of Selena-related clippings and other publications, documents from the Yolanda Saldivar trial, and an extensive record of Patoski's relationship with his publisher. read more

Articles about Selena:


Home - Contact - News/Appearances - Notes & Musings - Bio
Bibliography - Books - Music - Texas - Travel
Water - Misc - Photos - Links -

Copyright 2008 © Joe Nick Patoski, All Rights Reserved. - Website design: Jodi Jenkins

 
wp/books.html0000644000106600010660000006466211230234200010430 0ustar Books - Joe Nick Patoski
Joe Nick Patoski - joenickp.com
Google
 

Books | Joe Nick Patoski

An Epic Life Willie Nelson

.

Celebrate Willie Nelson's 75th birthday with Joe Nick Patoski
WILLIE NELSON: AN EPIC LIFE
In stores April 21st, 2008

The realization Texans are different from everybody else hit me about an hour after I'd first set foot on Texas soil. I was only two years old but I distinctly remember my father picking up my mother, my sister and me at the Greater Fort Worth International Airport and driving us to our new home in Fort Worth, stopping along the way at the Big Apple Barbecue on Highway 183. The waitresses talked funny and the smoked beef brisket covered in barbecue sauce we were served tasted like nothing I'd experienced, vaguely familiar and strange and exotic all once. Even as the hot spices set fire to my lips and the inside of my mouth, I immediately wanted more.

Read my MVP Q&A with Mickey Raphael, which ran in the next to last issue of No Depression. Order Willie Nelson: An Epic Life from Amazon here.


Big Bend National Park

Big Bend National Park is one of the few places left in America where a person can literally get away from it all. This book is the first and only comprehensive photographic and word portrait of Big Bend National Park. Joe Nick Patoski complements Laurence Parent's photography with a masterfully crafted word portrait of Big Bend National Park. Patoski describes the powerful geologic and volcanic forces that created the awe-inspiring landscape of the Big Bend. He reviews the park's natural history and also its human history. Patoski also summarizes recent conservation efforts that have led to the protection of 2.1 million acres. Although no single book could ever hope to contain the vastness of Big Bend National Park between two covers, this one beautifully captures its essence.

Buy Now University of Texas Press
Hardcover: 112 pp., 82 color photos, 1 map
ISBN-10: 0-292-71441-6; ISBN-13: 978-0-292-71441-0


 

Texas Coast

This beautiful book combines Laurence Parent's magnificent photographs with Joe Nick Patoski's entertaining text to create a one-of-a-kind portrait of the Texas coast. Joe Nick takes you on a verbal tour of the Texas coast. He describes the irresistible allure of this undramatic yet somehow unforgettable chain of barrier islands and bays. He also acknowledges the human activity that has always been a part of the coastal story-the arrival of immigrants to settle Texas; Civil War battles; towns that flourished and then suddenly folded after devastating hurricanes; the building of a huge petrochemical industry; and the successful effort to create wildlife refuges.

Buy Now University of Texas Press
Hardcover: 108 pages, 68 color phots ISBN: 029270299X
Read an excerpt | View photos


Conjunto

By John Dyer. Introduction by Joe Nick Patoski, who describes the origins of the music and its place in contemporary life, and Juan Tejeda, who pays tribute to the importance of conjunto and of musicians such as Valerio Longoria and Tony de la Rosa. Together, the photographs and essays clearly proclaim that conjunto is a true American roots music.

published by University of Texas Press
Hardcover: 128 pages ISBN: 0292709315
Read a review of Conjunto in Rumbo; Joe Nick on Conjunto


Texas Mountains

In this book, Laurence Parent and Joe Nick Patoski join forces to offer breathtaking views of the Texas mountains. With magnificent images and words, they take us on a journey not only through the familiar Guadalupe, Davis, and Chisos mountains, but also through lesser-known ranges with evocative names such as Sierra Diablo, Eagle, Chinati, Beach, and Christmas.

Buy Now University of Texas Press
Hardcover: 156 pages, 120 color photos ISBN: 0292765924


The Tex-Mex Cookbook

Joe Nick Patoski wrote the chapter on The Story of Tex-Mex music for Robb Walsh's Tex-Mex Cookbook. Go on a grand tour complete with larger-than-life characters, colorful yarns, rare archival photographs -- and a savory assortment of crispy, crunchy Tex-Mex foods.

published by Broadway Books
Paperback: 268 pages ISBN: 0767914880

 
BLOG!
  The Tex and the Mex


My Soul Looks Back in Wonder

This new book collects the stories of ordinary Americans who were involved in the civil rights movements. Joe Nick Patoski contributes oral histories of B.B. King, Jim Dickinson, Ruben Bonilla, Jr., Diane Wilson, Raylawni Branch, Ron Kirk, Sputnik Monroe, Eddie Wilson, Reverend Kenneth Lyons, and Quentin Mease. Hardcover: 240 pages, Published May 2004, ISBN: 1402714157

The Voices of Civil Rights Bus Tour
Joe Nick is joined up from September 17th - October 8th, 2004 for the 70-day journey to collect personal civil rights stories. [Civil Rights blogs]


Selena: Como La Flor

Joe Nick Patoski's biography of Selena is widely regarded as the most insightful portrayal of the beloved pop star. "If you're going to buy one Selena biography, this one is it," Cristina Saralegui, the Cristina Show, Univision; excerpted for VH1's "Behind The Music".


Stevie Ray Vaughan - Caught in the Crossfire

Stevie Ray Vaughan: Caught in the Crossfire

Joe Nick Patoski and Bill Crawford put together the first biography of the meteoric guitarist. Stevie Ray Vaughan fused blazing technique with deep soul in a manner unrivaled since the days of Jimi Hendrix, and the genuineness and passion of his music moved millions.


Home - Contact - News/Appearances - Notes & Musings - Bio
Bibliography - Books - Music - Texas - Travel
Water - Misc - Photos - Links -

Copyright 2008 © Joe Nick Patoski, All Rights Reserved. - Website design: Jodi Jenkins

wp/contact.html0000644000106600010660000002252311075151276010756 0ustar Contact - Joe Nick Patoski
Joe Nick Patoski - joenickp.com
Google
 

Joe Nick Patoski

Joe Nick Patoski

Wimberley, Texas

 

Home - Contact - News/Appearances - Notes & Musings - Bio
Bibliography - Books - Music - Texas - Travel
Water - Misc - Photos - Links -

Copyright 2008 © Joe Nick Patoski, All Rights Reserved. - Website design: Jodi Jenkins

wp/dev/0000755000106600010660000000000011075151256007205 5ustar wp/dev/wp-admin/0000755000106600010660000000000011063620261010713 5ustar wp/dev/wp-admin/install.php0000644000106600010660000001026011035437745013105 0ustar > <?php _e('WordPress › Installation'); ?>

WordPress

'.__('Already Installed').'

'.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'

');} switch($step) { case 0: case 1: // in case people are directly linking to this display_header(); ?>

ReadMe documentation at your leisure. Otherwise, just fill in the information below and you\'ll be on your way to using the most extendable and powerful personal publishing platform in the world.'), '../readme.html'); ?>


error) ) wp_die($wpdb->error->get_error_message()); display_header(); // Fill in the data we gathered $weblog_title = stripslashes($_POST['weblog_title']); $admin_email = stripslashes($_POST['admin_email']); $public = (int) $_POST['blog_public']; // check e-mail address if (empty($admin_email)) { // TODO: poka-yoke die('

'.__("ERROR: you must provide an e-mail address.").'

'); } else if (!is_email($admin_email)) { // TODO: poka-yoke die('

'.__('ERROR: that isn’t a valid e-mail address. E-mail addresses look like: username@example.com').'

'); } $wpdb->show_errors(); $result = wp_install($weblog_title, 'admin', $admin_email, $public); extract($result, EXTR_SKIP); ?>

admin

'.__('Note that password carefully! It is a random password that was generated just for you.').'

'; ?>

wp/dev/wp-admin/options-discussion.php0000644000106600010660000002000611007375340015301 0ustar







__("Don’t show Avatars"), 1 => __('Show Avatars')); foreach ( $yesorno as $key => $value) { $selected = (get_option('show_avatars') == $key) ? 'checked="checked"' : ''; echo "\n\t
"; } ?>
__('G — Suitable for all audiences'), 'PG' => __('PG — Possibly offensive, usually for audiences 13 and above'), 'R' => __('R — Intended for adult audiences above 17'), 'X' => __('X — Even more mature than above')); foreach ($ratings as $key => $rating) : $selected = (get_option('avatar_rating') == $key) ? 'checked="checked"' : ''; echo "\n\t
"; endforeach; ?>

__('Mystery Man'), 'blank' => __('Blank'), 'gravatar_default' => __('Gravatar Logo'), 'identicon' => __('Identicon (Generated)'), 'wavatar' => __('Wavatar (Generated)'), 'monsterid' => __('MonsterID (Generated)') ); $avatar_defaults = apply_filters('avatar_defaults', $avatar_defaults); $default = get_option('avatar_default'); if ( empty($default) ) $default = 'mystery'; $size = 32; $avatar_list = ''; foreach ( $avatar_defaults as $default_key => $default_name ) { $selected = ($default == $default_key) ? 'checked="checked" ' : ''; $avatar_list .= "\n\t'; $avatar_list .= '
'; } echo apply_filters('default_avatar_select', $avatar_list); ?>

wp/dev/wp-admin/export.php0000644000106600010660000000266711007310722012754 0ustar

wp/dev/wp-admin/press-this.php0000644000106600010660000005036611046105152013535 0ustar $image) { // see if files exist in content - we don't want to upload non-used selected files. if( strpos($_REQUEST['content'], $image) !== false ) { $upload = media_sideload_image($image, $post_ID, $_REQUEST['photo_description'][$key]); // Replace the POSTED content with correct uploaded ones. // escape quote for matching $quoted = preg_quote2($image); if( !is_wp_error($upload) ) $content = preg_replace('/]*)src=(\"|\')'.$quoted.'(\2)([^>\/]*)\/*>/is', $upload, $content); } } break; case "video": if($_REQUEST['embed_code']) $content .= $_REQUEST['embed_code']."\n\n"; $content .= $_REQUEST['content']; break; } // set the post_content $quick['post_content'] = $content; // error handling for $post if ( is_wp_error($post_ID)) { wp_die($id); wp_delete_post($post_ID); // error handling for media_sideload } elseif ( is_wp_error($upload)) { wp_die($upload); wp_delete_post($post_ID); } else { $quick['ID'] = $post_ID; wp_update_post($quick); } return $post_ID; } // For submitted posts. if ( 'post' == $_REQUEST['action'] ) { check_admin_referer('press-this'); $post_ID = press_it(); ?> > <?php _e('Press This') ?>

| |

', $selection); $selection = '

'.str_replace('

', '', $selection).'

'; } $url = clean_url($_GET['u']); $image = $_GET['i']; if($_REQUEST['ajax'] == 'thickbox') { ?>

<?php echo attribute_escape(__('Click to insert.')); ?>

|

]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif))[^<>\'\"]*(\2)([^>\/]*)\/*>/is'; preg_match_all($pattern, $content, $matches); if ( empty($matches[1]) ) return ''; $sources = array(); foreach ($matches[3] as $src) { // if no http in url if(strpos($src, 'http') === false) // if it doesn't have a relative uri if( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === true) $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src); else $src = 'http://'.str_replace('//','/', $host['host'].'/'.dirname($host['path']).'/'.$src); $sources[] = clean_url($src); } return "'" . implode("','", $sources) . "'"; } $url = urldecode($url); $url = str_replace(' ', '%20', $url); echo 'new Array('.get_images_from_uri($url).')'; die; } if($_REQUEST['ajax'] == 'photo_js') { ?> // gather images and load some default JS var last = null var img, img_tag, aspect, w, h, skip, i, strtoappend = ""; var my_src = eval( jQuery.ajax({ type: "GET", url: "", cache : false, async : false, data: "ajax=photo_images&u=", dataType : "script" }).responseText ); for (i = 0; i < my_src.length; i++) { img = new Image(); img.src = my_src[i]; img_attr = 'id="img' + i + '"'; skip = false; if (img.width && img.height) { if (img.width * img.height < 2500) skip = true; aspect = img.width / img.height; scale = (aspect > 1) ? (75 / img.width) : (75 / img.height); w = img.width; h = img.height; if (scale < 1) { w = parseInt(img.width * scale); h = parseInt(img.height * scale); } img_attr += ' style="width: ' + w + 'px; height: ' + h + 'px;"'; } if (!skip) strtoappend += ''; } function pick(img, desc) { if (img) { if('object' == typeof jQuery('.photolist input') && jQuery('.photolist input').length != 0) length = jQuery('.photolist input').length; if(length == 0) length = 1; jQuery('.photolist').append(''); jQuery('.photolist').append(''); append_editor("\n\n" + '

' + desc + '

'); } tinyMCE.activeEditor.resizeToContent(); return false; } function image_selector() { tb_remove(); desc = jQuery('#this_photo_description').val(); src = jQuery('#this_photo').val(); pick(src, desc); return false; } jQuery(document).ready(function() { jQuery('#extra_fields').html('
+
'); jQuery('#img_container').html(strtoappend); jQuery('#photo_add_url').attr('href', '?ajax=thickbox_url&height=200&width=500'); tb_init('a.thickbox, area.thickbox, input.thickbox'); }); > <?php _e('Press This') ?>

wp/dev/wp-admin/edit-form-advanced.php0000644000106600010660000004425711050374606015076 0ustar go back.' ), attribute_escape( stripslashes( $_GET['_wp_original_http_referer'] ) ) ); $messages[2] = __('Custom field updated.'); $messages[3] = __('Custom field deleted.'); $messages[4] = __('Post updated.'); if ( isset($_GET['revision']) ) $messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ); $notice = false; $notices[1] = __( 'There is an autosave of this post that is more recent than the version below. View the autosave.' ); if ( !isset($post_ID) || 0 == $post_ID ) { $form_action = 'post'; $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post() $form_extra = ""; $autosave = false; } else { $post_ID = (int) $post_ID; $form_action = 'editpost'; $form_extra = ""; $autosave = wp_get_post_autosave( $post_id ); // Detect if there exists an autosave newer than the post and if that autosave is different than the post if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) ) { foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) { if ( wp_text_diff( $autosave->$autosave_field, $post->$autosave_field ) ) { $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) ); break; } } unset($autosave_field, $_autosave_field); } } ?>

'; $form_prevstatus = ''; $saveasdraft = ''; ?> post_status ) wp_original_referer_field(true, 'previous'); ?>
post_status ) { ?>

post_status ) { // scheduled for publishing at a future date $stamp = __('Scheduled for:
%1$s at %2$s'); } else if ( 'publish' == $post->post_status ) { // already published $stamp = __('Published on:
%1$s at %2$s'); } else if ( '0000-00-00 00:00:00' == $post->post_date ) { // draft, 1 or more saves, no date specified $stamp = __('Publish immediately'); } else { // draft, 1 or more saves, date specified $stamp = __('Publish on:
%1$s at %2$s'); } $date = mysql2date(get_option('date_format'), $post->post_date); $time = mysql2date(get_option('time_format'), $post->post_date); } else { // draft (no saves, and thus no date specified) $stamp = __('Publish immediately'); $date = mysql2date(get_option('date_format'), current_time('mysql')); $time = mysql2date(get_option('time_format'), current_time('mysql')); } ?>

 

post_status, array('publish', 'future') ) || 0 == $post_ID ) { ?> post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete post') . ""; ?>
display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified)); } else { printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified)); } ?>

ID); ?>
ID) && ! empty($sample_permalink_html) ) : echo $sample_permalink_html; endif; ?>

post_content); ?>

0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?>

    ID, false, false, $popular_ids) ?>

use them in your template'); ?>

to_ping) ) .'" />'; if ('' != $post->pinged) { $pings = '

'. __('Already pinged:') . '

    '; $already_pinged = explode("\n", trim($post->pinged)); foreach ($already_pinged as $pinged_url) { $pings .= "\n\t
  • " . wp_specialchars($pinged_url) . "
  • "; } $pings .= '
'; } ?>


()

pingbacks, no other action necessary.'); ?>

ID); list_meta($metadata); ?>

use in your theme.'); ?>

trackbacks and pingbacks.'); ?>

id ); // TODO: ROLE SYSTEM if ( $post->post_author && !in_array($post->post_author, $authors) ) $authors[] = $post->post_author; if ( $authors && count( $authors ) > 1 ) : function post_author_meta_box($post) { global $current_user, $user_ID; $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM if ( $post->post_author && !in_array($post->post_author, $authors) ) $authors[] = $post->post_author; ?> $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
post_title) && '' == $post->post_title) || (isset($_GET['message']) && 2 > $_GET['message'])) : ?> wp/dev/wp-admin/admin.php0000644000106600010660000000577011035740603012527 0ustar wp/dev/wp-admin/edit-post-rows.php0000644000106600010660000001363011003453751014331 0ustar $column_display_name) { if ( 'cb' === $post_column_key ) $class = ' class="check-column"'; elseif ( 'comments' === $post_column_key ) $class = ' class="num"'; else $class = ''; ?> posts as $a_post ) $post_ids[] = $a_post->ID; $comment_pending_count = get_pending_comments_num($post_ids); while (have_posts()) : the_post(); $class = 'alternate' == $class ? '' : 'alternate'; global $current_user; $post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' ); $title = get_the_title(); if ( empty($title) ) $title = __('(no title)'); ?> post_status ); ?>' valign="top"> $column_display_name) { switch($column_name) { case 'cb': ?> post_date && 'date' == $column_name ) { $t_time = $h_time = __('Unpublished'); } else { if ( 'modified' == $column_name ) { $t_time = get_the_modified_time(__('Y/m/d g:i:s A')); $m_time = $post->post_modified; $time = get_post_modified_time('G', true); } else { $t_time = get_the_time(__('Y/m/d g:i:s A')); $m_time = $post->post_date; $time = get_post_time('G', true); } if ( ( abs(time() - $time) ) < 86400 ) { if ( ( 'future' == $post->post_status) ) $h_time = sprintf( __('%s from now'), human_time_diff( $time ) ); else $h_time = sprintf( __('%s ago'), human_time_diff( $time ) ); } else { $h_time = mysql2date(__('Y/m/d'), $m_time); } } ?>
>
ID ) ) { ?> ID ) ) { ?>"> post_password) ) { _e(' — Protected'); } elseif ('private' == $post->post_status) { _e(' — Private'); } ?> slug'> " . wp_specialchars(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . ""; echo join( ', ', $out ); } else { _e('Uncategorized'); } ?> slug'> " . wp_specialchars(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . ""; echo join( ', ', $out ); } else { _e('No Tags'); } ?>
ID] : 0; $pending_phrase = sprintf( __('%s pending'), number_format( $left ) ); if ( $left ) echo ''; comments_number("" . __('0') . '', "" . __('1') . '', "" . __('%') . ''); if ( $left ) echo ''; ?>
" rel="permalink"> post_status ) { case 'publish' : case 'private' : _e('Published'); break; case 'future' : _e('Scheduled'); break; case 'pending' : _e('Pending Review'); break; case 'draft' : _e('Unpublished'); break; } ?> ID) ) { echo "" . __('Edit') . ""; } ?> ID) ) { echo "ID) . "' class='delete'>" . __('Delete') . ""; } ?>
wp/dev/wp-admin/moderation.php0000644000106600010660000000014411014735077013574 0ustar wp/dev/wp-admin/install-helper.php0000644000106600010660000001007011047673251014356 0ustar get_col("SHOW TABLES",0) as $table ) { if ($table == $table_name) { return true; } } //didn't find it try to create it. $wpdb->query($create_ddl); // we cannot directly tell that whether this succeeded! foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { if ($table == $table_name) { return true; } } return false; } endif; /** ** maybe_add_column() ** Add column to db table if it doesn't exist. ** Returns: true if already exists or on successful completion ** false on error */ if ( ! function_exists('maybe_add_column') ) : function maybe_add_column($table_name, $column_name, $create_ddl) { global $wpdb, $debug; foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { if ($debug) echo("checking $column == $column_name
"); if ($column == $column_name) { return true; } } //didn't find it try to create it. $wpdb->query($create_ddl); // we cannot directly tell that whether this succeeded! foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { if ($column == $column_name) { return true; } } return false; } endif; /** ** maybe_drop_column() ** Drop column from db table if it exists. ** Returns: true if it doesn't already exist or on successful drop ** false on error */ function maybe_drop_column($table_name, $column_name, $drop_ddl) { global $wpdb; foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { if ($column == $column_name) { //found it try to drop it. $wpdb->query($drop_ddl); // we cannot directly tell that whether this succeeded! foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { if ($column == $column_name) { return false; } } } } // else didn't find it return true; } /** ** check_column() ** Check column matches passed in criteria. ** Pass in null to skip checking that criteria ** Returns: true if it matches ** false otherwise ** (case sensitive) Column names returned from DESC table are: ** Field ** Type ** Null ** Key ** Default ** Extra */ function check_column($table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null) { global $wpdb, $debug; $diffs = 0; $results = $wpdb->get_results("DESC $table_name"); foreach ($results as $row ) { if ($debug > 1) print_r($row); if ($row->Field == $col_name) { // got our column, check the params if ($debug) echo ("checking $row->Type against $col_type\n"); if (($col_type != null) && ($row->Type != $col_type)) { ++$diffs; } if (($is_null != null) && ($row->Null != $is_null)) { ++$diffs; } if (($key != null) && ($row->Key != $key)) { ++$diffs; } if (($default != null) && ($row->Default != $default)) { ++$diffs; } if (($extra != null) && ($row->Extra != $extra)) { ++$diffs; } if ($diffs > 0) { if ($debug) echo ("diffs = $diffs returning false\n"); return false; } return true; } // end if found our column } return false; } /* echo "

testing

"; echo "
";

//check_column('wp_links', 'link_description', 'mediumtext');
//if (check_column($wpdb->comments, 'comment_author', 'tinytext'))
//    echo "ok\n";
$error_count = 0;
$tablename = $wpdb->links;
// check the column
if (!check_column($wpdb->links, 'link_description', 'varchar(255)'))
{
	$ddl = "ALTER TABLE $wpdb->links MODIFY COLUMN link_description varchar(255) NOT NULL DEFAULT '' ";
	$q = $wpdb->query($ddl);
}
if (check_column($wpdb->links, 'link_description', 'varchar(255)')) {
	$res .= $tablename . ' - ok 
'; } else { $res .= 'There was a problem with ' . $tablename . '
'; ++$error_count; } echo "
"; */ ?> wp/dev/wp-admin/categories.php0000644000106600010660000001254111024604047013555 0ustar %s category: this is the default one"), $cat_name)); wp_delete_category($cat_ID); wp_redirect('categories.php?message=2'); exit; break; case 'bulk-delete': check_admin_referer('bulk-categories'); if ( !current_user_can('manage_categories') ) wp_die( __('You are not allowed to delete categories.') ); foreach ( (array) $_GET['delete'] as $cat_ID ) { $cat_name = get_catname($cat_ID); // Don't delete the default cats. if ( $cat_ID == get_option('default_category') ) wp_die(sprintf(__("Can’t delete the %s category: this is the default one"), $cat_name)); wp_delete_category($cat_ID); } $sendback = wp_get_referer(); $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); wp_redirect($sendback); exit(); break; case 'edit': require_once ('admin-header.php'); $cat_ID = (int) $_GET['cat_ID']; $category = get_category_to_edit($cat_ID); include('edit-category-form.php'); break; case 'editedcat': $cat_ID = (int) $_POST['cat_ID']; check_admin_referer('update-category_' . $cat_ID); if ( !current_user_can('manage_categories') ) wp_die(__('Cheatin’ uh?')); if ( wp_update_category($_POST) ) wp_redirect('categories.php?message=3'); else wp_redirect('categories.php?message=5'); exit; break; default: if ( !empty($_GET['_wp_http_referer']) ) { wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); exit; } wp_enqueue_script( 'admin-categories' ); wp_enqueue_script('admin-forms'); require_once ('admin-header.php'); $messages[1] = __('Category added.'); $messages[2] = __('Category deleted.'); $messages[3] = __('Category updated.'); $messages[4] = __('Category not added.'); $messages[5] = __('Category not updated.'); ?>

add new)'), '#addcat') ?>


add_query_arg( 'pagenum', '%#%' ), 'format' => '', 'total' => ceil(wp_count_terms('category') / $catsperpage), 'current' => $pagenum )); if ( $page_links ) echo "
$page_links
"; ?>


$page_links
"; ?>

Note:
Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category %s.'), apply_filters('the_category', get_catname(get_option('default_category')))) ?>

category to tag converter.'), 'admin.php?import=wp-cat2tag') ?>

wp/dev/wp-admin/rtl.css0000644000106600010660000001650311050411575012235 0ustar a:link, a:visited { text-decoration:none; } a:hover { text-decoration:underline; } .plugins .togl { border-right-width: 0; border-left-width: 1px; border-left-style: solid; } form#upload th { text-align:left; } td.available-theme { text-align:right; } #current-theme img { float: right; margin-right:0; margin-left: 1em; } .quicktags, .search { font-family: Tahoma; } /* 201 - 403 =================================== */ .side-info ul { padding-left:0; padding-right:18px; } .submit input, .button, .button-secondary, .button-highlighted { font-family: Tahoma; } #wpcontent select { font-family: Tahoma; } /* #postdiv, #titlediv, #guiddiv, #poststuff .stuffbox { margin:0 0 0 8px; } */ #quicktags #ed_code { font-family: Tahoma; } #searchform fieldset { float:right; margin: 0 0 1em 1.5ex; } #searchform fieldset legend { padding: 0 1px .2em 0; } #searchform #post-query-submit { float:right; } /* 404 - 804 =================================== */ #template div { margin-right:0; margin-left: 190px; } * html #template div { margin-left: 0; } #your-profile legend { font-family:arial; } #ajax-response.alignleft { margin-left:0; margin-right: 2em; } .page-numbers { margin-right:0; margin-left:3px; } .comment-column { margin-left:0; margin-right: 5px; } .tablenav a.button-secondary { margin: 1px 0 0 8px; } #update-nag, .plugin-update { clear:both; } /* .tablenav .tablenav-pages { float:left; } */ #user_info { right:auto; left:15px; } #wphead #viewsite { margin-left:0; margin-right:10px; } #wphead #viewsite a { font-family: Tahoma; } #wphead h1 { font-family:arial; margin-right:0; margin-left:15%; padding: 11px 12px 16px 170px; } #dashmenu { right:0; left:auto; padding-left:0; padding-right: 9px; } #dashmenu a { margin-right:0; margin-left:8px; } #adminmenu { padding-left:0; padding-right:11px; } #adminmenu a { font-family:arial; font-weight:bold; padding:6px 7px; } #adminmenu a.current, #sidemenu a.current { font-weight:bold; } #sidemenu { margin: -30px 0 0 15px; float: left; padding-left:0; padding-right: 10px; height: 1%; /* Peek-a-boo in IE6 */ } #sidemenu a { float:right; } #submenu li { padding: 0 17px 8px 0; font-size:13px; } #adminmenu li a #awaiting-mod span, #sidemenu li a #update-plugins span { right:auto; left:0; } #adminmenu li a:hover #awaiting-mod, #sidemenu li a:hover #update-plugins { background-position: -160px top; } /* 804 - 1004 =================================== */ #footer { padding: 10px 60px 0 0; } .form-table th { text-align:right; } .form-table input.tog { margin-right:0; margin-left: 2px; float: right; } .form-table table.color-palette { float:right; } #pass-strength-result { float:right; margin-right:0; margin-left: 5px; } #profile-page .form-table #rich_editing { margin-right:0; margin-left: 5px; } #tagsdiv #newtag { margin-right:0; margin-left: 5px; } #tagchecklist { margin-left:0; margin-right: 10px; } #tagchecklist strong { margin-left:0; margin-right: -8px; } #tagchecklist span { margin-right:0; margin-left: 25px; float: right; } #tagchecklist span a { margin: 6px -9px 0 0; float: right; } /* 1005 - 1304 =================================== */ .ac_results li { text-align:right; } #poststuff h2 { clear:right; } #poststuff .postbox, #poststuff .stuffbox, #titlediv, #poststuff .postarea { margin-left: 8px; margin-right: 20px; } #edit-slug-buttons a.save { margin-right:0; margin-left:4px; } #poststuff #edButtonPreview, #poststuff #edButtonHTML { margin: 5px 0 0 8px; float: left; } #poststuff #media-buttons { float: left; margin-right:0; margin-left: 20px; } #poststuff #media-buttons a { padding: 0 2px 2px 5px; } #poststuff .togbox { margin-left:0; margin-right: -21px; -moz-border-radius-topleft:0; -khtml-border-top-left-radius:0; -webkit-border-top-left-radius:0; border-top-left-radius:0; -moz-border-radius-topright: 3px; -khtml-border-top-right-radius: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; -moz-border-radius-bottomleft: 0; -khtml-border-bottom-left-radius:0; -webkit-border-bottom-left-radius:0; border-bottom-left-radius:0; -moz-border-radius-bottomright: 3px; -khtml-border-bottom-right-radius: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; } .submitbox .submitdelete { margin-left:0; margin-right:8px; } .submitbox .submit { text-align:right; } .submitbox .submit input { margin-right:0; margin-left:3px; } #categorydiv #category-adder { margin-left:0; margin-right: 120px; } #categorydiv ul#category-tabs { float: right; text-align: left; margin: 0 0 0 -120px; } ul#category-tabs li.ui-tabs-selected { -moz-border-radius-topleft:0; -khtml-border-top-left-radius:0; -webkit-border-top-left-radius:0; border-top-left-radius:0; -moz-border-radius-bottomleft:0; -khtml-border-bottom-left-radius:0; -webkit-border-bottom-left-radius:0; border-bottom-left-radius:0; -moz-border-radius-topright: 3px; -khtml-border-top-right-radius: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; -moz-border-radius-bottomright: 3px; -khtml-border-bottom-right-radius: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; } div.ui-tabs-panel { margin: 0 120px 0 5px; } /* 1305 - elakh! :-) =================================== */ #categorydiv ul.categorychecklist ul { margin-left:0; margin-right: 18px; } #linkcategorydiv #category-adder { margin-left:0; margin-right: 120px; } #linkcategorydiv ul#category-tabs { float: right; text-align: left; margin: 0 0 0 -120px; } #linkcategorydiv ul.categorychecklist ul { margin-left:0; margin-right: 18px; } p#tag-search, p#post-search { right:auto; left:0; } #posts-filter fieldset { float: right; margin: 0 0 1em 1.5ex; } #posts-filter fieldset legend { padding: 0 1px .2em 0; } ul.view-switch { float: left; margin: -23px 0 -2px 5px; } ul.view-switch li { float: right; } #the-comment-list td.comment p.comment-author { margin-right: 0 ; } #the-comment-list p.comment-author img { float: right; margin-right:0; margin-left: 8px; } #the-comment-list td.comment p { margin-left:0; margin-right: 8px; } .curtime { background-position: right 2px; padding-left:0; padding-right: 18px; } .tablenav .delete { margin-right:0; margin-left: 20px; } #tTips { } td.action-links, th.action-links { text-align:left; } .info-box { left:auto; right: 50%; margin-left: 0; margin-right: -225px; } .info-box .gears-img { float: left; } /* LTR =================================== */ #edit-slug-box, #trackback, #metakeyinput, #post_password, #link_url, #link_image, #rss_uri, #category_nicename, #slug, #dbuser, #dbpass, #dbname, #dbprefix, #dccharset, #gmpath, #archivespath, #lastentry, #dbhost, #pages-exclude, #newcontent, #email, #newcomment_author_url, #siteurl, #home, #admin_email, #date_format, #time_format, #gmt_offset, #mailserver_url, #mailserver_port, #mailserver_login, #mailserver_pass, #ping_sites, #posts_per_page, #posts_per_rss, #blog_charset, #moderation_keys, #blacklist_keys, #comment_max_links, #permalink_structure, #category_base, #tag_base, #upload_path, #upload_url_path, #thumbnail_size_w, #thumbnail_size_h, #medium_size_w, #medium_size_h, #user_login, #url, #pass1, #pass2, #aim, #yim, #jabber, #key, #src, #hostname, #username, #password, #rules { direction:ltr; } /* TinyMCE =================================== */ .clearlooks2 .mceTop .mceLeft { width:100% !important; } wp/dev/wp-admin/plugin-editor.php0000644000106600010660000001225111017045414014207 0ustar '.__('You do not have sufficient permissions to edit templates for this blog.').'

'); $newcontent = stripslashes($_POST['newcontent']); if ( is_writeable($real_file) ) { $f = fopen($real_file, 'w+'); fwrite($f, $newcontent); fclose($f); // Deactivate so we can test it. if ( is_plugin_active($file) || isset($_POST['phperror']) ) { if ( is_plugin_active($file) ) deactivate_plugins($file, true); wp_redirect(add_query_arg('_wpnonce', wp_create_nonce('edit-plugin-test_' . $file), "plugin-editor.php?file=$file&liveupdate=1")); exit; } wp_redirect("plugin-editor.php?file=$file&a=te"); } else { wp_redirect("plugin-editor.php?file=$file"); } exit; break; default: if ( !current_user_can('edit_plugins') ) wp_die('

'.__('You do not have sufficient permissions to edit plugins for this blog.').'

'); if ( isset($_GET['liveupdate']) ) { check_admin_referer('edit-plugin-test_' . $file); $error = validate_plugin($file); if( is_wp_error($error) ) wp_die( $error ); if ( ! is_plugin_active($file) ) activate_plugin($file, "plugin-editor.php?file=$file&phperror=1");// we'll override this later if the plugin can be included without fatal error wp_redirect("plugin-editor.php?file=$file&a=te"); exit; } require_once('admin-header.php'); update_recently_edited(WP_PLUGIN_DIR . '/' . $file); if ( ! is_file($real_file) ) $error = 1; if ( ! $error ) $content = htmlspecialchars(file_get_contents($real_file)); ?>

fatal error.') ?>

%s (active)'), $file); else echo sprintf(__('Browsing %s (active)'), $file); } else { if ( is_writeable($real_file) ) echo sprintf(__('Editing %s (inactive)'), $file); else echo sprintf(__('Browsing %s (inactive)'), $file); } ?>


Warning: Making changes to active plugins is not recommended. If your changes cause a fatal error, the plugin will be automatically deactivated.'); ?>

"; else echo ""; ?>

the Codex for more information.'); ?>

' . __('Oops, no such file exists! Double check the name and try again, merci.') . '

'; } ?>
 
wp/dev/wp-admin/edit-page-form.php0000644000106600010660000003466711050374606014251 0ustar go back.' ), attribute_escape( stripslashes( $_GET['_wp_original_http_referer'] ) ) ); $messages[2] = __('Custom field updated.'); $messages[3] = __('Custom field deleted.'); $messages[4] = __('Page updated.'); if ( isset($_GET['revision']) ) $messages[5] = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ); $notice = false; $notices[1] = __( 'There is an autosave of this page that is more recent than the version below. View the autosave.' ); if (!isset($post_ID) || 0 == $post_ID) { $form_action = 'post'; $nonce_action = 'add-page'; $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post() $form_extra = ""; } else { $post_ID = (int) $post_ID; $form_action = 'editpost'; $nonce_action = 'update-page_' . $post_ID; $form_extra = ""; $autosave = wp_get_post_autosave( $post_id ); if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) ) $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) ); } $temp_ID = (int) $temp_ID; $user_ID = (int) $user_ID; ?>

'; ?> post_status ) wp_original_referer_field(true, 'previous'); ?>
post_status ) { ?>

post_status ) { // scheduled for publishing at a future date $stamp = __('Scheduled for:
%1$s at %2$s'); } else if ( 'publish' == $post->post_status ) { // already published $stamp = __('Published on:
%1$s at %2$s'); } else if ( '0000-00-00 00:00:00' == $post->post_date ) { // draft, 1 or more saves, no date specified $stamp = __('Publish immediately'); } else { // draft, 1 or more saves, date specified $stamp = __('Publish on:
%1$s at %2$s'); } $date = mysql2date(get_option('date_format'), $post->post_date); $time = mysql2date(get_option('time_format'), $post->post_date); } else { // draft (no saves, and thus no date specified) $stamp = __('Publish immediately'); $date = mysql2date(get_option('date_format'), current_time('mysql')); $time = mysql2date(get_option('time_format'), current_time('mysql')); } ?>

 

post_status, array('publish', 'future') ) || 0 == $post_ID ) { ?> post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete page') . ""; ?>
display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified)); } else { printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified)); } ?>

ID); ?>
ID) && ! empty($sample_permalink_html) ) : echo $sample_permalink_html; endif; ?>

post_content); ?>

ID); list_meta($metadata); ?>

use in your theme.'); ?>

trackbacks and pingbacks.'); ?>

id ); // TODO: ROLE SYSTEM if ( $post->post_author && !in_array($post->post_author, $authors) ) $authors[] = $post->post_author; if ( $authors && count( $authors ) > 1 ) { function page_author_meta_box($post){ global $current_user, $user_ID; $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM if ( $post->post_author && !in_array($post->post_author, $authors) ) $authors[] = $post->post_author; ?> $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
wp/dev/wp-admin/revision.php0000644000106600010660000001404211043456466013277 0ustar post_parent ) ) break; if ( !$post = get_post( $revision->post_parent ) ) break; if ( !constant('WP_POST_REVISIONS') && !wp_is_post_autosave( $revision ) ) // Revisions disabled and we're not looking at an autosave break; check_admin_referer( "restore-post_$post->ID|$revision->ID" ); wp_restore_post_revision( $revision->ID ); $redirect = add_query_arg( array( 'message' => 5, 'revision' => $revision->ID ), get_edit_post_link( $post->ID, 'url' ) ); break; case 'diff' : if ( !$left_revision = get_post( $left ) ) break; if ( !$right_revision = get_post( $right ) ) break; if ( !current_user_can( 'read_post', $left_revision->ID ) || !current_user_can( 'read_post', $right_revision->ID ) ) break; // If we're comparing a revision to itself, redirect to the 'view' page for that revision or the edit page for that post if ( $left_revision->ID == $right_revision->ID ) { $redirect = get_edit_post_link( $left_revision->ID ); include( 'js/revisions-js.php' ); break; } // Don't allow reverse diffs? if ( strtotime($right_revision->post_modified_gmt) < strtotime($left_revision->post_modified_gmt) ) { $redirect = add_query_arg( array( 'left' => $right, 'right' => $left ) ); break; } if ( $left_revision->ID == $right_revision->post_parent ) // right is a revision of left $post =& $left_revision; elseif ( $left_revision->post_parent == $right_revision->ID ) // left is a revision of right $post =& $right_revision; elseif ( $left_revision->post_parent == $right_revision->post_parent ) // both are revisions of common parent $post = get_post( $left_revision->post_parent ); else break; // Don't diff two unrelated revisions if ( !constant('WP_POST_REVISIONS') ) { // Revisions disabled if ( // we're not looking at an autosave ( !wp_is_post_autosave( $left_revision ) && !wp_is_post_autosave( $right_revision ) ) || // we're not comparing an autosave to the current post ( $post->ID !== $left_revision->ID && $post->ID !== $right_revision->ID ) ) break; } if ( // They're the same $left_revision->ID == $right_revision->ID || // Neither is a revision ( !wp_get_post_revision( $left_revision->ID ) && !wp_get_post_revision( $right_revision->ID ) ) ) break; $post_title = '' . get_the_title() . ''; $h2 = sprintf( __( 'Compare Revisions of “%1$s”' ), $post_title ); $left = $left_revision->ID; $right = $right_revision->ID; $redirect = false; break; case 'view' : default : if ( !$revision = wp_get_post_revision( $revision_id ) ) break; if ( !$post = get_post( $revision->post_parent ) ) break; if ( !current_user_can( 'read_post', $revision->ID ) || !current_user_can( 'read_post', $post->ID ) ) break; if ( !constant('WP_POST_REVISIONS') && !wp_is_post_autosave( $revision ) ) // Revisions disabled and we're not looking at an autosave break; $post_title = '' . get_the_title() . ''; $revision_title = wp_post_revision_title( $revision, false ); $h2 = sprintf( __( 'Post Revision for “%1$s” created on %2$s' ), $post_title, $revision_title ); // Sets up the diff radio buttons $left = $revision->ID; $right = $post->ID; $redirect = false; break; endswitch; if ( !$redirect && !in_array( $post->post_type, array( 'post', 'page' ) ) ) $redirect = 'edit.php'; if ( $redirect ) { wp_redirect( $redirect ); exit; } if ( 'page' == $post->post_type ) { $submenu_file = 'edit-pages.php'; $title = __( 'Page Revisions' ); } else { $submenu_file = 'edit.php'; $title = __( 'Post Revisions' ); } require_once( 'admin-header.php' ); ?>

$field_title ) : if ( 'diff' == $action ) { $left_content = apply_filters( "_wp_post_revision_field_$field", $left_revision->$field, $field ); $right_content = apply_filters( "_wp_post_revision_field_$field", $right_revision->$field, $field ); if ( !$content = wp_text_diff( $left_content, $right_content ) ) continue; // There is no difference between left and right $identical = false; } else { add_filter( "_wp_post_revision_field_$field", 'htmlspecialchars' ); $content = apply_filters( "_wp_post_revision_field_$field", $revision->$field, $field ); } ?>


'form-table', 'parent' => true, 'right' => $right, 'left' => $left ); if ( !constant( 'WP_POST_REVISIONS' ) ) $args['type'] = 'autosave'; wp_list_post_revisions( $post, $args ); ?>
get_var( $wpdb->prepare("SELECT count(*) FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) ); } } if(!function_exists('link_exists')) { function link_exists($linkname) { global $wpdb; return $wpdb->get_var( $wpdb->prepare("SELECT link_id FROM $wpdb->links WHERE link_name = %s", $linkname) ); } } /* Identify UTF-8 text Taken from http://www.php.net/manual/fr/function.mb-detect-encoding.php#50087 */ // // utf8 encoding validation developed based on Wikipedia entry at: // http://en.wikipedia.org/wiki/UTF-8 // // Implemented as a recursive descent parser based on a simple state machine // copyright 2005 Maarten Meijer // // This cries out for a C-implementation to be included in PHP core // function valid_1byte($char) { if(!is_int($char)) return false; return ($char & 0x80) == 0x00; } function valid_2byte($char) { if(!is_int($char)) return false; return ($char & 0xE0) == 0xC0; } function valid_3byte($char) { if(!is_int($char)) return false; return ($char & 0xF0) == 0xE0; } function valid_4byte($char) { if(!is_int($char)) return false; return ($char & 0xF8) == 0xF0; } function valid_nextbyte($char) { if(!is_int($char)) return false; return ($char & 0xC0) == 0x80; } function valid_utf8($string) { $len = strlen($string); $i = 0; while( $i < $len ) { $char = ord(substr($string, $i++, 1)); if(valid_1byte($char)) { // continue continue; } else if(valid_2byte($char)) { // check 1 byte if(!valid_nextbyte(ord(substr($string, $i++, 1)))) return false; } else if(valid_3byte($char)) { // check 2 bytes if(!valid_nextbyte(ord(substr($string, $i++, 1)))) return false; if(!valid_nextbyte(ord(substr($string, $i++, 1)))) return false; } else if(valid_4byte($char)) { // check 3 bytes if(!valid_nextbyte(ord(substr($string, $i++, 1)))) return false; if(!valid_nextbyte(ord(substr($string, $i++, 1)))) return false; if(!valid_nextbyte(ord(substr($string, $i++, 1)))) return false; } // goto next char } return true; // done } function csc ($s) { if (valid_utf8 ($s)) { return $s; } else { return iconv(get_option ("dccharset"),"UTF-8",$s); } } function textconv ($s) { return csc (preg_replace ('|(?)\s*\n|', ' ', $s)); } /** The Main Importer Class **/ class Dotclear_Import { function header() { echo '
'; echo '

'.__('Import DotClear').'

'; echo '

'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'

'; } function footer() { echo '
'; } function greet() { echo '

'.__('Howdy! This importer allows you to extract posts from a DotClear database into your blog. Mileage may vary.').'

'; echo '

'.__('Your DotClear Configuration settings are as follows:').'

'; echo '
'; wp_nonce_field('import-dotclear'); $this->db_form(); echo '

'; echo '
'; } function get_dc_cats() { global $wpdb; // General Housekeeping $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); set_magic_quotes_runtime(0); $dbprefix = get_option('dcdbprefix'); // Get Categories return $dcdb->get_results('SELECT * FROM '.$dbprefix.'categorie', ARRAY_A); } function get_dc_users() { global $wpdb; // General Housekeeping $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); set_magic_quotes_runtime(0); $dbprefix = get_option('dcdbprefix'); // Get Users return $dcdb->get_results('SELECT * FROM '.$dbprefix.'user', ARRAY_A); } function get_dc_posts() { // General Housekeeping $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); set_magic_quotes_runtime(0); $dbprefix = get_option('dcdbprefix'); // Get Posts return $dcdb->get_results('SELECT '.$dbprefix.'post.*, '.$dbprefix.'categorie.cat_libelle_url AS post_cat_name FROM '.$dbprefix.'post INNER JOIN '.$dbprefix.'categorie ON '.$dbprefix.'post.cat_id = '.$dbprefix.'categorie.cat_id', ARRAY_A); } function get_dc_comments() { global $wpdb; // General Housekeeping $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); set_magic_quotes_runtime(0); $dbprefix = get_option('dcdbprefix'); // Get Comments return $dcdb->get_results('SELECT * FROM '.$dbprefix.'comment', ARRAY_A); } function get_dc_links() { //General Housekeeping $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); set_magic_quotes_runtime(0); $dbprefix = get_option('dcdbprefix'); return $dcdb->get_results('SELECT * FROM '.$dbprefix.'link ORDER BY position', ARRAY_A); } function cat2wp($categories='') { // General Housekeeping global $wpdb; $count = 0; $dccat2wpcat = array(); // Do the Magic if(is_array($categories)) { echo '

'.__('Importing Categories...').'

'; foreach ($categories as $category) { $count++; extract($category); // Make Nice Variables $name = $wpdb->escape($cat_libelle_url); $title = $wpdb->escape(csc ($cat_libelle)); $desc = $wpdb->escape(csc ($cat_desc)); if($cinfo = category_exists($name)) { $ret_id = wp_insert_category(array('cat_ID' => $cinfo, 'category_nicename' => $name, 'cat_name' => $title, 'category_description' => $desc)); } else { $ret_id = wp_insert_category(array('category_nicename' => $name, 'cat_name' => $title, 'category_description' => $desc)); } $dccat2wpcat[$id] = $ret_id; } // Store category translation for future use add_option('dccat2wpcat',$dccat2wpcat); echo '

'.sprintf(__ngettext('Done! %1$s category imported.', 'Done! %1$s categories imported.', $count), $count).'

'; return true; } echo __('No Categories to Import!'); return false; } function users2wp($users='') { // General Housekeeping global $wpdb; $count = 0; $dcid2wpid = array(); // Midnight Mojo if(is_array($users)) { echo '

'.__('Importing Users...').'

'; foreach($users as $user) { $count++; extract($user); // Make Nice Variables $name = $wpdb->escape(csc ($name)); $RealName = $wpdb->escape(csc ($user_pseudo)); if($uinfo = get_userdatabylogin($name)) { $ret_id = wp_insert_user(array( 'ID' => $uinfo->ID, 'user_login' => $user_id, 'user_nicename' => $Realname, 'user_email' => $user_email, 'user_url' => 'http://', 'display_name' => $Realname) ); } else { $ret_id = wp_insert_user(array( 'user_login' => $user_id, 'user_nicename' => csc ($user_pseudo), 'user_email' => $user_email, 'user_url' => 'http://', 'display_name' => $Realname) ); } $dcid2wpid[$user_id] = $ret_id; // Set DotClear-to-WordPress permissions translation // Update Usermeta Data $user = new WP_User($ret_id); $wp_perms = $user_level + 1; if(10 == $wp_perms) { $user->set_role('administrator'); } else if(9 == $wp_perms) { $user->set_role('editor'); } else if(5 <= $wp_perms) { $user->set_role('editor'); } else if(4 <= $wp_perms) { $user->set_role('author'); } else if(3 <= $wp_perms) { $user->set_role('contributor'); } else if(2 <= $wp_perms) { $user->set_role('contributor'); } else { $user->set_role('subscriber'); } update_usermeta( $ret_id, 'wp_user_level', $wp_perms); update_usermeta( $ret_id, 'rich_editing', 'false'); update_usermeta( $ret_id, 'first_name', csc ($user_prenom)); update_usermeta( $ret_id, 'last_name', csc ($user_nom)); }// End foreach($users as $user) // Store id translation array for future use add_option('dcid2wpid',$dcid2wpid); echo '

'.sprintf(__('Done! %1$s users imported.'), $count).'

'; return true; }// End if(is_array($users) echo __('No Users to Import!'); return false; }// End function user2wp() function posts2wp($posts='') { // General Housekeeping global $wpdb; $count = 0; $dcposts2wpposts = array(); $cats = array(); // Do the Magic if(is_array($posts)) { echo '

'.__('Importing Posts...').'

'; foreach($posts as $post) { $count++; extract($post); // Set DotClear-to-WordPress status translation $stattrans = array(0 => 'draft', 1 => 'publish'); $comment_status_map = array (0 => 'closed', 1 => 'open'); //Can we do this more efficiently? $uinfo = ( get_userdatabylogin( $user_id ) ) ? get_userdatabylogin( $user_id ) : 1; $authorid = ( is_object( $uinfo ) ) ? $uinfo->ID : $uinfo ; $Title = $wpdb->escape(csc ($post_titre)); $post_content = textconv ($post_content); $post_excerpt = ""; if ($post_chapo != "") { $post_excerpt = textconv ($post_chapo); $post_content = $post_excerpt ."\n\n".$post_content; } $post_excerpt = $wpdb->escape ($post_excerpt); $post_content = $wpdb->escape ($post_content); $post_status = $stattrans[$post_pub]; // Import Post data into WordPress if($pinfo = post_exists($Title,$post_content)) { $ret_id = wp_insert_post(array( 'ID' => $pinfo, 'post_author' => $authorid, 'post_date' => $post_dt, 'post_date_gmt' => $post_dt, 'post_modified' => $post_upddt, 'post_modified_gmt' => $post_upddt, 'post_title' => $Title, 'post_content' => $post_content, 'post_excerpt' => $post_excerpt, 'post_status' => $post_status, 'post_name' => $post_titre_url, 'comment_status' => $comment_status_map[$post_open_comment], 'ping_status' => $comment_status_map[$post_open_tb], 'comment_count' => $post_nb_comment + $post_nb_trackback) ); if ( is_wp_error( $ret_id ) ) return $ret_id; } else { $ret_id = wp_insert_post(array( 'post_author' => $authorid, 'post_date' => $post_dt, 'post_date_gmt' => $post_dt, 'post_modified' => $post_modified_gmt, 'post_modified_gmt' => $post_modified_gmt, 'post_title' => $Title, 'post_content' => $post_content, 'post_excerpt' => $post_excerpt, 'post_status' => $post_status, 'post_name' => $post_titre_url, 'comment_status' => $comment_status_map[$post_open_comment], 'ping_status' => $comment_status_map[$post_open_tb], 'comment_count' => $post_nb_comment + $post_nb_trackback) ); if ( is_wp_error( $ret_id ) ) return $ret_id; } $dcposts2wpposts[$post_id] = $ret_id; // Make Post-to-Category associations $cats = array(); $category1 = get_category_by_slug($post_cat_name); $category1 = $category1->term_id; if($cat1 = $category1) { $cats[1] = $cat1; } if(!empty($cats)) { wp_set_post_categories($ret_id, $cats); } } } // Store ID translation for later use add_option('dcposts2wpposts',$dcposts2wpposts); echo '

'.sprintf(__('Done! %1$s posts imported.'), $count).'

'; return true; } function comments2wp($comments='') { // General Housekeeping global $wpdb; $count = 0; $dccm2wpcm = array(); $postarr = get_option('dcposts2wpposts'); // Magic Mojo if(is_array($comments)) { echo '

'.__('Importing Comments...').'

'; foreach($comments as $comment) { $count++; extract($comment); // WordPressify Data $comment_ID = (int) ltrim($comment_id, '0'); $comment_post_ID = (int) $postarr[$post_id]; $comment_approved = "$comment_pub"; $name = $wpdb->escape(csc ($comment_auteur)); $email = $wpdb->escape($comment_email); $web = "http://".$wpdb->escape($comment_site); $message = $wpdb->escape(textconv ($comment_content)); if($cinfo = comment_exists($name, $comment_dt)) { // Update comments $ret_id = wp_update_comment(array( 'comment_ID' => $cinfo, 'comment_post_ID' => $comment_post_ID, 'comment_author' => $name, 'comment_author_email' => $email, 'comment_author_url' => $web, 'comment_author_IP' => $comment_ip, 'comment_date' => $comment_dt, 'comment_date_gmt' => $comment_dt, 'comment_content' => $message, 'comment_approved' => $comment_approved) ); } else { // Insert comments $ret_id = wp_insert_comment(array( 'comment_post_ID' => $comment_post_ID, 'comment_author' => $name, 'comment_author_email' => $email, 'comment_author_url' => $web, 'comment_author_IP' => $comment_ip, 'comment_date' => $comment_dt, 'comment_date_gmt' => $comment_dt, 'comment_content' => $message, 'comment_approved' => $comment_approved) ); } $dccm2wpcm[$comment_ID] = $ret_id; } // Store Comment ID translation for future use add_option('dccm2wpcm', $dccm2wpcm); // Associate newly formed categories with posts get_comment_count($ret_id); echo '

'.sprintf(__('Done! %1$s comments imported.'), $count).'

'; return true; } echo __('No Comments to Import!'); return false; } function links2wp($links='') { // General Housekeeping global $wpdb; $count = 0; // Deal with the links if(is_array($links)) { echo '

'.__('Importing Links...').'

'; foreach($links as $link) { $count++; extract($link); if ($title != "") { if ($cinfo = is_term(csc ($title), 'link_category')) { $category = $cinfo['term_id']; } else { $category = wp_insert_term($wpdb->escape (csc ($title)), 'link_category'); $category = $category['term_id']; } } else { $linkname = $wpdb->escape(csc ($label)); $description = $wpdb->escape(csc ($title)); if($linfo = link_exists($linkname)) { $ret_id = wp_insert_link(array( 'link_id' => $linfo, 'link_url' => $href, 'link_name' => $linkname, 'link_category' => $category, 'link_description' => $description) ); } else { $ret_id = wp_insert_link(array( 'link_url' => $url, 'link_name' => $linkname, 'link_category' => $category, 'link_description' => $description) ); } $dclinks2wplinks[$link_id] = $ret_id; } } add_option('dclinks2wplinks',$dclinks2wplinks); echo '

'; printf(__ngettext('Done! %s link or link category imported.', 'Done! %s links or link categories imported.', $count), $count); echo '

'; return true; } echo __('No Links to Import!'); return false; } function import_categories() { // Category Import $cats = $this->get_dc_cats(); $this->cat2wp($cats); add_option('dc_cats', $cats); echo '
'; wp_nonce_field('import-dotclear'); printf('', attribute_escape(__('Import Users'))); echo '
'; } function import_users() { // User Import $users = $this->get_dc_users(); $this->users2wp($users); echo '
'; wp_nonce_field('import-dotclear'); printf('', attribute_escape(__('Import Posts'))); echo '
'; } function import_posts() { // Post Import $posts = $this->get_dc_posts(); $result = $this->posts2wp($posts); if ( is_wp_error( $result ) ) return $result; echo '
'; wp_nonce_field('import-dotclear'); printf('', attribute_escape(__('Import Comments'))); echo '
'; } function import_comments() { // Comment Import $comments = $this->get_dc_comments(); $this->comments2wp($comments); echo '
'; wp_nonce_field('import-dotclear'); printf('', attribute_escape(__('Import Links'))); echo '
'; } function import_links() { //Link Import $links = $this->get_dc_links(); $this->links2wp($links); add_option('dc_links', $links); echo '
'; wp_nonce_field('import-dotclear'); printf('', attribute_escape(__('Finish'))); echo '
'; } function cleanup_dcimport() { delete_option('dcdbprefix'); delete_option('dc_cats'); delete_option('dcid2wpid'); delete_option('dccat2wpcat'); delete_option('dcposts2wpposts'); delete_option('dccm2wpcm'); delete_option('dclinks2wplinks'); delete_option('dcuser'); delete_option('dcpass'); delete_option('dcname'); delete_option('dchost'); delete_option('dccharset'); do_action('import_done', 'dotclear'); $this->tips(); } function tips() { echo '

'.__('Welcome to WordPress. We hope (and expect!) that you will find this platform incredibly rewarding! As a new WordPress user coming from DotClear, there are some things that we would like to point out. Hopefully, they will help your transition go as smoothly as possible.').'

'; echo '

'.__('Users').'

'; echo '

'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn\'t have that login in DotClear, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and DotClear uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. Every user has the same username, but their passwords are reset to password123. So Login and change it.'), '/wp-login.php').'

'; echo '

'.__('Preserving Authors').'

'; echo '

'.__('Secondly, we have attempted to preserve post authors. If you are the only author or contributor to your blog, then you are safe. In most cases, we are successful in this preservation endeavor. However, if we cannot ascertain the name of the writer due to discrepancies between database tables, we assign it to you, the administrative user.').'

'; echo '

'.__('Textile').'

'; echo '

'.__('Also, since you\'re coming from DotClear, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing Textile for WordPress. Trust me... You\'ll want it.').'

'; echo '

'.__('WordPress Resources').'

'; echo '

'.__('Finally, there are numerous WordPress resources around the internet. Some of them are:').'

'; echo ''; echo '

'.sprintf(__('That\'s it! What are you waiting for? Go login!'), '../wp-login.php').'

'; } function db_form() { echo ''; printf('', __('DotClear Database User:')); printf('', __('DotClear Database Password:')); printf('', __('DotClear Database Name:')); printf('', __('DotClear Database Host:')); printf('', __('DotClear Table prefix:')); printf('', __('Originating character set:')); echo '
'; } function dispatch() { if (empty ($_GET['step'])) $step = 0; else $step = (int) $_GET['step']; $this->header(); if ( $step > 0 ) { check_admin_referer('import-dotclear'); if($_POST['dbuser']) { if(get_option('dcuser')) delete_option('dcuser'); add_option('dcuser', sanitize_user($_POST['dbuser'], true)); } if($_POST['dbpass']) { if(get_option('dcpass')) delete_option('dcpass'); add_option('dcpass', sanitize_user($_POST['dbpass'], true)); } if($_POST['dbname']) { if(get_option('dcname')) delete_option('dcname'); add_option('dcname', sanitize_user($_POST['dbname'], true)); } if($_POST['dbhost']) { if(get_option('dchost')) delete_option('dchost'); add_option('dchost', sanitize_user($_POST['dbhost'], true)); } if($_POST['dccharset']) { if(get_option('dccharset')) delete_option('dccharset'); add_option('dccharset', sanitize_user($_POST['dccharset'], true)); } if($_POST['dbprefix']) { if(get_option('dcdbprefix')) delete_option('dcdbprefix'); add_option('dcdbprefix', sanitize_user($_POST['dbprefix'], true)); } } switch ($step) { default: case 0 : $this->greet(); break; case 1 : $this->import_categories(); break; case 2 : $this->import_users(); break; case 3 : $result = $this->import_posts(); if ( is_wp_error( $result ) ) echo $result->get_error_message(); break; case 4 : $this->import_comments(); break; case 5 : $this->import_links(); break; case 6 : $this->cleanup_dcimport(); break; } $this->footer(); } function Dotclear_Import() { // Nothing. } } $dc_import = new Dotclear_Import(); register_importer('dotclear', __('DotClear'), __('Import categories, users, posts, comments, and links from a DotClear blog.'), array ($dc_import, 'dispatch')); ?> wp/dev/wp-admin/import/blogger.php0000644000106600010660000011014311001503477014360 0ustar

$title

$welcome

$prereqs

$stepone

\n"; } function uh_oh($title, $message, $info) { echo "

$title

$message

$info
"; } function auth() { // We have a single-use token that must be upgraded to a session token. $token = preg_replace( '/[^-_0-9a-zA-Z]/', '', $_GET['token'] ); $headers = array( "GET /accounts/AuthSubSessionToken HTTP/1.0", "Authorization: AuthSub token=\"$token\"" ); $request = join( "\r\n", $headers ) . "\r\n\r\n"; $sock = $this->_get_auth_sock( ); if ( ! $sock ) return false; $response = $this->_txrx( $sock, $request ); preg_match( '/token=([-_0-9a-z]+)/i', $response, $matches ); if ( empty( $matches[1] ) ) { $this->uh_oh( __( 'Authorization failed' ), __( 'Something went wrong. If the problem persists, send this info to support:' ), htmlspecialchars($response) ); return false; } $this->token = $matches[1]; wp_redirect( remove_query_arg( array( 'token', 'noheader' ) ) ); } function get_token_info() { $headers = array( "GET /accounts/AuthSubTokenInfo HTTP/1.0", "Authorization: AuthSub token=\"$this->token\"" ); $request = join( "\r\n", $headers ) . "\r\n\r\n"; $sock = $this->_get_auth_sock( ); if ( ! $sock ) return; $response = $this->_txrx( $sock, $request ); return $this->parse_response($response); } function token_is_valid() { $info = $this->get_token_info(); if ( $info['code'] == 200 ) return true; return false; } function show_blogs($iter = 0) { if ( empty($this->blogs) ) { $headers = array( "GET /feeds/default/blogs HTTP/1.0", "Host: www.blogger.com", "Authorization: AuthSub token=\"$this->token\"" ); $request = join( "\r\n", $headers ) . "\r\n\r\n"; $sock = $this->_get_blogger_sock( ); if ( ! $sock ) return; $response = $this->_txrx( $sock, $request ); // Quick and dirty XML mining. list( $headers, $xml ) = explode( "\r\n\r\n", $response ); $p = xml_parser_create(); xml_parse_into_struct($p, $xml, $vals, $index); xml_parser_free($p); $this->title = $vals[$index['TITLE'][0]]['value']; // Give it a few retries... this step often flakes out the first time. if ( empty( $index['ENTRY'] ) ) { if ( $iter < 3 ) { return $this->show_blogs($iter + 1); } else { $this->uh_oh( __('Trouble signing in'), __('We were not able to gain access to your account. Try starting over.'), '' ); return false; } } foreach ( $index['ENTRY'] as $i ) { $blog = array(); while ( ( $tag = $vals[$i] ) && ! ( $tag['tag'] == 'ENTRY' && $tag['type'] == 'close' ) ) { if ( $tag['tag'] == 'TITLE' ) { $blog['title'] = $tag['value']; } elseif ( $tag['tag'] == 'SUMMARY' ) { $blog['summary'] == $tag['value']; } elseif ( $tag['tag'] == 'LINK' ) { if ( $tag['attributes']['REL'] == 'alternate' && $tag['attributes']['TYPE'] == 'text/html' ) { $parts = parse_url( $tag['attributes']['HREF'] ); $blog['host'] = $parts['host']; } elseif ( $tag['attributes']['REL'] == 'edit' ) $blog['gateway'] = $tag['attributes']['HREF']; } ++$i; } if ( ! empty ( $blog ) ) { $blog['total_posts'] = $this->get_total_results('posts', $blog['host']); $blog['total_comments'] = $this->get_total_results('comments', $blog['host']); $blog['mode'] = 'init'; $this->blogs[] = $blog; } } if ( empty( $this->blogs ) ) { $this->uh_oh( __('No blogs found'), __('We were able to log in but there were no blogs. Try a different account next time.'), '' ); return false; } } //echo '
'.print_r($this,1).'
'; $start = js_escape( __('Import') ); $continue = js_escape( __('Continue') ); $stop = js_escape( __('Importing...') ); $authors = js_escape( __('Set Authors') ); $loadauth = js_escape( __('Preparing author mapping form...') ); $authhead = js_escape( __('Final Step: Author Mapping') ); $nothing = js_escape( __('Nothing was imported. Had you already imported this blog?') ); $title = __('Blogger Blogs'); $name = __('Blog Name'); $url = __('Blog URL'); $action = __('The Magic Button'); $posts = __('Posts'); $comments = __('Comments'); $noscript = __('This feature requires Javascript but it seems to be disabled. Please enable Javascript and then reload this page. Don\'t worry, you can turn it back off when you\'re done.'); $interval = STATUS_INTERVAL * 1000; foreach ( $this->blogs as $i => $blog ) { if ( $blog['mode'] == 'init' ) $value = $start; elseif ( $blog['mode'] == 'posts' || $blog['mode'] == 'comments' ) $value = $continue; else $value = $authors; $blogtitle = js_escape( $blog['title'] ); $pdone = isset($blog['posts_done']) ? (int) $blog['posts_done'] : 0; $cdone = isset($blog['comments_done']) ? (int) $blog['comments_done'] : 0; $init .= "blogs[$i]=new blog($i,'$blogtitle','{$blog['mode']}'," . $this->get_js_status($i) . ');'; $pstat = "
 
$pdone/{$blog['total_posts']}
"; $cstat = "
 
$cdone/{$blog['total_comments']}
"; $rows .= "$blogtitle{$blog['host']}$pstat$cstat\n"; } echo "

$title

\n$rows
$name$url$posts$comments$action
"; echo " \n"; } // Handy function for stopping the script after a number of seconds. function have_time() { global $importer_started; if ( time() - $importer_started > MAX_EXECUTION_TIME ) die('continue'); return true; } function get_total_results($type, $host) { $headers = array( "GET /feeds/$type/default?max-results=1&start-index=2 HTTP/1.0", "Host: $host", "Authorization: AuthSub token=\"$this->token\"" ); $request = join( "\r\n", $headers ) . "\r\n\r\n"; $sock = $this->_get_blogger_sock( $host ); if ( ! $sock ) return; $response = $this->_txrx( $sock, $request ); $response = $this->parse_response( $response ); $parser = xml_parser_create(); xml_parse_into_struct($parser, $response['body'], $struct, $index); xml_parser_free($parser); $total_results = $struct[$index['OPENSEARCH:TOTALRESULTS'][0]]['value']; return (int) $total_results; } function import_blog($blogID) { global $importing_blog; $importing_blog = $blogID; if ( isset($_GET['authors']) ) return print($this->get_author_form()); header('Content-Type: text/plain'); if ( isset($_GET['status']) ) die($this->get_js_status()); if ( isset($_GET['saveauthors']) ) die($this->save_authors()); $blog = $this->blogs[$blogID]; $total_results = $this->get_total_results('posts', $blog['host']); $this->blogs[$importing_blog]['total_posts'] = $total_results; $start_index = $total_results - MAX_RESULTS + 1; if ( isset( $this->blogs[$importing_blog]['posts_start_index'] ) ) $start_index = (int) $this->blogs[$importing_blog]['posts_start_index']; elseif ( $total_results > MAX_RESULTS ) $start_index = $total_results - MAX_RESULTS + 1; else $start_index = 1; // This will be positive until we have finished importing posts if ( $start_index > 0 ) { // Grab all the posts $this->blogs[$importing_blog]['mode'] = 'posts'; $query = "start-index=$start_index&max-results=" . MAX_RESULTS; do { $index = $struct = $entries = array(); $headers = array( "GET /feeds/posts/default?$query HTTP/1.0", "Host: {$blog['host']}", "Authorization: AuthSub token=\"$this->token\"" ); $request = join( "\r\n", $headers ) . "\r\n\r\n"; $sock = $this->_get_blogger_sock( $blog['host'] ); if ( ! $sock ) return; // TODO: Error handling $response = $this->_txrx( $sock, $request ); $response = $this->parse_response( $response ); // Extract the entries and send for insertion preg_match_all( '/]*>.*?<\/entry>/s', $response['body'], $matches ); if ( count( $matches[0] ) ) { $entries = array_reverse($matches[0]); foreach ( $entries as $entry ) { $entry = "$entry"; $AtomParser = new AtomParser(); $AtomParser->parse( $entry ); $result = $this->import_post($AtomParser->entry); if ( is_wp_error( $result ) ) return $result; unset($AtomParser); } } else break; // Get the 'previous' query string which we'll use on the next iteration $query = ''; $links = preg_match_all('/]*)>/', $response['body'], $matches); if ( count( $matches[1] ) ) foreach ( $matches[1] as $match ) if ( preg_match('/rel=.previous./', $match) ) $query = html_entity_decode( preg_replace('/^.*href=[\'"].*\?(.+)[\'"].*$/', '$1', $match) ); if ( $query ) { parse_str($query, $q); $this->blogs[$importing_blog]['posts_start_index'] = (int) $q['start-index']; } else $this->blogs[$importing_blog]['posts_start_index'] = 0; $this->save_vars(); } while ( !empty( $query ) && $this->have_time() ); } $total_results = $this->get_total_results( 'comments', $blog['host'] ); $this->blogs[$importing_blog]['total_comments'] = $total_results; if ( isset( $this->blogs[$importing_blog]['comments_start_index'] ) ) $start_index = (int) $this->blogs[$importing_blog]['comments_start_index']; elseif ( $total_results > MAX_RESULTS ) $start_index = $total_results - MAX_RESULTS + 1; else $start_index = 1; if ( $start_index > 0 ) { // Grab all the comments $this->blogs[$importing_blog]['mode'] = 'comments'; $query = "start-index=$start_index&max-results=" . MAX_RESULTS; do { $index = $struct = $entries = array(); $headers = array( "GET /feeds/comments/default?$query HTTP/1.0", "Host: {$blog['host']}", "Authorization: AuthSub token=\"$this->token\"" ); $request = join( "\r\n", $headers ) . "\r\n\r\n"; $sock = $this->_get_blogger_sock( $blog['host'] ); if ( ! $sock ) return; // TODO: Error handling $response = $this->_txrx( $sock, $request ); $response = $this->parse_response( $response ); // Extract the comments and send for insertion preg_match_all( '/]*>.*?<\/entry>/s', $response['body'], $matches ); if ( count( $matches[0] ) ) { $entries = array_reverse( $matches[0] ); foreach ( $entries as $entry ) { $entry = "$entry"; $AtomParser = new AtomParser(); $AtomParser->parse( $entry ); $this->import_comment($AtomParser->entry); unset($AtomParser); } } // Get the 'previous' query string which we'll use on the next iteration $query = ''; $links = preg_match_all('/]*)>/', $response['body'], $matches); if ( count( $matches[1] ) ) foreach ( $matches[1] as $match ) if ( preg_match('/rel=.previous./', $match) ) $query = html_entity_decode( preg_replace('/^.*href=[\'"].*\?(.+)[\'"].*$/', '$1', $match) ); parse_str($query, $q); $this->blogs[$importing_blog]['comments_start_index'] = (int) $q['start-index']; $this->save_vars(); } while ( !empty( $query ) && $this->have_time() ); } $this->blogs[$importing_blog]['mode'] = 'authors'; $this->save_vars(); if ( !$this->blogs[$importing_blog]['posts_done'] && !$this->blogs[$importing_blog]['comments_done'] ) die('nothing'); do_action('import_done', 'blogger'); die('done'); } function convert_date( $date ) { preg_match('#([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.[0-9]+)?(Z|[\+|\-][0-9]{2,4}){0,1}#', $date, $date_bits); $offset = iso8601_timezone_to_offset( $date_bits[7] ); $timestamp = gmmktime($date_bits[4], $date_bits[5], $date_bits[6], $date_bits[2], $date_bits[3], $date_bits[1]); $timestamp -= $offset; // Convert from Blogger local time to GMT $timestamp += get_option('gmt_offset') * 3600; // Convert from GMT to WP local time return gmdate('Y-m-d H:i:s', $timestamp); } function no_apos( $string ) { return str_replace( ''', "'", $string); } function min_whitespace( $string ) { return preg_replace( '|\s+|', ' ', $string ); } function import_post( $entry ) { global $wpdb, $importing_blog; // The old permalink is all Blogger gives us to link comments to their posts. if ( isset( $entry->draft ) ) $rel = 'self'; else $rel = 'alternate'; foreach ( $entry->links as $link ) { if ( $link['rel'] == $rel ) { $parts = parse_url( $link['href'] ); $entry->old_permalink = $parts['path']; break; } } $post_date = $this->convert_date( $entry->published ); $post_content = trim( addslashes( $this->no_apos( html_entity_decode( $entry->content ) ) ) ); $post_title = trim( addslashes( $this->no_apos( $this->min_whitespace( $entry->title ) ) ) ); $post_status = isset( $entry->draft ) ? 'draft' : 'publish'; // Clean up content $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content); $post_content = str_replace('
', '
', $post_content); $post_content = str_replace('
', '
', $post_content); // Checks for duplicates if ( isset( $this->blogs[$importing_blog]['posts'][$entry->old_permalink] ) ) { ++$this->blogs[$importing_blog]['posts_skipped']; } elseif ( $post_id = post_exists( $post_title, $post_content, $post_date ) ) { $this->blogs[$importing_blog]['posts'][$entry->old_permalink] = $post_id; ++$this->blogs[$importing_blog]['posts_skipped']; } else { $post = compact('post_date', 'post_content', 'post_title', 'post_status'); $post_id = wp_insert_post($post); if ( is_wp_error( $post_id ) ) return $post_id; wp_create_categories( array_map( 'addslashes', $entry->categories ), $post_id ); $author = $this->no_apos( strip_tags( $entry->author ) ); add_post_meta( $post_id, 'blogger_blog', $this->blogs[$importing_blog]['host'], true ); add_post_meta( $post_id, 'blogger_author', $author, true ); add_post_meta( $post_id, 'blogger_permalink', $entry->old_permalink, true ); $this->blogs[$importing_blog]['posts'][$entry->old_permalink] = $post_id; ++$this->blogs[$importing_blog]['posts_done']; } $this->save_vars(); return; } function import_comment( $entry ) { global $importing_blog; // Drop the #fragment and we have the comment's old post permalink. foreach ( $entry->links as $link ) { if ( $link['rel'] == 'alternate' ) { $parts = parse_url( $link['href'] ); $entry->old_permalink = $parts['fragment']; $entry->old_post_permalink = $parts['path']; break; } } $comment_post_ID = (int) $this->blogs[$importing_blog]['posts'][$entry->old_post_permalink]; preg_match('#(.+?).*(?:\(.+?))?#', $entry->author, $matches); $comment_author = addslashes( $this->no_apos( strip_tags( (string) $matches[1] ) ) ); $comment_author_url = addslashes( $this->no_apos( strip_tags( (string) $matches[2] ) ) ); $comment_date = $this->convert_date( $entry->updated ); $comment_content = addslashes( $this->no_apos( html_entity_decode( $entry->content ) ) ); // Clean up content $comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content); $comment_content = str_replace('
', '
', $comment_content); $comment_content = str_replace('
', '
', $comment_content); // Checks for duplicates if ( isset( $this->blogs[$importing_blog]['comments'][$entry->old_permalink] ) || comment_exists( $comment_author, $comment_date ) ) { ++$this->blogs[$importing_blog]['comments_skipped']; } else { $comment = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_date', 'comment_content'); $comment_id = wp_insert_comment($comment); $this->blogs[$importing_blog]['comments'][$entry->old_permalink] = $comment_id; ++$this->blogs[$importing_blog]['comments_done']; } $this->save_vars(); } function get_js_status($blog = false) { global $importing_blog; if ( $blog === false ) $blog = $this->blogs[$importing_blog]; else $blog = $this->blogs[$blog]; $p1 = isset( $blog['posts_done'] ) ? (int) $blog['posts_done'] : 0; $p2 = isset( $blog['total_posts'] ) ? (int) $blog['total_posts'] : 0; $c1 = isset( $blog['comments_done'] ) ? (int) $blog['comments_done'] : 0; $c2 = isset( $blog['total_comments'] ) ? (int) $blog['total_comments'] : 0; return "{p1:$p1,p2:$p2,c1:$c1,c2:$c2}"; } function get_author_form($blog = false) { global $importing_blog, $wpdb, $current_user; if ( $blog === false ) $blog = & $this->blogs[$importing_blog]; else $blog = & $this->blogs[$blog]; if ( !isset( $blog['authors'] ) ) { $post_ids = array_values($blog['posts']); $authors = (array) $wpdb->get_col("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = 'blogger_author' AND post_id IN (" . join( ',', $post_ids ) . ")"); $blog['authors'] = array_map(null, $authors, array_fill(0, count($authors), $current_user->ID)); $this->save_vars(); } $directions = __('All posts were imported with the current user as author. Use this form to move each Blogger user\'s posts to a different WordPress user. You may add users and then return to this page and complete the user mapping. This form may be used as many times as you like until you activate the "Restart" function below.'); $heading = __('Author mapping'); $blogtitle = "{$blog['title']} ({$blog['host']})"; $mapthis = __('Blogger username'); $tothis = __('WordPress login'); $submit = js_escape( __('Save Changes') ); foreach ( $blog['authors'] as $i => $author ) $rows .= ""; return "

$heading

$blogtitle

$directions

$rows
$mapthis$tothis
"; } function get_user_options($current) { global $wpdb, $importer_users; if ( ! isset( $importer_users ) ) $importer_users = (array) get_users_of_blog(); foreach ( $importer_users as $user ) { $sel = ( $user->user_id == $current ) ? " selected='selected'" : ''; $options .= ""; } return $options; } function save_authors() { global $importing_blog, $wpdb; $authors = (array) $_POST['authors']; $host = $this->blogs[$importing_blog]['host']; // Get an array of posts => authors $post_ids = (array) $wpdb->get_col( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'blogger_blog' AND meta_value = %s", $host) ); $post_ids = join( ',', $post_ids ); $results = (array) $wpdb->get_results("SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = 'blogger_author' AND post_id IN ($post_ids)"); foreach ( $results as $row ) $authors_posts[$row->post_id] = $row->meta_value; foreach ( $authors as $author => $user_id ) { $user_id = (int) $user_id; // Skip authors that haven't been changed if ( $user_id == $this->blogs[$importing_blog]['authors'][$author][1] ) continue; // Get a list of the selected author's posts $post_ids = (array) array_keys( $authors_posts, $this->blogs[$importing_blog]['authors'][$author][0] ); $post_ids = join( ',', $post_ids); $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_author = %d WHERE id IN ($post_ids)", $user_id) ); $this->blogs[$importing_blog]['authors'][$author][1] = $user_id; } $this->save_vars(); wp_redirect('edit.php'); } function _get_auth_sock() { // Connect to https://www.google.com if ( !$sock = @ fsockopen('ssl://www.google.com', 443, $errno, $errstr) ) { $this->uh_oh( __('Could not connect to https://www.google.com'), __('There was a problem opening a secure connection to Google. This is what went wrong:'), "$errstr ($errno)" ); return false; } return $sock; } function _get_blogger_sock($host = 'www2.blogger.com') { if ( !$sock = @ fsockopen($host, 80, $errno, $errstr) ) { $this->uh_oh( sprintf( __('Could not connect to %s'), $host ), __('There was a problem opening a connection to Blogger. This is what went wrong:'), "$errstr ($errno)" ); return false; } return $sock; } function _txrx( $sock, $request ) { fwrite( $sock, $request ); while ( ! feof( $sock ) ) $response .= @ fread ( $sock, 8192 ); fclose( $sock ); return $response; } function revoke($token) { $headers = array( "GET /accounts/AuthSubRevokeToken HTTP/1.0", "Authorization: AuthSub token=\"$token\"" ); $request = join( "\r\n", $headers ) . "\r\n\r\n"; $sock = $this->_get_auth_sock( ); if ( ! $sock ) return false; $this->_txrx( $sock, $request ); } function restart() { global $wpdb; $options = get_option( 'blogger_importer' ); if ( isset( $options['token'] ) ) $this->revoke( $options['token'] ); delete_option('blogger_importer'); $wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_key = 'blogger_author'"); wp_redirect('?import=blogger'); } // Returns associative array of code, header, cookies, body. Based on code from php.net. function parse_response($this_response) { // Split response into header and body sections list($response_headers, $response_body) = explode("\r\n\r\n", $this_response, 2); $response_header_lines = explode("\r\n", $response_headers); // First line of headers is the HTTP response code $http_response_line = array_shift($response_header_lines); if(preg_match('@^HTTP/[0-9]\.[0-9] ([0-9]{3})@',$http_response_line, $matches)) { $response_code = $matches[1]; } // put the rest of the headers in an array $response_header_array = array(); foreach($response_header_lines as $header_line) { list($header,$value) = explode(': ', $header_line, 2); $response_header_array[$header] .= $value."\n"; } $cookie_array = array(); $cookies = explode("\n", $response_header_array["Set-Cookie"]); foreach($cookies as $this_cookie) { array_push($cookie_array, "Cookie: ".$this_cookie); } return array("code" => $response_code, "header" => $response_header_array, "cookies" => $cookie_array, "body" => $response_body); } // Step 9: Congratulate the user function congrats() { $blog = (int) $_GET['blog']; echo '

'.__('Congratulations!').'

'.__('Now that you have imported your Blogger blog into WordPress, what are you going to do? Here are some suggestions:').'

  • '.__('That was hard work! Take a break.').'
  • '; if ( count($this->import['blogs']) > 1 ) echo '
  • '.__('In case you haven\'t done it already, you can import the posts from your other blogs:'). $this->show_blogs() . '
  • '; if ( $n = count($this->import['blogs'][$blog]['newusers']) ) echo '
  • '.sprintf(__('Go to Authors & Users, where you can modify the new user(s) or delete them. If you want to make all of the imported posts yours, you will be given that option when you delete the new authors.'), 'users.php', '_parent').'
  • '; echo '
  • '.__('For security, click the link below to reset this importer.').'
  • '; echo '
'; } // Figures out what to do, then does it. function start() { if ( isset($_POST['restart']) ) $this->restart(); $options = get_option('blogger_importer'); if ( is_array($options) ) foreach ( $options as $key => $value ) $this->$key = $value; if ( isset( $_REQUEST['blog'] ) ) { $blog = is_array($_REQUEST['blog']) ? array_shift( $keys = array_keys( $_REQUEST['blog'] ) ) : $_REQUEST['blog']; $blog = (int) $blog; $result = $this->import_blog( $blog ); if ( is_wp_error( $result ) ) echo $result->get_error_message(); } elseif ( isset($_GET['token']) ) $this->auth(); elseif ( $this->token && $this->token_is_valid() ) $this->show_blogs(); else $this->greet(); $saved = $this->save_vars(); if ( $saved && !isset($_GET['noheader']) ) { $restart = __('Restart'); $message = __('We have saved some information about your Blogger account in your WordPress database. Clearing this information will allow you to start over. Restarting will not affect any posts you have already imported. If you attempt to re-import a blog, duplicate posts and comments will be skipped.'); $submit = __('Clear account information'); echo "

$restart

$message

"; } } function save_vars() { $vars = get_object_vars($this); update_option( 'blogger_importer', $vars ); return !empty($vars); } function admin_head() { ?> entry = new AtomEntry(); $this->map_attrs_func = create_function('$k,$v', 'return "$k=\"$v\"";'); $this->map_xmlns_func = create_function('$p,$n', '$xd = "xmlns"; if(strlen($n[0])>0) $xd .= ":{$n[0]}"; return "{$xd}=\"{$n[1]}\"";'); } function parse($xml) { global $app_logging; array_unshift($this->ns_contexts, array()); $parser = xml_parser_create_ns(); xml_set_object($parser, $this); xml_set_element_handler($parser, "start_element", "end_element"); xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,0); xml_set_character_data_handler($parser, "cdata"); xml_set_default_handler($parser, "_default"); xml_set_start_namespace_decl_handler($parser, "start_ns"); xml_set_end_namespace_decl_handler($parser, "end_ns"); $contents = ""; xml_parse($parser, $xml); xml_parser_free($parser); return true; } function start_element($parser, $name, $attrs) { $tag = array_pop(split(":", $name)); array_unshift($this->ns_contexts, $this->ns_decls); $this->depth++; if(!empty($this->in_content)) { $attrs_prefix = array(); // resolve prefixes for attributes foreach($attrs as $key => $value) { $attrs_prefix[$this->ns_to_prefix($key)] = $this->xml_escape($value); } $attrs_str = join(' ', array_map($this->map_attrs_func, array_keys($attrs_prefix), array_values($attrs_prefix))); if(strlen($attrs_str) > 0) { $attrs_str = " " . $attrs_str; } $xmlns_str = join(' ', array_map($this->map_xmlns_func, array_keys($this->ns_contexts[0]), array_values($this->ns_contexts[0]))); if(strlen($xmlns_str) > 0) { $xmlns_str = " " . $xmlns_str; } // handle self-closing tags (case: a new child found right-away, no text node) if(count($this->in_content) == 2) { array_push($this->in_content, ">"); } array_push($this->in_content, "<". $this->ns_to_prefix($name) ."{$xmlns_str}{$attrs_str}"); } else if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) { $this->in_content = array(); $this->is_xhtml = $attrs['type'] == 'xhtml'; array_push($this->in_content, array($tag,$this->depth)); } else if($tag == 'link') { array_push($this->entry->links, $attrs); } else if($tag == 'category') { array_push($this->entry->categories, $attrs['term']); } $this->ns_decls = array(); } function end_element($parser, $name) { $tag = array_pop(split(":", $name)); if(!empty($this->in_content)) { if($this->in_content[0][0] == $tag && $this->in_content[0][1] == $this->depth) { array_shift($this->in_content); if($this->is_xhtml) { $this->in_content = array_slice($this->in_content, 2, count($this->in_content)-3); } $this->entry->$tag = join('',$this->in_content); $this->in_content = array(); } else { $endtag = $this->ns_to_prefix($name); if (strpos($this->in_content[count($this->in_content)-1], '<' . $endtag) !== false) { array_push($this->in_content, "/>"); } else { array_push($this->in_content, ""); } } } array_shift($this->ns_contexts); #print str_repeat(" ", $this->depth * $this->indent) . "end_element('$name')" ."\n"; $this->depth--; } function start_ns($parser, $prefix, $uri) { #print str_repeat(" ", $this->depth * $this->indent) . "starting: " . $prefix . ":" . $uri . "\n"; array_push($this->ns_decls, array($prefix,$uri)); } function end_ns($parser, $prefix) { #print str_repeat(" ", $this->depth * $this->indent) . "ending: #" . $prefix . "#\n"; } function cdata($parser, $data) { #print str_repeat(" ", $this->depth * $this->indent) . "data: #" . $data . "#\n"; if(!empty($this->in_content)) { // handle self-closing tags (case: text node found, need to close element started) if (strpos($this->in_content[count($this->in_content)-1], '<') !== false) { array_push($this->in_content, ">"); } array_push($this->in_content, $this->xml_escape($data)); } } function _default($parser, $data) { # when does this gets called? } function ns_to_prefix($qname) { $components = split(":", $qname); $name = array_pop($components); if(!empty($components)) { $ns = join(":",$components); foreach($this->ns_contexts as $context) { foreach($context as $mapping) { if($mapping[1] == $ns && strlen($mapping[0]) > 0) { return "$mapping[0]:$name"; } } } } return $name; } function xml_escape($string) { return str_replace(array('&','"',"'",'<','>'), array('&','"',''','<','>'), $string ); } } ?> wp/dev/wp-admin/import/wordpress.php0000644000106600010660000005676111014647435015015 0ustar '; echo '

'.__('Import WordPress').'

'; } function footer() { echo ''; } function unhtmlentities($string) { // From php.net for < 4.3 compat $trans_tbl = get_html_translation_table(HTML_ENTITIES); $trans_tbl = array_flip($trans_tbl); return strtr($string, $trans_tbl); } function greet() { echo '
'; echo '

'.__('Howdy! Upload your WordPress eXtended RSS (WXR) file and we’ll import the posts, comments, custom fields, and categories into this blog.').'

'; echo '

'.__('Choose a WordPress WXR file to upload, then click Upload file and import.').'

'; wp_import_upload_form("admin.php?import=wordpress&step=1"); echo '
'; } function get_tag( $string, $tag ) { global $wpdb; preg_match("|<$tag.*?>(.*?)|is", $string, $return); $return = preg_replace('|^$|s', '$1', $return[1]); $return = $wpdb->escape( trim( $return ) ); return $return; } function has_gzip() { return is_callable('gzopen'); } function fopen($filename, $mode='r') { if ( $this->has_gzip() ) return gzopen($filename, $mode); return fopen($filename, $mode); } function feof($fp) { if ( $this->has_gzip() ) return gzeof($fp); return feof($fp); } function fgets($fp, $len=8192) { if ( $this->has_gzip() ) return gzgets($fp, $len); return fgets($fp, $len); } function fclose($fp) { if ( $this->has_gzip() ) return gzclose($fp); return fclose($fp); } function get_entries($process_post_func=NULL) { set_magic_quotes_runtime(0); $doing_entry = false; $is_wxr_file = false; $fp = $this->fopen($this->file, 'r'); if ($fp) { while ( !$this->feof($fp) ) { $importline = rtrim($this->fgets($fp)); // this doesn't check that the file is perfectly valid but will at least confirm that it's not the wrong format altogether if ( !$is_wxr_file && preg_match('|xmlns:wp="http://wordpress[.]org/export/\d+[.]\d+/"|', $importline) ) $is_wxr_file = true; if ( false !== strpos($importline, '') ) { preg_match('|(.*?)|is', $importline, $category); $this->categories[] = $category[1]; continue; } if ( false !== strpos($importline, '') ) { preg_match('|(.*?)|is', $importline, $tag); $this->tags[] = $tag[1]; continue; } if ( false !== strpos($importline, '') ) { $this->post = ''; $doing_entry = true; continue; } if ( false !== strpos($importline, '') ) { $doing_entry = false; if ($process_post_func) call_user_func($process_post_func, $this->post); continue; } if ( $doing_entry ) { $this->post .= $importline . "\n"; } } $this->fclose($fp); } return $is_wxr_file; } function get_wp_authors() { // We need to find unique values of author names, while preserving the order, so this function emulates the unique_value(); php function, without the sorting. $temp = $this->allauthornames; $authors[0] = array_shift($temp); $y = count($temp) + 1; for ($x = 1; $x < $y; $x ++) { $next = array_shift($temp); if (!(in_array($next, $authors))) array_push($authors, "$next"); } return $authors; } function get_authors_from_post() { global $current_user; // this will populate $this->author_ids with a list of author_names => user_ids foreach ( $_POST['author_in'] as $i => $in_author_name ) { if ( !empty($_POST['user_select'][$i]) ) { // an existing user was selected in the dropdown list $user = get_userdata( intval($_POST['user_select'][$i]) ); if ( isset($user->ID) ) $this->author_ids[$in_author_name] = $user->ID; } elseif ( $this->allow_create_users() ) { // nothing was selected in the dropdown list, so we'll use the name in the text field $new_author_name = trim($_POST['user_create'][$i]); // if the user didn't enter a name, assume they want to use the same name as in the import file if ( empty($new_author_name) ) $new_author_name = $in_author_name; $user_id = username_exists($new_author_name); if ( !$user_id ) { $user_id = wp_create_user($new_author_name, wp_generate_password()); } $this->author_ids[$in_author_name] = $user_id; } // failsafe: if the user_id was invalid, default to the current user if ( empty($this->author_ids[$in_author_name]) ) { $this->author_ids[$in_author_name] = intval($current_user->ID); } } } function wp_authors_form() { ?>

admins entries.'); ?>

allow_create_users() ) { echo '

'.__('If a new user is created by WordPress, a password will be randomly generated. Manually change the user\'s details if necessary.')."

\n"; } $authors = $this->get_wp_authors(); echo '
    '; echo '
    '; wp_nonce_field('import-wordpress'); $j = -1; foreach ($authors as $author) { ++ $j; echo '
  1. '.__('Import author:').' '.$author.'
    '; $this->users_form($j, $author); echo '
  2. '; } if ( $this->allow_fetch_attachments() ) { ?>

'.'
'; echo ''; } function users_form($n, $author) { if ( $this->allow_create_users() ) { printf('
'); } else { echo __('Map to existing').'
'; } // keep track of $n => $author name echo ''; $users = get_users_of_blog(); ?> get_entries(array(&$this, 'process_author')); if ( $is_wxr_file ) { $this->wp_authors_form(); } else { echo '

'.__('Invalid file').'

'; echo '

'.__('Please upload a valid WXR (WordPress eXtended RSS) export file.').'

'; } } // fetch the user ID for a given author name, respecting the mapping preferences function checkauthor($author) { global $current_user; if ( !empty($this->author_ids[$author]) ) return $this->author_ids[$author]; // failsafe: map to the current user return $current_user->ID; } function process_categories() { global $wpdb; $cat_names = (array) get_terms('category', 'fields=names'); while ( $c = array_shift($this->categories) ) { $cat_name = trim($this->get_tag( $c, 'wp:cat_name' )); // If the category exists we leave it alone if ( in_array($cat_name, $cat_names) ) continue; $category_nicename = $this->get_tag( $c, 'wp:category_nicename' ); $posts_private = (int) $this->get_tag( $c, 'wp:posts_private' ); $links_private = (int) $this->get_tag( $c, 'wp:links_private' ); $parent = $this->get_tag( $c, 'wp:category_parent' ); if ( empty($parent) ) $category_parent = '0'; else $category_parent = category_exists($parent); $catarr = compact('category_nicename', 'category_parent', 'posts_private', 'links_private', 'posts_private', 'cat_name'); $cat_ID = wp_insert_category($catarr); } } function process_tags() { global $wpdb; $tag_names = (array) get_terms('post_tag', 'fields=names'); while ( $c = array_shift($this->tags) ) { $tag_name = trim($this->get_tag( $c, 'wp:tag_name' )); // If the category exists we leave it alone if ( in_array($tag_name, $tag_names) ) continue; $slug = $this->get_tag( $c, 'wp:tag_slug' ); $description = $this->get_tag( $c, 'wp:tag_description' ); $tagarr = compact('slug', 'description'); $tag_ID = wp_insert_term($tag_name, 'post_tag', $tagarr); } } function process_author($post) { $author = $this->get_tag( $post, 'dc:creator' ); if ($author) $this->allauthornames[] = $author; } function process_posts() { $i = -1; echo '
    '; $this->get_entries(array(&$this, 'process_post')); echo '
'; wp_import_cleanup($this->id); do_action('import_done', 'wordpress'); echo '

'.sprintf(__('All done.').' '.__('Have fun!').'', get_option('home')).'

'; } function process_post($post) { global $wpdb; $post_ID = (int) $this->get_tag( $post, 'wp:post_id' ); if ( $post_ID && !empty($this->post_ids_processed[$post_ID]) ) // Processed already return 0; set_time_limit( 60 ); // There are only ever one of these $post_title = $this->get_tag( $post, 'title' ); $post_date = $this->get_tag( $post, 'wp:post_date' ); $post_date_gmt = $this->get_tag( $post, 'wp:post_date_gmt' ); $comment_status = $this->get_tag( $post, 'wp:comment_status' ); $ping_status = $this->get_tag( $post, 'wp:ping_status' ); $post_status = $this->get_tag( $post, 'wp:status' ); $post_name = $this->get_tag( $post, 'wp:post_name' ); $post_parent = $this->get_tag( $post, 'wp:post_parent' ); $menu_order = $this->get_tag( $post, 'wp:menu_order' ); $post_type = $this->get_tag( $post, 'wp:post_type' ); $post_password = $this->get_tag( $post, 'wp:post_password' ); $guid = $this->get_tag( $post, 'guid' ); $post_author = $this->get_tag( $post, 'dc:creator' ); $post_excerpt = $this->get_tag( $post, 'excerpt:encoded' ); $post_excerpt = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_excerpt); $post_excerpt = str_replace('
', '
', $post_excerpt); $post_excerpt = str_replace('
', '
', $post_excerpt); $post_content = $this->get_tag( $post, 'content:encoded' ); $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content); $post_content = str_replace('
', '
', $post_content); $post_content = str_replace('
', '
', $post_content); preg_match_all('|(.*?)|is', $post, $tags); $tags = $tags[1]; $tag_index = 0; foreach ($tags as $tag) { $tags[$tag_index] = $wpdb->escape($this->unhtmlentities(str_replace(array (''), '', $tag))); $tag_index++; } preg_match_all('|(.*?)|is', $post, $categories); $categories = $categories[1]; $cat_index = 0; foreach ($categories as $category) { $categories[$cat_index] = $wpdb->escape($this->unhtmlentities(str_replace(array (''), '', $category))); $cat_index++; } $post_exists = post_exists($post_title, '', $post_date); if ( $post_exists ) { echo '
  • '; printf(__('Post %s already exists.'), stripslashes($post_title)); } else { // If it has parent, process parent first. $post_parent = (int) $post_parent; if ($post_parent) { // if we already know the parent, map it to the local ID if ( $parent = $this->post_ids_processed[$post_parent] ) { $post_parent = $parent; // new ID of the parent } else { // record the parent for later $this->orphans[intval($post_ID)] = $post_parent; } } echo '
  • '; $post_author = $this->checkauthor($post_author); //just so that if a post already exists, new users are not created by checkauthor $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_excerpt', 'post_title', 'post_status', 'post_name', 'comment_status', 'ping_status', 'guid', 'post_parent', 'menu_order', 'post_type', 'post_password'); if ($post_type == 'attachment') { $remote_url = $this->get_tag( $post, 'wp:attachment_url' ); if ( !$remote_url ) $remote_url = $guid; $comment_post_ID = $post_id = $this->process_attachment($postdata, $remote_url); if ( !$post_id or is_wp_error($post_id) ) return $post_id; } else { printf(__('Importing post %s...'), stripslashes($post_title)); $comment_post_ID = $post_id = wp_insert_post($postdata); } if ( is_wp_error( $post_id ) ) return $post_id; // Memorize old and new ID. if ( $post_id && $post_ID ) { $this->post_ids_processed[intval($post_ID)] = intval($post_id); } // Add categories. if (count($categories) > 0) { $post_cats = array(); foreach ($categories as $category) { $slug = sanitize_term_field('slug', $category, 0, 'category', 'db'); $cat = get_term_by('slug', $slug, 'category'); $cat_ID = 0; if ( ! empty($cat) ) $cat_ID = $cat->term_id; if ($cat_ID == 0) { $category = $wpdb->escape($category); $cat_ID = wp_insert_category(array('cat_name' => $category)); } $post_cats[] = $cat_ID; } wp_set_post_categories($post_id, $post_cats); } // Add tags. if (count($tags) > 0) { $post_tags = array(); foreach ($tags as $tag) { $slug = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db'); $tag_obj = get_term_by('slug', $slug, 'post_tag'); $tag_id = 0; if ( ! empty($tag_obj) ) $tag_id = $tag_obj->term_id; if ( $tag_id == 0 ) { $tag = $wpdb->escape($tag); $tag_id = wp_insert_term($tag, 'post_tag'); $tag_id = $tag_id['term_id']; } $post_tags[] = intval($tag_id); } wp_set_post_tags($post_id, $post_tags); } } // Now for comments preg_match_all('|(.*?)|is', $post, $comments); $comments = $comments[1]; $num_comments = 0; if ( $comments) { foreach ($comments as $comment) { $comment_author = $this->get_tag( $comment, 'wp:comment_author'); $comment_author_email = $this->get_tag( $comment, 'wp:comment_author_email'); $comment_author_IP = $this->get_tag( $comment, 'wp:comment_author_IP'); $comment_author_url = $this->get_tag( $comment, 'wp:comment_author_url'); $comment_date = $this->get_tag( $comment, 'wp:comment_date'); $comment_date_gmt = $this->get_tag( $comment, 'wp:comment_date_gmt'); $comment_content = $this->get_tag( $comment, 'wp:comment_content'); $comment_approved = $this->get_tag( $comment, 'wp:comment_approved'); $comment_type = $this->get_tag( $comment, 'wp:comment_type'); $comment_parent = $this->get_tag( $comment, 'wp:comment_parent'); // if this is a new post we can skip the comment_exists() check if ( !$post_exists || !comment_exists($comment_author, $comment_date) ) { $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_author_IP', 'comment_date', 'comment_date_gmt', 'comment_content', 'comment_approved', 'comment_type', 'comment_parent'); wp_insert_comment($commentdata); $num_comments++; } } } if ( $num_comments ) printf(' '.__ngettext('(%s comment)', '(%s comments)', $num_comments), $num_comments); // Now for post meta preg_match_all('|(.*?)|is', $post, $postmeta); $postmeta = $postmeta[1]; if ( $postmeta) { foreach ($postmeta as $p) { $key = $this->get_tag( $p, 'wp:meta_key' ); $value = $this->get_tag( $p, 'wp:meta_value' ); $value = stripslashes($value); // add_post_meta() will escape. $this->process_post_meta($post_id, $key, $value); } } do_action('import_post_added', $post_id); print "
  • \n"; } function process_post_meta($post_id, $key, $value) { // the filter can return false to skip a particular metadata key $_key = apply_filters('import_post_meta_key', $key); if ( $_key ) { add_post_meta( $post_id, $_key, $value ); do_action('import_post_meta', $post_id, $_key, $value); } } function process_attachment($postdata, $remote_url) { if ($this->fetch_attachments and $remote_url) { printf( __('Importing attachment %s... '), htmlspecialchars($remote_url) ); $upload = $this->fetch_remote_file($postdata, $remote_url); if ( is_wp_error($upload) ) { printf( __('Remote file error: %s'), htmlspecialchars($upload->get_error_message()) ); return $upload; } else { print '('.size_format(filesize($upload['file'])).')'; } if ( $info = wp_check_filetype($upload['file']) ) { $postdata['post_mime_type'] = $info['type']; } else { print __('Invalid file type'); return; } $postdata['guid'] = $upload['url']; // as per wp-admin/includes/upload.php $post_id = wp_insert_attachment($postdata, $upload['file']); wp_update_attachment_metadata( $post_id, wp_generate_attachment_metadata( $post_id, $upload['file'] ) ); // remap the thumbnail url. this isn't perfect because we're just guessing the original url. if ( preg_match('@^image/@', $info['type']) && $thumb_url = wp_get_attachment_thumb_url($post_id) ) { $parts = pathinfo($remote_url); $ext = $parts['extension']; $name = basename($parts['basename'], ".{$ext}"); $this->url_remap[$parts['dirname'] . '/' . $name . '.thumbnail.' . $ext] = $thumb_url; } return $post_id; } else { printf( __('Skipping attachment %s'), htmlspecialchars($remote_url) ); } } function fetch_remote_file($post, $url) { $upload = wp_upload_dir($post['post_date']); // extract the file name and extension from the url $file_name = basename($url); // get placeholder file in the upload dir with a unique sanitized filename $upload = wp_upload_bits( $file_name, 0, '', $post['post_date']); if ( $upload['error'] ) { echo $upload['error']; return new WP_Error( 'upload_dir_error', $upload['error'] ); } // fetch the remote url and write it to the placeholder file $headers = wp_get_http($url, $upload['file']); // make sure the fetch was successful if ( $headers['response'] != '200' ) { @unlink($upload['file']); return new WP_Error( 'import_file_error', sprintf(__('Remote file returned error response %d'), intval($headers['response'])) ); } elseif ( isset($headers['content-length']) && filesize($upload['file']) != $headers['content-length'] ) { @unlink($upload['file']); return new WP_Error( 'import_file_error', __('Remote file is incorrect size') ); } $max_size = $this->max_attachment_size(); if ( !empty($max_size) and filesize($upload['file']) > $max_size ) { @unlink($upload['file']); return new WP_Error( 'import_file_error', sprintf(__('Remote file is too large, limit is %s', size_format($max_size))) ); } // keep track of the old and new urls so we can substitute them later $this->url_remap[$url] = $upload['url']; // if the remote url is redirected somewhere else, keep track of the destination too if ( $headers['x-final-location'] != $url ) $this->url_remap[$headers['x-final-location']] = $upload['url']; return $upload; } // sort by strlen, longest string first function cmpr_strlen($a, $b) { return strlen($b) - strlen($a); } // update url references in post bodies to point to the new local files function backfill_attachment_urls() { // make sure we do the longest urls first, in case one is a substring of another uksort($this->url_remap, array(&$this, 'cmpr_strlen')); global $wpdb; foreach ($this->url_remap as $from_url => $to_url) { // remap urls in post_content $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->posts} SET post_content = REPLACE(post_content, '%s', '%s')", $from_url, $to_url) ); // remap enclosure urls $result = $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->postmeta} SET meta_value = REPLACE(meta_value, '%s', '%s') WHERE meta_key='enclosure'", $from_url, $to_url) ); } } // update the post_parent of orphans now that we know the local id's of all parents function backfill_parents() { global $wpdb; foreach ($this->orphans as $child_id => $parent_id) { $local_child_id = $this->post_ids_processed[$child_id]; $local_parent_id = $this->post_ids_processed[$parent_id]; if ($local_child_id and $local_parent_id) { $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->posts} SET post_parent = %d WHERE ID = %d", $local_parent_id, $local_child_id)); } } } function is_valid_meta_key($key) { // skip _wp_attached_file metadata since we'll regenerate it from scratch if ( $key == '_wp_attached_file' ) return false; return $key; } // give the user the option of creating new users to represent authors in the import file? function allow_create_users() { return apply_filters('import_allow_create_users', true); } // give the user the option of downloading and importing attached files function allow_fetch_attachments() { return apply_filters('import_allow_fetch_attachments', true); } function max_attachment_size() { // can be overridden with a filter - 0 means no limit return apply_filters('import_attachment_size_limit', 0); } function import_start() { wp_defer_term_counting(true); wp_defer_comment_counting(true); do_action('import_start'); } function import_end() { do_action('import_end'); // clear the caches after backfilling foreach ($this->post_ids_processed as $post_id) clean_post_cache($post_id); wp_defer_term_counting(false); wp_defer_comment_counting(false); } function import($id, $fetch_attachments = false) { $this->id = (int) $id; $this->fetch_attachments = ($this->allow_fetch_attachments() && (bool) $fetch_attachments); add_filter('import_post_meta_key', array($this, 'is_valid_meta_key')); $file = get_attached_file($this->id); $this->import_file($file); } function import_file($file) { $this->file = $file; $this->import_start(); $this->get_authors_from_post(); $this->get_entries(); $this->process_categories(); $this->process_tags(); $result = $this->process_posts(); $this->backfill_parents(); $this->backfill_attachment_urls(); $this->import_end(); if ( is_wp_error( $result ) ) return $result; } function handle_upload() { $file = wp_import_handle_upload(); if ( isset($file['error']) ) { echo '

    '.__('Sorry, there has been an error.').'

    '; echo '

    ' . $file['error'] . '

    '; return false; } $this->file = $file['file']; $this->id = (int) $file['id']; return true; } function dispatch() { if (empty ($_GET['step'])) $step = 0; else $step = (int) $_GET['step']; $this->header(); switch ($step) { case 0 : $this->greet(); break; case 1 : check_admin_referer('import-upload'); if ( $this->handle_upload() ) $this->select_authors(); break; case 2: check_admin_referer('import-wordpress'); $result = $this->import( $_GET['id'], $_POST['attachments'] ); if ( is_wp_error( $result ) ) echo $result->get_error_message(); break; } $this->footer(); } function WP_Import() { // Nothing. } } $wp_import = new WP_Import(); register_importer('wordpress', 'WordPress', __('Import posts, comments, custom fields, pages, and categories from a WordPress export file.'), array ($wp_import, 'dispatch')); ?> wp/dev/wp-admin/import/greymatter.php0000644000106600010660000002522111007310722015117 0ustar '; echo '

    '.__('Import GreyMatter').'

    '; } function footer() { echo ''; } function greet() { $this->header(); ?>

    • If authors are found not to be in gm-authors.cgi, imports them at level 0.') ?>

     


    so you need to enter the number of the last GM post here.
    (if you don't know that number, just log into your FTP and look it out
    in the entries' folder)") ?>

    footer(); } function gm2autobr($string) { // transforms GM's |*| into b2's
    \n $string = str_replace("|*|","
    \n",$string); return($string); } function import() { global $wpdb; $wpvarstoreset = array('gmpath', 'archivespath', 'lastentry'); for ($i=0; $iheader(); ?>

      • escape($userdata[0]); $pass1=$wpdb->escape($userdata[1]); $user_nickname=$wpdb->escape($userdata[0]); $user_email=$wpdb->escape($userdata[2]); $user_url=$wpdb->escape($userdata[3]); $user_joindate=$wpdb->escape($user_joindate); $user_id = username_exists($user_login); if ($user_id) { printf('
      • '.__('user %s').''.__('Already exists').'
      • ', "$user_login"); $this->gmnames[$userdata[0]] = $user_id; continue; } $user_info = array("user_login"=>"$user_login", "user_pass"=>"$pass1", "user_nickname"=>"$user_nickname", "user_email"=>"$user_email", "user_url"=>"$user_url", "user_ip"=>"$user_ip", "user_domain"=>"$user_domain", "user_browser"=>"$user_browser", "dateYMDhour"=>"$user_joindate", "user_level"=>"1", "user_idmode"=>"nickname"); $user_id = wp_insert_user($user_info); $this->gmnames[$userdata[0]] = $user_id; printf('
      • '.__('user %s...').' '.__('Done').'
      • ', "$user_login"); } ?>

      • gm2autobr($entry[2]); $postmorecontent=$this->gm2autobr($entry[3]); $post_author=trim($wpdb->escape($postinfo[1])); $post_title=$this->gm2autobr($postinfo[2]); printf('
      • '.__('entry # %s : %s : by %s'), $entryfile, $post_title, $postinfo[1]); $post_title=$wpdb->escape($post_title); $postyear=$postinfo[6]; $postmonth=zeroise($postinfo[4],2); $postday=zeroise($postinfo[5],2); $posthour=zeroise($postinfo[7],2); $postminute=zeroise($postinfo[8],2); $postsecond=zeroise($postinfo[9],2); if (($postinfo[10]=="PM") && ($posthour!="12")) $posthour=$posthour+12; $post_date="$postyear-$postmonth-$postday $posthour:$postminute:$postsecond"; $post_content=$postmaincontent; if (strlen($postmorecontent)>3) $post_content .= "

        ".$postmorecontent; $post_content=$wpdb->escape($post_content); $post_karma=$postinfo[12]; $post_status = 'publish'; //in greymatter, there are no drafts $comment_status = 'open'; $ping_status = 'closed'; if ($post_ID = post_exists($post_title, '', $post_date)) { echo ' '; _e('(already exists)'); } else { //just so that if a post already exists, new users are not created by checkauthor // we'll check the author is registered, or if it's a deleted author $user_id = username_exists($post_author); if (!$user_id) { // if deleted from GM, we register the author as a level 0 user $user_ip="127.0.0.1"; $user_domain="localhost"; $user_browser="server"; $user_joindate="1979-06-06 00:41:00"; $user_login=$wpdb->escape($post_author); $pass1=$wpdb->escape("password"); $user_nickname=$wpdb->escape($post_author); $user_email=$wpdb->escape("user@deleted.com"); $user_url=$wpdb->escape(""); $user_joindate=$wpdb->escape($user_joindate); $user_info = array("user_login"=>$user_login, "user_pass"=>$pass1, "user_nickname"=>$user_nickname, "user_email"=>$user_email, "user_url"=>$user_url, "user_ip"=>$user_ip, "user_domain"=>$user_domain, "user_browser"=>$user_browser, "dateYMDhour"=>$user_joindate, "user_level"=>0, "user_idmode"=>"nickname"); $user_id = wp_insert_user($user_info); $this->gmnames[$postinfo[1]] = $user_id; echo ': '; printf(__('registered deleted user %s at level 0 '), "$user_login"); } if (array_key_exists($postinfo[1], $this->gmnames)) { $post_author = $this->gmnames[$postinfo[1]]; } else { $post_author = $user_id; } $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'comment_status', 'ping_status', 'post_modified', 'post_modified_gmt'); $post_ID = wp_insert_post($postdata); if ( is_wp_error( $post_ID ) ) return $post_ID; } $c=count($entry); if ($c>4) { $numAddedComments = 0; $numComments = 0; for ($j=4;$j<$c;$j++) { $entry[$j]=$this->gm2autobr($entry[$j]); $commentinfo=explode("|",$entry[$j]); $comment_post_ID=$post_ID; $comment_author=$wpdb->escape($commentinfo[0]); $comment_author_email=$wpdb->escape($commentinfo[2]); $comment_author_url=$wpdb->escape($commentinfo[3]); $comment_author_IP=$wpdb->escape($commentinfo[1]); $commentyear=$commentinfo[7]; $commentmonth=zeroise($commentinfo[5],2); $commentday=zeroise($commentinfo[6],2); $commenthour=zeroise($commentinfo[8],2); $commentminute=zeroise($commentinfo[9],2); $commentsecond=zeroise($commentinfo[10],2); if (($commentinfo[11]=="PM") && ($commenthour!="12")) $commenthour=$commenthour+12; $comment_date="$commentyear-$commentmonth-$commentday $commenthour:$commentminute:$commentsecond"; $comment_content=$wpdb->escape($commentinfo[12]); if (!comment_exists($comment_author, $comment_date)) { $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_author_IP', 'comment_date', 'comment_content', 'comment_approved'); $commentdata = wp_filter_comment($commentdata); wp_insert_comment($commentdata); $numAddedComments++; } $numComments++; } if ($numAddedComments > 0) { echo ': '; printf( __ngettext('imported %s comment', 'imported %s comments', $numAddedComments) , $numAddedComments); } $preExisting = $numComments - numAddedComments; if ($preExisting > 0) { echo ' '; printf( __ngettext( 'ignored %s pre-existing comment', 'ignored %s pre-existing comments', $preExisting ) , $preExisting); } } echo '... '.__('Done').'
      • '; } } do_action('import_done', 'greymatter'); ?>

     

    footer(); return; } function dispatch() { if (empty ($_GET['step'])) $step = 0; else $step = (int) $_GET['step']; switch ($step) { case 0 : $this->greet(); break; case 1: check_admin_referer('import-greymatter'); $result = $this->import(); if ( is_wp_error( $result ) ) echo $result->get_error_message(); break; } } function GM_Import() { // Nothing. } } $gm_import = new GM_Import(); register_importer('greymatter', __('GreyMatter'), __('Import users, posts, and comments from a Greymatter blog.'), array ($gm_import, 'dispatch')); ?> wp/dev/wp-admin/import/utw.php0000644000106600010660000001504210761355210013562 0ustar '; echo '

    '.__('Import Ultimate Tag Warrior').'

    '; echo '

    '.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'

    '; } function footer() { echo ''; } function greet() { echo '
    '; echo '

    '.__('Howdy! This imports tags from Ultimate Tag Warrior 3 into WordPress tags.').'

    '; echo '

    '.__('This has not been tested on any other versions of Ultimate Tag Warrior. Mileage may vary.').'

    '; echo '

    '.__('To accommodate larger databases for those tag-crazy authors out there, we have made this into an easy 5-step program to help you kick that nasty UTW habit. Just keep clicking along and we will let you know when you are in the clear!').'

    '; echo '

    '.__('Don’t be stupid - backup your database before proceeding!').'

    '; echo '
    '; echo '

    '; echo '
    '; echo '
    '; } function dispatch () { if ( empty( $_GET['step'] ) ) { $step = 0; } else { $step = (int) $_GET['step']; } if ( $step > 1 ) check_admin_referer('import-utw'); // load the header $this->header(); switch ( $step ) { case 0 : $this->greet(); break; case 1 : $this->import_tags(); break; case 2 : $this->import_posts(); break; case 3: $this->import_t2p(); break; case 4: $this->cleanup_import(); break; } // load the footer $this->footer(); } function import_tags ( ) { echo '
    '; echo '

    '.__('Reading UTW Tags…').'

    '; $tags = $this->get_utw_tags(); // if we didn't get any tags back, that's all there is folks! if ( !is_array($tags) ) { echo '

    ' . __('No Tags Found!') . '

    '; return false; } else { // if there's an existing entry, delete it if ( get_option('utwimp_tags') ) { delete_option('utwimp_tags'); } add_option('utwimp_tags', $tags); $count = count($tags); echo '

    ' . sprintf( __ngettext('Done! %s tag were read.', 'Done! %s tags were read.', $count), $count ) . '

    '; echo '

    ' . __('The following tags were found:') . '

    '; echo '
      '; foreach ( $tags as $tag_id => $tag_name ) { echo '
    • ' . $tag_name . '
    • '; } echo '
    '; echo '
    '; echo '

    ' . __('If you don’t want to import any of these tags, you should delete them from the UTW tag management page and then re-run this import.') . '

    '; } echo '
    '; wp_nonce_field('import-utw'); echo '

    '; echo '
    '; echo '
    '; } function import_posts ( ) { echo '
    '; echo '

    '.__('Reading UTW Post Tags…').'

    '; // read in all the UTW tag -> post settings $posts = $this->get_utw_posts(); // if we didn't get any tags back, that's all there is folks! if ( !is_array($posts) ) { echo '

    ' . __('No posts were found to have tags!') . '

    '; return false; } else { // if there's an existing entry, delete it if ( get_option('utwimp_posts') ) { delete_option('utwimp_posts'); } add_option('utwimp_posts', $posts); $count = count($posts); echo '

    ' . sprintf( __ngettext('Done! %s tag to post relationships were read.', 'Done! %s tags to post relationships were read.', $count), $count ) . '

    '; } echo '
    '; wp_nonce_field('import-utw'); echo '

    '; echo '
    '; echo '
    '; } function import_t2p ( ) { echo '
    '; echo '

    '.__('Adding Tags to Posts…').'

    '; // run that funky magic! $tags_added = $this->tag2post(); echo '

    ' . sprintf( __ngettext( 'Done! %s tag were added!', 'Done! %s tags were added!', $tags_added ), $tags_added ) . '

    '; echo '
    '; wp_nonce_field('import-utw'); echo '

    '; echo '
    '; echo '
    '; } function get_utw_tags ( ) { global $wpdb; // read in all the tags from the UTW tags table: should be wp_tags $tags_query = "SELECT tag_id, tag FROM " . $wpdb->prefix . "tags"; $tags = $wpdb->get_results($tags_query); // rearrange these tags into something we can actually use foreach ( $tags as $tag ) { $new_tags[$tag->tag_id] = $tag->tag; } return $new_tags; } function get_utw_posts ( ) { global $wpdb; // read in all the posts from the UTW post->tag table: should be wp_post2tag $posts_query = "SELECT tag_id, post_id FROM " . $wpdb->prefix . "post2tag"; $posts = $wpdb->get_results($posts_query); return $posts; } function tag2post ( ) { // get the tags and posts we imported in the last 2 steps $tags = get_option('utwimp_tags'); $posts = get_option('utwimp_posts'); // null out our results $tags_added = 0; // loop through each post and add its tags to the db foreach ( $posts as $this_post ) { $the_post = (int) $this_post->post_id; $the_tag = (int) $this_post->tag_id; // what's the tag name for that id? $the_tag = $tags[$the_tag]; // screw it, just try to add the tag wp_add_post_tags($the_post, $the_tag); $tags_added++; } // that's it, all posts should be linked to their tags properly, pending any errors we just spit out! return $tags_added; } function cleanup_import ( ) { delete_option('utwimp_tags'); delete_option('utwimp_posts'); $this->done(); } function done ( ) { echo '
    '; echo '

    '.__('Import Complete!').'

    '; echo '

    ' . __('OK, so we lied about this being a 5-step program! You’re done!') . '

    '; echo '

    ' . __('Now wasn’t that easy?') . '

    '; echo '
    '; } function UTW_Import ( ) { // Nothing. } } // create the import object $utw_import = new UTW_Import(); // add it to the import page! register_importer('utw', 'Ultimate Tag Warrior', __('Import Ultimate Tag Warrior tags into WordPress tags.'), array($utw_import, 'dispatch')); ?> wp/dev/wp-admin/import/wp-cat2tag.php0000644000106600010660000004110111034525602014705 0ustar '; if ( ! current_user_can('manage_categories') ) { echo '
    '; echo '

    ' . __('Cheatin’ uh?') . '

    '; echo '
    '; } else { ?>

    '; } function populate_cats() { $categories = get_categories('get=all'); foreach ( $categories as $category ) { $this->all_categories[] = $category; if ( is_term( $category->slug, 'post_tag' ) ) $this->hybrids_ids[] = $category->term_id; } } function populate_tags() { $tags = get_terms( array('post_tag'), 'get=all' ); foreach ( $tags as $tag ) { $this->all_tags[] = $tag; if ( is_term( $tag->slug, 'category' ) ) $this->hybrids_ids[] = $tag->term_id; } } function categories_tab() { $this->populate_cats(); $cat_num = count($this->all_categories); echo '
    '; if ( $cat_num > 0 ) { echo '

    ' . sprintf( __ngettext( 'Convert Category to Tag.', 'Convert Categories (%d) to Tags.', $cat_num ), $cat_num ) . '

    '; echo '
    '; echo '

    ' . __('Hey there. Here you can selectively convert existing categories to tags. To get started, check the categories you wish to be converted, then click the Convert button.') . '

    '; echo '

    ' . __('Keep in mind that if you convert a category with child categories, the children become top-level orphans.') . '

    '; $this->categories_form(); } else { echo '

    '.__('You have no categories to convert!').'

    '; } } function categories_form() { ?>

      all_categories as $category) { $category = sanitize_term( $category, 'category', 'display' ); if ( (int) $category->parent == 0 ) { ?>
    • term_id), $this->hybrids_ids ) ) echo ' * '; if ( isset($hier[$category->term_id]) ) $this->_category_children($category, $hier); ?>
    hybrids_ids) ) echo '

    ' . __('* This category is also a tag. Converting it will add that tag to all posts that are currently in the category.') . '

    '; ?>

    populate_tags(); $tags_num = count($this->all_tags); echo '
    '; if ( $tags_num > 0 ) { echo '

    ' . sprintf( __ngettext( 'Convert Tag to Category.', 'Convert Tags (%d) to Categories.', $tags_num ), $tags_num ) . '

    '; echo '
    '; echo '

    ' . __('Here you can selectively converts existing tags to categories. To get started, check the tags you wish to be converted, then click the Convert button.') . '

    '; echo '

    ' . __('The newly created categories will still be associated with the same posts.') . '

    '; $this->tags_form(); } else { echo '

    '.__('You have no tags to convert!').'

    '; } } function tags_form() { ?>

      all_tags as $tag ) { ?>
    • term_id), $this->hybrids_ids ) ) echo ' * '; ?>
    hybrids_ids) ) echo '

    ' . __('* This tag is also a category. When converted, all posts associated with the tag will also be in the category.') . '

    '; ?>

      term_id] as $child_id) { $child =& get_category($child_id); ?>
    • term_id), $this->hybrids_ids ) ) echo ' * '; if ( isset($hier[$child->term_id]) ) $this->_category_children($child, $hier); ?>
    categories_to_convert)) { ?>

    try again.'), 'admin.php?import=wp-cat2tag'); ?>

    categories_to_convert) ) $this->categories_to_convert = $_POST['cats_to_convert']; $hier = _get_term_hierarchy('category'); $hybrid_cats = $clear_parents = $parents = false; $clean_term_cache = $clean_cat_cache = array(); $default_cat = get_option('default_category'); echo '
      '; foreach ( (array) $this->categories_to_convert as $cat_id) { $cat_id = (int) $cat_id; if ( ! $this->_category_exists($cat_id) ) { echo '
    • ' . sprintf( __('Category %s doesn\'t exist!'), $cat_id ) . "
    • \n"; } else { $category =& get_category($cat_id); echo '
    • ' . sprintf(__('Converting category %s ... '), $category->name); // If the category is the default, leave category in place and create tag. if ( $default_cat == $category->term_id ) { if ( ! ($id = is_term( $category->slug, 'post_tag' ) ) ) $id = wp_insert_term($category->name, 'post_tag', array('slug' => $category->slug)); $id = $id['term_taxonomy_id']; $posts = get_objects_in_term($category->term_id, 'category'); $term_order = 0; foreach ( $posts as $post ) { $values[] = $wpdb->prepare( "(%d, %d, %d)", $post, $id, $term_order); clean_post_cache($post); } if ( $values ) { $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join(',', $values) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)"); $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET count = %d WHERE term_id = %d AND taxonomy = 'post_tag'", $category->count, $category->term_id) ); } echo __('Converted successfully.') . "
    • \n"; continue; } // if tag already exists, add it to all posts in the category if ( $tag_ttid = $wpdb->get_var( $wpdb->prepare("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'post_tag'", $category->term_id) ) ) { $objects_ids = get_objects_in_term($category->term_id, 'category'); $tag_ttid = (int) $tag_ttid; $term_order = 0; foreach ( $objects_ids as $object_id ) $values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $tag_ttid, $term_order); if ( $values ) { $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join(',', $values) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)"); $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $tag_ttid) ); $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET count = %d WHERE term_id = %d AND taxonomy = 'post_tag'", $count, $category->term_id) ); } echo __('Tag added to all posts in this category.') . " *\n"; $hybrid_cats = true; $clean_term_cache[] = $category->term_id; $clean_cat_cache[] = $category->term_id; continue; } $tt_ids = $wpdb->get_col( $wpdb->prepare("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'category'", $category->term_id) ); if ( $tt_ids ) { $posts = $wpdb->get_col("SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id IN (" . join(',', $tt_ids) . ") GROUP BY object_id"); foreach ( (array) $posts as $post ) clean_post_cache($post); } // Change the category to a tag. $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET taxonomy = 'post_tag' WHERE term_id = %d AND taxonomy = 'category'", $category->term_id) ); // Set all parents to 0 (root-level) if their parent was the converted tag $parents = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET parent = 0 WHERE parent = %d AND taxonomy = 'category'", $category->term_id) ); if ( $parents ) $clear_parents = true; $clean_cat_cache[] = $category->term_id; echo __('Converted successfully.') . "\n"; } } echo '
    '; if ( ! empty($clean_term_cache) ) { $clean_term_cache = array_unique(array_values($clean_term_cache)); foreach ( $clean_term_cache as $id ) wp_cache_delete($id, 'post_tag'); } if ( ! empty($clean_cat_cache) ) { $clean_cat_cache = array_unique(array_values($clean_cat_cache)); foreach ( $clean_cat_cache as $id ) wp_cache_delete($id, 'category'); } if ( $clear_parents ) delete_option('category_children'); if ( $hybrid_cats ) echo '

    ' . sprintf( __('* This category is also a tag. The converter has added that tag to all posts currently in the category. If you want to remove it, please confirm that all tags were added successfully, then delete it from the Manage Categories page.'), 'categories.php') . '

    '; echo '

    ' . sprintf( __('We’re all done here, but you can always convert more.'), 'admin.php?import=wp-cat2tag' ) . '

    '; } function convert_tags() { global $wpdb; if ( (!isset($_POST['tags_to_convert']) || !is_array($_POST['tags_to_convert'])) && empty($this->tags_to_convert)) { echo '
    '; echo '

    ' . sprintf(__('Uh, oh. Something didn’t work. Please try again.'), 'admin.php?import=wp-cat2tag&step=3') . '

    '; echo '
    '; return; } if ( empty($this->tags_to_convert) ) $this->tags_to_convert = $_POST['tags_to_convert']; $hybrid_tags = $clear_parents = false; $clean_cat_cache = $clean_term_cache = array(); $default_cat = get_option('default_category'); echo '
      '; foreach ( (array) $this->tags_to_convert as $tag_id) { $tag_id = (int) $tag_id; if ( $tag = get_term( $tag_id, 'post_tag' ) ) { printf('
    • ' . __('Converting tag %s ... '), $tag->name); if ( $cat_ttid = $wpdb->get_var( $wpdb->prepare("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'category'", $tag->term_id) ) ) { $objects_ids = get_objects_in_term($tag->term_id, 'post_tag'); $cat_ttid = (int) $cat_ttid; $term_order = 0; foreach ( $objects_ids as $object_id ) { $values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $cat_ttid, $term_order); clean_post_cache($object_id); } if ( $values ) { $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join(',', $values) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)"); if ( $default_cat != $tag->term_id ) { $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $tag->term_id) ); $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET count = %d WHERE term_id = %d AND taxonomy = 'category'", $count, $tag->term_id) ); } } $hybrid_tags = true; $clean_term_cache[] = $tag->term_id; $clean_cat_cache[] = $tag->term_id; echo __('All posts were added to the category with the same name.') . " *
    • \n"; continue; } // Change the tag to a category. $parent = $wpdb->get_var( $wpdb->prepare("SELECT parent FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'post_tag'", $tag->term_id) ); if ( 0 == $parent || (0 < (int) $parent && $this->_category_exists($parent)) ) { $reset_parent = ''; $clear_parents = true; } else $reset_parent = ", parent = '0'"; $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET taxonomy = 'category' $reset_parent WHERE term_id = %d AND taxonomy = 'post_tag'", $tag->term_id) ); $clean_term_cache[] = $tag->term_id; $clean_cat_cache[] = $cat['term_id']; echo __('Converted successfully.') . "\n"; } else { printf( '
    • ' . __('Tag #%s doesn\'t exist!') . "
    • \n", $tag_id ); } } if ( ! empty($clean_term_cache) ) { $clean_term_cache = array_unique(array_values($clean_term_cache)); foreach ( $clean_term_cache as $id ) wp_cache_delete($id, 'post_tag'); } if ( ! empty($clean_cat_cache) ) { $clean_cat_cache = array_unique(array_values($clean_cat_cache)); foreach ( $clean_cat_cache as $id ) wp_cache_delete($id, 'category'); } if ( $clear_parents ) delete_option('category_children'); echo '
    '; if ( $hybrid_tags ) echo '

    ' . sprintf( __('* This tag is also a category. The converter has added all posts from it to the category. If you want to remove it, please confirm that all posts were added successfully, then delete it from the Manage Tags page.'), 'edit-tags.php') . '

    '; echo '

    ' . sprintf( __('We’re all done here, but you can always convert more.'), 'admin.php?import=wp-cat2tag&step=3' ) . '

    '; } function init() { $step = (isset($_GET['step'])) ? (int) $_GET['step'] : 1; $this->header(); if ( current_user_can('manage_categories') ) { switch ($step) { case 1 : $this->categories_tab(); break; case 2 : check_admin_referer('import-cat2tag'); $this->convert_categories(); break; case 3 : $this->tags_tab(); break; case 4 : check_admin_referer('import-cat2tag'); $this->convert_tags(); break; } } $this->footer(); } function WP_Categories_to_Tags() { // Do nothing. } } $wp_cat2tag_importer = new WP_Categories_to_Tags(); register_importer('wp-cat2tag', __('Categories and Tags Converter'), __('Convert existing categories to tags or tags to categories, selectively.'), array(&$wp_cat2tag_importer, 'init')); ?> wp/dev/wp-admin/import/blogware.php0000644000106600010660000001417010762036130014544 0ustar '; echo '

    '.__('Import Blogware').'

    '; } function footer() { echo ''; } function unhtmlentities($string) { // From php.net for < 4.3 compat $trans_tbl = get_html_translation_table(HTML_ENTITIES); $trans_tbl = array_flip($trans_tbl); return strtr($string, $trans_tbl); } function greet() { echo '
    '; echo '

    '.__('Howdy! This importer allows you to extract posts from Blogware XML export file into your blog. Pick a Blogware file to upload and click Import.').'

    '; wp_import_upload_form("admin.php?import=blogware&step=1"); echo '
    '; } function import_posts() { global $wpdb, $current_user; set_magic_quotes_runtime(0); $importdata = file($this->file); // Read the file into an array $importdata = implode('', $importdata); // squish it $importdata = str_replace(array ("\r\n", "\r"), "\n", $importdata); preg_match_all('|(]+>(.*?))|is', $importdata, $posts); $posts = $posts[1]; unset($importdata); echo '
      '; foreach ($posts as $post) { flush(); preg_match('||is', $post, $post_type); $post_type = $post_type[1]; if($post_type == "photo") { preg_match('|(.*?)|is', $post, $post_title); } else { preg_match('|(.*?)|is', $post, $post_title); } $post_title = $wpdb->escape(trim($post_title[1])); preg_match('|(.*?)|is', $post, $post_date); $post_date = strtotime($post_date[1]); $post_date = gmdate('Y-m-d H:i:s', $post_date); preg_match_all('|(.*?)|is', $post, $categories); $categories = $categories[1]; $cat_index = 0; foreach ($categories as $category) { $categories[$cat_index] = $wpdb->escape($this->unhtmlentities($category)); $cat_index++; } if(strcasecmp($post_type, "photo") === 0) { preg_match('|(.*?)|is', $post, $post_content); $post_content = ''; $post_content = $this->unhtmlentities($post_content); } else { preg_match('|(.*?)|is', $post, $post_content); $post_content = str_replace(array (''), '', trim($post_content[1])); $post_content = $this->unhtmlentities($post_content); } // Clean up content $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content); $post_content = str_replace('
      ', '
      ', $post_content); $post_content = str_replace('
      ', '
      ', $post_content); $post_content = $wpdb->escape($post_content); $post_author = $current_user->ID; preg_match('|(.*?)|is', $post, $post_status); $post_status = trim($post_status[1]); echo '
    1. '; if ($post_id = post_exists($post_title, $post_content, $post_date)) { printf(__('Post %s already exists.'), stripslashes($post_title)); } else { printf(__('Importing post %s...'), stripslashes($post_title)); $postdata = compact('post_author', 'post_date', 'post_content', 'post_title', 'post_status'); $post_id = wp_insert_post($postdata); if ( is_wp_error( $post_id ) ) { return $post_id; } if (!$post_id) { _e("Couldn't get post ID"); echo '
    2. '; break; } if(0 != count($categories)) wp_create_categories($categories, $post_id); } preg_match_all('|(.*?)|is', $post, $comments); $comments = $comments[1]; if ( $comments ) { $comment_post_ID = (int) $post_id; $num_comments = 0; foreach ($comments as $comment) { preg_match('|(.*?)|is', $comment, $comment_content); $comment_content = str_replace(array (''), '', trim($comment_content[1])); $comment_content = $this->unhtmlentities($comment_content); // Clean up content $comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content); $comment_content = str_replace('
      ', '
      ', $comment_content); $comment_content = str_replace('
      ', '
      ', $comment_content); $comment_content = $wpdb->escape($comment_content); preg_match('|(.*?)|is', $comment, $comment_date); $comment_date = trim($comment_date[1]); $comment_date = date('Y-m-d H:i:s', strtotime($comment_date)); preg_match('|(.*?)|is', $comment, $comment_author); $comment_author = $wpdb->escape(trim($comment_author[1])); $comment_author_email = NULL; $comment_approved = 1; // Check if it's already there if (!comment_exists($comment_author, $comment_date)) { $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_date', 'comment_content', 'comment_approved'); $commentdata = wp_filter_comment($commentdata); wp_insert_comment($commentdata); $num_comments++; } } } if ( $num_comments ) { echo ' '; printf( __ngettext('%s comment', '%s comments', $num_comments), $num_comments ); } echo ''; flush(); ob_flush(); } echo '
    '; } function import() { $file = wp_import_handle_upload(); if ( isset($file['error']) ) { echo $file['error']; return; } $this->file = $file['file']; $result = $this->import_posts(); if ( is_wp_error( $result ) ) return $result; wp_import_cleanup($file['id']); do_action('import_done', 'blogware'); echo '

    '; printf(__('All done. Have fun!'), get_option('home')); echo '

    '; } function dispatch() { if (empty ($_GET['step'])) $step = 0; else $step = (int) $_GET['step']; $this->header(); switch ($step) { case 0 : $this->greet(); break; case 1 : $result = $this->import(); if ( is_wp_error( $result ) ) $result->get_error_message(); break; } $this->footer(); } function BW_Import() { // Nothing. } } $blogware_import = new BW_Import(); register_importer('blogware', __('Blogware'), __('Import posts from Blogware.'), array ($blogware_import, 'dispatch')); ?> wp/dev/wp-admin/import/stp.php0000644000106600010660000001136210762341150013551 0ustar '; echo '

    '.__('Import Simple Tagging').'

    '; echo '

    '.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'

    '; } function footer() { echo ''; } function greet() { echo '
    '; echo '

    '.__('Howdy! This imports tags from Simple Tagging 1.6.2 into WordPress tags.').'

    '; echo '

    '.__('This has not been tested on any other versions of Simple Tagging. Mileage may vary.').'

    '; echo '

    '.__('To accommodate larger databases for those tag-crazy authors out there, we have made this into an easy 4-step program to help you kick that nasty Simple Tagging habit. Just keep clicking along and we will let you know when you are in the clear!').'

    '; echo '

    '.__('Don’t be stupid - backup your database before proceeding!').'

    '; echo '
    '; wp_nonce_field('import-stp'); echo '

    '; echo '
    '; echo '
    '; } function dispatch () { if ( empty( $_GET['step'] ) ) { $step = 0; } else { $step = (int) $_GET['step']; } // load the header $this->header(); switch ( $step ) { case 0 : $this->greet(); break; case 1 : check_admin_referer('import-stp'); $this->import_posts(); break; case 2: check_admin_referer('import-stp'); $this->import_t2p(); break; case 3: check_admin_referer('import-stp'); $this->cleanup_import(); break; } // load the footer $this->footer(); } function import_posts ( ) { echo '
    '; echo '

    '.__('Reading STP Post Tags…').'

    '; // read in all the STP tag -> post settings $posts = $this->get_stp_posts(); // if we didn't get any tags back, that's all there is folks! if ( !is_array($posts) ) { echo '

    ' . __('No posts were found to have tags!') . '

    '; return false; } else { // if there's an existing entry, delete it if ( get_option('stpimp_posts') ) { delete_option('stpimp_posts'); } add_option('stpimp_posts', $posts); $count = count($posts); echo '

    ' . sprintf( __ngettext('Done! %s tag to post relationships were read.', 'Done! %s tags to post relationships were read.', $count), $count ) . '

    '; } echo '
    '; wp_nonce_field('import-stp'); echo '

    '; echo '
    '; echo '
    '; } function import_t2p ( ) { echo '
    '; echo '

    '.__('Adding Tags to Posts…').'

    '; // run that funky magic! $tags_added = $this->tag2post(); echo '

    ' . sprintf( __ngettext('Done! %s tag was added!', 'Done! %s tags were added!', $tags_added), $tags_added ) . '

    '; echo '
    '; wp_nonce_field('import-stp'); echo '

    '; echo '
    '; echo '
    '; } function get_stp_posts ( ) { global $wpdb; // read in all the posts from the STP post->tag table: should be wp_post2tag $posts_query = "SELECT post_id, tag_name FROM " . $wpdb->prefix . "stp_tags"; $posts = $wpdb->get_results($posts_query); return $posts; } function tag2post ( ) { global $wpdb; // get the tags and posts we imported in the last 2 steps $posts = get_option('stpimp_posts'); // null out our results $tags_added = 0; // loop through each post and add its tags to the db foreach ( $posts as $this_post ) { $the_post = (int) $this_post->post_id; $the_tag = $wpdb->escape($this_post->tag_name); // try to add the tag wp_add_post_tags($the_post, $the_tag); $tags_added++; } // that's it, all posts should be linked to their tags properly, pending any errors we just spit out! return $tags_added; } function cleanup_import ( ) { delete_option('stpimp_posts'); $this->done(); } function done ( ) { echo '
    '; echo '

    '.__('Import Complete!').'

    '; echo '

    ' . __('OK, so we lied about this being a 4-step program! You’re done!') . '

    '; echo '

    ' . __('Now wasn’t that easy?') . '

    '; echo '
    '; } function STP_Import ( ) { // Nothing. } } // create the import object $stp_import = new STP_Import(); // add it to the import page! register_importer('stp', 'Simple Tagging', __('Import Simple Tagging tags into WordPress tags.'), array($stp_import, 'dispatch')); ?> wp/dev/wp-admin/import/mt.php0000644000106600010660000003544411017045414013370 0ustar '; echo '

    '.__('Import Movable Type or TypePad').'

    '; } function footer() { echo ''; } function greet() { $this->header(); ?>

    mt-export.txt in your /wp-content/ directory and then click "Import mt-export.txt"'); ?>

    mt-export.txt in your /wp-content/ directory'); ?>

    out of memory error try splitting up the import file into pieces.'); ?>

    footer(); } function users_form($n) { global $wpdb, $testing; $users = $wpdb->get_results("SELECT * FROM $wpdb->users ORDER BY ID"); ?> mtnames))) { //a new mt author name is found ++ $this->j; $this->mtnames[$this->j] = $author; //add that new mt author name to an array $user_id = username_exists($this->newauthornames[$this->j]); //check if the new author name defined by the user is a pre-existing wp user if (!$user_id) { //banging my head against the desk now. if ($newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname $user_id = wp_create_user($author, $pass); $this->newauthornames[$this->j] = $author; //now we have a name, in the place of left_blank. } else { $user_id = wp_create_user($this->newauthornames[$this->j], $pass); } } else { return $user_id; // return pre-existing wp username if it exists } } else { $key = array_search($author, $this->mtnames); //find the array key for $author in the $mtnames array $user_id = username_exists($this->newauthornames[$key]); //use that key to get the value of the author's name from $newauthornames } return $user_id; } function get_mt_authors() { $temp = array(); $authors = array(); $handle = fopen($this->file, 'r'); if ( $handle == null ) return false; $in_comment = false; while ( $line = fgets($handle) ) { $line = trim($line); if ( 'COMMENT:' == $line ) $in_comment = true; else if ( '-----' == $line ) $in_comment = false; if ( $in_comment || 0 !== strpos($line,"AUTHOR:") ) continue; $temp[] = trim( substr($line, strlen("AUTHOR:")) ); } //we need to find unique values of author names, while preserving the order, so this function emulates the unique_value(); php function, without the sorting. $authors[0] = array_shift($temp); $y = count($temp) + 1; for ($x = 1; $x < $y; $x ++) { $next = array_shift($temp); if (!(in_array($next, $authors))) array_push($authors, "$next"); } fclose($handle); return $authors; } function get_authors_from_post() { $formnames = array (); $selectnames = array (); foreach ($_POST['user'] as $key => $line) { $newname = trim(stripslashes($line)); if ($newname == '') $newname = 'left_blank'; //passing author names from step 1 to step 2 is accomplished by using POST. left_blank denotes an empty entry in the form. array_push($formnames, "$newname"); } // $formnames is the array with the form entered names foreach ($_POST['userselect'] as $user => $key) { $selected = trim(stripslashes($key)); array_push($selectnames, "$selected"); } $count = count($formnames); for ($i = 0; $i < $count; $i ++) { if ($selectnames[$i] != '#NONE#') { //if no name was selected from the select menu, use the name entered in the form array_push($this->newauthornames, "$selectnames[$i]"); } else { array_push($this->newauthornames, "$formnames[$i]"); } } } function mt_authors_form() { ?>

    italics. For each of these names, you can either pick an author in your WordPress installation from the menu, or enter a name for the author in the textbox.'); ?>

    get_mt_authors(); echo '
      '; echo '
      '; wp_nonce_field('import-mt'); $j = -1; foreach ($authors as $author) { ++ $j; echo '
    1. '; } echo ''.'
      '; echo '
      '; echo '
    '; } function select_authors() { if ( $_POST['upload_type'] === 'ftp' ) { $file['file'] = WP_CONTENT_DIR . '/mt-export.txt'; if ( !file_exists($file['file']) ) $file['error'] = __('mt-export.txt does not exist'); } else { $file = wp_import_handle_upload(); } if ( isset($file['error']) ) { $this->header(); echo '

    '.__('Sorry, there has been an error').'.

    '; echo '

    ' . $file['error'] . '

    '; $this->footer(); return; } $this->file = $file['file']; $this->id = (int) $file['id']; $this->mt_authors_form(); } function save_post(&$post, &$comments, &$pings) { // Reset the counter set_time_limit(30); $post = get_object_vars($post); $post = add_magic_quotes($post); $post = (object) $post; if ( $post_id = post_exists($post->post_title, '', $post->post_date) ) { echo '
  • '; printf(__('Post %s already exists.'), stripslashes($post->post_title)); } else { echo '
  • '; printf(__('Importing post %s...'), stripslashes($post->post_title)); if ( '' != trim( $post->extended ) ) $post->post_content .= "\n\n$post->extended"; $post->post_author = $this->checkauthor($post->post_author); //just so that if a post already exists, new users are not created by checkauthor $post_id = wp_insert_post($post); if ( is_wp_error( $post_id ) ) return $post_id; // Add categories. if ( 0 != count($post->categories) ) { wp_create_categories($post->categories, $post_id); } // Add tags or keywords if ( 1 < strlen($post->post_keywords) ) { // Keywords exist. printf(__('
    Adding tags %s...'), stripslashes($post->post_keywords)); wp_add_post_tags($post_id, $post->post_keywords); } } $num_comments = 0; foreach ( $comments as $comment ) { $comment = get_object_vars($comment); $comment = add_magic_quotes($comment); if ( !comment_exists($comment['comment_author'], $comment['comment_date'])) { $comment['comment_post_ID'] = $post_id; $comment = wp_filter_comment($comment); wp_insert_comment($comment); $num_comments++; } } if ( $num_comments ) printf(' '.__ngettext('(%s comment)', '(%s comments)', $num_comments), $num_comments); $num_pings = 0; foreach ( $pings as $ping ) { $ping = get_object_vars($ping); $ping = add_magic_quotes($ping); if ( !comment_exists($ping['comment_author'], $ping['comment_date'])) { $ping['comment_content'] = "{$ping['title']}\n\n{$ping['comment_content']}"; $ping['comment_post_ID'] = $post_id; $ping = wp_filter_comment($ping); wp_insert_comment($ping); $num_pings++; } } if ( $num_pings ) printf(' '.__ngettext('(%s ping)', '(%s pings)', $num_pings), $num_pings); echo "
  • "; //ob_flush();flush(); } function process_posts() { global $wpdb; $handle = fopen($this->file, 'r'); if ( $handle == null ) return false; $context = ''; $post = new StdClass(); $comment = new StdClass(); $comments = array(); $ping = new StdClass(); $pings = array(); echo "
      "; while ( $line = fgets($handle) ) { $line = trim($line); if ( '-----' == $line ) { // Finishing a multi-line field if ( 'comment' == $context ) { $comments[] = $comment; $comment = new StdClass(); } else if ( 'ping' == $context ) { $pings[] = $ping; $ping = new StdClass(); } $context = ''; } else if ( '--------' == $line ) { // Finishing a post. $context = ''; $result = $this->save_post($post, $comments, $pings); if ( is_wp_error( $result ) ) return $result; $post = new StdClass; $comment = new StdClass(); $ping = new StdClass(); $comments = array(); $pings = array(); } else if ( 'BODY:' == $line ) { $context = 'body'; } else if ( 'EXTENDED BODY:' == $line ) { $context = 'extended'; } else if ( 'EXCERPT:' == $line ) { $context = 'excerpt'; } else if ( 'KEYWORDS:' == $line ) { $context = 'keywords'; } else if ( 'COMMENT:' == $line ) { $context = 'comment'; } else if ( 'PING:' == $line ) { $context = 'ping'; } else if ( 0 === strpos($line, "AUTHOR:") ) { $author = trim( substr($line, strlen("AUTHOR:")) ); if ( '' == $context ) $post->post_author = $author; else if ( 'comment' == $context ) $comment->comment_author = $author; } else if ( 0 === strpos($line, "TITLE:") ) { $title = trim( substr($line, strlen("TITLE:")) ); if ( '' == $context ) $post->post_title = $title; else if ( 'ping' == $context ) $ping->title = $title; } else if ( 0 === strpos($line, "STATUS:") ) { $status = trim( strtolower( substr($line, strlen("STATUS:")) ) ); if ( empty($status) ) $status = 'publish'; $post->post_status = $status; } else if ( 0 === strpos($line, "ALLOW COMMENTS:") ) { $allow = trim( substr($line, strlen("ALLOW COMMENTS:")) ); if ( $allow == 1 ) $post->comment_status = 'open'; else $post->comment_status = 'closed'; } else if ( 0 === strpos($line, "ALLOW PINGS:") ) { $allow = trim( substr($line, strlen("ALLOW PINGS:")) ); if ( $allow == 1 ) $post->ping_status = 'open'; else $post->ping_status = 'closed'; } else if ( 0 === strpos($line, "CATEGORY:") ) { $category = trim( substr($line, strlen("CATEGORY:")) ); if ( '' != $category ) $post->categories[] = $category; } else if ( 0 === strpos($line, "PRIMARY CATEGORY:") ) { $category = trim( substr($line, strlen("PRIMARY CATEGORY:")) ); if ( '' != $category ) $post->categories[] = $category; } else if ( 0 === strpos($line, "DATE:") ) { $date = trim( substr($line, strlen("DATE:")) ); $date = strtotime($date); $date = date('Y-m-d H:i:s', $date); $date_gmt = get_gmt_from_date($date); if ( '' == $context ) { $post->post_modified = $date; $post->post_modified_gmt = $date_gmt; $post->post_date = $date; $post->post_date_gmt = $date_gmt; } else if ( 'comment' == $context ) { $comment->comment_date = $date; } else if ( 'ping' == $context ) { $ping->comment_date = $date; } } else if ( 0 === strpos($line, "EMAIL:") ) { $email = trim( substr($line, strlen("EMAIL:")) ); if ( 'comment' == $context ) $comment->comment_author_email = $email; else $ping->comment_author_email = ''; } else if ( 0 === strpos($line, "IP:") ) { $ip = trim( substr($line, strlen("IP:")) ); if ( 'comment' == $context ) $comment->comment_author_IP = $ip; else $ping->comment_author_IP = $ip; } else if ( 0 === strpos($line, "URL:") ) { $url = trim( substr($line, strlen("URL:")) ); if ( 'comment' == $context ) $comment->comment_author_url = $url; else $ping->comment_author_url = $url; } else if ( 0 === strpos($line, "BLOG NAME:") ) { $blog = trim( substr($line, strlen("BLOG NAME:")) ); $ping->comment_author = $blog; } else { // Processing multi-line field, check context. $line .= "\n"; if ( 'body' == $context ) { $post->post_content .= $line; } else if ( 'extended' == $context ) { $post->extended .= $line; } else if ( 'excerpt' == $context ) { $post->post_excerpt .= $line; } else if ( 'keywords' == $context ) { $post->post_keywords .= $line; } else if ( 'comment' == $context ) { $comment->comment_content .= $line; } else if ( 'ping' == $context ) { $ping->comment_content .= $line; } } } echo '
    '; wp_import_cleanup($this->id); do_action('import_done', 'mt'); echo '

    '.sprintf(__('All done. Have fun!'), get_option('home')).'

    '; } function import() { $this->id = (int) $_GET['id']; if ( $this->id == 0 ) $this->file = WP_CONTENT_DIR . '/mt-export.txt'; else $this->file = get_attached_file($this->id); $this->get_authors_from_post(); $result = $this->process_posts(); if ( is_wp_error( $result ) ) return $result; } function dispatch() { if (empty ($_GET['step'])) $step = 0; else $step = (int) $_GET['step']; switch ($step) { case 0 : $this->greet(); break; case 1 : check_admin_referer('import-upload'); $this->select_authors(); break; case 2: check_admin_referer('import-mt'); $result = $this->import(); if ( is_wp_error( $result ) ) echo $result->get_error_message(); break; } } function MT_Import() { // Nothing. } } $mt_import = new MT_Import(); register_importer('mt', __('Movable Type and TypePad'), __('Import posts and comments from a Movable Type or Typepad blog.'), array ($mt_import, 'dispatch')); ?> wp/dev/wp-admin/import/jkw.php0000644000106600010660000001355610761355210013546 0ustar '; echo '

    '.__('Import Jerome’s Keywords').'

    '; echo '

    '.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'

    '; } function footer() { echo ''; } function greet() { echo '
    '; echo '

    '.__('Howdy! This imports tags from Jerome’s Keywords into WordPress tags.').'

    '; echo '

    '.__('This is suitable for Jerome’s Keywords version 1.x and 2.0a.').'

    '; echo '

    '.__('All existing Jerome’s Keywords will be removed after import.').'

    '; echo '

    '.__('Don’t be stupid - backup your database before proceeding!').'

    '; echo '
    '; wp_nonce_field('import-jkw'); echo '

    '; echo '
    '; echo '
    '; wp_nonce_field('import-jkw'); echo '

    '; echo '
    '; echo '
    '; } function dispatch() { if ( empty($_GET['step']) ) $step = 0; else $step = absint($_GET['step']); // load the header $this->header(); switch ( $step ) { case 0 : $this->greet(); break; case 1 : check_admin_referer('import-jkw'); $this->check_V1_post_keyword( true ); break; case 2 : check_admin_referer('import-jkw'); $this->check_V1_post_keyword( false ); break; case 3 : check_admin_referer('import-jkw'); $this->check_V2_post_keyword( true ); break; case 4 : check_admin_referer('import-jkw'); $this->check_V2_post_keyword( false ); break; case 5: check_admin_referer('import-jkw'); $this->cleanup_V2_import(); break; case 6: $this->done(); break; } // load the footer $this->footer(); } function check_V1_post_keyword($precheck = true) { global $wpdb; echo '
    '; echo '

    '.__('Reading Jerome’s Keywords Tags…').'

    '; // import Jerome's Keywords tags $metakeys = $wpdb->get_results("SELECT post_id, meta_id, meta_key, meta_value FROM $wpdb->postmeta WHERE $wpdb->postmeta.meta_key = 'keywords'"); if ( !is_array($metakeys)) { echo '

    ' . __('No Tags Found!') . '

    '; return false; } else { $count = count($metakeys); echo '

    ' . sprintf( __ngettext('Done! %s post with tags were read.', 'Done! %s posts with tags were read.', $count), $count ) . '

    '; echo '
      '; foreach ( $metakeys as $post_meta ) { if ( $post_meta->meta_value != '' ) { $post_keys = explode(',', $post_meta->meta_value); foreach ( $post_keys as $keyword ) { $keyword = addslashes(trim($keyword)); if ( '' != $keyword ) { echo '
    • ' . $post_meta->post_id . ' - ' . $keyword . '
    • '; if ( !$precheck ) wp_add_post_tags($post_meta->post_id, $keyword); } } } if ( !$precheck ) delete_post_meta($post_meta->post_id, 'keywords'); } echo '
    '; } echo '
    '; wp_nonce_field('import-jkw'); echo '

    '; echo '
    '; echo '
    '; } function check_V2_post_keyword($precheck = true) { global $wpdb; echo '
    '; echo '

    '.__('Reading Jerome’s Keywords Tags…').'

    '; // import Jerome's Keywords tags $tablename = $wpdb->prefix . substr(get_option('jkeywords_keywords_table'), 1, -1); $metakeys = $wpdb->get_results("SELECT post_id, tag_name FROM $tablename"); if ( !is_array($metakeys) ) { echo '

    ' . __('No Tags Found!') . '

    '; return false; } else { $count = count($metakeys); echo '

    ' . sprintf( __ngettext('Done! %s tag were read.', 'Done! %s tags were read.', $count), $count ) . '

    '; echo '
      '; foreach ( $metakeys as $post_meta ) { $keyword = addslashes(trim($post_meta->tag_name)); if ( $keyword != '' ) { echo '
    • ' . $post_meta->post_id . ' - ' . $keyword . '
    • '; if ( !$precheck ) wp_add_post_tags($post_meta->post_id, $keyword); } } echo '
    '; } echo '
    '; wp_nonce_field('import-jkw'); echo '

    '; echo '
    '; echo '
    '; } function cleanup_V2_import() { global $wpdb; /* options from V2.0a (jeromes-keywords.php) */ $options = array('version', 'keywords_table', 'query_varname', 'template', 'meta_always_include', 'meta_includecats', 'meta_autoheader', 'search_strict', 'use_feed_cats', 'post_linkformat', 'post_tagseparator', 'post_includecats', 'post_notagstext', 'cloud_linkformat', 'cloud_tagseparator', 'cloud_includecats', 'cloud_sortorder', 'cloud_displaymax', 'cloud_displaymin', 'cloud_scalemax', 'cloud_scalemin'); $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . substr(get_option('jkeywords_keywords_table'), 1, -1)); foreach ( $options as $o ) delete_option('jkeywords_' . $o); $this->done(); } function done() { echo '
    '; echo '

    '.__('Import Complete!').'

    '; echo '
    '; } function JeromesKeyword_Import() { } } // create the import object $jkw_import = new JeromesKeyword_Import(); // add it to the import page! register_importer('jkw', 'Jerome’s Keywords', __('Import Jerome’s Keywords into WordPress tags.'), array($jkw_import, 'dispatch')); ?> wp/dev/wp-admin/import/textpattern.php0000644000106600010660000004752711000701245015330 0ustar get_var( $wpdb->prepare("SELECT count(*) FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) ); } } if(!function_exists('link_exists')) { function link_exists($linkname) { global $wpdb; return $wpdb->get_var( $wpdb->prepare("SELECT link_id FROM $wpdb->links WHERE link_name = %s", $linkname) ); } } /** The Main Importer Class **/ class Textpattern_Import { function header() { echo '
    '; echo '

    '.__('Import Textpattern').'

    '; echo '

    '.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'

    '; } function footer() { echo '
    '; } function greet() { echo '
    '; echo '

    '.__('Howdy! This imports categories, users, posts, comments, and links from any Textpattern 4.0.2+ into this blog.').'

    '; echo '

    '.__('This has not been tested on previous versions of Textpattern. Mileage may vary.').'

    '; echo '

    '.__('Your Textpattern Configuration settings are as follows:').'

    '; echo '
    '; wp_nonce_field('import-textpattern'); $this->db_form(); echo '

    '; echo '
    '; echo '
    '; } function get_txp_cats() { global $wpdb; // General Housekeeping $txpdb = new wpdb(get_option('txpuser'), get_option('txppass'), get_option('txpname'), get_option('txphost')); set_magic_quotes_runtime(0); $prefix = get_option('tpre'); // Get Categories return $txpdb->get_results('SELECT id, name, title FROM '.$prefix.'txp_category WHERE type = "article"', ARRAY_A); } function get_txp_users() { global $wpdb; // General Housekeeping $txpdb = new wpdb(get_option('txpuser'), get_option('txppass'), get_option('txpname'), get_option('txphost')); set_magic_quotes_runtime(0); $prefix = get_option('tpre'); // Get Users return $txpdb->get_results('SELECT user_id, name, RealName, email, privs FROM '.$prefix.'txp_users', ARRAY_A); } function get_txp_posts() { // General Housekeeping $txpdb = new wpdb(get_option('txpuser'), get_option('txppass'), get_option('txpname'), get_option('txphost')); set_magic_quotes_runtime(0); $prefix = get_option('tpre'); // Get Posts return $txpdb->get_results('SELECT ID, Posted, AuthorID, LastMod, Title, Body, Excerpt, Category1, Category2, Status, Keywords, url_title, comments_count FROM '.$prefix.'textpattern ', ARRAY_A); } function get_txp_comments() { global $wpdb; // General Housekeeping $txpdb = new wpdb(get_option('txpuser'), get_option('txppass'), get_option('txpname'), get_option('txphost')); set_magic_quotes_runtime(0); $prefix = get_option('tpre'); // Get Comments return $txpdb->get_results('SELECT * FROM '.$prefix.'txp_discuss', ARRAY_A); } function get_txp_links() { //General Housekeeping $txpdb = new wpdb(get_option('txpuser'), get_option('txppass'), get_option('txpname'), get_option('txphost')); set_magic_quotes_runtime(0); $prefix = get_option('tpre'); return $txpdb->get_results('SELECT id, date, category, url, linkname, description FROM '.$prefix.'txp_link', ARRAY_A); } function cat2wp($categories='') { // General Housekeeping global $wpdb; $count = 0; $txpcat2wpcat = array(); // Do the Magic if(is_array($categories)) { echo '

    '.__('Importing Categories...').'

    '; foreach ($categories as $category) { $count++; extract($category); // Make Nice Variables $name = $wpdb->escape($name); $title = $wpdb->escape($title); if($cinfo = category_exists($name)) { $ret_id = wp_insert_category(array('cat_ID' => $cinfo, 'category_nicename' => $name, 'cat_name' => $title)); } else { $ret_id = wp_insert_category(array('category_nicename' => $name, 'cat_name' => $title)); } $txpcat2wpcat[$id] = $ret_id; } // Store category translation for future use add_option('txpcat2wpcat',$txpcat2wpcat); echo '

    '.sprintf(__ngettext('Done! %1$s category imported.', 'Done! %1$s categories imported.', $count), $count).'

    '; return true; } echo __('No Categories to Import!'); return false; } function users2wp($users='') { // General Housekeeping global $wpdb; $count = 0; $txpid2wpid = array(); // Midnight Mojo if(is_array($users)) { echo '

    '.__('Importing Users...').'

    '; foreach($users as $user) { $count++; extract($user); // Make Nice Variables $name = $wpdb->escape($name); $RealName = $wpdb->escape($RealName); if($uinfo = get_userdatabylogin($name)) { $ret_id = wp_insert_user(array( 'ID' => $uinfo->ID, 'user_login' => $name, 'user_nicename' => $RealName, 'user_email' => $email, 'user_url' => 'http://', 'display_name' => $name) ); } else { $ret_id = wp_insert_user(array( 'user_login' => $name, 'user_nicename' => $RealName, 'user_email' => $email, 'user_url' => 'http://', 'display_name' => $name) ); } $txpid2wpid[$user_id] = $ret_id; // Set Textpattern-to-WordPress permissions translation $transperms = array(1 => '10', 2 => '9', 3 => '5', 4 => '4', 5 => '3', 6 => '2', 7 => '0'); // Update Usermeta Data $user = new WP_User($ret_id); if('10' == $transperms[$privs]) { $user->set_role('administrator'); } if('9' == $transperms[$privs]) { $user->set_role('editor'); } if('5' == $transperms[$privs]) { $user->set_role('editor'); } if('4' == $transperms[$privs]) { $user->set_role('author'); } if('3' == $transperms[$privs]) { $user->set_role('contributor'); } if('2' == $transperms[$privs]) { $user->set_role('contributor'); } if('0' == $transperms[$privs]) { $user->set_role('subscriber'); } update_usermeta( $ret_id, 'wp_user_level', $transperms[$privs] ); update_usermeta( $ret_id, 'rich_editing', 'false'); }// End foreach($users as $user) // Store id translation array for future use add_option('txpid2wpid',$txpid2wpid); echo '

    '.sprintf(__('Done! %1$s users imported.'), $count).'

    '; return true; }// End if(is_array($users) echo __('No Users to Import!'); return false; }// End function user2wp() function posts2wp($posts='') { // General Housekeeping global $wpdb; $count = 0; $txpposts2wpposts = array(); $cats = array(); // Do the Magic if(is_array($posts)) { echo '

    '.__('Importing Posts...').'

    '; foreach($posts as $post) { $count++; extract($post); // Set Textpattern-to-WordPress status translation $stattrans = array(1 => 'draft', 2 => 'private', 3 => 'draft', 4 => 'publish', 5 => 'publish'); //Can we do this more efficiently? $uinfo = ( get_userdatabylogin( $AuthorID ) ) ? get_userdatabylogin( $AuthorID ) : 1; $authorid = ( is_object( $uinfo ) ) ? $uinfo->ID : $uinfo ; $Title = $wpdb->escape($Title); $Body = $wpdb->escape($Body); $Excerpt = $wpdb->escape($Excerpt); $post_status = $stattrans[$Status]; // Import Post data into WordPress if($pinfo = post_exists($Title,$Body)) { $ret_id = wp_insert_post(array( 'ID' => $pinfo, 'post_date' => $Posted, 'post_date_gmt' => $post_date_gmt, 'post_author' => $authorid, 'post_modified' => $LastMod, 'post_modified_gmt' => $post_modified_gmt, 'post_title' => $Title, 'post_content' => $Body, 'post_excerpt' => $Excerpt, 'post_status' => $post_status, 'post_name' => $url_title, 'comment_count' => $comments_count) ); if ( is_wp_error( $ret_id ) ) return $ret_id; } else { $ret_id = wp_insert_post(array( 'post_date' => $Posted, 'post_date_gmt' => $post_date_gmt, 'post_author' => $authorid, 'post_modified' => $LastMod, 'post_modified_gmt' => $post_modified_gmt, 'post_title' => $Title, 'post_content' => $Body, 'post_excerpt' => $Excerpt, 'post_status' => $post_status, 'post_name' => $url_title, 'comment_count' => $comments_count) ); if ( is_wp_error( $ret_id ) ) return $ret_id; } $txpposts2wpposts[$ID] = $ret_id; // Make Post-to-Category associations $cats = array(); $category1 = get_category_by_slug($Category1); $category1 = $category1->term_id; $category2 = get_category_by_slug($Category2); $category2 = $category1->term_id; if($cat1 = $category1) { $cats[1] = $cat1; } if($cat2 = $category2) { $cats[2] = $cat2; } if(!empty($cats)) { wp_set_post_categories($ret_id, $cats); } } } // Store ID translation for later use add_option('txpposts2wpposts',$txpposts2wpposts); echo '

    '.sprintf(__('Done! %1$s posts imported.'), $count).'

    '; return true; } function comments2wp($comments='') { // General Housekeeping global $wpdb; $count = 0; $txpcm2wpcm = array(); $postarr = get_option('txpposts2wpposts'); // Magic Mojo if(is_array($comments)) { echo '

    '.__('Importing Comments...').'

    '; foreach($comments as $comment) { $count++; extract($comment); // WordPressify Data $comment_ID = ltrim($discussid, '0'); $comment_post_ID = $postarr[$parentid]; $comment_approved = (1 == $visible) ? 1 : 0; $name = $wpdb->escape($name); $email = $wpdb->escape($email); $web = $wpdb->escape($web); $message = $wpdb->escape($message); if($cinfo = comment_exists($name, $posted)) { // Update comments $ret_id = wp_update_comment(array( 'comment_ID' => $cinfo, 'comment_post_ID' => $comment_post_ID, 'comment_author' => $name, 'comment_author_email' => $email, 'comment_author_url' => $web, 'comment_date' => $posted, 'comment_content' => $message, 'comment_approved' => $comment_approved) ); } else { // Insert comments $ret_id = wp_insert_comment(array( 'comment_post_ID' => $comment_post_ID, 'comment_author' => $name, 'comment_author_email' => $email, 'comment_author_url' => $web, 'comment_author_IP' => $ip, 'comment_date' => $posted, 'comment_content' => $message, 'comment_approved' => $comment_approved) ); } $txpcm2wpcm[$comment_ID] = $ret_id; } // Store Comment ID translation for future use add_option('txpcm2wpcm', $txpcm2wpcm); // Associate newly formed categories with posts get_comment_count($ret_id); echo '

    '.sprintf(__('Done! %1$s comments imported.'), $count).'

    '; return true; } echo __('No Comments to Import!'); return false; } function links2wp($links='') { // General Housekeeping global $wpdb; $count = 0; // Deal with the links if(is_array($links)) { echo '

    '.__('Importing Links...').'

    '; foreach($links as $link) { $count++; extract($link); // Make nice vars $category = $wpdb->escape($category); $linkname = $wpdb->escape($linkname); $description = $wpdb->escape($description); if($linfo = link_exists($linkname)) { $ret_id = wp_insert_link(array( 'link_id' => $linfo, 'link_url' => $url, 'link_name' => $linkname, 'link_category' => $category, 'link_description' => $description, 'link_updated' => $date) ); } else { $ret_id = wp_insert_link(array( 'link_url' => $url, 'link_name' => $linkname, 'link_category' => $category, 'link_description' => $description, 'link_updated' => $date) ); } $txplinks2wplinks[$link_id] = $ret_id; } add_option('txplinks2wplinks',$txplinks2wplinks); echo '

    '; printf(__ngettext('Done! %s link imported', 'Done! %s links imported', $count), $count); echo '

    '; return true; } echo __('No Links to Import!'); return false; } function import_categories() { // Category Import $cats = $this->get_txp_cats(); $this->cat2wp($cats); add_option('txp_cats', $cats); echo '
    '; wp_nonce_field('import-textpattern'); printf('', attribute_escape(__('Import Users'))); echo '
    '; } function import_users() { // User Import $users = $this->get_txp_users(); $this->users2wp($users); echo '
    '; wp_nonce_field('import-textpattern'); printf('', attribute_escape(__('Import Posts'))); echo '
    '; } function import_posts() { // Post Import $posts = $this->get_txp_posts(); $result = $this->posts2wp($posts); if ( is_wp_error( $result ) ) return $result; echo '
    '; wp_nonce_field('import-textpattern'); printf('', attribute_escape(__('Import Comments'))); echo '
    '; } function import_comments() { // Comment Import $comments = $this->get_txp_comments(); $this->comments2wp($comments); echo '
    '; wp_nonce_field('import-textpattern'); printf('', attribute_escape(__('Import Links'))); echo '
    '; } function import_links() { //Link Import $links = $this->get_txp_links(); $this->links2wp($links); add_option('txp_links', $links); echo '
    '; wp_nonce_field('import-textpattern'); printf('', attribute_escape(__('Finish'))); echo '
    '; } function cleanup_txpimport() { delete_option('tpre'); delete_option('txp_cats'); delete_option('txpid2wpid'); delete_option('txpcat2wpcat'); delete_option('txpposts2wpposts'); delete_option('txpcm2wpcm'); delete_option('txplinks2wplinks'); delete_option('txpuser'); delete_option('txppass'); delete_option('txpname'); delete_option('txphost'); do_action('import_done', 'textpattern'); $this->tips(); } function tips() { echo '

    '.__('Welcome to WordPress. We hope (and expect!) that you will find this platform incredibly rewarding! As a new WordPress user coming from Textpattern, there are some things that we would like to point out. Hopefully, they will help your transition go as smoothly as possible.').'

    '; echo '

    '.__('Users').'

    '; echo '

    '.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn’t have that login in Textpattern, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and Textpattern uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. Every user has the same username, but their passwords are reset to password123. So Login and change it.'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'

    '; echo '

    '.__('Preserving Authors').'

    '; echo '

    '.__('Secondly, we have attempted to preserve post authors. If you are the only author or contributor to your blog, then you are safe. In most cases, we are successful in this preservation endeavor. However, if we cannot ascertain the name of the writer due to discrepancies between database tables, we assign it to you, the administrative user.').'

    '; echo '

    '.__('Textile').'

    '; echo '

    '.__('Also, since you’re coming from Textpattern, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing Textile for WordPress. Trust me... You’ll want it.').'

    '; echo '

    '.__('WordPress Resources').'

    '; echo '

    '.__('Finally, there are numerous WordPress resources around the internet. Some of them are:').'

    '; echo ''; echo '

    '.sprintf(__('That’s it! What are you waiting for? Go login!'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'

    '; } function db_form() { echo ''; printf('', __('Textpattern Database User:')); printf('', __('Textpattern Database Password:')); printf('', __('Textpattern Database Name:')); printf('', __('Textpattern Database Host:')); printf('', __('Textpattern Table prefix (if any):')); echo '
    '; } function dispatch() { if (empty ($_GET['step'])) $step = 0; else $step = (int) $_GET['step']; $this->header(); if ( $step > 0 ) { check_admin_referer('import-textpattern'); if($_POST['dbuser']) { if(get_option('txpuser')) delete_option('txpuser'); add_option('txpuser', sanitize_user($_POST['dbuser'], true)); } if($_POST['dbpass']) { if(get_option('txppass')) delete_option('txppass'); add_option('txppass', sanitize_user($_POST['dbpass'], true)); } if($_POST['dbname']) { if(get_option('txpname')) delete_option('txpname'); add_option('txpname', sanitize_user($_POST['dbname'], true)); } if($_POST['dbhost']) { if(get_option('txphost')) delete_option('txphost'); add_option('txphost', sanitize_user($_POST['dbhost'], true)); } if($_POST['dbprefix']) { if(get_option('tpre')) delete_option('tpre'); add_option('tpre', sanitize_user($_POST['dbprefix'])); } } switch ($step) { default: case 0 : $this->greet(); break; case 1 : $this->import_categories(); break; case 2 : $this->import_users(); break; case 3 : $result = $this->import_posts(); if ( is_wp_error( $result ) ) echo $result->get_error_message(); break; case 4 : $this->import_comments(); break; case 5 : $this->import_links(); break; case 6 : $this->cleanup_txpimport(); break; } $this->footer(); } function Textpattern_Import() { // Nothing. } } $txp_import = new Textpattern_Import(); register_importer('textpattern', __('Textpattern'), __('Import categories, users, posts, comments, and links from a Textpattern blog.'), array ($txp_import, 'dispatch')); ?> wp/dev/wp-admin/import/livejournal.php0000644000106600010660000001303410762036130015272 0ustar '; echo '

    '.__('Import LiveJournal').'

    '; } function footer() { echo ''; } function unhtmlentities($string) { // From php.net for < 4.3 compat $trans_tbl = get_html_translation_table(HTML_ENTITIES); $trans_tbl = array_flip($trans_tbl); return strtr($string, $trans_tbl); } function greet() { echo '
    '; echo '

    '.__('Howdy! Upload your LiveJournal XML export file and we’ll import the posts into this blog.').'

    '; echo '

    '.__('Choose a LiveJournal XML file to upload, then click Upload file and import.').'

    '; wp_import_upload_form("admin.php?import=livejournal&step=1"); echo '
    '; } function import_posts() { global $wpdb, $current_user; set_magic_quotes_runtime(0); $importdata = file($this->file); // Read the file into an array $importdata = implode('', $importdata); // squish it $importdata = str_replace(array ("\r\n", "\r"), "\n", $importdata); preg_match_all('|(.*?)|is', $importdata, $posts); $posts = $posts[1]; unset($importdata); echo '
      '; foreach ($posts as $post) { preg_match('|(.*?)|is', $post, $post_title); $post_title = $wpdb->escape(trim($post_title[1])); if ( empty($post_title) ) { preg_match('|(.*?)|is', $post, $post_title); $post_title = $wpdb->escape(trim($post_title[1])); } preg_match('|(.*?)|is', $post, $post_date); $post_date = strtotime($post_date[1]); $post_date = date('Y-m-d H:i:s', $post_date); preg_match('|(.*?)|is', $post, $post_content); $post_content = str_replace(array (''), '', trim($post_content[1])); $post_content = $this->unhtmlentities($post_content); // Clean up content $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content); $post_content = str_replace('
      ', '
      ', $post_content); $post_content = str_replace('
      ', '
      ', $post_content); $post_content = $wpdb->escape($post_content); $post_author = $current_user->ID; $post_status = 'publish'; echo '
    1. '; if ($post_id = post_exists($post_title, $post_content, $post_date)) { printf(__('Post %s already exists.'), stripslashes($post_title)); } else { printf(__('Importing post %s...'), stripslashes($post_title)); $postdata = compact('post_author', 'post_date', 'post_content', 'post_title', 'post_status'); $post_id = wp_insert_post($postdata); if ( is_wp_error( $post_id ) ) return $post_id; if (!$post_id) { _e("Couldn't get post ID"); echo '
    2. '; break; } } preg_match_all('|(.*?)|is', $post, $comments); $comments = $comments[1]; if ( $comments ) { $comment_post_ID = (int) $post_id; $num_comments = 0; foreach ($comments as $comment) { preg_match('|(.*?)|is', $comment, $comment_content); $comment_content = str_replace(array (''), '', trim($comment_content[1])); $comment_content = $this->unhtmlentities($comment_content); // Clean up content $comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content); $comment_content = str_replace('
      ', '
      ', $comment_content); $comment_content = str_replace('
      ', '
      ', $comment_content); $comment_content = $wpdb->escape($comment_content); preg_match('|(.*?)|is', $comment, $comment_date); $comment_date = trim($comment_date[1]); $comment_date = date('Y-m-d H:i:s', strtotime($comment_date)); preg_match('|(.*?)|is', $comment, $comment_author); $comment_author = $wpdb->escape(trim($comment_author[1])); preg_match('|(.*?)|is', $comment, $comment_author_email); $comment_author_email = $wpdb->escape(trim($comment_author_email[1])); $comment_approved = 1; // Check if it's already there if (!comment_exists($comment_author, $comment_date)) { $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_date', 'comment_content', 'comment_approved'); $commentdata = wp_filter_comment($commentdata); wp_insert_comment($commentdata); $num_comments++; } } } if ( $num_comments ) { echo ' '; printf(__ngettext('(%s comment)', '(%s comments)', $num_comments), $num_comments); } echo ''; } echo '
    '; } function import() { $file = wp_import_handle_upload(); if ( isset($file['error']) ) { echo $file['error']; return; } $this->file = $file['file']; $result = $this->import_posts(); if ( is_wp_error( $result ) ) return $result; wp_import_cleanup($file['id']); do_action('import_done', 'livejournal'); echo '

    '; printf(__('All done. Have fun!'), get_option('home')); echo '

    '; } function dispatch() { if (empty ($_GET['step'])) $step = 0; else $step = (int) $_GET['step']; $this->header(); switch ($step) { case 0 : $this->greet(); break; case 1 : check_admin_referer('import-upload'); $result = $this->import(); if ( is_wp_error( $result ) ) echo $result->get_error_message(); break; } $this->footer(); } function LJ_Import() { // Nothing. } } $livejournal_import = new LJ_Import(); register_importer('livejournal', __('LiveJournal'), __('Import posts from a LiveJournal XML export file.'), array ($livejournal_import, 'dispatch')); ?> wp/dev/wp-admin/import/btt.php0000644000106600010660000000662110761355210013537 0ustar '; echo '

    '.__('Import Bunny’s Technorati Tags').'

    '; echo '

    '.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'

    '; } function footer() { echo ''; } function greet() { echo '
    '; echo '

    '.__('Howdy! This imports tags from Bunny’s Technorati Tags into WordPress tags.').'

    '; echo '

    '.__('This is suitable for Bunny’s Technorati Tags version 0.6.').'

    '; echo '

    '.__('All existing Bunny’s Technorati Tags will be removed after import.').'

    '; echo '

    '.__('Don’t be stupid - backup your database before proceeding!').'

    '; echo '
    '; wp_nonce_field('import-btt'); echo '

    '; echo '
    '; echo '
    '; } function dispatch() { if ( empty($_GET['step']) ) $step = 0; else $step = absint($_GET['step']); // load the header $this->header(); switch ( $step ) { case 0 : $this->greet(); break; case 1 : check_admin_referer('import-btt'); $this->check_post_keyword( true ); break; case 2 : check_admin_referer('import-btt'); $this->check_post_keyword( false ); break; case 3: $this->done(); break; } // load the footer $this->footer(); } function check_post_keyword($precheck = true) { global $wpdb; echo '
    '; echo '

    '.__('Reading Bunny’s Technorati Tags…').'

    '; // import Bunny's Keywords tags $metakeys = $wpdb->get_results("SELECT post_id, meta_id, meta_key, meta_value FROM $wpdb->postmeta WHERE $wpdb->postmeta.meta_key = 'tags'"); if ( !is_array($metakeys)) { echo '

    ' . __('No Tags Found!') . '

    '; return false; } else { $count = count($metakeys); echo '

    ' . sprintf( __ngettext('Done! %s post with tags were read.', 'Done! %s posts with tags were read.', $count), $count ) . '

    '; echo '
      '; foreach ( $metakeys as $post_meta ) { if ( $post_meta->meta_value != '' ) { $post_keys = explode(' ', $post_meta->meta_value); foreach ( $post_keys as $keyword ) { $keyword = addslashes(trim(str_replace('+',' ',$keyword))); if ( '' != $keyword ) { echo '
    • ' . $post_meta->post_id . ' - ' . $keyword . '
    • '; if ( !$precheck ) wp_add_post_tags($post_meta->post_id, $keyword); } } } if ( !$precheck ) delete_post_meta($post_meta->post_id, 'tags'); } echo '
    '; } echo '
    '; wp_nonce_field('import-btt'); echo '

    '; echo '
    '; echo '
    '; } function done() { echo '
    '; echo '

    '.__('Import Complete!').'

    '; echo '
    '; } function BunnyTags_Import() { } } // create the import object $btt_import = new BunnyTags_Import(); // add it to the import page! register_importer('btt', 'Bunny’s Technorati Tags', __('Import Bunny’s Technorati Tags into WordPress tags.'), array($btt_import, 'dispatch')); ?> wp/dev/wp-admin/import/rss.php0000644000106600010660000001166210761357276013574 0ustar '; echo '

    '.__('Import RSS').'

    '; } function footer() { echo ''; } function unhtmlentities($string) { // From php.net for < 4.3 compat $trans_tbl = get_html_translation_table(HTML_ENTITIES); $trans_tbl = array_flip($trans_tbl); return strtr($string, $trans_tbl); } function greet() { echo '
    '; echo '

    '.__('Howdy! This importer allows you to extract posts from an RSS 2.0 file into your blog. This is useful if you want to import your posts from a system that is not handled by a custom import tool. Pick an RSS file to upload and click Import.').'

    '; wp_import_upload_form("admin.php?import=rss&step=1"); echo '
    '; } function get_posts() { global $wpdb; set_magic_quotes_runtime(0); $datalines = file($this->file); // Read the file into an array $importdata = implode('', $datalines); // squish it $importdata = str_replace(array ("\r\n", "\r"), "\n", $importdata); preg_match_all('|(.*?)|is', $importdata, $this->posts); $this->posts = $this->posts[1]; $index = 0; foreach ($this->posts as $post) { preg_match('|(.*?)|is', $post, $post_title); $post_title = str_replace(array(''), '', $wpdb->escape( trim($post_title[1]) )); preg_match('|(.*?)|is', $post, $post_date_gmt); if ($post_date_gmt) { $post_date_gmt = strtotime($post_date_gmt[1]); } else { // if we don't already have something from pubDate preg_match('|(.*?)|is', $post, $post_date_gmt); $post_date_gmt = preg_replace('|([-+])([0-9]+):([0-9]+)$|', '\1\2\3', $post_date_gmt[1]); $post_date_gmt = str_replace('T', ' ', $post_date_gmt); $post_date_gmt = strtotime($post_date_gmt); } $post_date_gmt = gmdate('Y-m-d H:i:s', $post_date_gmt); $post_date = get_date_from_gmt( $post_date_gmt ); preg_match_all('|(.*?)|is', $post, $categories); $categories = $categories[1]; if (!$categories) { preg_match_all('|(.*?)|is', $post, $categories); $categories = $categories[1]; } $cat_index = 0; foreach ($categories as $category) { $categories[$cat_index] = $wpdb->escape($this->unhtmlentities($category)); $cat_index++; } preg_match('|(.*?)|is', $post, $guid); if ($guid) $guid = $wpdb->escape(trim($guid[1])); else $guid = ''; preg_match('|(.*?)|is', $post, $post_content); $post_content = str_replace(array (''), '', $wpdb->escape(trim($post_content[1]))); if (!$post_content) { // This is for feeds that put content in description preg_match('|(.*?)|is', $post, $post_content); $post_content = $wpdb->escape($this->unhtmlentities(trim($post_content[1]))); } // Clean up content $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content); $post_content = str_replace('
    ', '
    ', $post_content); $post_content = str_replace('
    ', '
    ', $post_content); $post_author = 1; $post_status = 'publish'; $this->posts[$index] = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_status', 'guid', 'categories'); $index++; } } function import_posts() { echo '
      '; foreach ($this->posts as $post) { echo "
    1. ".__('Importing post...'); extract($post); if ($post_id = post_exists($post_title, $post_content, $post_date)) { _e('Post already imported'); } else { $post_id = wp_insert_post($post); if ( is_wp_error( $post_id ) ) return $post_id; if (!$post_id) { _e("Couldn't get post ID"); return; } if (0 != count($categories)) wp_create_categories($categories, $post_id); _e('Done !'); } echo '
    2. '; } echo '
    '; } function import() { $file = wp_import_handle_upload(); if ( isset($file['error']) ) { echo $file['error']; return; } $this->file = $file['file']; $this->get_posts(); $result = $this->import_posts(); if ( is_wp_error( $result ) ) return $result; wp_import_cleanup($file['id']); do_action('import_done', 'rss'); echo '

    '; printf(__('All done. Have fun!'), get_option('home')); echo '

    '; } function dispatch() { if (empty ($_GET['step'])) $step = 0; else $step = (int) $_GET['step']; $this->header(); switch ($step) { case 0 : $this->greet(); break; case 1 : check_admin_referer('import-upload'); $result = $this->import(); if ( is_wp_error( $result ) ) echo $result->get_error_message(); break; } $this->footer(); } function RSS_Import() { // Nothing. } } $rss_import = new RSS_Import(); register_importer('rss', __('RSS'), __('Import posts from an RSS feed.'), array ($rss_import, 'dispatch')); ?> wp/dev/wp-admin/edit-attachment-rows.php0000644000106600010660000001022411004374210015461 0ustar $column_display_name) { if ( 'cb' === $post_column_key ) $class = ' class="check-column"'; elseif ( 'comments' === $post_column_key ) $class = ' class="num"'; else $class = ''; ?> ID == $post->post_author ? 'self' : 'other' ); $att_title = get_the_title(); if ( empty($att_title) ) $att_title = __('(no title)'); ?> post_status ); ?>' valign="top"> $column_display_name) { switch($column_name) { case 'cb': ?> post_date && 'date' == $column_name ) { $t_time = $h_time = __('Unpublished'); } else { $t_time = get_the_time(__('Y/m/d g:i:s A')); $m_time = $post->post_date; $time = get_post_time( 'G', true ); if ( ( abs($t_diff = time() - $time) ) < 86400 ) { if ( $t_diff < 0 ) $h_time = sprintf( __('%s from now'), human_time_diff( $time ) ); else $h_time = sprintf( __('%s ago'), human_time_diff( $time ) ); } else { $h_time = mysql2date(__('Y/m/d'), $m_time); } } ?> post_parent > 0 ) { if ( get_post($post->post_parent) ) { $parent_title = get_the_title($post->post_parent); if ( !empty($parent_title) ) $title = $parent_title; } ?>
    >
    ID, array(80, 60), false, true); ?> ">
    ID))); ?> ID); ?>
    post_excerpt : ''; ?>  
    ID ); $pending_phrase = sprintf( __('%s pending'), number_format( $left ) ); if ( $left ) echo ''; comments_number("" . __('0') . '', "" . __('1') . '', "" . __('%') . ''); if ( $left ) echo ''; ?>
    wp/dev/wp-admin/edit-link-form.php0000644000106600010660000003513411020067237014254 0ustar '; $nonce_action = 'update-bookmark_' . $link_id; } else { $heading = __('Add Link'); $submit_text = __('Add Link'); $form = ' wp/dev/wp-admin/link-parse-opml.php0000644000106600010660000000334011014735077014446 0ustar 'link_url', 'HTMLURL' => 'link_url', 'TEXT' => 'link_name', 'TITLE' => 'link_name', 'TARGET' => 'link_target', 'DESCRIPTION' => 'link_description', 'XMLURL' => 'link_rss' ); $map = $opml_map; /** ** startElement() ** Callback function. Called at the start of a new xml tag. **/ function startElement($parser, $tagName, $attrs) { global $updated_timestamp, $all_links, $map; global $names, $urls, $targets, $descriptions, $feeds; if ($tagName == 'OUTLINE') { foreach (array_keys($map) as $key) { if (isset($attrs[$key])) { $$map[$key] = $attrs[$key]; } } //echo("got data: link_url = [$link_url], link_name = [$link_name], link_target = [$link_target], link_description = [$link_description]
    \n"); // save the data away. $names[] = $link_name; $urls[] = $link_url; $targets[] = $link_target; $feeds[] = $link_rss; $descriptions[] = $link_description; } // end if outline } /** ** endElement() ** Callback function. Called at the end of an xml tag. **/ function endElement($parser, $tagName) { // nothing to do. } // Create an XML parser $xml_parser = xml_parser_create(); // Set the functions to handle opening and closing tags xml_set_element_handler($xml_parser, "startElement", "endElement"); if (!xml_parse($xml_parser, $opml, true)) { echo(sprintf(__('XML error: %1$s at line %2$s'), xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); } // Free up memory used by the XML parser xml_parser_free($xml_parser); ?> wp/dev/wp-admin/edit-link-categories.php0000644000106600010660000001106511041132661015430 0ustar %s category: this is the default one"), $cat_name)); wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id)); } $location = 'edit-link-categories.php'; if ( $referer = wp_get_referer() ) { if ( false !== strpos($referer, 'edit-link-categories.php') ) $location = $referer; } $location = add_query_arg('message', 6, $location); wp_redirect($location); exit(); } elseif ( !empty($_GET['_wp_http_referer']) ) { wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); exit; } $title = __('Link Categories'); $parent_file = 'edit.php'; wp_enqueue_script( 'admin-categories' ); wp_enqueue_script('admin-forms'); require_once ('admin-header.php'); $messages[1] = __('Category added.'); $messages[2] = __('Category deleted.'); $messages[3] = __('Category updated.'); $messages[4] = __('Category not added.'); $messages[5] = __('Category not updated.'); $messages[6] = __('Categories deleted.'); if (isset($_GET['message'])) : ?>

    add new)'), '#addcat') ?>


    add_query_arg( 'pagenum', '%#%' ), 'format' => '', 'total' => ceil(wp_count_terms('link_category') / $catsperpage), 'current' => $pagenum )); if ( $page_links ) echo "
    $page_links
    "; ?>


    $start, 'number' => $catsperpage, 'hide_empty' => 0); if ( !empty( $_GET['s'] ) ) $args['search'] = $_GET['s']; $categories = get_terms( 'link_category', $args ); if ( $categories ) { $output = ''; foreach ( $categories as $category ) { $category = sanitize_term($category, 'link_category', 'display'); $output .= link_cat_row($category); } $output = apply_filters('cat_rows', $output); echo $output; unset($category); } ?>
    $page_links
    "; ?>

    Note:
    Deleting a category does not delete the links in that category. Instead, links that were only assigned to the deleted category are set to the category %s.'), get_term_field('name', get_option('default_link_category'), 'link_category')) ?>

    wp/dev/wp-admin/images/0000755000106600010660000000000011051167753012171 5ustar wp/dev/wp-admin/images/logo-ghost.png0000644000106600010660000000156010733156345014764 0ustar PNG  IHDRDz5tEXtSoftwareAdobe ImageReadyqe<PLTEOOOGGGhhh{{{TTTHHHqqqQQQSSSyyy[[[lllnnnIIILLLMMMbbbiii]]]KKKgggVVVzzzaaaJJJ}}}ddduuukkk```xxxsssNNNfff^^^PPPXXXjjj|||___WWWeeepppRRRrrr~~~UUU\\\vvvtttZZZcccwwwmmmoooFFFg"\ IDATxڄSgs@ ]p {BBH#i~S}zbxz9(J.'3IDCҩlUBXLm,ҷZe]e>jhwVpMŬ$_Px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C*B,&< h W~-`, ,>; 8RN<, <1T] c' qk$ @)#!;wp/dev/wp-admin/images/xit.gif0000644000106600010660000000026510737035623013467 0ustar GIF89a !, bb0EJ",d H00KA(L&BB0DR!$ఓgJVsPH4"sKAn೏1*NJՒP,  ;wp/dev/wp-admin/images/yes.png0000644000106600010660000000114411035303340013461 0ustar PNG  IHDRa+IDAT8]HSa98[jDb4JֈĺK$( ҺꪏnBȆ6-Ksu,)6t45u;{Dl\'ZHtPn_2gVvv!c $kD2d߭Í:%!' p?x< _Fr'* a}=2>WU忉Op1Y/ &f*ԒLG{`C!Փ?%:~4ހ^-! G#hlD}Q.KեզŤ'YqWS=tHYs䲭= :B#$&8pL8 ?,QOѪsg/=poL;A.KJ4Ovj/1b tMIK[ؑbx Wj"o!M`2t\}̩\?P<OJqv=vYobf$RWqjyxQ2{K§Y_+5K RwH9]doi:R6dI?IENDB`wp/dev/wp-admin/images/comment-stalk-classic.gif0000644000106600010660000000211410765660031017051 0ustar GIF89a@P'>N!%&Ga&Ga&Ga&Ga!,@P0I8ͻ`x dihlC,tmxq * l:&oJZgv%p -ޫzr+=~ߚ:sqstww|[Ifk?!MT,9 '4Яߝꥺ/dg@L 0! KE|X(ĉFj_}mѧ.˟{?~F`b2Fa_va]օn]ՅU jP HXJT6]2JL2$hӎ8Ў<^EDDD:"H&YCeQЕSRiN.;WJ!O蔉zWYh2&s9j9geBsbg:~ei&@ڣa)E"#*餎lʨlxЦʧ$ꩨBj: *j+VjkG++ł+>*=e$Vk-}mt{Ӹʍm>;nꆖﺦkZ;T <Uz1e[AUVD2[ 5\ Բ/2--r/{͊,rρ\"ݘr M#-Ґ9#Ҷbr6XG7_5_C3g gvavvjm7sv+wmw}7YyG8}/x"_7q~X_9y;7%[~yd. ;wp/dev/wp-admin/images/loading.gif0000644000106600010660000000474211012411571014267 0ustar GIF89a! NETSCAPE2.0! ,///vvvd uBz4q@2,,F@( ;cKJ0(&$`fj0PhQ( B+Q\%Sr=0(FS A GKv E  Z$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d!ȼ!%怀ABhFA U JLwAذCA8@9,(~@ 6a N6daه)g@U' '0\B ##8%pJ P@ iG(9"c 2 e8Ρ&` p`ܐ Br=]G`"D, 8 &FQl;v&' Mԁ:KXsw+la \"YsPs2:0K`&-OA9_ ZT!P|ЃЧ?! 9H=H45xQuC"pp?Pdf P0 p i @]@P 0_`Rg|P` Up r0bUmDw'H@7Ht@k 7 zXtd=&vM0 {p 0q@ g@F @ `l -# b AHCp^\]NH00e0o=d F@u @ pvK <@^`p 0 &u g@' 5F,g)pXtdf&dujR0yP 0W6k\0pj@6@^ @Aa6ZG– pƒ! m X1 spKp BYPCy| G@Kp E5P PApp5P`Q]ptey aM /PD;` jI!" ˅ 0 qG 0h4@ CD}2K ` `Od/!NXX[`z O` "HPv& ` `_aB  A D 0 P pZT FԠԜgHI  Xd -{L%#a SyH x/ C G3>GeP:HH;Ev:ji  r UA  7`B\ZvzxU2z0z0lP ~ʥAD9A+Kz@}U)  @gJ3@r::%@P% zP0` B gA< ?!  @! G!޺) C,`79 )p?:Zz*PJ!@ iZp 4P4!C0 )@ ;&{(*,۲.{:aJ6 {8:;wp/dev/wp-admin/images/media-button-gallery.gif0000644000106600010660000000011010753776325016706 0ustar GIF89a !, mRp3FB{vUeeR@;wp/dev/wp-admin/images/required.gif0000644000106600010660000000007611035303340014465 0ustar GIF89a!, Jgg~{H&;wp/dev/wp-admin/images/tail.gif0000644000106600010660000000014210766777420013620 0ustar GIF89a!,3fsmn}#Y 番gkqfaS<"B D*;wp/dev/wp-admin/images/logo-login.gif0000644000106600010660000000616010756670765014746 0ustar GIF89a"BFFF%ѢtttRRR]]]󹹹iii藗֌Ůw3iN@兹\Ÿ$FGGIGF%i2[!,"B@pH,D)8€ZجvzxLN("zf"yN^;TELk{V Z CjHU}jZ D mj B  Р ۱r_ im D jC78ǰ3IHCHǏ hu9\2H! 4{-sssHrsΣH$@/&PH.U:}j1B]^9;?\-7v@wBLwAw#RD&E!EM3 ab25]qeP{wYeZ^'?X"7 e,l&;Ex~J=Tk 5U4z"A8Д'f9zpPXA|GI-f&Sc0N80v[/ԙ'TnaFνj*0[ϓK~, 2*,LW& xBP`y#P@1^d+eB2|E,"xJHQf:" }iFos27 +gs5cJDBK2 9ғ-j|Cp>P,q;PP2<Rlaf;QVPq5*6 FA pSGU/[Y֗b\]CK gOY{eV@!&E̬} lP)`in L}B"d#O؟icmdIYp@q[W[5MC]pzӴ3뉓 -T?OZ]LH'##`eUeh 5<( Gv!iLNq>}/B X `_8]"frhwG5,B &L"[jmVаe4EpP5Ӂ&_Q uQyfx!;cV EDJoԺ6]EMys#K : ,}[4Jh=s< \-J0n)h"ϩ<,&V) ~<ܝъ!or0Y ~U|FEXУEjtf(J,>bI HI]5u{ ,`ށ+XF'-?$¹La_+LZ es.mfwWQ$X y`H ؀xS wCRE%Y`&vKz][7*'ҡCPð{i C#9۱~/x0Ђ\D׷fV8 ~ 9^J5߀?vdAPgRf&Eje8pRO]F@wF0 nPW (p78Ј1lH?hY0A X+m DЉ؊d0:Mb-0*ኼxpU1Q&BՋH7! G`m A L8 p@ aXH{!7h `T8 y[J\d F 9 0%YFF9vF3Yr;wp/dev/wp-admin/images/align-center.png0000644000106600010660000000107310741101145015234 0ustar PNG  IHDR8< pHYs  IDAT(OkAūkgc"݋~ ®1$Az$%$tUк?+ T{ ȗ$%@d($C `f9rQEN,qSڂc雏DU{_VOnp9J~ RsMvEϋp}a8g">=fp'SSe"Oft@9WtvMD9s"]B׮z_xK@2 զS7݋1yc@D\TP;^|M&g`}noX"-Pj׊t m۶mss>99SucAJxQFя:tvvvW?ڇ#t*"MӔ+Ο32pttt7?f@d.%_U=SSz|B9u's;ǫbIENDB`wp/dev/wp-admin/images/wordpress-logo.png0000644000106600010660000000443610756407545015703 0ustar PNG  IHDRD tEXtSoftwareAdobe ImageReadyqe<cPLTE\\\$fff™{{{ppp[̷2Mv˭儺i?L4!tRNS!$IDATxٖ: E fL ɲCWU]Oq;$Ŷ%Y8-EEEE@tJ$UL?]&n M+OV^&;=Mqt5$X,e=av[[J [EWE5* [:Ed6UNJjO"z%~Y{ɵa*seņ]Y6Kj{\͆"B/: yVOTI!6?_ӛ,SAWzg#ݠKЫp 'F+=kLc2őDl]2#igXR^] h>1Y{}ﶔUFT^Ž\j]w{}߾?땮s7SDY>{.`VO$0w3PI 6G2= #3 >QFj4V|:Xw0e3wX3&@7^=S|+n@gbݠ;fW#y:߼CË>5YԻm;=V"~sxgooPjwg;);V0k!w"_0"^v2N'뼆n=L{~e\4N^nv% b@I#7oEX_}]gƽlx'҃O&NW @'@KBHHi͞/@s^ݓw0{9o஼1Ũi$tWIA9ob #nӻ5䝤;zN ?</=1}suST7po+YbtT~z W>{^ngi ]r)Z3볧2@o>^@=#@Gߌ@JяЧutgvBRJ1 Do d{蘭 q߻AGoN{]Nn>g%w bVT+ G/"WK)^:b+T~GWgzzC=}}dbxWyN v֢[iHV`q“G-}*>]4z]g//qp +ayF{J)0 >Aŗ R~דݘtp]2W{*P ]}pu WҶes>Q9%˕fO=@t\Bѻ;(ks֠Is"F%Nk )F5Q7t♼9usl@lAHx2u wX۩Vy.Mf~JzjUɰuԸW|L .r{E͊ycttW'-b lN#OJxTi>m,_\_a6 d#x1\a%۴/xx-#q)=Ӓ6O 沠 g4V\@{3S9Lw~O6O}q{YwAbɍV,Wg#WepwRP(4n *EP rLD^_̓ρW sϏ#z |pӁwIL)zI^l8] ᨑ]|"#`sLh*7P`ޢ:\rrEv)ccY7A<~`?}+h^6+O-i]eսO{ Ί5LFv)sx486hE q@?sd&@rK܂'XqW½֓V|_X3(Sm=_NU]^pPTDi jĆ!AEal_* \1qPϹSʀq9 C|>"8" fb>xYIENDB`wp/dev/wp-admin/images/media-button-music.gif0000644000106600010660000000027410753776325016402 0ustar GIF89a 穫󟟠ɸ߰!, 9 $B J`<#L \K$]3ñp<`#6d:;wp/dev/wp-admin/images/toggle-arrow-rtl.gif0000644000106600010660000000011010770235143016054 0ustar GIF89a%!,a {lE6)9޷#DA;wp/d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DAT>* (XUUu˲ ƘQ@|$3]$uT /8n\Y]I,EQ,EQ,}wc$I^$cnP[[Ӈc؈ꢋ.A@Âgz{$mܹlImˌ11&. K( /, "H=EQiA2Dmm-Od2J$ɢ29K!\Lp`M)E Vm}((E›ņRp۝%(s<IENDB`wp/dev/wp-admin/images/bubble_bg.gif0000644000106600010660000000061310771375647014576 0ustar GIF89ad&GaiN!%꧐𿿿d=3̡jgΠ4SkȺY/@A^uuャwN!),dpH,Ȥrl:ШtJ.X쁙ł] k)f6Ӓ~DL 'MNOPPQ&L#MNOPP!{ L$(M OPIA;wp/dev/wp-admin/images/fade-butt.png0000644000106600010660000000142110304135300014527 0ustar PNG  IHDR(*gAMA7tEXtSoftwareAdobe ImageReadyqe<PLTE 2IDATxbpP``"uf Rg $`CM888 eueeeuA]_J]JL]_LDE#e@ <<@GBGH  )f@ |||||V|Ġjh(*i*) dĤjĤdd288CIbT6UV䔖VV0V4 'AAM{A-AM-A%%M-A%bbbaab KE[ |*@X @a U VA*@X @a U VA*@X @a U VAKv%FUIENDB`wp/dev/wp-admin/setup-config.php0000644000106600010660000001413711035437745014051 0ustar The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now.

    "); // Check if wp-config.php exists above the root directory if (file_exists('../../wp-config.php')) wp_die("

    The file 'wp-config.php' already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now.

    "); if (isset($_GET['step'])) $step = $_GET['step']; else $step = 0; function display_header(){ header( 'Content-Type: text/html; charset=utf-8' ); ?> WordPress › Setup Configuration File

    WordPress

    Welcome to WordPress. Before getting started, we need some information on the database. You will need to know the following items before proceeding.

    1. Database name
    2. Database username
    3. Database password
    4. Database host
    5. Table prefix (if you want to run more than one WordPress in a single database)

    If for any reason this automatic file creation doesn't work, don't worry. All this does is fill in the database information to a configuration file. You may also simply open wp-config-sample.php in a text editor, fill in your information, and save it as wp-config.php.

    In all likelihood, these items were supplied to you by your ISP. If you do not have this information, then you will need to contact them before you can continue. If you’re all ready…

    Let’s go!

    Below you should enter your database connection details. If you're not sure about these, contact your host.

    The name of the database you want to run WP in.
    Your MySQL username
    ...and MySQL password.
    99% chance you won't need to change this value.
    If you want to run multiple WordPress installations in a single database, change this.

    error) ) wp_die($wpdb->error->get_error_message()); $handle = fopen('../wp-config.php', 'w'); foreach ($configFile as $line_num => $line) { switch (substr($line,0,16)) { case "define('DB_NAME'": fwrite($handle, str_replace("putyourdbnamehere", $dbname, $line)); break; case "define('DB_USER'": fwrite($handle, str_replace("'usernamehere'", "'$uname'", $line)); break; case "define('DB_PASSW": fwrite($handle, str_replace("'yourpasswordhere'", "'$passwrd'", $line)); break; case "define('DB_HOST'": fwrite($handle, str_replace("localhost", $dbhost, $line)); break; case '$table_prefix =': fwrite($handle, str_replace('wp_', $prefix, $line)); break; default: fwrite($handle, $line); } } fclose($handle); chmod('../wp-config.php', 0666); display_header(); ?>

    All right sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to…

    Run the install

    wp/dev/wp-admin/page.php0000644000106600010660000001231111050374773012350 0ustar ID) ) wp_die( __("You attempted to edit a page that doesn't exist. Perhaps it was deleted?") ); if ( 'page' != $post->post_type ) { wp_redirect( get_edit_post_link( $post_ID, 'url' ) ); exit(); } wp_enqueue_script('page'); if ( user_can_richedit() ) wp_enqueue_script('editor'); add_thickbox(); wp_enqueue_script('media-upload'); wp_enqueue_script('word-count'); if ( current_user_can('edit_page', $page_ID) ) { if ( $last = wp_check_post_lock( $post->ID ) ) { $last_user = get_userdata( $last ); $last_user_name = $last_user ? $last_user->display_name : __('Somebody'); $message = sprintf( __( 'Warning: %s is currently editing this page' ), wp_specialchars( $last_user_name ) ); $message = str_replace( "'", "\'", "

    $message

    " ); add_action('admin_notices', create_function( '', "echo '$message';" ) ); } else { wp_set_post_lock( $post->ID ); wp_enqueue_script('autosave'); } } require_once('admin-header.php'); if ( !current_user_can('edit_page', $page_ID) ) die ( __('You are not allowed to edit this page.') ); include('edit-page-form.php'); break; case 'editattachment': $page_id = $post_ID = (int) $_POST['post_ID']; check_admin_referer('update-attachment_' . $page_id); // Don't let these be changed unset($_POST['guid']); $_POST['post_type'] = 'attachment'; // Update the thumbnail filename $newmeta = wp_get_attachment_metadata( $page_id, true ); $newmeta['thumb'] = $_POST['thumb']; wp_update_attachment_metadata( $newmeta ); case 'editpost': $page_ID = (int) $_POST['post_ID']; check_admin_referer('update-page_' . $page_ID); $page_ID = edit_post(); redirect_page($page_ID); exit(); break; case 'delete': $page_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']); check_admin_referer('delete-page_' . $page_id); $page = & get_post($page_id); if ( !current_user_can('delete_page', $page_id) ) wp_die( __('You are not allowed to delete this page.') ); if ( $page->post_type == 'attachment' ) { if ( ! wp_delete_attachment($page_id) ) wp_die( __('Error in deleting...') ); } else { if ( !wp_delete_post($page_id) ) wp_die( __('Error in deleting...') ); } $sendback = wp_get_referer(); if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('page.php'); elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); wp_redirect($sendback); exit(); break; default: wp_redirect('edit-pages.php'); exit(); break; } // end switch include('admin-footer.php'); ?> wp/dev/wp-admin/theme-editor.php0000644000106600010660000001334711031245072014020 0ustar '.__('You do not have sufficient permissions to edit templates for this blog.').'

    '); $newcontent = stripslashes($_POST['newcontent']); $theme = urlencode($theme); if (is_writeable($real_file)) { //is_writable() not always reliable, check return value. see comments @ http://uk.php.net/is_writable $f = fopen($real_file, 'w+'); if ($f !== FALSE) { fwrite($f, $newcontent); fclose($f); $location = "theme-editor.php?file=$file&theme=$theme&a=te"; } else { $location = "theme-editor.php?file=$file&theme=$theme"; } } else { $location = "theme-editor.php?file=$file&theme=$theme"; } $location = wp_kses_no_null($location); $strip = array('%0d', '%0a'); $location = str_replace($strip, '', $location); header("Location: $location"); exit(); break; default: if ( !current_user_can('edit_themes') ) wp_die('

    '.__('You do not have sufficient permissions to edit themes for this blog.').'

    '); require_once('admin-header.php'); update_recently_edited($file); if (!is_file($real_file)) $error = 1; if (!$error && filesize($real_file) > 0) { $f = fopen($real_file, 'r'); $content = fread($f, filesize($real_file)); $content = htmlspecialchars($content); } ?>

    (%s)" : "%s"; ?>



      ($template_show)" : "$description"; $filedesc = ( $template_file == $file ) ? "$description ($template_show)" : $filedesc; ?>
    • &theme=">

      ($style_show)" : "$description"; $filedesc = ( $style_file == $file ) ? "$description ($style_show)" : $filedesc; ?>
    • &theme=">

    "; ?>

    the Codex for more information.'); ?>

    ' . __('Oops, no such file exists! Double check the name and try again, merci.') . '

    '; } ?>
     
    wp/dev/wp-admin/post.php0000644000106600010660000001311311050374606012415 0ustar ID) ) wp_die( __("You attempted to edit a post that doesn't exist. Perhaps it was deleted?") ); if ( 'post' != $post->post_type ) { wp_redirect( get_edit_post_link( $post->ID, 'url' ) ); exit(); } wp_enqueue_script('post'); if ( user_can_richedit() ) wp_enqueue_script('editor'); add_thickbox(); wp_enqueue_script('media-upload'); wp_enqueue_script('word-count'); if ( current_user_can('edit_post', $post_ID) ) { if ( $last = wp_check_post_lock( $post->ID ) ) { $last_user = get_userdata( $last ); $last_user_name = $last_user ? $last_user->display_name : __('Somebody'); $message = sprintf( __( 'Warning: %s is currently editing this post' ), wp_specialchars( $last_user_name ) ); $message = str_replace( "'", "\'", "

    $message

    " ); add_action('admin_notices', create_function( '', "echo '$message';" ) ); } else { wp_set_post_lock( $post->ID ); wp_enqueue_script('autosave'); } } require_once('admin-header.php'); if ( !current_user_can('edit_post', $post_ID) ) die ( __('You are not allowed to edit this post.') ); $post = get_post_to_edit($post_ID); include('edit-form-advanced.php'); break; case 'editattachment': $post_id = (int) $_POST['post_ID']; check_admin_referer('update-attachment_' . $post_id); // Don't let these be changed unset($_POST['guid']); $_POST['post_type'] = 'attachment'; // Update the thumbnail filename $newmeta = wp_get_attachment_metadata( $post_id, true ); $newmeta['thumb'] = $_POST['thumb']; wp_update_attachment_metadata( $post_id, $newmeta ); case 'editpost': $post_ID = (int) $_POST['post_ID']; check_admin_referer('update-post_' . $post_ID); $post_ID = edit_post(); redirect_post($post_ID); // Send user on their way while we keep working exit(); break; case 'delete': $post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']); check_admin_referer('delete-post_' . $post_id); $post = & get_post($post_id); if ( !current_user_can('delete_post', $post_id) ) wp_die( __('You are not allowed to delete this post.') ); if ( $post->post_type == 'attachment' ) { if ( ! wp_delete_attachment($post_id) ) wp_die( __('Error in deleting...') ); } else { if ( !wp_delete_post($post_id) ) wp_die( __('Error in deleting...') ); } $sendback = wp_get_referer(); if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('post-new.php'); elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); wp_redirect($sendback); exit(); break; default: wp_redirect('edit.php'); exit(); break; } // end switch include('admin-footer.php'); ?> wp/dev/wp-admin/options-reading.php0000644000106600010660000000707611007310722014534 0ustar

    • ".__('Front page: %s')."", wp_dropdown_pages("name=page_on_front&echo=0&show_option_none=".__('- Select -')."&selected=" . get_option('page_on_front'))); ?>
    • ".__('Posts page: %s')."", wp_dropdown_pages("name=page_for_posts&echo=0&show_option_none=".__('- Select -')."&selected=" . get_option('page_for_posts'))); ?>

    Warning: these pages should not be the same!'); ?>



    recommended)') ?>

    wp/dev/wp-admin/upload.php0000644000106600010660000001771211007310722012714 0ustar post_type == 'attachment' ) if ( ! wp_delete_attachment($post_id_del) ) wp_die( __('Error in deleting...') ); } $location = 'upload.php'; if ( $referer = wp_get_referer() ) { if ( false !== strpos($referer, 'upload.php') ) $location = $referer; } $location = add_query_arg('message', 2, $location); $location = remove_query_arg('posted', $location); wp_redirect($location); exit; } elseif ( !empty($_GET['_wp_http_referer']) ) { wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); exit; } $title = __('Media Library'); $parent_file = 'edit.php'; wp_enqueue_script( 'admin-forms' ); list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query(); if ( is_singular() ) wp_enqueue_script( 'admin-comments' ); require_once('admin-header.php'); if ( !isset( $_GET['paged'] ) ) $_GET['paged'] = 1; ?>

    post_title)); } else { $post_mime_type_label = _c('Manage Media|manage media header'); if ( isset($_GET['post_mime_type']) && in_array( $_GET['post_mime_type'], array_keys($post_mime_types) ) ) $post_mime_type_label = $post_mime_types[$_GET['post_mime_type']][1]; if ( $post_listing_pageable && !is_archive() && !is_search() ) $h2_noun = is_paged() ? sprintf(__( 'Previous %s' ), $post_mime_type_label) : sprintf(__('Latest %s'), $post_mime_type_label); else $h2_noun = $post_mime_type_label; // Use $_GET instead of is_ since they can override each other $h2_author = ''; $_GET['author'] = (int) $_GET['author']; if ( $_GET['author'] != 0 ) { if ( $_GET['author'] == '-' . $user_ID ) { // author exclusion $h2_author = ' ' . __('by other authors'); } else { $author_user = get_userdata( get_query_var( 'author' ) ); $h2_author = ' ' . sprintf(__('by %s'), wp_specialchars( $author_user->display_name )); } } $h2_search = isset($_GET['s']) && $_GET['s'] ? ' ' . sprintf(__('matching “%s”'), wp_specialchars( get_search_query() ) ) : ''; $h2_cat = isset($_GET['cat']) && $_GET['cat'] ? ' ' . sprintf( __('in “%s”'), single_cat_title('', false) ) : ''; $h2_tag = isset($_GET['tag']) && $_GET['tag'] ? ' ' . sprintf( __('tagged with “%s”'), single_tag_title('', false) ) : ''; $h2_month = isset($_GET['m']) && $_GET['m'] ? ' ' . sprintf( __('during %s'), single_month_title(' ', false) ) : ''; printf( _c( '%1$s%2$s%3$s%4$s%5$s%6$s|You can reorder these: 1: Posts, 2: by {s}, 3: matching {s}, 4: in {s}, 5: tagged with {s}, 6: during {s}' ), $h2_noun, $h2_author, $h2_search, $h2_cat, $h2_tag, $h2_month ); } ?>

    |

    add_query_arg( 'paged', '%#%' ), 'format' => '', 'total' => $wp_query->max_num_pages, 'current' => $_GET['paged'] )); if ( $page_links ) echo "
    $page_links
    "; ?>
    posts WHERE post_type = 'attachment' ORDER BY post_date DESC"; $arc_result = $wpdb->get_results( $arc_query ); $month_count = count($arc_result); if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) : ?>


    $page_links
    "; ?>

    get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $id) ); if ( $comments ) : // Make sure comments, post, and post_author are cached update_comment_cache($comments); $post = get_post($id); $authordata = get_userdata($post->post_author); ?>
    comment_ID, 'detail', false, false ); ?>
    wp/dev/wp-admin/menu-header.php0000644000106600010660000001344011021555133013617 0ustar
      $item ) { if ( 3 < $key ) // get each menu item before 3 continue; $class = ''; // 0 = name, 1 = capability, 2 = file if (( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"'; if ( !empty($submenu[$item[2]]) ) { $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) echo "\n\t
    • {$item[0]}
    • "; else echo "\n\t
    • {$item[0]}
    • "; } else if ( current_user_can($item[1]) ) { $menu_hook = get_plugin_page_hook($item[2], 'admin.php'); if ( file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || !empty($menu_hook) ) echo "\n\t
    • {$item[0]}
    • "; else echo "\n\t
    • {$item[0]}
    • "; } } do_action( 'dashmenu' ); ?>
      $item ) { if ( 5 > $key || $key > 25 ) // get each menu item before 3 continue; $class = ''; // 0 = name, 1 = capability, 2 = file if (( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"'; if ( !empty($submenu[$item[2]]) ) { $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) echo "\n\t
    • {$item[0]}
    • "; else echo "\n\t
    • {$item[0]}
    • "; } else if ( current_user_can($item[1]) ) { $menu_hook = get_plugin_page_hook($item[2], 'admin.php'); if ( file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || !empty($menu_hook) ) echo "\n\t
    • {$item[0]}
    • "; else echo "\n\t
    • {$item[0]}
    • "; } } foreach ( $menu as $key => $item ) { if ( $key < 41 ) // there is a more efficient way to do this! continue; $class = ''; // 0 = name, 1 = capability, 2 = file if (( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"'; if ( !empty($submenu[$item[2]]) ) { $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) echo "\n\t
    • {$item[0]}
    • "; else echo "\n\t
    • {$item[0]}
    • "; } else if ( current_user_can($item[1]) ) { $menu_hook = get_plugin_page_hook($item[2], 'admin.php'); if ( file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || !empty($menu_hook) ) echo "\n\t
    • {$item[0]}
    • "; else echo "\n\t
    • {$item[0]}
    • "; } } do_action( 'adminmenu' ); ?>
      $item ) { if ( 26 > $key || $key > 40 ) continue; $class = ''; // 0 = name, 1 = capability, 2 = file if (( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"'; if ( !empty($submenu[$item[2]]) ) { $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) $side_items[] = "\n\t
    • {$item[0]}"; else $side_items[] = "\n\t
    • {$item[0]}"; } else if ( current_user_can($item[1]) ) { $menu_hook = get_plugin_page_hook($item[2], 'admin.php'); if ( file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || !empty($menu_hook) ) $side_items[] = "\n\t
    • {$item[0]}"; else $side_items[] = "\n\t
    • {$item[0]}"; } } echo implode('
    • ', $side_items) . ''; unset($side_items); do_action( 'sidemenu' ); ?>
    wp/dev/wp-admin/options.php0000644000106600010660000000536011007310722013117 0ustar $value) { if ( !in_array($key, array('_wpnonce', '_wp_http_referer')) ) $options[] = $key; } } else { $options = explode(',', stripslashes($_POST['page_options'])); } if ($options) { foreach ($options as $option) { $option = trim($option); $value = $_POST[$option]; if(!is_array($value)) $value = trim($value); $value = stripslashes_deep($value); update_option($option, $value); } } $goback = add_query_arg('updated', 'true', wp_get_referer()); wp_redirect($goback); break; default: include('admin-header.php'); ?>

    get_results("SELECT * FROM $wpdb->options ORDER BY option_name"); foreach ( (array) $options as $option) : $disabled = ''; $option->option_name = attribute_escape($option->option_name); if ( is_serialized($option->option_value) ) { if ( is_serialized_string($option->option_value) ) { // this is a serialized string, so we should display it $value = maybe_unserialize($option->option_value); $options_to_update[] = $option->option_name; $class = 'all-options'; } else { $value = 'SERIALIZED DATA'; $disabled = ' disabled="disabled"'; $class = 'all-options disabled'; } } else { $value = $option->option_value; $options_to_update[] = $option->option_name; $class = 'all-options'; } echo " "; endforeach; ?>
    "; if (strpos($value, "\n") !== false) echo ""; else echo ""; echo "

    wp/dev/wp-admin/link-import.php0000644000106600010660000000767611007310722013705 0ustar


    false, 'test_type' => false); $file = wp_handle_upload($_FILES['userfile'], $overrides); if ( isset($file['error']) ) wp_die($file['error']); $url = $file['url']; $opml_url = $file['file']; $blogrolling = false; } if ( isset($opml_url) && $opml_url != '' ) { if ( $blogrolling === true ) { $opml = wp_remote_fopen($opml_url); } else { $opml = file_get_contents($opml_url); } include_once('link-parse-opml.php'); $link_count = count($names); for ( $i = 0; $i < $link_count; $i++ ) { if ('Last' == substr($titles[$i], 0, 4)) $titles[$i] = ''; if ( 'http' == substr($titles[$i], 0, 4) ) $titles[$i] = ''; $link = array( 'link_url' => $urls[$i], 'link_name' => $wpdb->escape($names[$i]), 'link_category' => array($cat_id), 'link_description' => $wpdb->escape($descriptions[$i]), 'link_owner' => $user_ID, 'link_rss' => $feeds[$i]); wp_insert_link($link); echo sprintf('

    '.__('Inserted %s').'

    ', $names[$i]); } ?>

    manage those links.'), $link_count, $cat_id, 'link-manager.php') ?>

    " . __("You need to supply your OPML url. Press back on your browser and try again") . "

    \n"; } // end else if ( ! $blogrolling ) do_action( 'wp_delete_file', $opml_url); @unlink($opml_url); ?>
    wp/dev/wp-admin/includes/0000755000106600010660000000000011051167753012532 5ustar wp/dev/wp-admin/includes/export.php0000644000106600010660000002351411014647435014570 0ustar prepare(" WHERE post_author = %d ", $author_id); } // grab a snapshot of post IDs, just in case it changes during the export $post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts $where ORDER BY post_date_gmt ASC"); $categories = (array) get_categories('get=all'); $tags = (array) get_tags('get=all'); function wxr_missing_parents($categories) { if ( !is_array($categories) || empty($categories) ) return array(); foreach ( $categories as $category ) $parents[$category->term_id] = $category->parent; $parents = array_unique(array_diff($parents, array_keys($parents))); if ( $zero = array_search('0', $parents) ) unset($parents[$zero]); return $parents; } while ( $parents = wxr_missing_parents($categories) ) { $found_parents = get_categories("include=" . join(', ', $parents)); if ( is_array($found_parents) && count($found_parents) ) $categories = array_merge($categories, $found_parents); else break; } // Put them in order to be inserted with no child going before its parent $pass = 0; $passes = 1000 + count($categories); while ( ( $cat = array_shift($categories) ) && ++$pass < $passes ) { if ( $cat->parent == 0 || isset($cats[$cat->parent]) ) { $cats[$cat->term_id] = $cat; } else { $categories[] = $cat; } } unset($categories); function wxr_cdata($str) { if ( seems_utf8($str) == false ) $str = utf8_encode($str); // $str = ent2ncr(wp_specialchars($str)); $str = ""; return $str; } function wxr_site_url() { global $current_site; // mu: the base url if ( isset($current_site->domain) ) { return 'http://'.$current_site->domain.$current_site->path; } // wp: the blog url else { return get_bloginfo_rss('url'); } } function wxr_cat_name($c) { if ( empty($c->name) ) return; echo '' . wxr_cdata($c->name) . ''; } function wxr_category_description($c) { if ( empty($c->description) ) return; echo '' . wxr_cdata($c->description) . ''; } function wxr_tag_name($t) { if ( empty($t->name) ) return; echo '' . wxr_cdata($t->name) . ''; } function wxr_tag_description($t) { if ( empty($t->description) ) return; echo '' . wxr_cdata($t->description) . ''; } function wxr_post_taxonomy() { $categories = get_the_category(); $tags = get_the_tags(); $the_list = ''; $filter = 'rss'; if ( !empty($categories) ) foreach ( (array) $categories as $category ) { $cat_name = sanitize_term_field('name', $category->name, $category->term_id, 'category', $filter); // for backwards compatibility $the_list .= "\n\t\t\n"; // forwards compatibility: use a unique identifier for each cat to avoid clashes // http://trac.wordpress.org/ticket/5447 $the_list .= "\n\t\tslug}\">\n"; } if ( !empty($tags) ) foreach ( (array) $tags as $tag ) { $tag_name = sanitize_term_field('name', $tag->name, $tag->term_id, 'post_tag', $filter); $the_list .= "\n\t\t\n"; // forwards compatibility as above $the_list .= "\n\t\tslug}\">\n"; } echo $the_list; } echo '\n"; ?> <?php bloginfo_rss('name'); ?> http://wordpress.org/?v= slug; ?>parent ? $cats[$c->parent]->name : ''; ?> slug; ?> in_the_loop = true; // Fake being in the loop. // fetch 20 posts at a time rather than loading the entire table into memory while ( $next_posts = array_splice($post_ids, 0, 20) ) { $where = "WHERE ID IN (".join(',', $next_posts).")"; $posts = $wpdb->get_results("SELECT * FROM $wpdb->posts $where ORDER BY post_date_gmt ASC"); foreach ($posts as $post) { setup_postdata($post); ?> <?php echo apply_filters('the_title_rss', $post->post_title); ?> post_content) ); ?> post_excerpt) ); ?> ID; ?> post_date; ?> post_date_gmt; ?> comment_status; ?> ping_status; ?> post_name; ?> post_status; ?> post_parent; ?> menu_order; ?> post_type; ?> post_password; ?> post_type == 'attachment') { ?> ID); ?> get_results( $wpdb->prepare("SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID) ); if ( $postmeta ) { ?> meta_key; ?> meta_value; ?> get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d", $post->ID) ); if ( $comments ) { foreach ( $comments as $c ) { ?> comment_ID; ?> comment_author); ?> comment_author_email; ?> comment_author_url; ?> comment_author_IP; ?> comment_date; ?> comment_date_gmt; ?> comment_content) ?> comment_approved; ?> comment_type; ?> comment_parent; ?> user_id; ?> wp/dev/wp-admin/includes/theme.php0000644000106600010660000000274211021621053014333 0ustar name = $current_theme; $ct->title = $themes[$current_theme]['Title']; $ct->version = $themes[$current_theme]['Version']; $ct->parent_theme = $themes[$current_theme]['Parent Theme']; $ct->template_dir = $themes[$current_theme]['Template Dir']; $ct->stylesheet_dir = $themes[$current_theme]['Stylesheet Dir']; $ct->template = $themes[$current_theme]['Template']; $ct->stylesheet = $themes[$current_theme]['Stylesheet']; $ct->screenshot = $themes[$current_theme]['Screenshot']; $ct->description = $themes[$current_theme]['Description']; $ct->author = $themes[$current_theme]['Author']; $ct->tags = $themes[$current_theme]['Tags']; return $ct; } function get_broken_themes() { global $wp_broken_themes; get_themes(); return $wp_broken_themes; } function get_page_templates() { $themes = get_themes(); $theme = get_current_theme(); $templates = $themes[$theme]['Template Files']; $page_templates = array (); if ( is_array( $templates ) ) { foreach ( $templates as $template ) { $template_data = implode( '', file( WP_CONTENT_DIR.$template )); preg_match( '|Template Name:(.*)$|mi', $template_data, $name ); preg_match( '|Description:(.*)$|mi', $template_data, $description ); $name = $name[1]; $description = $description[1]; if ( !empty( $name ) ) { $page_templates[trim( $name )] = basename( $template ); } } } return $page_templates; } ?> wp/dev/wp-admin/includes/admin.php0000644000106600010660000000151511000707526014325 0ustar wp/dev/wp-admin/includes/dashboard.php0000644000106600010660000005344711026752641015205 0ustar 'WordPress Dashboard', 'id' => 'wp_dashboard', 'before_widget' => "\t
    \n\n\t\t
    \n\n", 'after_widget' => "\t\t
    \n\n\t
    \n\n", 'before_title' => "\t\t\t

    ", 'after_title' => "

    \n\n" ) ); /* Register Widgets and Controls */ // Recent Comments Widget $mod_comments = wp_count_comments(); $mod_comments = $mod_comments->moderated; if ( current_user_can( 'moderate_comments' ) && $mod_comments ) { $notice = sprintf( __ngettext( '%d comment awaiting moderation', '%d comments awaiting moderation', $mod_comments ), $mod_comments ); $notice = "$notice"; } else { $notice = ''; } wp_register_sidebar_widget( 'dashboard_recent_comments', __( 'Recent Comments' ), 'wp_dashboard_recent_comments', array( 'all_link' => 'edit-comments.php', 'notice' => $notice, 'width' => 'half' ) ); // Incoming Links Widget if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) { $update = true; $widget_options['dashboard_incoming_links'] = array( 'home' => get_option('home'), 'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ), 'url' => apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&ie=utf-8&num=10&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ), 'items' => 5, 'show_date' => 0 ); } wp_register_sidebar_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_empty', array( 'all_link' => $widget_options['dashboard_incoming_links']['link'], 'feed_link' => $widget_options['dashboard_incoming_links']['url'], 'width' => 'half' ), 'wp_dashboard_cached_rss_widget', 'wp_dashboard_incoming_links_output' ); wp_register_widget_control( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_rss_control', array(), array( 'widget_id' => 'dashboard_incoming_links', 'form_inputs' => array( 'title' => false, 'show_summary' => false, 'show_author' => false ) ) ); // WP Plugins Widget wp_register_sidebar_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_empty', array( 'all_link' => 'http://wordpress.org/extend/plugins/', 'feed_link' => 'http://wordpress.org/extend/plugins/rss/topics/', 'width' => 'half' ), 'wp_dashboard_cached_rss_widget', 'wp_dashboard_plugins_output', array( 'http://wordpress.org/extend/plugins/rss/browse/popular/', 'http://wordpress.org/extend/plugins/rss/browse/new/', 'http://wordpress.org/extend/plugins/rss/browse/updated/' ) ); // Primary feed (Dev Blog) Widget if ( !isset( $widget_options['dashboard_primary'] ) ) { $update = true; $widget_options['dashboard_primary'] = array( 'link' => apply_filters( 'dashboard_primary_link', __( 'http://wordpress.org/development/' ) ), 'url' => apply_filters( 'dashboard_primary_feed', __( 'http://wordpress.org/development/feed/' ) ), 'title' => apply_filters( 'dashboard_primary_title', __( 'WordPress Development Blog' ) ), 'items' => 2, 'show_summary' => 1, 'show_author' => 0, 'show_date' => 1 ); } wp_register_sidebar_widget( 'dashboard_primary', $widget_options['dashboard_primary']['title'], 'wp_dashboard_empty', array( 'all_link' => $widget_options['dashboard_primary']['link'], 'feed_link' => $widget_options['dashboard_primary']['url'], 'width' => 'half', 'class' => 'widget_rss' ), 'wp_dashboard_cached_rss_widget', 'wp_dashboard_rss_output' ); wp_register_widget_control( 'dashboard_primary', __( 'Primary Feed' ), 'wp_dashboard_rss_control', array(), array( 'widget_id' => 'dashboard_primary' ) ); // Secondary Feed (Planet) Widget if ( !isset( $widget_options['dashboard_secondary'] ) ) { $update = true; $widget_options['dashboard_secondary'] = array( 'link' => apply_filters( 'dashboard_secondary_link', __( 'http://planet.wordpress.org/' ) ), 'url' => apply_filters( 'dashboard_secondary_feed', __( 'http://planet.wordpress.org/feed/' ) ), 'title' => apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ), 'items' => 15 ); } wp_register_sidebar_widget( 'dashboard_secondary', $widget_options['dashboard_secondary']['title'], 'wp_dashboard_empty', array( 'all_link' => $widget_options['dashboard_secondary']['link'], 'feed_link' => $widget_options['dashboard_secondary']['url'], 'width' => 'full' ), 'wp_dashboard_cached_rss_widget', 'wp_dashboard_secondary_output' ); wp_register_widget_control( 'dashboard_secondary', __( 'Secondary Feed' ), 'wp_dashboard_rss_control', array(), array( 'widget_id' => 'dashboard_secondary', 'form_inputs' => array( 'show_summary' => false, 'show_author' => false, 'show_date' => false ) ) ); /* Dashboard Widget Template wp_register_sidebar_widget( $widget_id (unique slug) , $widget_title, $output_callback, array( 'all_link' => full url for "See All" link, 'feed_link' => full url for "RSS" link, 'width' => 'fourth', 'third', 'half', 'full' (defaults to 'half'), 'height' => 'single', 'double' (defaults to 'single'), ), $wp_dashboard_empty_callback (only needed if using 'wp_dashboard_empty' as your $output_callback), $arg, $arg, $arg... (further args passed to callbacks) ); // optional: if you want users to be able to edit the settings of your widget, you need to register a widget_control wp_register_widget_control( $widget_id, $widget_control_title, $control_output_callback, array(), // leave an empty array here: oddity in widget code array( 'widget_id' => $widget_id, // Yes - again. This is required: oddity in widget code 'arg' => an arg to pass to the $control_output_callback, 'another' => another arg to pass to the $control_output_callback, ... ) ); */ // Hook to register new widgets do_action( 'wp_dashboard_setup' ); // Hard code the sidebar's widgets and order $dashboard_widgets = array(); $dashboard_widgets[] = 'dashboard_recent_comments'; $dashboard_widgets[] = 'dashboard_incoming_links'; $dashboard_widgets[] = 'dashboard_primary'; if ( current_user_can( 'activate_plugins' ) ) $dashboard_widgets[] = 'dashboard_plugins'; $dashboard_widgets[] = 'dashboard_secondary'; // Filter widget order $dashboard_widgets = apply_filters( 'wp_dashboard_widgets', $dashboard_widgets ); $wp_dashboard_sidebars = array( 'wp_dashboard' => $dashboard_widgets, 'array_version' => 3.5 ); add_filter( 'dynamic_sidebar_params', 'wp_dashboard_dynamic_sidebar_params' ); if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget_id']) ) { ob_start(); // hack - but the same hack wp-admin/widgets.php uses wp_dashboard_trigger_widget_control( $_POST['widget_id'] ); ob_end_clean(); wp_redirect( remove_query_arg( 'edit' ) ); exit; } if ( $update ) update_option( 'dashboard_widget_options', $widget_options ); } // Echoes out the dashboard function wp_dashboard() { echo "
    \n\n"; // We're already filtering dynamic_sidebar_params obove add_filter( 'option_sidebars_widgets', 'wp_dashboard_sidebars_widgets' ); // here there be hackery dynamic_sidebar( 'wp_dashboard' ); remove_filter( 'option_sidebars_widgets', 'wp_dashboard_sidebars_widgets' ); echo "
    \n
    \n\n\n"; } // Makes sidebar_widgets option reflect the dashboard settings function wp_dashboard_sidebars_widgets() { // hackery return $GLOBALS['wp_dashboard_sidebars']; } // Modifies sidbar params on the fly to set up ids, class names, titles for each widget (called once per widget) // Switches widget to edit mode if $_GET['edit'] function wp_dashboard_dynamic_sidebar_params( $params ) { global $wp_registered_widgets, $wp_registered_widget_controls; $sidebar_defaults = array('widget_id' => 0, 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => ''); extract( $sidebar_defaults, EXTR_PREFIX_ALL, 'sidebar' ); extract( $params[0], EXTR_PREFIX_ALL, 'sidebar' ); if ( !isset($wp_registered_widgets[$sidebar_widget_id]) || !is_array($wp_registered_widgets[$sidebar_widget_id]) ) { return $params; } $widget_defaults = array('id' => '', 'width' => '', 'height' => '', 'class' => '', 'feed_link' => '', 'all_link' => '', 'notice' => false, 'error' => false); extract( $widget_defaults, EXTR_PREFIX_ALL, 'widget' ); extract( $wp_registered_widgets[$sidebar_widget_id], EXTR_PREFIX_ALL, 'widget' ); $the_classes = array(); if ( in_array($widget_width, array( 'third', 'fourth', 'full' ) ) ) $the_classes[] = $widget_width; if ( 'double' == $widget_height ) $the_classes[] = 'double'; if ( $widget_class ) $the_classes[] = $widget_class; // Add classes to the widget holder if ( $the_classes ) $sidebar_before_widget = str_replace( "
    ' . __( 'See All' ) . ''; $content_class = 'dashboard-widget-content'; if ( current_user_can( 'edit_dashboard' ) && isset($wp_registered_widget_controls[$widget_id]) && is_callable($wp_registered_widget_controls[$widget_id]['callback']) ) { // Switch this widget to edit mode if ( isset($_GET['edit']) && $_GET['edit'] == $widget_id ) { $content_class .= ' dashboard-widget-control'; $wp_registered_widgets[$widget_id]['callback'] = 'wp_dashboard_empty'; $sidebar_widget_name = $wp_registered_widget_controls[$widget_id]['name']; $params[1] = 'wp_dashboard_trigger_widget_control'; $sidebar_before_widget .= '
    '; $sidebar_after_widget = "
    $sidebar_after_widget"; $links[] = '' . __( 'Cancel' ) . ''; } else { $links[] = '' . __( 'Edit' ) . ''; } } if ( $widget_feed_link ) $links[] = '' . __( 'rss icon' ) . ' ' . __( 'RSS' ) . ''; $links = apply_filters( "wp_dashboard_widget_links_$widget_id", $links ); // Add links to widget's title bar if ( $links ) { $sidebar_before_title .= ''; $sidebar_after_title = '' . join( ' | ', $links ) . "
    $sidebar_after_title"; } // Could have put this in widget-content. Doesn't really matter if ( $widget_notice ) $sidebar_after_title .= "\t\t\t
    $widget_notice
    \n\n"; if ( $widget_error ) $sidebar_after_title .= "\t\t\t
    $widget_error
    \n\n"; $sidebar_after_title .= "\t\t\t
    \n\n"; $sidebar_after_widget .= "\t\t\t
    \n\n"; foreach( array_keys( $params[0] ) as $key ) $$key = ${'sidebar_' . $key}; $params[0] = compact( array_keys( $params[0] ) ); return $params; } /* Dashboard Widgets */ function wp_dashboard_recent_comments( $sidebar_args ) { global $comment; extract( $sidebar_args, EXTR_SKIP ); echo $before_widget; echo $before_title; echo $widget_name; echo $after_title; $lambda = create_function( '', 'return 5;' ); add_filter( 'option_posts_per_rss', $lambda ); // hack - comments query doesn't accept per_page parameter $comments_query = new WP_Query(array('feed' => 'rss2', 'withcomments' => 1)); remove_filter( 'option_posts_per_rss', $lambda ); $is_first = true; if ( $comments_query->have_comments() ) { while ( $comments_query->have_comments() ) { $comments_query->the_comment(); $comment_post_url = get_permalink( $comment->comment_post_ID ); $comment_post_title = get_the_title( $comment->comment_post_ID ); $comment_post_link = "$comment_post_title"; $comment_link = '#'; $comment_meta = sprintf( __( 'From %1$s on %2$s %3$s' ), get_comment_author(), $comment_post_link, $comment_link ); if ( $is_first ) : $is_first = false; ?>

    comment_count > 1 ) : ?>
    • comment_count > 1 ) : ?>
    items) && 0 < count($rss->items) ) { echo "
      \n"; $rss->items = array_slice($rss->items, 0, $items); foreach ( $rss->items as $item ) { $publisher = ''; $site_link = ''; $link = ''; $content = ''; $date = ''; $link = clean_url( strip_tags( $item['link'] ) ); if ( isset( $item['author_uri'] ) ) $site_link = clean_url( strip_tags( $item['author_uri'] ) ); if ( !$publisher = wp_specialchars( strip_tags( isset($item['dc']['publisher']) ? $item['dc']['publisher'] : $item['author_name'] ) ) ) $publisher = __( 'Somebody' ); if ( $site_link ) $publisher = "$publisher"; else $publisher = "$publisher"; if ( isset($item['description']) ) $content = $item['description']; elseif ( isset($item['summary']) ) $content = $item['summary']; elseif ( isset($item['atom_content']) ) $content = $item['atom_content']; else $content = __( 'something' ); $content = wp_html_excerpt($content, 50) . ' ...'; if ( $link ) $text = _c( '%1$s linked here saying, "%3$s"|feed_display' ); else $text = _c( '%1$s linked here saying, "%3$s"|feed_display' ); if ( $show_date ) { if ( $show_author || $show_summary ) $text .= _c( ' on %4$s|feed_display' ); $date = wp_specialchars( strip_tags( isset($item['pubdate']) ? $item['pubdate'] : $item['published'] ) ); $date = strtotime( $date ); $date = gmdate( get_option( 'date_format' ), $date ); } echo "\t
    • " . sprintf( _c( "$text|feed_display" ), $publisher, $link, $content, $date ) . "
    • \n"; } echo "
    \n"; } else { echo '

    ' . __('This dashboard widget queries Google Blog Search so that when another blog links to your site it will show up here. It has found no incoming links… yet. It’s okay — there is no rush.') . "

    \n"; } } // $sidebar_args are handled by wp_dashboard_empty() function wp_dashboard_rss_output( $widget_id ) { $widgets = get_option( 'dashboard_widget_options' ); wp_widget_rss_output( $widgets[$widget_id] ); } // $sidebar_args are handled by wp_dashboard_empty() function wp_dashboard_secondary_output() { $widgets = get_option( 'dashboard_widget_options' ); @extract( @$widgets['dashboard_secondary'], EXTR_SKIP ); $rss = @fetch_rss( $url ); if ( !isset($rss->items) || 0 == count($rss->items) ) return false; echo "
      \n"; $rss->items = array_slice($rss->items, 0, $items); foreach ($rss->items as $item ) { $title = wp_specialchars($item['title']); list($author,$post) = explode( ':', $title, 2 ); $link = clean_url($item['link']); echo "\t
    • $post$author
    • \n"; } echo "
    \n
    \n"; } // $sidebar_args are handled by wp_dashboard_empty() function wp_dashboard_plugins_output() { $popular = @fetch_rss( 'http://wordpress.org/extend/plugins/rss/browse/popular/' ); $new = @fetch_rss( 'http://wordpress.org/extend/plugins/rss/browse/new/' ); $updated = @fetch_rss( 'http://wordpress.org/extend/plugins/rss/browse/updated/' ); foreach ( array( 'popular' => __('Most Popular'), 'new' => __('Newest Plugins'), 'updated' => __('Recently Updated') ) as $feed => $label ) { if ( !isset($$feed->items) || 0 == count($$feed->items) ) continue; $$feed->items = array_slice($$feed->items, 0, 5); $item_key = array_rand($$feed->items); // Eliminate some common badly formed plugin descriptions while ( ( null !== $item_key = array_rand($$feed->items) ) && false !== strpos( $$feed->items[$item_key]['description'], 'Plugin Name:' ) ) unset($$feed->items[$item_key]); if ( !isset($$feed->items[$item_key]) ) continue; $item = $$feed->items[$item_key]; // current bbPress feed item titles are: user on "topic title" if ( preg_match( '/"(.*)"/s', $item['title'], $matches ) ) $title = $matches[1]; else // but let's make it forward compatible if things change $title = $item['title']; $title = wp_specialchars( $title ); $description = wp_specialchars( strip_tags(html_entity_decode($item['description'], ENT_QUOTES)) ); list($link, $frag) = explode( '#', $item['link'] ); $link = clean_url($link); $dlink = rtrim($link, '/') . '/download/'; echo "

    $label

    \n"; echo "
    $title
     (" . __( 'Download' ) . ")\n"; echo "

    $description

    \n"; } } // Checks to see if all of the feed url in $check_urls are cached. // If $check_urls is empty, look for the rss feed url found in the dashboard widget optios of $widget_id. // If cached, call $callback, a function that echoes out output for this widget. // If not cache, echo a "Loading..." stub which is later replaced by AJAX call (see top of /wp-admin/index.php) function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = array() ) { $loading = '

    ' . __( 'Loading…' ) . '

    '; if ( empty($check_urls) ) { $widgets = get_option( 'dashboard_widget_options' ); if ( empty($widgets[$widget_id]['url']) ) { echo $loading; return false; } $check_urls = array( $widgets[$widget_id]['url'] ); } require_once( ABSPATH . WPINC . '/rss.php' ); init(); // initialize rss constants $cache = new RSSCache( MAGPIE_CACHE_DIR, MAGPIE_CACHE_AGE ); foreach ( $check_urls as $check_url ) { $status = $cache->check_cache( $check_url ); if ( 'HIT' !== $status ) { echo $loading; return false; } } if ( $callback && is_callable( $callback ) ) { $args = array_slice( func_get_args(), 2 ); array_unshift( $args, $widget_id ); call_user_func_array( $callback, $args ); } return true; } // Empty widget used for JS/AJAX created output. // Callback inserts content between before_widget and after_widget. Used when widget is in edit mode. Can also be used for custom widgets. function wp_dashboard_empty( $sidebar_args, $callback = false ) { extract( $sidebar_args, EXTR_SKIP ); echo $before_widget; echo $before_title; echo $widget_name; echo $after_title; // When in edit mode, the callback passed to this function is the widget_control callback if ( $callback && is_callable( $callback ) ) { $args = array_slice( func_get_args(), 2 ); array_unshift( $args, $widget_id ); call_user_func_array( $callback, $args ); } echo $after_widget; } /* Dashboard Widgets Controls. Ssee also wp_dashboard_empty() */ // Calls widget_control callback function wp_dashboard_trigger_widget_control( $widget_control_id = false ) { global $wp_registered_widget_controls; if ( is_scalar($widget_control_id) && $widget_control_id && isset($wp_registered_widget_controls[$widget_control_id]) && is_callable($wp_registered_widget_controls[$widget_control_id]['callback']) ) call_user_func_array( $wp_registered_widget_controls[$widget_control_id]['callback'], $wp_registered_widget_controls[$widget_control_id]['params'] ); } // Sets up $args to be used as input to wp_widget_rss_form(), handles POST data from RSS-type widgets function wp_dashboard_rss_control( $args ) { extract( $args ); if ( !$widget_id ) return false; if ( !$widget_options = get_option( 'dashboard_widget_options' ) ) $widget_options = array(); if ( !isset($widget_options[$widget_id]) ) $widget_options[$widget_id] = array(); $number = 1; // Hack to use wp_widget_rss_form() $widget_options[$widget_id]['number'] = $number; if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget-rss'][$number]) ) { $_POST['widget-rss'][$number] = stripslashes_deep( $_POST['widget-rss'][$number] ); $widget_options[$widget_id] = wp_widget_rss_process( $_POST['widget-rss'][$number] ); // title is optional. If black, fill it if possible if ( !$widget_options[$widget_id]['title'] && isset($_POST['widget-rss'][$number]['title']) ) { require_once(ABSPATH . WPINC . '/rss.php'); $rss = fetch_rss($widget_options[$widget_id]['url']); $widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->channel['title'])); } update_option( 'dashboard_widget_options', $widget_options ); } wp_widget_rss_form( $widget_options[$widget_id], $form_inputs ); } ?> wp/dev/wp-admin/includes/image.php0000644000106600010660000002243211000736103014311 0ustar 0, 'credit' => '', 'camera' => '', 'caption' => '', 'created_timestamp' => 0, 'copyright' => '', 'focal_length' => 0, 'iso' => 0, 'shutter_speed' => 0, 'title' => '', ); // read iptc first, since it might contain data not available in exif such as caption, description etc if ( is_callable('iptcparse') ) { getimagesize($file, $info); if ( !empty($info['APP13']) ) { $iptc = iptcparse($info['APP13']); if ( !empty($iptc['2#110'][0]) ) // credit $meta['credit'] = trim( $iptc['2#110'][0] ); elseif ( !empty($iptc['2#080'][0]) ) // byline $meta['credit'] = trim( $iptc['2#080'][0] ); if ( !empty($iptc['2#055'][0]) and !empty($iptc['2#060'][0]) ) // created datee and time $meta['created_timestamp'] = strtotime($iptc['2#055'][0] . ' ' . $iptc['2#060'][0]); if ( !empty($iptc['2#120'][0]) ) // caption $meta['caption'] = trim( $iptc['2#120'][0] ); if ( !empty($iptc['2#116'][0]) ) // copyright $meta['copyright'] = trim( $iptc['2#116'][0] ); if ( !empty($iptc['2#005'][0]) ) // title $meta['title'] = trim( $iptc['2#005'][0] ); } } // fetch additional info from exif if available if ( is_callable('exif_read_data') && in_array($sourceImageType, apply_filters('wp_read_image_metadata_types', array(IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM)) ) ) { $exif = @exif_read_data( $file ); if (!empty($exif['FNumber'])) $meta['aperture'] = round( wp_exif_frac2dec( $exif['FNumber'] ), 2 ); if (!empty($exif['Model'])) $meta['camera'] = trim( $exif['Model'] ); if (!empty($exif['DateTimeDigitized'])) $meta['created_timestamp'] = wp_exif_date2ts($exif['DateTimeDigitized']); if (!empty($exif['FocalLength'])) $meta['focal_length'] = wp_exif_frac2dec( $exif['FocalLength'] ); if (!empty($exif['ISOSpeedRatings'])) $meta['iso'] = $exif['ISOSpeedRatings']; if (!empty($exif['ExposureTime'])) $meta['shutter_speed'] = wp_exif_frac2dec( $exif['ExposureTime'] ); } // FIXME: try other exif libraries if available return apply_filters( 'wp_read_image_metadata', $meta, $file, $sourceImageType ); } // is the file a real image file? function file_is_valid_image($path) { $size = @getimagesize($path); return !empty($size); } // is the file an image suitable for displaying within a web page? function file_is_displayable_image($path) { $info = @getimagesize($path); if ( empty($info) ) $result = false; elseif ( !in_array($info[2], array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG)) ) // only gif, jpeg and png images can reliably be displayed $result = false; elseif ( $info['channels'] > 0 && $info['channels'] != 3 ) { // some web browsers can't display cmyk or grayscale jpegs $result = false; } else $result = true; return apply_filters('file_is_displayable_image', $result, $path); } ?> wp/dev/wp-admin/includes/plugin.php0000644000106600010660000003740011044674500014540 0ustar '.$plugin.''; } if ('' == $author_uri[1] ) { $author = trim( $author_name[1] ); } else { $author = '' . trim( $author_name[1] ) . ''; } return array('Name' => $name, 'Title' => $plugin, 'Description' => $description, 'Author' => $author, 'Version' => $version); } function get_plugins($plugin_folder = '') { if ( ! $cache_plugins = wp_cache_get('plugins', 'plugins') ) $cache_plugins = array(); if ( isset($cache_plugins[ $plugin_folder ]) ) return $cache_plugins[ $plugin_folder ]; $wp_plugins = array (); $plugin_root = WP_PLUGIN_DIR; if( !empty($plugin_folder) ) $plugin_root .= $plugin_folder; // Files in wp-content/plugins directory $plugins_dir = @ opendir( $plugin_root); if ( $plugins_dir ) { while (($file = readdir( $plugins_dir ) ) !== false ) { if ( substr($file, 0, 1) == '.' ) continue; if ( is_dir( $plugin_root.'/'.$file ) ) { $plugins_subdir = @ opendir( $plugin_root.'/'.$file ); if ( $plugins_subdir ) { while (($subfile = readdir( $plugins_subdir ) ) !== false ) { if ( substr($subfile, 0, 1) == '.' ) continue; if ( substr($subfile, -4) == '.php' ) $plugin_files[] = "$file/$subfile"; } } } else { if ( substr($file, -4) == '.php' ) $plugin_files[] = $file; } } } @closedir( $plugins_dir ); @closedir( $plugins_subdir ); if ( !$plugins_dir || !$plugin_files ) return $wp_plugins; foreach ( $plugin_files as $plugin_file ) { if ( !is_readable( "$plugin_root/$plugin_file" ) ) continue; $plugin_data = get_plugin_data( "$plugin_root/$plugin_file" ); if ( empty ( $plugin_data['Name'] ) ) continue; $wp_plugins[plugin_basename( $plugin_file )] = $plugin_data; } uasort( $wp_plugins, create_function( '$a, $b', 'return strnatcasecmp( $a["Name"], $b["Name"] );' )); $cache_plugins[ $plugin_folder ] = $wp_plugins; wp_cache_set('plugins', $cache_plugins, 'plugins'); return $wp_plugins; } function is_plugin_active($plugin){ return in_array($plugin, get_option('active_plugins')); } function activate_plugin($plugin, $redirect = '') { $current = get_option('active_plugins'); $plugin = trim($plugin); $valid = validate_plugin($plugin); if ( is_wp_error($valid) ) return $valid; if ( !in_array($plugin, $current) ) { if ( !empty($redirect) ) wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect)); // we'll override this later if the plugin can be included without fatal error ob_start(); @include(WP_PLUGIN_DIR . '/' . $plugin); $current[] = $plugin; sort($current); update_option('active_plugins', $current); do_action('activate_' . $plugin); ob_end_clean(); } return null; } function deactivate_plugins($plugins, $silent= false) { $current = get_option('active_plugins'); if ( !is_array($plugins) ) $plugins = array($plugins); foreach ( $plugins as $plugin ) { if( ! is_plugin_active($plugin) ) continue; array_splice($current, array_search( $plugin, $current), 1 ); // Fixed Array-fu! if ( ! $silent ) //Used by Plugin updater to internally deactivate plugin, however, not to notify plugins of the fact to prevent plugin output. do_action('deactivate_' . trim( $plugin )); } update_option('active_plugins', $current); } function activate_plugins($plugins, $redirect = '') { if ( !is_array($plugins) ) $plugins = array($plugins); $errors = array(); foreach ( (array) $plugins as $plugin ) { if ( !empty($redirect) ) $redirect = add_query_arg('plugin', $plugin, $redirect); $result = activate_plugin($plugin, $redirect); if ( is_wp_error($result) ) $errors[$plugin] = $result; } if ( !empty($errors) ) return new WP_Error('plugins_invalid', __('One of the plugins is invalid.'), $errors); return true; } function delete_plugins($plugins, $redirect = '' ) { global $wp_filesystem; if( empty($plugins) ) return false; $checked = array(); foreach( $plugins as $plugin ) $checked[] = 'checked[]=' . $plugin; ob_start(); $url = wp_nonce_url('plugins.php?action=delete-selected&verify-delete=1&' . implode('&', $checked), 'bulk-manage-plugins'); if ( false === ($credentials = request_filesystem_credentials($url)) ) { $data = ob_get_contents(); ob_end_clean(); if( ! empty($data) ){ include_once( ABSPATH . 'wp-admin/admin-header.php'); echo $data; include( ABSPATH . 'wp-admin/admin-footer.php'); exit; } return; } if ( ! WP_Filesystem($credentials) ) { request_filesystem_credentials($url, '', true); //Failed to connect, Error and request again $data = ob_get_contents(); ob_end_clean(); if( ! empty($data) ){ include_once( ABSPATH . 'wp-admin/admin-header.php'); echo $data; include( ABSPATH . 'wp-admin/admin-footer.php'); exit; } return; } if ( $wp_filesystem->errors->get_error_code() ) { return $wp_filesystem->errors; } if ( ! is_object($wp_filesystem) ) return new WP_Error('fs_unavailable', __('Could not access filesystem.')); if ( $wp_filesystem->errors->get_error_code() ) return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem->errors); //Get the base plugin folder $plugins_dir = $wp_filesystem->wp_plugins_dir(); if ( empty($plugins_dir) ) return new WP_Error('fs_no_plugins_dir', __('Unable to locate WordPress Plugin directory.')); $plugins_dir = trailingslashit( $plugins_dir ); $errors = array(); foreach( $plugins as $plugin_file ) { $this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin_file) ); // If plugin is in its own directory, recursively delete the directory. if ( strpos($plugin_file, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory seperator AND that its not the root plugin folder $deleted = $wp_filesystem->delete($this_plugin_dir, true); else $deleted = $wp_filesystem->delete($plugins_dir . $plugin_file); if ( ! $deleted ) $errors[] = $plugin_file; } if( ! empty($errors) ) return new WP_Error('could_not_remove_plugin', sprintf(__('Could not fully remove the plugin(s) %s'), implode(', ', $errors)) ); return true; } function validate_active_plugins() { $check_plugins = get_option('active_plugins'); // Sanity check. If the active plugin list is not an array, make it an // empty array. if ( !is_array($check_plugins) ) { update_option('active_plugins', array()); return; } //Invalid is any plugin that is deactivated due to error. $invalid = array(); // If a plugin file does not exist, remove it from the list of active // plugins. foreach ( $check_plugins as $check_plugin ) { $result = validate_plugin($check_plugin); if ( is_wp_error( $result ) ) { $invalid[$check_plugin] = $result; deactivate_plugins( $check_plugin, true); } } return $invalid; } function validate_plugin($plugin) { if ( validate_file($plugin) ) return new WP_Error('plugin_invalid', __('Invalid plugin.')); if ( ! file_exists(WP_PLUGIN_DIR . '/' . $plugin) ) return new WP_Error('plugin_not_found', __('Plugin file does not exist.')); return 0; } // // Menu // function add_menu_page( $page_title, $menu_title, $access_level, $file, $function = '' ) { global $menu, $admin_page_hooks; $file = plugin_basename( $file ); $menu[] = array ( $menu_title, $access_level, $file, $page_title ); $admin_page_hooks[$file] = sanitize_title( $menu_title ); $hookname = get_plugin_page_hookname( $file, '' ); if (!empty ( $function ) && !empty ( $hookname )) add_action( $hookname, $function ); return $hookname; } function add_submenu_page( $parent, $page_title, $menu_title, $access_level, $file, $function = '' ) { global $submenu; global $menu; global $_wp_real_parent_file; global $_wp_submenu_nopriv; $file = plugin_basename( $file ); $parent = plugin_basename( $parent); if ( isset( $_wp_real_parent_file[$parent] ) ) $parent = $_wp_real_parent_file[$parent]; if ( !current_user_can( $access_level ) ) { $_wp_submenu_nopriv[$parent][$file] = true; return false; } // If the parent doesn't already have a submenu, add a link to the parent // as the first item in the submenu. If the submenu file is the same as the // parent file someone is trying to link back to the parent manually. In // this case, don't automatically add a link back to avoid duplication. if (!isset( $submenu[$parent] ) && $file != $parent ) { foreach ( $menu as $parent_menu ) { if ( $parent_menu[2] == $parent && current_user_can( $parent_menu[1] ) ) $submenu[$parent][] = $parent_menu; } } $submenu[$parent][] = array ( $menu_title, $access_level, $file, $page_title ); $hookname = get_plugin_page_hookname( $file, $parent); if (!empty ( $function ) && !empty ( $hookname )) add_action( $hookname, $function ); return $hookname; } function add_management_page( $page_title, $menu_title, $access_level, $file, $function = '' ) { return add_submenu_page( 'edit.php', $page_title, $menu_title, $access_level, $file, $function ); } function add_options_page( $page_title, $menu_title, $access_level, $file, $function = '' ) { return add_submenu_page( 'options-general.php', $page_title, $menu_title, $access_level, $file, $function ); } function add_theme_page( $page_title, $menu_title, $access_level, $file, $function = '' ) { return add_submenu_page( 'themes.php', $page_title, $menu_title, $access_level, $file, $function ); } function add_users_page( $page_title, $menu_title, $access_level, $file, $function = '' ) { if ( current_user_can('edit_users') ) $parent = 'users.php'; else $parent = 'profile.php'; return add_submenu_page( $parent, $page_title, $menu_title, $access_level, $file, $function ); } // // Pluggable Menu Support -- Private // function get_admin_page_parent() { global $parent_file; global $menu; global $submenu; global $pagenow; global $plugin_page; global $_wp_real_parent_file; global $_wp_menu_nopriv; global $_wp_submenu_nopriv; if ( !empty ( $parent_file ) ) { if ( isset( $_wp_real_parent_file[$parent_file] ) ) $parent_file = $_wp_real_parent_file[$parent_file]; return $parent_file; } if ( $pagenow == 'admin.php' && isset( $plugin_page ) ) { foreach ( $menu as $parent_menu ) { if ( $parent_menu[2] == $plugin_page ) { $parent_file = $plugin_page; if ( isset( $_wp_real_parent_file[$parent_file] ) ) $parent_file = $_wp_real_parent_file[$parent_file]; return $parent_file; } } if ( isset( $_wp_menu_nopriv[$plugin_page] ) ) { $parent_file = $plugin_page; if ( isset( $_wp_real_parent_file[$parent_file] ) ) $parent_file = $_wp_real_parent_file[$parent_file]; return $parent_file; } } if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$pagenow][$plugin_page] ) ) { $parent_file = $pagenow; if ( isset( $_wp_real_parent_file[$parent_file] ) ) $parent_file = $_wp_real_parent_file[$parent_file]; return $parent_file; } foreach (array_keys( $submenu ) as $parent) { foreach ( $submenu[$parent] as $submenu_array ) { if ( isset( $_wp_real_parent_file[$parent] ) ) $parent = $_wp_real_parent_file[$parent]; if ( $submenu_array[2] == $pagenow ) { $parent_file = $parent; return $parent; } else if ( isset( $plugin_page ) && ($plugin_page == $submenu_array[2] ) ) { $parent_file = $parent; return $parent; } } } $parent_file = ''; return ''; } function get_admin_page_title() { global $title; global $menu; global $submenu; global $pagenow; global $plugin_page; if ( isset( $title ) && !empty ( $title ) ) { return $title; } $hook = get_plugin_page_hook( $plugin_page, $pagenow ); $parent = $parent1 = get_admin_page_parent(); if ( empty ( $parent) ) { foreach ( $menu as $menu_array ) { if ( isset( $menu_array[3] ) ) { if ( $menu_array[2] == $pagenow ) { $title = $menu_array[3]; return $menu_array[3]; } else if ( isset( $plugin_page ) && ($plugin_page == $menu_array[2] ) && ($hook == $menu_array[3] ) ) { $title = $menu_array[3]; return $menu_array[3]; } } else { $title = $menu_array[0]; return $title; } } } else { foreach (array_keys( $submenu ) as $parent) { foreach ( $submenu[$parent] as $submenu_array ) { if ( isset( $plugin_page ) && ($plugin_page == $submenu_array[2] ) && (($parent == $pagenow ) || ($parent == $plugin_page ) || ($plugin_page == $hook ) || (($pagenow == 'admin.php' ) && ($parent1 != $submenu_array[2] ) ) ) ) { $title = $submenu_array[3]; return $submenu_array[3]; } if ( $submenu_array[2] != $pagenow || isset( $_GET['page'] ) ) // not the current page continue; if ( isset( $submenu_array[3] ) ) { $title = $submenu_array[3]; return $submenu_array[3]; } else { $title = $submenu_array[0]; return $title; } } } } return $title; } function get_plugin_page_hook( $plugin_page, $parent_page ) { $hook = get_plugin_page_hookname( $plugin_page, $parent_page ); if ( has_action($hook) ) return $hook; else return null; } function get_plugin_page_hookname( $plugin_page, $parent_page ) { global $admin_page_hooks; $parent = get_admin_page_parent(); $page_type = 'admin'; if ( empty ( $parent_page ) || 'admin.php' == $parent_page ) { if ( isset( $admin_page_hooks[$plugin_page] )) $page_type = 'toplevel'; else if ( isset( $admin_page_hooks[$parent] )) $page_type = $admin_page_hooks[$parent]; } else if ( isset( $admin_page_hooks[$parent_page] ) ) { $page_type = $admin_page_hooks[$parent_page]; } $plugin_name = preg_replace( '!\.php!', '', $plugin_page ); return $page_type.'_page_'.$plugin_name; } function user_can_access_admin_page() { global $pagenow; global $menu; global $submenu; global $_wp_menu_nopriv; global $_wp_submenu_nopriv; global $plugin_page; $parent = get_admin_page_parent(); if ( isset( $_wp_submenu_nopriv[$parent][$pagenow] ) ) return false; if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) ) return false; if ( empty( $parent) ) { if ( isset( $_wp_menu_nopriv[$pagenow] ) ) return false; if ( isset( $_wp_submenu_nopriv[$pagenow][$pagenow] ) ) return false; if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$pagenow][$plugin_page] ) ) return false; foreach (array_keys( $_wp_submenu_nopriv ) as $key ) { if ( isset( $_wp_submenu_nopriv[$key][$pagenow] ) ) return false; if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$key][$plugin_page] ) ) return false; } return true; } if ( isset( $submenu[$parent] ) ) { foreach ( $submenu[$parent] as $submenu_array ) { if ( isset( $plugin_page ) && ( $submenu_array[2] == $plugin_page ) ) { if ( current_user_can( $submenu_array[1] )) return true; else return false; } else if ( $submenu_array[2] == $pagenow ) { if ( current_user_can( $submenu_array[1] )) return true; else return false; } } } foreach ( $menu as $menu_array ) { if ( $menu_array[2] == $parent) { if ( current_user_can( $menu_array[1] )) return true; else return false; } } return true; } ?> wp/dev/wp-admin/includes/bookmark.php0000644000106600010660000001132211001312317015026 0ustar link_url = clean_url( $_GET['linkurl']); else $link->link_url = ''; if ( isset( $_GET['name'] ) ) $link->link_name = attribute_escape( $_GET['name']); else $link->link_name = ''; $link->link_visible = 'Y'; return $link; } function wp_delete_link($link_id) { global $wpdb; do_action('delete_link', $link_id); wp_delete_object_term_relationships($link_id, 'link_category'); $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->links WHERE link_id = %d", $link_id) ); do_action('deleted_link', $link_id); return true; } function wp_get_link_cats($link_id = 0) { $cats = wp_get_object_terms($link_id, 'link_category', 'fields=ids'); return array_unique($cats); } function get_link_to_edit( $link_id ) { return get_bookmark( $link_id, OBJECT, 'edit' ); } function wp_insert_link($linkdata) { global $wpdb, $current_user; $defaults = array('link_id' => 0, 'link_name' => '', 'link_url' => '', 'link_rating' => 0 ); $linkdata = wp_parse_args($linkdata, $defaults); $linkdata = sanitize_bookmark($linkdata, 'db'); extract(stripslashes_deep($linkdata), EXTR_SKIP); $update = false; if ( !empty($link_id) ) $update = true; if ( trim( $link_name ) == '' ) return 0; if ( trim( $link_url ) == '' ) return 0; if ( empty($link_rating) ) $link_rating = 0; if ( empty($link_image) ) $link_image = ''; if ( empty($link_target) ) $link_target = ''; if ( empty($link_visible) ) $link_visible = 'Y'; if ( empty($link_owner) ) $link_owner = $current_user->id; if ( empty($link_notes) ) $link_notes = ''; if ( empty($link_description) ) $link_description = ''; if ( empty($link_rss) ) $link_rss = ''; if ( empty($link_rel) ) $link_rel = ''; // Make sure we set a valid category if (0 == count($link_category) || !is_array($link_category)) { $link_category = array(get_option('default_link_category')); } if ( $update ) { $wpdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_url = %s, link_name = %s, link_image = %s, link_target = %s, link_visible = %s, link_description = %s, link_rating = %s, link_rel = %s, link_notes = %s, link_rss = %s WHERE link_id = %s", $link_url, $link_name, $link_image, $link_target, $link_visible, $link_description, $link_rating, $link_rel, $link_notes, $link_rss, $link_id) ); } else { $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->links (link_url, link_name, link_image, link_target, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", $link_url,$link_name, $link_image, $link_target, $link_description, $link_visible, $link_owner, $link_rating, $link_rel, $link_notes, $link_rss) ); $link_id = (int) $wpdb->insert_id; } wp_set_link_cats($link_id, $link_category); if ( $update ) do_action('edit_link', $link_id); else do_action('add_link', $link_id); return $link_id; } function wp_set_link_cats($link_id = 0, $link_categories = array()) { // If $link_categories isn't already an array, make it one: if (!is_array($link_categories) || 0 == count($link_categories)) $link_categories = array(get_option('default_link_category')); $link_categories = array_map('intval', $link_categories); $link_categories = array_unique($link_categories); wp_set_object_terms($link_id, $link_categories, 'link_category'); } // wp_set_link_cats() function wp_update_link($linkdata) { $link_id = (int) $linkdata['link_id']; $link = get_link($link_id, ARRAY_A); // Escape data pulled from DB. $link = add_magic_quotes($link); // Passed link category list overwrites existing category list if not empty. if ( isset($linkdata['link_category']) && is_array($linkdata['link_category']) && 0 != count($linkdata['link_category']) ) $link_cats = $linkdata['link_category']; else $link_cats = $link['link_category']; // Merge old and new fields with new fields overwriting old ones. $linkdata = array_merge($link, $linkdata); $linkdata['link_category'] = $link_cats; return wp_insert_link($linkdata); } ?>wp/dev/wp-admin/includes/post.php0000644000106600010660000005362311041400704014222 0ustar 31 ) ? 31 : $jj; $jj = ($jj <= 0 ) ? date('j') : $jj; $hh = ($hh > 23 ) ? $hh -24 : $hh; $mn = ($mn > 59 ) ? $mn -60 : $mn; $ss = ($ss > 59 ) ? $ss -60 : $ss; $_POST['post_date'] = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $aa, $mm, $jj, $hh, $mn, $ss ); $_POST['post_date_gmt'] = get_gmt_from_date( $_POST['post_date'] ); } return true; } // Update an existing post with values provided in $_POST. function edit_post() { $post_ID = (int) $_POST['post_ID']; if ( 'page' == $_POST['post_type'] ) { if ( !current_user_can( 'edit_page', $post_ID ) ) wp_die( __('You are not allowed to edit this page.' )); } else { if ( !current_user_can( 'edit_post', $post_ID ) ) wp_die( __('You are not allowed to edit this post.' )); } // Autosave shouldn't save too soon after a real save if ( 'autosave' == $_POST['action'] ) { $post =& get_post( $post_ID ); $now = time(); $then = strtotime($post->post_date_gmt . ' +0000'); $delta = AUTOSAVE_INTERVAL / 2; if ( ($now - $then) < $delta ) return $post_ID; } $translated = _wp_translate_postdata( true ); if ( is_wp_error($translated) ) wp_die( $translated->get_error_message() ); // Meta Stuff if ( isset($_POST['meta']) && $_POST['meta'] ) { foreach ( $_POST['meta'] as $key => $value ) update_meta( $key, $value['key'], $value['value'] ); } if ( isset($_POST['deletemeta']) && $_POST['deletemeta'] ) { foreach ( $_POST['deletemeta'] as $key => $value ) delete_meta( $key ); } add_meta( $post_ID ); wp_update_post( $_POST ); // Reunite any orphaned attachments with their parent if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) ) $draft_ids = array(); if ( $draft_temp_id = (int) array_search( $post_ID, $draft_ids ) ) _relocate_children( $draft_temp_id, $post_ID ); // Now that we have an ID we can fix any attachment anchor hrefs _fix_attachment_links( $post_ID ); wp_set_post_lock( $post_ID, $GLOBALS['current_user']->ID ); return $post_ID; } // Default post information to use when populating the "Write Post" form. function get_default_post_to_edit() { if ( !empty( $_REQUEST['post_title'] ) ) $post_title = wp_specialchars( stripslashes( $_REQUEST['post_title'] )); else if ( !empty( $_REQUEST['popuptitle'] ) ) { $post_title = wp_specialchars( stripslashes( $_REQUEST['popuptitle'] )); $post_title = funky_javascript_fix( $post_title ); } else { $post_title = ''; } $post_content = ''; if ( !empty( $_REQUEST['content'] ) ) $post_content = wp_specialchars( stripslashes( $_REQUEST['content'] )); else if ( !empty( $post_title ) ) { $text = wp_specialchars( stripslashes( urldecode( $_REQUEST['text'] ) ) ); $text = funky_javascript_fix( $text); $popupurl = clean_url($_REQUEST['popupurl']); $post_content = ''.$post_title.''."\n$text"; } if ( !empty( $_REQUEST['excerpt'] ) ) $post_excerpt = wp_specialchars( stripslashes( $_REQUEST['excerpt'] )); else $post_excerpt = ''; $post->ID = 0; $post->post_name = ''; $post->post_author = ''; $post->post_date = ''; $post->post_status = 'draft'; $post->post_type = 'post'; $post->to_ping = ''; $post->pinged = ''; $post->comment_status = get_option( 'default_comment_status' ); $post->ping_status = get_option( 'default_ping_status' ); $post->post_pingback = get_option( 'default_pingback_flag' ); $post->post_category = get_option( 'default_category' ); $post->post_content = apply_filters( 'default_content', $post_content); $post->post_title = apply_filters( 'default_title', $post_title ); $post->post_excerpt = apply_filters( 'default_excerpt', $post_excerpt); $post->page_template = 'default'; $post->post_parent = 0; $post->menu_order = 0; return $post; } function get_default_page_to_edit() { $page = get_default_post_to_edit(); $page->post_type = 'page'; return $page; } // Get an existing post and format it for editing. function get_post_to_edit( $id ) { $post = get_post( $id, OBJECT, 'edit' ); if ( $post->post_type == 'page' ) $post->page_template = get_post_meta( $id, '_wp_page_template', true ); return $post; } function post_exists($title, $content = '', $post_date = '') { global $wpdb; if (!empty ($post_date)) $post_date = $wpdb->prepare("AND post_date = %s", $post_date); if (!empty ($title)) return $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_title = %s $post_date", $title) ); else if (!empty ($content)) return $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_content = %s $post_date", $content) ); return 0; } // Creates a new post from the "Write Post" form using $_POST information. function wp_write_post() { global $user_ID; if ( 'page' == $_POST['post_type'] ) { if ( !current_user_can( 'edit_pages' ) ) return new WP_Error( 'edit_pages', __( 'You are not allowed to create pages on this blog.' ) ); } else { if ( !current_user_can( 'edit_posts' ) ) return new WP_Error( 'edit_posts', __( 'You are not allowed to create posts or drafts on this blog.' ) ); } // Check for autosave collisions $temp_id = false; if ( isset($_POST['temp_ID']) ) { $temp_id = (int) $_POST['temp_ID']; if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) ) $draft_ids = array(); foreach ( $draft_ids as $temp => $real ) if ( time() + $temp > 86400 ) // 1 day: $temp is equal to -1 * time( then ) unset($draft_ids[$temp]); if ( isset($draft_ids[$temp_id]) ) { // Edit, don't write $_POST['post_ID'] = $draft_ids[$temp_id]; unset($_POST['temp_ID']); update_user_option( $user_ID, 'autosave_draft_ids', $draft_ids ); return edit_post(); } } $translated = _wp_translate_postdata( false ); if ( is_wp_error($translated) ) return $translated; // Create the post. $post_ID = wp_insert_post( $_POST ); if ( is_wp_error( $post_ID ) ) return $post_ID; if ( empty($post_ID) ) return 0; add_meta( $post_ID ); // Reunite any orphaned attachments with their parent if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) ) $draft_ids = array(); if ( $draft_temp_id = (int) array_search( $post_ID, $draft_ids ) ) _relocate_children( $draft_temp_id, $post_ID ); if ( $temp_id && $temp_id != $draft_temp_id ) _relocate_children( $temp_id, $post_ID ); // Update autosave collision detection if ( $temp_id ) { $draft_ids[$temp_id] = $post_ID; update_user_option( $user_ID, 'autosave_draft_ids', $draft_ids ); } // Now that we have an ID we can fix any attachment anchor hrefs _fix_attachment_links( $post_ID ); wp_set_post_lock( $post_ID, $GLOBALS['current_user']->ID ); return $post_ID; } function write_post() { $result = wp_write_post(); if( is_wp_error( $result ) ) wp_die( $result->get_error_message() ); else return $result; } // // Post Meta // function add_meta( $post_ID ) { global $wpdb; $post_ID = (int) $post_ID; $protected = array( '_wp_attached_file', '_wp_attachment_metadata', '_wp_old_slug', '_wp_page_template' ); $metakeyselect = $wpdb->escape( stripslashes( trim( $_POST['metakeyselect'] ) ) ); $metakeyinput = $wpdb->escape( stripslashes( trim( $_POST['metakeyinput'] ) ) ); $metavalue = maybe_serialize( stripslashes( (trim( $_POST['metavalue'] ) ) )); $metavalue = $wpdb->escape( $metavalue ); if ( ('0' === $metavalue || !empty ( $metavalue ) ) && ((('#NONE#' != $metakeyselect) && !empty ( $metakeyselect) ) || !empty ( $metakeyinput) ) ) { // We have a key/value pair. If both the select and the // input for the key have data, the input takes precedence: if ('#NONE#' != $metakeyselect) $metakey = $metakeyselect; if ( $metakeyinput) $metakey = $metakeyinput; // default if ( in_array($metakey, $protected) ) return false; wp_cache_delete($post_ID, 'post_meta'); $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->postmeta (post_id,meta_key,meta_value ) VALUES (%s, %s, %s)", $post_ID, $metakey, $metavalue) ); return $wpdb->insert_id; } return false; } // add_meta function delete_meta( $mid ) { global $wpdb; $mid = (int) $mid; $post_id = $wpdb->get_var( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = %d", $mid) ); wp_cache_delete($post_id, 'post_meta'); return $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_id = %d", $mid) ); } // Get a list of previously defined keys function get_meta_keys() { global $wpdb; $keys = $wpdb->get_col( " SELECT meta_key FROM $wpdb->postmeta GROUP BY meta_key ORDER BY meta_key" ); return $keys; } function get_post_meta_by_id( $mid ) { global $wpdb; $mid = (int) $mid; $meta = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->postmeta WHERE meta_id = %d", $mid) ); if ( is_serialized_string( $meta->meta_value ) ) $meta->meta_value = maybe_unserialize( $meta->meta_value ); return $meta; } // Some postmeta stuff function has_meta( $postid ) { global $wpdb; return $wpdb->get_results( $wpdb->prepare("SELECT meta_key, meta_value, meta_id, post_id FROM $wpdb->postmeta WHERE post_id = %d ORDER BY meta_key,meta_id", $postid), ARRAY_A ); } function update_meta( $meta_id, $meta_key, $meta_value ) { global $wpdb; $protected = array( '_wp_attached_file', '_wp_attachment_metadata', '_wp_old_slug', '_wp_page_template' ); if ( in_array($meta_key, $protected) ) return false; $post_id = $wpdb->get_var( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = %d", $meta_id) ); wp_cache_delete($post_id, 'post_meta'); $meta_value = maybe_serialize( stripslashes( $meta_value )); $meta_id = (int) $meta_id; $data = compact( 'meta_key', 'meta_value' ); $where = compact( 'meta_id' ); return $wpdb->update( $wpdb->postmeta, $data, $where ); } // // Private // // Replace hrefs of attachment anchors with up-to-date permalinks. function _fix_attachment_links( $post_ID ) { $post = & get_post( $post_ID, ARRAY_A ); $search = "#]+rel=('|\")[^'\"]*attachment[^>]*>#ie"; // See if we have any rel="attachment" links if ( 0 == preg_match_all( $search, $post['post_content'], $anchor_matches, PREG_PATTERN_ORDER ) ) return; $i = 0; $search = "#[\s]+rel=(\"|')(.*?)wp-att-(\d+)\\1#i"; foreach ( $anchor_matches[0] as $anchor ) { if ( 0 == preg_match( $search, $anchor, $id_matches ) ) continue; $id = (int) $id_matches[3]; // While we have the attachment ID, let's adopt any orphans. $attachment = & get_post( $id, ARRAY_A ); if ( ! empty( $attachment) && ! is_object( get_post( $attachment['post_parent'] ) ) ) { $attachment['post_parent'] = $post_ID; // Escape data pulled from DB. $attachment = add_magic_quotes( $attachment); wp_update_post( $attachment); } $post_search[$i] = $anchor; $post_replace[$i] = preg_replace( "#href=(\"|')[^'\"]*\\1#e", "stripslashes( 'href=\\1' ).get_attachment_link( $id ).stripslashes( '\\1' )", $anchor ); ++$i; } $post['post_content'] = str_replace( $post_search, $post_replace, $post['post_content'] ); // Escape data pulled from DB. $post = add_magic_quotes( $post); return wp_update_post( $post); } // Move child posts to a new parent function _relocate_children( $old_ID, $new_ID ) { global $wpdb; $old_ID = (int) $old_ID; $new_ID = (int) $new_ID; return $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_parent = %d WHERE post_parent = %d", $new_ID, $old_ID) ); } function get_available_post_statuses($type = 'post') { $stati = wp_count_posts($type); return array_keys(get_object_vars($stati)); } function wp_edit_posts_query( $q = false ) { global $wpdb; if ( false === $q ) $q = $_GET; $q['m'] = (int) $q['m']; $q['cat'] = (int) $q['cat']; $post_stati = array( // array( adj, noun ) 'publish' => array(__('Published'), __('Published posts'), __ngettext_noop('Published (%s)', 'Published (%s)')), 'future' => array(__('Scheduled'), __('Scheduled posts'), __ngettext_noop('Scheduled (%s)', 'Scheduled (%s)')), 'pending' => array(__('Pending Review'), __('Pending posts'), __ngettext_noop('Pending Review (%s)', 'Pending Review (%s)')), 'draft' => array(__('Draft'), _c('Drafts|manage posts header'), __ngettext_noop('Draft (%s)', 'Drafts (%s)')), 'private' => array(__('Private'), __('Private posts'), __ngettext_noop('Private (%s)', 'Private (%s)')), ); $post_stati = apply_filters('post_stati', $post_stati); $avail_post_stati = get_available_post_statuses('post'); $post_status_q = ''; if ( isset($q['post_status']) && in_array( $q['post_status'], array_keys($post_stati) ) ) { $post_status_q = '&post_status=' . $q['post_status']; $post_status_q .= '&perm=readable'; } if ( 'pending' === $q['post_status'] ) { $order = 'ASC'; $orderby = 'modified'; } elseif ( 'draft' === $q['post_status'] ) { $order = 'DESC'; $orderby = 'modified'; } else { $order = 'DESC'; $orderby = 'date'; } wp("post_type=post&what_to_show=posts$post_status_q&posts_per_page=15&order=$order&orderby=$orderby"); return array($post_stati, $avail_post_stati); } function get_available_post_mime_types($type = 'attachment') { global $wpdb; $types = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT post_mime_type FROM $wpdb->posts WHERE post_type = %s", $type)); return $types; } function wp_edit_attachments_query( $q = false ) { global $wpdb; if ( false === $q ) $q = $_GET; $q['m'] = (int) $q['m']; $q['cat'] = (int) $q['cat']; $q['post_type'] = 'attachment'; $q['post_status'] = 'any'; $q['posts_per_page'] = 15; $post_mime_types = array( // array( adj, noun ) 'image' => array(__('Images'), __('Manage Images'), __ngettext_noop('Image (%s)', 'Images (%s)')), 'audio' => array(__('Audio'), __('Manage Audio'), __ngettext_noop('Audio (%s)', 'Audio (%s)')), 'video' => array(__('Video'), __('Manage Video'), __ngettext_noop('Video (%s)', 'Video (%s)')), ); $post_mime_types = apply_filters('post_mime_types', $post_mime_types); $avail_post_mime_types = get_available_post_mime_types('attachment'); if ( isset($q['post_mime_type']) && !array_intersect( (array) $q['post_mime_type'], array_keys($post_mime_types) ) ) unset($q['post_mime_type']); wp($q); return array($post_mime_types, $avail_post_mime_types); } function postbox_classes( $id, $page ) { $current_user = wp_get_current_user(); if ( $closed = get_usermeta( $current_user->ID, 'closedpostboxes_'.$page ) ) { if ( !is_array( $closed ) ) return ''; return in_array( $id, $closed )? 'if-js-closed' : ''; } else { if ( 'tagsdiv' == $id || 'categorydiv' == $id ) return ''; else return 'if-js-closed'; } } function get_sample_permalink($id, $title=null, $name = null) { $post = &get_post($id); if (!$post->ID) { return array('', ''); } $original_status = $post->post_status; $original_date = $post->post_date; $original_name = $post->post_name; // Hack: get_permalink would return ugly permalink for // drafts, so we will fake, that our post is published if (in_array($post->post_status, array('draft', 'pending'))) { $post->post_status = 'publish'; $post->post_date = date('Y-m-d H:i:s'); $post->post_name = sanitize_title($post->post_name? $post->post_name : $post->post_title, $post->ID); } // If the user wants to set a new name -- override the current one // Note: if empty name is supplied -- use the title instead, see #6072 if (!is_null($name)) { $post->post_name = sanitize_title($name? $name : $title, $post->ID); } $permalink = get_permalink($post, true); // Handle page hierarchy if ( 'page' == $post->post_type ) { $uri = get_page_uri($post->ID); $uri = untrailingslashit($uri); $uri = strrev( stristr( strrev( $uri ), '/' ) ); $uri = untrailingslashit($uri); if ( !empty($uri) ) $uri .='/'; $permalink = str_replace('%pagename%', "${uri}%pagename%", $permalink); } $permalink = array($permalink, apply_filters('editable_slug', $post->post_name)); $post->post_status = $original_status; $post->post_date = $original_date; $post->post_name = $original_name; return $permalink; } function get_sample_permalink_html($id, $new_title=null, $new_slug=null) { $post = &get_post($id); list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug); if (false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%')) { return ''; } $title = __('Click to edit this part of the permalink'); if (strlen($post_name) > 30) { $post_name_abridged = substr($post_name, 0, 14). '…' . substr($post_name, -14); } else { $post_name_abridged = $post_name; } $post_name_html = ''.$post_name_abridged.''.$post_name.''; $display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink); $return = '' . __('Permalink:') . "\n" . '' . $display_link . "\n"; $return .= '' . __('Edit') . "\n"; return $return; } // false: not locked or locked by current user // int: user ID of user with lock function wp_check_post_lock( $post_id ) { global $current_user; if ( !$post = get_post( $post_id ) ) return false; $lock = get_post_meta( $post->ID, '_edit_lock', true ); $last = get_post_meta( $post->ID, '_edit_last', true ); $time_window = apply_filters( 'wp_check_post_lock_window', AUTOSAVE_INTERVAL * 2 ); if ( $lock && $lock > time() - $time_window && $last != $current_user->ID ) return $last; return false; } function wp_set_post_lock( $post_id ) { global $current_user; if ( !$post = get_post( $post_id ) ) return false; if ( !$current_user || !$current_user->ID ) return false; $now = time(); if ( !add_post_meta( $post->ID, '_edit_lock', $now, true ) ) update_post_meta( $post->ID, '_edit_lock', $now ); if ( !add_post_meta( $post->ID, '_edit_last', $current_user->ID, true ) ) update_post_meta( $post->ID, '_edit_last', $current_user->ID ); } /** * wp_create_post_autosave() - creates autosave data for the specified post from $_POST data * * @package WordPress * @subpackage Post Revisions * @since 2.6 * * @uses _wp_translate_postdata() * @uses _wp_post_revision_fields() */ function wp_create_post_autosave( $post_id ) { $translated = _wp_translate_postdata( true ); if ( is_wp_error( $translated ) ) return $translated; // Only store one autosave. If there is already an autosave, overwrite it. if ( $old_autosave = wp_get_post_autosave( $post_id ) ) { $new_autosave = _wp_post_revision_fields( $_POST, true ); $new_autosave['ID'] = $old_autosave->ID; return wp_update_post( $new_autosave ); } // Otherwise create the new autosave as a special post revision return _wp_put_post_revision( $_POST, true ); } wp/dev/wp-admin/includes/class-wp-filesystem-base.php0000644000106600010660000001227311033340254020060 0ustar method, 'ftp') !== false ) return FTP_BASE; return $this->find_folder(ABSPATH); } function wp_content_dir() { if ( defined('FTP_CONTENT_DIR') && strpos($this->method, 'ftp') !== false ) return FTP_CONTENT_DIR; return $this->find_folder(WP_CONTENT_DIR); } function wp_plugins_dir() { if ( defined('FTP_PLUGIN_DIR') && strpos($this->method, 'ftp') !== false ) return FTP_PLUGIN_DIR; return $this->find_folder(WP_PLUGIN_DIR); } function wp_themes_dir() { return $this->wp_content_dir() . '/themes'; } //Back compat: use abspath() or wp_*_dir function find_base_dir($base = '.', $echo = false) { $this->verbose = $echo; return $this->abspath(); } //Back compat: use ::abspath() or ::wp_*_dir function get_base_dir($base = '.', $echo = false) { $this->verbose = $echo; return $this->abspath(); } function find_folder($folder) { $folder = str_replace('\\', '/', $folder); //Windows Sanitiation if ( isset($this->cache[ $folder ] ) ) return $this->cache[ $folder ]; if ( $this->exists($folder) ) { //Folder exists at that absolute path. $this->cache[ $folder ] = $folder; return $folder; } if( $return = $this->search_for_folder($folder) ) $this->cache[ $folder ] = $return; return $return; } // Assumes $folder is windows sanitized; // Assumes that the drive letter is safe to be stripped off, Should not be a problem for windows servers. function search_for_folder($folder, $base = '.', $loop = false ) { if ( empty( $base ) || '.' == $base ) $base = trailingslashit($this->cwd()); $folder = preg_replace('|^([a-z]{1}):|i', '', $folder); //Strip out windows driveletter if its there. $folder_parts = explode('/', $folder); $last_path = $folder_parts[ count($folder_parts) - 1 ]; $files = $this->dirlist( $base ); foreach ( $folder_parts as $key ) { if ( $key == $last_path ) continue; //We want this to be caught by the next code block. //Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder, // If its found, change into it and follow through looking for it. // If it cant find WordPress down that route, it'll continue onto the next folder level, and see if that matches, and so on. // If it reaches the end, and still cant find it, it'll return false for the entire function. if( isset($files[ $key ]) ){ //Lets try that folder: $newdir = trailingslashit(path_join($base, $key)); if( $this->verbose ) printf( __('Changing to %s') . '
    ', $newdir ); if( $ret = $this->search_for_folder( $folder, $newdir, $loop) ) return $ret; } } //Only check this as a last resort, to prevent locating the incorrect install. All above proceeedures will fail quickly if this is the right branch to take. if(isset( $files[ $last_path ] ) ) { if( $this->verbose ) printf( __('Found %s') . '
    ', $base . $last_path ); return $base . $last_path; } if( $loop ) return false;//Prevent tihs function looping again. //As an extra last resort, Change back to / if the folder wasnt found. This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... mainly dedicated setups. return $this->search_for_folder($folder, '/', true); } //Common Helper functions. function gethchmod($file){ //From the PHP.net page for ...? $perms = $this->getchmod($file); if (($perms & 0xC000) == 0xC000) // Socket $info = 's'; elseif (($perms & 0xA000) == 0xA000) // Symbolic Link $info = 'l'; elseif (($perms & 0x8000) == 0x8000) // Regular $info = '-'; elseif (($perms & 0x6000) == 0x6000) // Block special $info = 'b'; elseif (($perms & 0x4000) == 0x4000) // Directory $info = 'd'; elseif (($perms & 0x2000) == 0x2000) // Character special $info = 'c'; elseif (($perms & 0x1000) == 0x1000)// FIFO pipe $info = 'p'; else // Unknown $info = 'u'; // Owner $info .= (($perms & 0x0100) ? 'r' : '-'); $info .= (($perms & 0x0080) ? 'w' : '-'); $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); // Group $info .= (($perms & 0x0020) ? 'r' : '-'); $info .= (($perms & 0x0010) ? 'w' : '-'); $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); // World $info .= (($perms & 0x0004) ? 'r' : '-'); $info .= (($perms & 0x0002) ? 'w' : '-'); $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); return $info; } function getnumchmodfromh($mode) { $realmode = ""; $legal = array("", "w", "r", "x", "-"); $attarray = preg_split("//", $mode); for($i=0; $i < count($attarray); $i++) if($key = array_search($attarray[$i], $legal)) $realmode .= $legal[$key]; $mode = str_pad($realmode, 9, '-'); $trans = array('-'=>'0', 'r'=>'4', 'w'=>'2', 'x'=>'1'); $mode = strtr($mode,$trans); $newmode = ''; $newmode .= $mode[0] + $mode[1] + $mode[2]; $newmode .= $mode[3] + $mode[4] + $mode[5]; $newmode .= $mode[6] + $mode[7] + $mode[8]; return $newmode; } } ?> wp/dev/wp-admin/includes/class-ftp.php0000644000106600010660000006247010767166426015161 0ustar __construct($port_mode); } function __construct($port_mode=FALSE, $verb=FALSE, $le=FALSE) { $this->LocalEcho=$le; $this->Verbose=$verb; $this->_lastaction=NULL; $this->_error_array=array(); $this->_eol_code=array(FTP_OS_Unix=>"\n", FTP_OS_Mac=>"\r", FTP_OS_Windows=>"\r\n"); $this->AuthorizedTransferMode=array(FTP_AUTOASCII, FTP_ASCII, FTP_BINARY); $this->OS_FullName=array(FTP_OS_Unix => 'UNIX', FTP_OS_Windows => 'WINDOWS', FTP_OS_Mac => 'MACOS'); $this->AutoAsciiExt=array("ASP","BAT","C","CPP","CSS","CSV","JS","H","HTM","HTML","SHTML","INI","LOG","PHP3","PHTML","PL","PERL","SH","SQL","TXT"); $this->_port_available=($port_mode==TRUE); $this->SendMSG("Staring FTP client class".($this->_port_available?"":" without PORT mode support")); $this->_connected=FALSE; $this->_ready=FALSE; $this->_can_restore=FALSE; $this->_code=0; $this->_message=""; $this->_ftp_buff_size=4096; $this->_curtype=NULL; $this->SetUmask(0022); $this->SetType(FTP_AUTOASCII); $this->SetTimeout(30); $this->Passive(!$this->_port_available); $this->_login="anonymous"; $this->_password="anon@ftp.com"; $this->_features=array(); $this->OS_local=FTP_OS_Unix; $this->OS_remote=FTP_OS_Unix; $this->features=array(); if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') $this->OS_local=FTP_OS_Windows; elseif(strtoupper(substr(PHP_OS, 0, 3)) === 'MAC') $this->OS_local=FTP_OS_Mac; } // // // function parselisting($line) { $is_windows = ($this->OS_remote == FTP_OS_Windows); if ($is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|) +(.+)/",$line,$lucifer)) { $b = array(); if ($lucifer[3]<70) { $lucifer[3]+=2000; } else { $lucifer[3]+=1900; } // 4digit year fix $b['isdir'] = ($lucifer[7]==""); if ( $b['isdir'] ) $b['type'] = 'd'; else $b['type'] = 'f'; $b['size'] = $lucifer[7]; $b['month'] = $lucifer[1]; $b['day'] = $lucifer[2]; $b['year'] = $lucifer[3]; $b['hour'] = $lucifer[4]; $b['minute'] = $lucifer[5]; $b['time'] = @mktime($lucifer[4]+(strcasecmp($lucifer[6],"PM")==0?12:0),$lucifer[5],0,$lucifer[1],$lucifer[2],$lucifer[3]); $b['am/pm'] = $lucifer[6]; $b['name'] = $lucifer[8]; } else if (!$is_windows && $lucifer=preg_split("/[ ]/",$line,9,PREG_SPLIT_NO_EMPTY)) { //echo $line."\n"; $lcount=count($lucifer); if ($lcount<8) return ''; $b = array(); $b['isdir'] = $lucifer[0]{0} === "d"; $b['islink'] = $lucifer[0]{0} === "l"; if ( $b['isdir'] ) $b['type'] = 'd'; elseif ( $b['islink'] ) $b['type'] = 'l'; else $b['type'] = 'f'; $b['perms'] = $lucifer[0]; $b['number'] = $lucifer[1]; $b['owner'] = $lucifer[2]; $b['group'] = $lucifer[3]; $b['size'] = $lucifer[4]; if ($lcount==8) { sscanf($lucifer[5],"%d-%d-%d",$b['year'],$b['month'],$b['day']); sscanf($lucifer[6],"%d:%d",$b['hour'],$b['minute']); $b['time'] = @mktime($b['hour'],$b['minute'],0,$b['month'],$b['day'],$b['year']); $b['name'] = $lucifer[7]; } else { $b['month'] = $lucifer[5]; $b['day'] = $lucifer[6]; if (preg_match("/([0-9]{2}):([0-9]{2})/",$lucifer[7],$l2)) { $b['year'] = date("Y"); $b['hour'] = $l2[1]; $b['minute'] = $l2[2]; } else { $b['year'] = $lucifer[7]; $b['hour'] = 0; $b['minute'] = 0; } $b['time'] = strtotime(sprintf("%d %s %d %02d:%02d",$b['day'],$b['month'],$b['year'],$b['hour'],$b['minute'])); $b['name'] = $lucifer[8]; } } return $b; } function SendMSG($message = "", $crlf=true) { if ($this->Verbose) { echo $message.($crlf?CRLF:""); flush(); } return TRUE; } function SetType($mode=FTP_AUTOASCII) { if(!in_array($mode, $this->AuthorizedTransferMode)) { $this->SendMSG("Wrong type"); return FALSE; } $this->_type=$mode; $this->SendMSG("Transfer type: ".($this->_type==FTP_BINARY?"binary":($this->_type==FTP_ASCII?"ASCII":"auto ASCII") ) ); return TRUE; } function _settype($mode=FTP_ASCII) { if($this->_ready) { if($mode==FTP_BINARY) { if($this->_curtype!=FTP_BINARY) { if(!$this->_exec("TYPE I", "SetType")) return FALSE; $this->_curtype=FTP_BINARY; } } elseif($this->_curtype!=FTP_ASCII) { if(!$this->_exec("TYPE A", "SetType")) return FALSE; $this->_curtype=FTP_ASCII; } } else return FALSE; return TRUE; } function Passive($pasv=NULL) { if(is_null($pasv)) $this->_passive=!$this->_passive; else $this->_passive=$pasv; if(!$this->_port_available and !$this->_passive) { $this->SendMSG("Only passive connections available!"); $this->_passive=TRUE; return FALSE; } $this->SendMSG("Passive mode ".($this->_passive?"on":"off")); return TRUE; } function SetServer($host, $port=21, $reconnect=true) { if(!is_long($port)) { $this->verbose=true; $this->SendMSG("Incorrect port syntax"); return FALSE; } else { $ip=@gethostbyname($host); $dns=@gethostbyaddr($host); if(!$ip) $ip=$host; if(!$dns) $dns=$host; if(ip2long($ip) === -1) { $this->SendMSG("Wrong host name/address \"".$host."\""); return FALSE; } $this->_host=$ip; $this->_fullhost=$dns; $this->_port=$port; $this->_dataport=$port-1; } $this->SendMSG("Host \"".$this->_fullhost."(".$this->_host."):".$this->_port."\""); if($reconnect){ if($this->_connected) { $this->SendMSG("Reconnecting"); if(!$this->quit(FTP_FORCE)) return FALSE; if(!$this->connect()) return FALSE; } } return TRUE; } function SetUmask($umask=0022) { $this->_umask=$umask; umask($this->_umask); $this->SendMSG("UMASK 0".decoct($this->_umask)); return TRUE; } function SetTimeout($timeout=30) { $this->_timeout=$timeout; $this->SendMSG("Timeout ".$this->_timeout); if($this->_connected) if(!$this->_settimeout($this->_ftp_control_sock)) return FALSE; return TRUE; } function connect($server=NULL) { if(!empty($server)) { if(!$this->SetServer($server)) return false; } if($this->_ready) return true; $this->SendMsg('Local OS : '.$this->OS_FullName[$this->OS_local]); if(!($this->_ftp_control_sock = $this->_connect($this->_host, $this->_port))) { $this->SendMSG("Error : Cannot connect to remote host \"".$this->_fullhost." :".$this->_port."\""); return FALSE; } $this->SendMSG("Connected to remote host \"".$this->_fullhost.":".$this->_port."\". Waiting for greeting."); do { if(!$this->_readmsg()) return FALSE; if(!$this->_checkCode()) return FALSE; $this->_lastaction=time(); } while($this->_code<200); $this->_ready=true; $syst=$this->systype(); if(!$syst) $this->SendMSG("Can't detect remote OS"); else { if(preg_match("/win|dos|novell/i", $syst[0])) $this->OS_remote=FTP_OS_Windows; elseif(preg_match("/os/i", $syst[0])) $this->OS_remote=FTP_OS_Mac; elseif(preg_match("/(li|u)nix/i", $syst[0])) $this->OS_remote=FTP_OS_Unix; else $this->OS_remote=FTP_OS_Mac; $this->SendMSG("Remote OS: ".$this->OS_FullName[$this->OS_remote]); } if(!$this->features()) $this->SendMSG("Can't get features list. All supported - disabled"); else $this->SendMSG("Supported features: ".implode(", ", array_keys($this->_features))); return TRUE; } function quit($force=false) { if($this->_ready) { if(!$this->_exec("QUIT") and !$force) return FALSE; if(!$this->_checkCode() and !$force) return FALSE; $this->_ready=false; $this->SendMSG("Session finished"); } $this->_quit(); return TRUE; } function login($user=NULL, $pass=NULL) { if(!is_null($user)) $this->_login=$user; else $this->_login="anonymous"; if(!is_null($pass)) $this->_password=$pass; else $this->_password="anon@anon.com"; if(!$this->_exec("USER ".$this->_login, "login")) return FALSE; if(!$this->_checkCode()) return FALSE; if($this->_code!=230) { if(!$this->_exec((($this->_code==331)?"PASS ":"ACCT ").$this->_password, "login")) return FALSE; if(!$this->_checkCode()) return FALSE; } $this->SendMSG("Authentication succeeded"); if(empty($this->_features)) { if(!$this->features()) $this->SendMSG("Can't get features list. All supported - disabled"); else $this->SendMSG("Supported features: ".implode(", ", array_keys($this->_features))); } return TRUE; } function pwd() { if(!$this->_exec("PWD", "pwd")) return FALSE; if(!$this->_checkCode()) return FALSE; return ereg_replace("^[0-9]{3} \"(.+)\".+", "\\1", $this->_message); } function cdup() { if(!$this->_exec("CDUP", "cdup")) return FALSE; if(!$this->_checkCode()) return FALSE; return true; } function chdir($pathname) { if(!$this->_exec("CWD ".$pathname, "chdir")) return FALSE; if(!$this->_checkCode()) return FALSE; return TRUE; } function rmdir($pathname) { if(!$this->_exec("RMD ".$pathname, "rmdir")) return FALSE; if(!$this->_checkCode()) return FALSE; return TRUE; } function mkdir($pathname) { if(!$this->_exec("MKD ".$pathname, "mkdir")) return FALSE; if(!$this->_checkCode()) return FALSE; return TRUE; } function rename($from, $to) { if(!$this->_exec("RNFR ".$from, "rename")) return FALSE; if(!$this->_checkCode()) return FALSE; if($this->_code==350) { if(!$this->_exec("RNTO ".$to, "rename")) return FALSE; if(!$this->_checkCode()) return FALSE; } else return FALSE; return TRUE; } function filesize($pathname) { if(!isset($this->_features["SIZE"])) { $this->PushError("filesize", "not supported by server"); return FALSE; } if(!$this->_exec("SIZE ".$pathname, "filesize")) return FALSE; if(!$this->_checkCode()) return FALSE; return ereg_replace("^[0-9]{3} ([0-9]+)".CRLF, "\\1", $this->_message); } function abort() { if(!$this->_exec("ABOR", "abort")) return FALSE; if(!$this->_checkCode()) { if($this->_code!=426) return FALSE; if(!$this->_readmsg("abort")) return FALSE; if(!$this->_checkCode()) return FALSE; } return true; } function mdtm($pathname) { if(!isset($this->_features["MDTM"])) { $this->PushError("mdtm", "not supported by server"); return FALSE; } if(!$this->_exec("MDTM ".$pathname, "mdtm")) return FALSE; if(!$this->_checkCode()) return FALSE; $mdtm = ereg_replace("^[0-9]{3} ([0-9]+)".CRLF, "\\1", $this->_message); $date = sscanf($mdtm, "%4d%2d%2d%2d%2d%2d"); $timestamp = mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0]); return $timestamp; } function systype() { if(!$this->_exec("SYST", "systype")) return FALSE; if(!$this->_checkCode()) return FALSE; $DATA = explode(" ", $this->_message); return array($DATA[1], $DATA[3]); } function delete($pathname) { if(!$this->_exec("DELE ".$pathname, "delete")) return FALSE; if(!$this->_checkCode()) return FALSE; return TRUE; } function site($command, $fnction="site") { if(!$this->_exec("SITE ".$command, $fnction)) return FALSE; if(!$this->_checkCode()) return FALSE; return TRUE; } function chmod($pathname, $mode) { if(!$this->site( sprintf('CHMOD %o %s', $mode, $pathname), "chmod")) return FALSE; return TRUE; } function restore($from) { if(!isset($this->_features["REST"])) { $this->PushError("restore", "not supported by server"); return FALSE; } if($this->_curtype!=FTP_BINARY) { $this->PushError("restore", "can't restore in ASCII mode"); return FALSE; } if(!$this->_exec("REST ".$from, "resore")) return FALSE; if(!$this->_checkCode()) return FALSE; return TRUE; } function features() { if(!$this->_exec("FEAT", "features")) return FALSE; if(!$this->_checkCode()) return FALSE; $f=preg_split("/[".CRLF."]+/", preg_replace("/[0-9]{3}[ -].*[".CRLF."]+/", "", $this->_message), -1, PREG_SPLIT_NO_EMPTY); $this->_features=array(); foreach($f as $k=>$v) { $v=explode(" ", trim($v)); $this->_features[array_shift($v)]=$v;; } return true; } function rawlist($pathname="", $arg="") { return $this->_list(($arg?" ".$arg:"").($pathname?" ".$pathname:""), "LIST", "rawlist"); } function nlist($pathname="") { return $this->_list(($arg?" ".$arg:"").($pathname?" ".$pathname:""), "NLST", "nlist"); } function is_exists($pathname) { return $this->file_exists($pathname); } function file_exists($pathname) { $exists=true; if(!$this->_exec("RNFR ".$pathname, "rename")) $exists=FALSE; else { if(!$this->_checkCode()) $exists=FALSE; $this->abort(); } if($exists) $this->SendMSG("Remote file ".$pathname." exists"); else $this->SendMSG("Remote file ".$pathname." does not exist"); return $exists; } function fget($fp, $remotefile,$rest=0) { if($this->_can_restore and $rest!=0) fseek($fp, $rest); $pi=pathinfo($remotefile); if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII; else $mode=FTP_BINARY; if(!$this->_data_prepare($mode)) { return FALSE; } if($this->_can_restore and $rest!=0) $this->restore($rest); if(!$this->_exec("RETR ".$remotefile, "get")) { $this->_data_close(); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); return FALSE; } $out=$this->_data_read($mode, $fp); $this->_data_close(); if(!$this->_readmsg()) return FALSE; if(!$this->_checkCode()) return FALSE; return $out; } function get($remotefile, $localfile=NULL, $rest=0) { if(is_null($localfile)) $localfile=$remotefile; if (@file_exists($localfile)) $this->SendMSG("Warning : local file will be overwritten"); $fp = @fopen($localfile, "w"); if (!$fp) { $this->PushError("get","can't open local file", "Cannot create \"".$localfile."\""); return FALSE; } if($this->_can_restore and $rest!=0) fseek($fp, $rest); $pi=pathinfo($remotefile); if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII; else $mode=FTP_BINARY; if(!$this->_data_prepare($mode)) { fclose($fp); return FALSE; } if($this->_can_restore and $rest!=0) $this->restore($rest); if(!$this->_exec("RETR ".$remotefile, "get")) { $this->_data_close(); fclose($fp); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); fclose($fp); return FALSE; } $out=$this->_data_read($mode, $fp); fclose($fp); $this->_data_close(); if(!$this->_readmsg()) return FALSE; if(!$this->_checkCode()) return FALSE; return $out; } function fput($remotefile, $fp) { if($this->_can_restore and $rest!=0) fseek($fp, $rest); $pi=pathinfo($remotefile); if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII; else $mode=FTP_BINARY; if(!$this->_data_prepare($mode)) { return FALSE; } if($this->_can_restore and $rest!=0) $this->restore($rest); if(!$this->_exec("STOR ".$remotefile, "put")) { $this->_data_close(); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); return FALSE; } $ret=$this->_data_write($mode, $fp); $this->_data_close(); if(!$this->_readmsg()) return FALSE; if(!$this->_checkCode()) return FALSE; return $ret; } function put($localfile, $remotefile=NULL, $rest=0) { if(is_null($remotefile)) $remotefile=$localfile; if (!file_exists($localfile)) { $this->PushError("put","can't open local file", "No such file or directory \"".$localfile."\""); return FALSE; } $fp = @fopen($localfile, "r"); if (!$fp) { $this->PushError("put","can't open local file", "Cannot read file \"".$localfile."\""); return FALSE; } if($this->_can_restore and $rest!=0) fseek($fp, $rest); $pi=pathinfo($localfile); if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII; else $mode=FTP_BINARY; if(!$this->_data_prepare($mode)) { fclose($fp); return FALSE; } if($this->_can_restore and $rest!=0) $this->restore($rest); if(!$this->_exec("STOR ".$remotefile, "put")) { $this->_data_close(); fclose($fp); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); fclose($fp); return FALSE; } $ret=$this->_data_write($mode, $fp); fclose($fp); $this->_data_close(); if(!$this->_readmsg()) return FALSE; if(!$this->_checkCode()) return FALSE; return $ret; } function mput($local=".", $remote=NULL, $continious=false) { $local=realpath($local); if(!@file_exists($local)) { $this->PushError("mput","can't open local folder", "Cannot stat folder \"".$local."\""); return FALSE; } if(!is_dir($local)) return $this->put($local, $remote); if(empty($remote)) $remote="."; elseif(!$this->file_exists($remote) and !$this->mkdir($remote)) return FALSE; if($handle = opendir($local)) { $list=array(); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") $list[]=$file; } closedir($handle); } else { $this->PushError("mput","can't open local folder", "Cannot read folder \"".$local."\""); return FALSE; } if(empty($list)) return TRUE; $ret=true; foreach($list as $el) { if(is_dir($local."/".$el)) $t=$this->mput($local."/".$el, $remote."/".$el); else $t=$this->put($local."/".$el, $remote."/".$el); if(!$t) { $ret=FALSE; if(!$continious) break; } } return $ret; } function mget($remote, $local=".", $continious=false) { $list=$this->rawlist($remote, "-lA"); if($list===false) { $this->PushError("mget","can't read remote folder list", "Can't read remote folder \"".$remote."\" contents"); return FALSE; } if(empty($list)) return true; if(!@file_exists($local)) { if(!@mkdir($local)) { $this->PushError("mget","can't create local folder", "Cannot create folder \"".$local."\""); return FALSE; } } foreach($list as $k=>$v) { $list[$k]=$this->parselisting($v); if($list[$k]["name"]=="." or $list[$k]["name"]=="..") unset($list[$k]); } $ret=true; foreach($list as $el) { if($el["type"]=="d") { if(!$this->mget($remote."/".$el["name"], $local."/".$el["name"], $continious)) { $this->PushError("mget", "can't copy folder", "Can't copy remote folder \"".$remote."/".$el["name"]."\" to local \"".$local."/".$el["name"]."\""); $ret=false; if(!$continious) break; } } else { if(!$this->get($remote."/".$el["name"], $local."/".$el["name"])) { $this->PushError("mget", "can't copy file", "Can't copy remote file \"".$remote."/".$el["name"]."\" to local \"".$local."/".$el["name"]."\""); $ret=false; if(!$continious) break; } } @chmod($local."/".$el["name"], $el["perms"]); $t=strtotime($el["date"]); if($t!==-1 and $t!==false) @touch($local."/".$el["name"], $t); } return $ret; } function mdel($remote, $continious=false) { $list=$this->rawlist($remote, "-la"); if($list===false) { $this->PushError("mdel","can't read remote folder list", "Can't read remote folder \"".$remote."\" contents"); return false; } foreach($list as $k=>$v) { $list[$k]=$this->parselisting($v); if($list[$k]["name"]=="." or $list[$k]["name"]=="..") unset($list[$k]); } $ret=true; foreach($list as $el) { if ( empty($el) ) continue; if($el["type"]=="d") { if(!$this->mdel($remote."/".$el["name"], $continious)) { $ret=false; if(!$continious) break; } } else { if (!$this->delete($remote."/".$el["name"])) { $this->PushError("mdel", "can't delete file", "Can't delete remote file \"".$remote."/".$el["name"]."\""); $ret=false; if(!$continious) break; } } } if(!$this->rmdir($remote)) { $this->PushError("mdel", "can't delete folder", "Can't delete remote folder \"".$remote."/".$el["name"]."\""); $ret=false; } return $ret; } function mmkdir($dir, $mode = 0777) { if(empty($dir)) return FALSE; if($this->is_exists($dir) or $dir == "/" ) return TRUE; if(!$this->mmkdir(dirname($dir), $mode)) return false; $r=$this->mkdir($dir, $mode); $this->chmod($dir,$mode); return $r; } function glob($pattern, $handle=NULL) { $path=$output=null; if(PHP_OS=='WIN32') $slash='\\'; else $slash='/'; $lastpos=strrpos($pattern,$slash); if(!($lastpos===false)) { $path=substr($pattern,0,-$lastpos-1); $pattern=substr($pattern,$lastpos); } else $path=getcwd(); if(is_array($handle) and !empty($handle)) { while($dir=each($handle)) { if($this->glob_pattern_match($pattern,$dir)) $output[]=$dir; } } else { $handle=@opendir($path); if($handle===false) return false; while($dir=readdir($handle)) { if($this->glob_pattern_match($pattern,$dir)) $output[]=$dir; } closedir($handle); } if(is_array($output)) return $output; return false; } function glob_pattern_match($pattern,$string) { $out=null; $chunks=explode(';',$pattern); foreach($chunks as $pattern) { $escape=array('$','^','.','{','}','(',')','[',']','|'); while(strpos($pattern,'**')!==false) $pattern=str_replace('**','*',$pattern); foreach($escape as $probe) $pattern=str_replace($probe,"\\$probe",$pattern); $pattern=str_replace('?*','*', str_replace('*?','*', str_replace('*',".*", str_replace('?','.{1,1}',$pattern)))); $out[]=$pattern; } if(count($out)==1) return($this->glob_regexp("^$out[0]$",$string)); else { foreach($out as $tester) if($this->my_regexp("^$tester$",$string)) return true; } return false; } function glob_regexp($pattern,$probe) { $sensitive=(PHP_OS!='WIN32'); return ($sensitive? ereg($pattern,$probe): eregi($pattern,$probe) ); } function dirlist($remote) { $list=$this->rawlist($remote, "-la"); if($list===false) { $this->PushError("dirlist","can't read remote folder list", "Can't read remote folder \"".$remote."\" contents"); return false; } $dirlist = array(); foreach($list as $k=>$v) { $entry=$this->parselisting($v); if ( empty($entry) ) continue; if($entry["name"]=="." or $entry["name"]=="..") continue; $dirlist[$entry['name']] = $entry; } return $dirlist; } // // // function _checkCode() { return ($this->_code<400 and $this->_code>0); } function _list($arg="", $cmd="LIST", $fnction="_list") { if(!$this->_data_prepare()) return false; if(!$this->_exec($cmd.$arg, $fnction)) { $this->_data_close(); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); return FALSE; } $out=""; if($this->_code<200) { $out=$this->_data_read(); $this->_data_close(); if(!$this->_readmsg()) return FALSE; if(!$this->_checkCode()) return FALSE; if($out === FALSE ) return FALSE; $out=preg_split("/[".CRLF."]+/", $out, -1, PREG_SPLIT_NO_EMPTY); // $this->SendMSG(implode($this->_eol_code[$this->OS_local], $out)); } return $out; } // // // // Gnre une erreur pour traitement externe la classe function PushError($fctname,$msg,$desc=false){ $error=array(); $error['time']=time(); $error['fctname']=$fctname; $error['msg']=$msg; $error['desc']=$desc; if($desc) $tmp=' ('.$desc.')'; else $tmp=''; $this->SendMSG($fctname.': '.$msg.$tmp); return(array_push($this->_error_array,$error)); } // Rcupre une erreur externe function PopError(){ if(count($this->_error_array)) return(array_pop($this->_error_array)); else return(false); } } $mod_sockets=TRUE; if (!extension_loaded('sockets')) { $prefix = (PHP_SHLIB_SUFFIX == 'dll') ? 'php_' : ''; if(!@dl($prefix . 'sockets.' . PHP_SHLIB_SUFFIX)) $mod_sockets=FALSE; } require_once "class-ftp-".($mod_sockets?"sockets":"pure").".php"; ?> wp/dev/wp-admin/includes/schema.php0000644000106600010660000003627611046147301014510 0ustar supports_collation() ) { if ( ! empty($wpdb->charset) ) $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; if ( ! empty($wpdb->collate) ) $charset_collate .= " COLLATE $wpdb->collate"; } $wp_queries="CREATE TABLE $wpdb->terms ( term_id bigint(20) NOT NULL auto_increment, name varchar(200) NOT NULL default '', slug varchar(200) NOT NULL default '', term_group bigint(10) NOT NULL default 0, PRIMARY KEY (term_id), UNIQUE KEY slug (slug), KEY name (name) ) $charset_collate; CREATE TABLE $wpdb->term_taxonomy ( term_taxonomy_id bigint(20) NOT NULL auto_increment, term_id bigint(20) NOT NULL default 0, taxonomy varchar(32) NOT NULL default '', description longtext NOT NULL, parent bigint(20) NOT NULL default 0, count bigint(20) NOT NULL default 0, PRIMARY KEY (term_taxonomy_id), UNIQUE KEY term_id_taxonomy (term_id,taxonomy) ) $charset_collate; CREATE TABLE $wpdb->term_relationships ( object_id bigint(20) NOT NULL default 0, term_taxonomy_id bigint(20) NOT NULL default 0, term_order int(11) NOT NULL default 0, PRIMARY KEY (object_id,term_taxonomy_id), KEY term_taxonomy_id (term_taxonomy_id) ) $charset_collate; CREATE TABLE $wpdb->comments ( comment_ID bigint(20) unsigned NOT NULL auto_increment, comment_post_ID int(11) NOT NULL default '0', comment_author tinytext NOT NULL, comment_author_email varchar(100) NOT NULL default '', comment_author_url varchar(200) NOT NULL default '', comment_author_IP varchar(100) NOT NULL default '', comment_date datetime NOT NULL default '0000-00-00 00:00:00', comment_date_gmt datetime NOT NULL default '0000-00-00 00:00:00', comment_content text NOT NULL, comment_karma int(11) NOT NULL default '0', comment_approved varchar(20) NOT NULL default '1', comment_agent varchar(255) NOT NULL default '', comment_type varchar(20) NOT NULL default '', comment_parent bigint(20) NOT NULL default '0', user_id bigint(20) NOT NULL default '0', PRIMARY KEY (comment_ID), KEY comment_approved (comment_approved), KEY comment_post_ID (comment_post_ID), KEY comment_approved_date_gmt (comment_approved,comment_date_gmt), KEY comment_date_gmt (comment_date_gmt) ) $charset_collate; CREATE TABLE $wpdb->links ( link_id bigint(20) NOT NULL auto_increment, link_url varchar(255) NOT NULL default '', link_name varchar(255) NOT NULL default '', link_image varchar(255) NOT NULL default '', link_target varchar(25) NOT NULL default '', link_category bigint(20) NOT NULL default '0', link_description varchar(255) NOT NULL default '', link_visible varchar(20) NOT NULL default 'Y', link_owner int(11) NOT NULL default '1', link_rating int(11) NOT NULL default '0', link_updated datetime NOT NULL default '0000-00-00 00:00:00', link_rel varchar(255) NOT NULL default '', link_notes mediumtext NOT NULL, link_rss varchar(255) NOT NULL default '', PRIMARY KEY (link_id), KEY link_category (link_category), KEY link_visible (link_visible) ) $charset_collate; CREATE TABLE $wpdb->options ( option_id bigint(20) NOT NULL auto_increment, blog_id int(11) NOT NULL default '0', option_name varchar(64) NOT NULL default '', option_value longtext NOT NULL, autoload varchar(20) NOT NULL default 'yes', PRIMARY KEY (option_id,blog_id,option_name), KEY option_name (option_name) ) $charset_collate; CREATE TABLE $wpdb->postmeta ( meta_id bigint(20) NOT NULL auto_increment, post_id bigint(20) NOT NULL default '0', meta_key varchar(255) default NULL, meta_value longtext, PRIMARY KEY (meta_id), KEY post_id (post_id), KEY meta_key (meta_key) ) $charset_collate; CREATE TABLE $wpdb->posts ( ID bigint(20) unsigned NOT NULL auto_increment, post_author bigint(20) NOT NULL default '0', post_date datetime NOT NULL default '0000-00-00 00:00:00', post_date_gmt datetime NOT NULL default '0000-00-00 00:00:00', post_content longtext NOT NULL, post_title text NOT NULL, post_category int(4) NOT NULL default '0', post_excerpt text NOT NULL, post_status varchar(20) NOT NULL default 'publish', comment_status varchar(20) NOT NULL default 'open', ping_status varchar(20) NOT NULL default 'open', post_password varchar(20) NOT NULL default '', post_name varchar(200) NOT NULL default '', to_ping text NOT NULL, pinged text NOT NULL, post_modified datetime NOT NULL default '0000-00-00 00:00:00', post_modified_gmt datetime NOT NULL default '0000-00-00 00:00:00', post_content_filtered text NOT NULL, post_parent bigint(20) NOT NULL default '0', guid varchar(255) NOT NULL default '', menu_order int(11) NOT NULL default '0', post_type varchar(20) NOT NULL default 'post', post_mime_type varchar(100) NOT NULL default '', comment_count bigint(20) NOT NULL default '0', PRIMARY KEY (ID), KEY post_name (post_name), KEY type_status_date (post_type,post_status,post_date,ID) ) $charset_collate; CREATE TABLE $wpdb->users ( ID bigint(20) unsigned NOT NULL auto_increment, user_login varchar(60) NOT NULL default '', user_pass varchar(64) NOT NULL default '', user_nicename varchar(50) NOT NULL default '', user_email varchar(100) NOT NULL default '', user_url varchar(100) NOT NULL default '', user_registered datetime NOT NULL default '0000-00-00 00:00:00', user_activation_key varchar(60) NOT NULL default '', user_status int(11) NOT NULL default '0', display_name varchar(250) NOT NULL default '', PRIMARY KEY (ID), KEY user_login_key (user_login), KEY user_nicename (user_nicename) ) $charset_collate; CREATE TABLE $wpdb->usermeta ( umeta_id bigint(20) NOT NULL auto_increment, user_id bigint(20) NOT NULL default '0', meta_key varchar(255) default NULL, meta_value longtext, PRIMARY KEY (umeta_id), KEY user_id (user_id), KEY meta_key (meta_key) ) $charset_collate;"; function populate_options() { global $wpdb, $wp_db_version; $guessurl = wp_guess_url(); do_action('populate_options'); add_option('siteurl', $guessurl); add_option('blogname', __('My Blog')); add_option('blogdescription', __('Just another WordPress weblog')); add_option('users_can_register', 0); add_option('admin_email', 'you@example.com'); add_option('start_of_week', 1); add_option('use_balanceTags', 0); add_option('use_smilies', 1); add_option('require_name_email', 1); add_option('comments_notify', 1); add_option('posts_per_rss', 10); add_option('rss_excerpt_length', 50); add_option('rss_use_excerpt', 0); add_option('mailserver_url', 'mail.example.com'); add_option('mailserver_login', 'login@example.com'); add_option('mailserver_pass', 'password'); add_option('mailserver_port', 110); add_option('default_category', 1); add_option('default_comment_status', 'open'); add_option('default_ping_status', 'open'); add_option('default_pingback_flag', 1); add_option('default_post_edit_rows', 10); add_option('posts_per_page', 10); add_option('what_to_show', 'posts'); add_option('date_format', __('F j, Y')); add_option('time_format', __('g:i a')); add_option('links_updated_date_format', __('F j, Y g:i a')); add_option('links_recently_updated_prepend', ''); add_option('links_recently_updated_append', ''); add_option('links_recently_updated_time', 120); add_option('comment_moderation', 0); add_option('moderation_notify', 1); add_option('permalink_structure'); add_option('gzipcompression', 0); add_option('hack_file', 0); add_option('blog_charset', 'UTF-8'); add_option('moderation_keys'); add_option('active_plugins'); add_option('home', $guessurl); // in case it is set, but blank, update "home" if ( !__get_option('home') ) update_option('home', $guessurl); add_option('category_base'); add_option('ping_sites', 'http://rpc.pingomatic.com/'); add_option('advanced_edit', 0); add_option('comment_max_links', 2); add_option('gmt_offset', date('Z') / 3600); // 1.5 add_option('default_email_category', 1); add_option('recently_edited'); add_option('use_linksupdate', 0); add_option('template', 'default'); add_option('stylesheet', 'default'); add_option('comment_whitelist', 1); add_option('page_uris'); add_option('blacklist_keys'); add_option('comment_registration', 0); add_option('rss_language', 'en'); add_option('html_type', 'text/html'); // 1.5.1 add_option('use_trackback', 0); // 2.0 add_option('default_role', 'subscriber'); add_option('db_version', $wp_db_version); // 2.0.1 if ( ini_get('safe_mode') ) { // Safe mode screws up mkdir(), so we must use a flat structure. add_option('uploads_use_yearmonth_folders', 0); add_option('upload_path', WP_CONTENT_DIR); } else { add_option('uploads_use_yearmonth_folders', 1); add_option('upload_path', WP_CONTENT_DIR . '/uploads'); } // 2.0.3 add_option('secret', wp_generate_password(64)); // 2.1 add_option('blog_public', '1'); add_option('default_link_category', 2); add_option('show_on_front', 'posts'); // 2.2 add_option('tag_base'); // 2.5 add_option('show_avatars', '1'); add_option('avatar_rating', 'G'); add_option('upload_url_path', ''); add_option('thumbnail_size_w', 150); add_option('thumbnail_size_h', 150); add_option('thumbnail_crop', 1); add_option('medium_size_w', 300); add_option('medium_size_h', 300); // 2.6 add_option('avatar_default', 'mystery'); add_option('enable_app', 0); add_option('enable_xmlrpc', 0); // Delete unused options $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins'); foreach ($unusedoptions as $option) : delete_option($option); endforeach; // Set up a few options not to load by default $fatoptions = array( 'moderation_keys', 'recently_edited', 'blacklist_keys' ); foreach ($fatoptions as $fatoption) : $wpdb->query("UPDATE $wpdb->options SET `autoload` = 'no' WHERE option_name = '$fatoption'"); endforeach; } function populate_roles() { populate_roles_160(); populate_roles_210(); populate_roles_230(); populate_roles_250(); populate_roles_260(); } function populate_roles_160() { // Add roles // Dummy gettext calls to get strings in the catalog. _c('Administrator|User role'); _c('Editor|User role'); _c('Author|User role'); _c('Contributor|User role'); _c('Subscriber|User role'); add_role('administrator', 'Administrator|User role'); add_role('editor', 'Editor|User role'); add_role('author', 'Author|User role'); add_role('contributor', 'Contributor|User role'); add_role('subscriber', 'Subscriber|User role'); // Add caps for Administrator role $role = get_role('administrator'); $role->add_cap('switch_themes'); $role->add_cap('edit_themes'); $role->add_cap('activate_plugins'); $role->add_cap('edit_plugins'); $role->add_cap('edit_users'); $role->add_cap('edit_files'); $role->add_cap('manage_options'); $role->add_cap('moderate_comments'); $role->add_cap('manage_categories'); $role->add_cap('manage_links'); $role->add_cap('upload_files'); $role->add_cap('import'); $role->add_cap('unfiltered_html'); $role->add_cap('edit_posts'); $role->add_cap('edit_others_posts'); $role->add_cap('edit_published_posts'); $role->add_cap('publish_posts'); $role->add_cap('edit_pages'); $role->add_cap('read'); $role->add_cap('level_10'); $role->add_cap('level_9'); $role->add_cap('level_8'); $role->add_cap('level_7'); $role->add_cap('level_6'); $role->add_cap('level_5'); $role->add_cap('level_4'); $role->add_cap('level_3'); $role->add_cap('level_2'); $role->add_cap('level_1'); $role->add_cap('level_0'); // Add caps for Editor role $role = get_role('editor'); $role->add_cap('moderate_comments'); $role->add_cap('manage_categories'); $role->add_cap('manage_links'); $role->add_cap('upload_files'); $role->add_cap('unfiltered_html'); $role->add_cap('edit_posts'); $role->add_cap('edit_others_posts'); $role->add_cap('edit_published_posts'); $role->add_cap('publish_posts'); $role->add_cap('edit_pages'); $role->add_cap('read'); $role->add_cap('level_7'); $role->add_cap('level_6'); $role->add_cap('level_5'); $role->add_cap('level_4'); $role->add_cap('level_3'); $role->add_cap('level_2'); $role->add_cap('level_1'); $role->add_cap('level_0'); // Add caps for Author role $role = get_role('author'); $role->add_cap('upload_files'); $role->add_cap('edit_posts'); $role->add_cap('edit_published_posts'); $role->add_cap('publish_posts'); $role->add_cap('read'); $role->add_cap('level_2'); $role->add_cap('level_1'); $role->add_cap('level_0'); // Add caps for Contributor role $role = get_role('contributor'); $role->add_cap('edit_posts'); $role->add_cap('read'); $role->add_cap('level_1'); $role->add_cap('level_0'); // Add caps for Subscriber role $role = get_role('subscriber'); $role->add_cap('read'); $role->add_cap('level_0'); } function populate_roles_210() { $roles = array('administrator', 'editor'); foreach ($roles as $role) { $role = get_role($role); if ( empty($role) ) continue; $role->add_cap('edit_others_pages'); $role->add_cap('edit_published_pages'); $role->add_cap('publish_pages'); $role->add_cap('delete_pages'); $role->add_cap('delete_others_pages'); $role->add_cap('delete_published_pages'); $role->add_cap('delete_posts'); $role->add_cap('delete_others_posts'); $role->add_cap('delete_published_posts'); $role->add_cap('delete_private_posts'); $role->add_cap('edit_private_posts'); $role->add_cap('read_private_posts'); $role->add_cap('delete_private_pages'); $role->add_cap('edit_private_pages'); $role->add_cap('read_private_pages'); } $role = get_role('administrator'); if ( ! empty($role) ) { $role->add_cap('delete_users'); $role->add_cap('create_users'); } $role = get_role('author'); if ( ! empty($role) ) { $role->add_cap('delete_posts'); $role->add_cap('delete_published_posts'); } $role = get_role('contributor'); if ( ! empty($role) ) { $role->add_cap('delete_posts'); } } function populate_roles_230() { $role = get_role( 'administrator' ); if ( !empty( $role ) ) { $role->add_cap( 'unfiltered_upload' ); } } function populate_roles_250() { $role = get_role( 'administrator' ); if ( !empty( $role ) ) { $role->add_cap( 'edit_dashboard' ); } } function populate_roles_260() { $role = get_role( 'administrator' ); if ( !empty( $role ) ) { $role->add_cap( 'update_plugins' ); $role->add_cap( 'delete_plugins' ); } } ?> wp/dev/wp-admin/includes/comment.php0000644000106600010660000000647011003453751014705 0ustar get_var( $wpdb->prepare("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_author = %s AND comment_date = %s", $comment_author, $comment_date) ); } function edit_comment() { $comment_post_ID = (int) $_POST['comment_post_ID']; if (!current_user_can( 'edit_post', $comment_post_ID )) wp_die( __('You are not allowed to edit comments on this post, so you cannot edit this comment.' )); $_POST['comment_author'] = $_POST['newcomment_author']; $_POST['comment_author_email'] = $_POST['newcomment_author_email']; $_POST['comment_author_url'] = $_POST['newcomment_author_url']; $_POST['comment_approved'] = $_POST['comment_status']; $_POST['comment_content'] = $_POST['content']; $_POST['comment_ID'] = (int) $_POST['comment_ID']; foreach ( array ('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit ) { if ( !empty( $_POST['hidden_' . $timeunit] ) && $_POST['hidden_' . $timeunit] != $_POST[$timeunit] ) { $_POST['edit_date'] = '1'; break; } } if (!empty ( $_POST['edit_date'] ) ) { $aa = $_POST['aa']; $mm = $_POST['mm']; $jj = $_POST['jj']; $hh = $_POST['hh']; $mn = $_POST['mn']; $ss = $_POST['ss']; $jj = ($jj > 31 ) ? 31 : $jj; $hh = ($hh > 23 ) ? $hh -24 : $hh; $mn = ($mn > 59 ) ? $mn -60 : $mn; $ss = ($ss > 59 ) ? $ss -60 : $ss; $_POST['comment_date'] = "$aa-$mm-$jj $hh:$mn:$ss"; } wp_update_comment( $_POST); } function get_comment_to_edit( $id ) { if ( !$comment = get_comment($id) ) return false; $comment->comment_ID = (int) $comment->comment_ID; $comment->comment_post_ID = (int) $comment->comment_post_ID; $comment->comment_content = format_to_edit( $comment->comment_content ); $comment->comment_content = apply_filters( 'comment_edit_pre', $comment->comment_content); $comment->comment_author = format_to_edit( $comment->comment_author ); $comment->comment_author_email = format_to_edit( $comment->comment_author_email ); $comment->comment_author_url = clean_url($comment->comment_author_url); $comment->comment_author_url = format_to_edit( $comment->comment_author_url ); return $comment; } function get_pending_comments_num( $post_id ) { global $wpdb; $single = false; if ( !is_array($post_id) ) { $post_id = (array) $post_id; $single = true; } $post_id = array_map('intval', $post_id); $post_id = "'" . implode("', '", $post_id) . "'"; $pending = $wpdb->get_results( "SELECT comment_post_ID, COUNT(comment_ID) as num_comments FROM $wpdb->comments WHERE comment_post_ID IN ( $post_id ) AND comment_approved = '0' GROUP BY comment_post_ID", ARRAY_N ); if ( empty($pending) ) return 0; if ( $single ) return $pending[0][1]; $pending_keyed = array(); foreach ( $pending as $pend ) $pending_keyed[$pend[0]] = $pend[1]; return $pending_keyed; } // Add avatars to relevant places in admin, or try to function floated_admin_avatar( $name ) { global $comment; $id = $avatar = false; if ( $comment->comment_author_email ) $id = $comment->comment_author_email; if ( $comment->user_id ) $id = $comment->user_id; if ( $id ) $avatar = get_avatar( $id, 32 ); return "$avatar $name"; } if ( is_admin() && ('edit-comments.php' == $pagenow || 'edit.php' == $pagenow) ) { if ( get_option('show_avatars') ) add_filter( 'comment_author', 'floated_admin_avatar' ); } ?> wp/dev/wp-admin/includes/class-ftp-sockets.php0000644000106600010660000002003710765614603016614 0ustar __construct($verb, $le); } function __construct($verb=FALSE, $le=FALSE) { parent::__construct(true, $verb, $le); } // // // function _settimeout($sock) { if(!@socket_set_option($sock, SOL_SOCKET, SO_RCVTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) { $this->PushError('_connect','socket set receive timeout',socket_strerror(socket_last_error($sock))); @socket_close($sock); return FALSE; } if(!@socket_set_option($sock, SOL_SOCKET , SO_SNDTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) { $this->PushError('_connect','socket set send timeout',socket_strerror(socket_last_error($sock))); @socket_close($sock); return FALSE; } return true; } function _connect($host, $port) { $this->SendMSG("Creating socket"); if(!($sock = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) { $this->PushError('_connect','socket create failed',socket_strerror(socket_last_error($sock))); return FALSE; } if(!$this->_settimeout($sock)) return FALSE; $this->SendMSG("Connecting to \"".$host.":".$port."\""); if (!($res = @socket_connect($sock, $host, $port))) { $this->PushError('_connect','socket connect failed',socket_strerror(socket_last_error($sock))); @socket_close($sock); return FALSE; } $this->_connected=true; return $sock; } function _readmsg($fnction="_readmsg"){ if(!$this->_connected) { $this->PushError($fnction,'Connect first'); return FALSE; } $result=true; $this->_message=""; $this->_code=0; $go=true; do { $tmp=@socket_read($this->_ftp_control_sock, 4096, PHP_BINARY_READ); if($tmp===false) { $go=$result=false; $this->PushError($fnction,'Read failed', socket_strerror(socket_last_error($this->_ftp_control_sock))); } else { $this->_message.=$tmp; $go = !preg_match("/^([0-9]{3})(-.+\\1)? [^".CRLF."]+".CRLF."$/Us", $this->_message, $regs); } } while($go); if($this->LocalEcho) echo "GET < ".rtrim($this->_message, CRLF).CRLF; $this->_code=(int)$regs[1]; return $result; } function _exec($cmd, $fnction="_exec") { if(!$this->_ready) { $this->PushError($fnction,'Connect first'); return FALSE; } if($this->LocalEcho) echo "PUT > ",$cmd,CRLF; $status=@socket_write($this->_ftp_control_sock, $cmd.CRLF); if($status===false) { $this->PushError($fnction,'socket write failed', socket_strerror(socket_last_error($this->stream))); return FALSE; } $this->_lastaction=time(); if(!$this->_readmsg($fnction)) return FALSE; return TRUE; } function _data_prepare($mode=FTP_ASCII) { if(!$this->_settype($mode)) return FALSE; $this->SendMSG("Creating data socket"); $this->_ftp_data_sock = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP); if ($this->_ftp_data_sock < 0) { $this->PushError('_data_prepare','socket create failed',socket_strerror(socket_last_error($this->_ftp_data_sock))); return FALSE; } if(!$this->_settimeout($this->_ftp_data_sock)) { $this->_data_close(); return FALSE; } if($this->_passive) { if(!$this->_exec("PASV", "pasv")) { $this->_data_close(); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); return FALSE; } $ip_port = explode(",", ereg_replace("^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*".CRLF."$", "\\1", $this->_message)); $this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3]; $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]); $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); if(!@socket_connect($this->_ftp_data_sock, $this->_datahost, $this->_dataport)) { $this->PushError("_data_prepare","socket_connect", socket_strerror(socket_last_error($this->_ftp_data_sock))); $this->_data_close(); return FALSE; } else $this->_ftp_temp_sock=$this->_ftp_data_sock; } else { if(!@socket_getsockname($this->_ftp_control_sock, $addr, $port)) { $this->PushError("_data_prepare","can't get control socket information", socket_strerror(socket_last_error($this->_ftp_control_sock))); $this->_data_close(); return FALSE; } if(!@socket_bind($this->_ftp_data_sock,$addr)){ $this->PushError("_data_prepare","can't bind data socket", socket_strerror(socket_last_error($this->_ftp_data_sock))); $this->_data_close(); return FALSE; } if(!@socket_listen($this->_ftp_data_sock)) { $this->PushError("_data_prepare","can't listen data socket", socket_strerror(socket_last_error($this->_ftp_data_sock))); $this->_data_close(); return FALSE; } if(!@socket_getsockname($this->_ftp_data_sock, $this->_datahost, $this->_dataport)) { $this->PushError("_data_prepare","can't get data socket information", socket_strerror(socket_last_error($this->_ftp_data_sock))); $this->_data_close(); return FALSE; } if(!$this->_exec('PORT '.str_replace('.',',',$this->_datahost.'.'.($this->_dataport>>8).'.'.($this->_dataport&0x00FF)), "_port")) { $this->_data_close(); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); return FALSE; } } return TRUE; } function _data_read($mode=FTP_ASCII, $fp=NULL) { $NewLine=$this->_eol_code[$this->OS_local]; if(is_resource($fp)) $out=0; else $out=""; if(!$this->_passive) { $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); $this->_ftp_temp_sock=socket_accept($this->_ftp_data_sock); if($this->_ftp_temp_sock===FALSE) { $this->PushError("_data_read","socket_accept", socket_strerror(socket_last_error($this->_ftp_temp_sock))); $this->_data_close(); return FALSE; } } while(($block=@socket_read($this->_ftp_temp_sock, $this->_ftp_buff_size, PHP_BINARY_READ))!==false) { if($block==="") break; if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_local], $block); if(is_resource($fp)) $out+=fwrite($fp, $block, strlen($block)); else $out.=$block; } return $out; } function _data_write($mode=FTP_ASCII, $fp=NULL) { $NewLine=$this->_eol_code[$this->OS_local]; if(is_resource($fp)) $out=0; else $out=""; if(!$this->_passive) { $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); $this->_ftp_temp_sock=socket_accept($this->_ftp_data_sock); if($this->_ftp_temp_sock===FALSE) { $this->PushError("_data_write","socket_accept", socket_strerror(socket_last_error($this->_ftp_temp_sock))); $this->_data_close(); return false; } } if(is_resource($fp)) { while(!feof($fp)) { $block=fread($fp, $this->_ftp_buff_size); if(!$this->_data_write_block($mode, $block)) return false; } } elseif(!$this->_data_write_block($mode, $fp)) return false; return true; } function _data_write_block($mode, $block) { if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_remote], $block); do { if(($t=@socket_write($this->_ftp_temp_sock, $block))===FALSE) { $this->PushError("_data_write","socket_write", socket_strerror(socket_last_error($this->_ftp_temp_sock))); $this->_data_close(); return FALSE; } $block=substr($block, $t); } while(!empty($block)); return true; } function _data_close() { @socket_close($this->_ftp_temp_sock); @socket_close($this->_ftp_data_sock); $this->SendMSG("Disconnected data from remote host"); return TRUE; } function _quit() { if($this->_connected) { @socket_close($this->_ftp_control_sock); $this->_connected=false; $this->SendMSG("Socket closed"); } } } ?> wp/dev/wp-admin/includes/update.php0000644000106600010660000001612711035754323014531 0ustar response ) { case 'development' : return sprintf( '| '.__( 'You are using a development version (%s). Cool! Please stay updated.' ), $GLOBALS['wp_version'], $cur->url, $cur->current ); break; case 'upgrade' : if ( current_user_can('manage_options') ) { return sprintf( '| '.__( 'Get Version %3$s' ).'', $GLOBALS['wp_version'], $cur->url, $cur->current ); break; } case 'latest' : default : return sprintf( '| '.__( 'Version %s' ), $GLOBALS['wp_version'], $cur->url, $cur->current ); break; } } add_filter( 'update_footer', 'core_update_footer' ); function update_nag() { $cur = get_option( 'update_core' ); if ( ! isset( $cur->response ) || $cur->response != 'upgrade' ) return false; if ( current_user_can('manage_options') ) $msg = sprintf( __('WordPress %2$s is available! Please update now.'), $cur->url, $cur->current ); else $msg = sprintf( __('WordPress %2$s is available! Please notify the site administrator.'), $cur->url, $cur->current ); echo "
    $msg
    "; } add_action( 'admin_notices', 'update_nag', 3 ); // Called directly from dashboard function update_right_now_message() { $cur = get_option( 'update_core' ); $msg = sprintf( __('This is WordPress version %s.'), $GLOBALS['wp_version'] ); if ( isset( $cur->response ) && $cur->response == 'upgrade' && current_user_can('manage_options') ) $msg .= " " . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . ''; echo "$msg"; } function wp_plugin_update_row( $file, $plugin_data ) { $current = get_option( 'update_plugins' ); if ( !isset( $current->response[ $file ] ) ) return false; $r = $current->response[ $file ]; echo ''; if ( ! current_user_can('update_plugins') ) printf( __('There is a new version of %1$s available. Download version %3$s here.'), $plugin_data['Name'], $r->url, $r->new_version); else if ( empty($r->package) ) printf( __('There is a new version of %1$s available. Download version %3$s here automatic upgrade unavailable for this plugin.'), $plugin_data['Name'], $r->url, $r->new_version); else printf( __('There is a new version of %1$s available. Download version %3$s here or upgrade automatically.'), $plugin_data['Name'], $r->url, $r->new_version, wp_nonce_url('update.php?action=upgrade-plugin&plugin=' . $file, 'upgrade-plugin_' . $file) ); echo ''; } add_action( 'after_plugin_row', 'wp_plugin_update_row', 10, 2 ); function wp_update_plugin($plugin, $feedback = '') { global $wp_filesystem; if ( !empty($feedback) ) add_filter('update_feedback', $feedback); // Is an update available? $current = get_option( 'update_plugins' ); if ( !isset( $current->response[ $plugin ] ) ) return new WP_Error('up_to_date', __('The plugin is at the latest version.')); // Is a filesystem accessor setup? if ( ! $wp_filesystem || ! is_object($wp_filesystem) ) WP_Filesystem(); if ( ! is_object($wp_filesystem) ) return new WP_Error('fs_unavailable', __('Could not access filesystem.')); if ( $wp_filesystem->errors->get_error_code() ) return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem->errors); //Get the base plugin folder $plugins_dir = $wp_filesystem->wp_plugins_dir(); if ( empty($plugins_dir) ) return new WP_Error('fs_no_plugins_dir', __('Unable to locate WordPress Plugin directory.')); //And the same for the Content directory. $content_dir = $wp_filesystem->wp_content_dir(); if( empty($content_dir) ) return new WP_Error('fs_no_content_dir', __('Unable to locate WordPress Content directory (wp-content).')); $plugins_dir = trailingslashit( $plugins_dir ); $content_dir = trailingslashit( $content_dir ); // Get the URL to the zip file $r = $current->response[ $plugin ]; if ( empty($r->package) ) return new WP_Error('no_package', __('Upgrade package not available.')); // Download the package $package = $r->package; apply_filters('update_feedback', sprintf(__('Downloading update from %s'), $package)); $download_file = download_url($package); if ( is_wp_error($download_file) ) return new WP_Error('download_failed', __('Download failed.'), $download_file->get_error_message()); $working_dir = $content_dir . 'upgrade/' . basename($plugin, '.php'); // Clean up working directory if ( $wp_filesystem->is_dir($working_dir) ) $wp_filesystem->delete($working_dir, true); apply_filters('update_feedback', __('Unpacking the update')); // Unzip package to working directory $result = unzip_file($download_file, $working_dir); // Once extracted, delete the package unlink($download_file); if ( is_wp_error($result) ) { $wp_filesystem->delete($working_dir, true); return $result; } if ( is_plugin_active($plugin) ) { //Deactivate the plugin silently, Prevent deactivation hooks from running. apply_filters('update_feedback', __('Deactivating the plugin')); deactivate_plugins($plugin, true); } // Remove the existing plugin. apply_filters('update_feedback', __('Removing the old version of the plugin')); $this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin) ); // If plugin is in its own directory, recursively delete the directory. if ( strpos($plugin, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory seperator AND that its not the root plugin folder $deleted = $wp_filesystem->delete($this_plugin_dir, true); else $deleted = $wp_filesystem->delete($plugins_dir . $plugin); if ( ! $deleted ) { $wp_filesystem->delete($working_dir, true); return new WP_Error('delete_failed', __('Could not remove the old plugin')); } apply_filters('update_feedback', __('Installing the latest version')); // Copy new version of plugin into place. $result = copy_dir($working_dir, $plugins_dir); if ( is_wp_error($result) ) { //$wp_filesystem->delete($working_dir, true); //TODO: Uncomment? This DOES mean that the new files are available in the upgrade folder if it fails. return $result; } //Get a list of the directories in the working directory before we delete it, We need to know the new folder for the plugin $filelist = array_keys( $wp_filesystem->dirlist($working_dir) ); // Remove working directory $wp_filesystem->delete($working_dir, true); // Force refresh of plugin update information delete_option('update_plugins'); if( empty($filelist) ) return false; //We couldnt find any files in the working dir, therefor no plugin installed? Failsafe backup. $folder = $filelist[0]; $plugin = get_plugins('/' . $folder); //Ensure to pass with leading slash $pluginfiles = array_keys($plugin); //Assume the requested plugin is the first in the list return $folder . '/' . $pluginfiles[0]; } ?> wp/dev/wp-admin/includes/misc.php0000644000106600010660000001057511032571541014177 0ustar $markerline ) { if (strpos($markerline, '# BEGIN ' . $marker) !== false) $state = false; if ( $state ) { if ( $n + 1 < count( $markerdata ) ) fwrite( $f, "{$markerline}\n" ); else fwrite( $f, "{$markerline}" ); } if (strpos($markerline, '# END ' . $marker) !== false) { fwrite( $f, "# BEGIN {$marker}\n" ); if ( is_array( $insertion )) foreach ( $insertion as $insertline ) fwrite( $f, "{$insertline}\n" ); fwrite( $f, "# END {$marker}\n" ); $state = true; $foundit = true; } } } if (!$foundit) { fwrite( $f, "\n# BEGIN {$marker}\n" ); foreach ( $insertion as $insertline ) fwrite( $f, "{$insertline}\n" ); fwrite( $f, "# END {$marker}\n" ); } fclose( $f ); return true; } else { return false; } } /** * Updates the htaccess file with the current rules if it is writable. * * Always writes to the file if it exists and is writable to ensure that we blank out old rules. */ function save_mod_rewrite_rules() { global $wp_rewrite; $home_path = get_home_path(); $htaccess_file = $home_path.'.htaccess'; // If the file doesn't already exists check for write access to the directory and whether of not we have some rules. // else check for write access to the file. if ((!file_exists($htaccess_file) && is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks()) || is_writable($htaccess_file)) { if ( got_mod_rewrite() ) { $rules = explode( "\n", $wp_rewrite->mod_rewrite_rules() ); return insert_with_markers( $htaccess_file, 'WordPress', $rules ); } } return false; } function update_recently_edited( $file ) { $oldfiles = (array ) get_option( 'recently_edited' ); if ( $oldfiles ) { $oldfiles = array_reverse( $oldfiles ); $oldfiles[] = $file; $oldfiles = array_reverse( $oldfiles ); $oldfiles = array_unique( $oldfiles ); if ( 5 < count( $oldfiles )) array_pop( $oldfiles ); } else { $oldfiles[] = $file; } update_option( 'recently_edited', $oldfiles ); } // If siteurl or home changed, flush rewrite rules. function update_home_siteurl( $old_value, $value ) { global $wp_rewrite; if ( defined( "WP_INSTALLING" ) ) return; // If home changed, write rewrite rules to new location. $wp_rewrite->flush_rules(); } add_action( 'update_option_home', 'update_home_siteurl', 10, 2 ); add_action( 'update_option_siteurl', 'update_home_siteurl', 10, 2 ); function url_shorten( $url ) { $short_url = str_replace( 'http://', '', stripslashes( $url )); $short_url = str_replace( 'www.', '', $short_url ); if ('/' == substr( $short_url, -1 )) $short_url = substr( $short_url, 0, -1 ); if ( strlen( $short_url ) > 35 ) $short_url = substr( $short_url, 0, 32 ).'...'; return $short_url; } function wp_reset_vars( $vars ) { for ( $i=0; $i wp/dev/wp-admin/includes/import.php0000644000106600010660000000214310733647662014565 0ustar false, 'test_type' => false ); $_FILES['import']['name'] .= '.import'; $file = wp_handle_upload( $_FILES['import'], $overrides ); if ( isset( $file['error'] ) ) return $file; $url = $file['url']; $type = $file['type']; $file = addslashes( $file['file'] ); $filename = basename( $file ); // Construct the object array $object = array( 'post_title' => $filename, 'post_content' => $url, 'post_mime_type' => $type, 'guid' => $url ); // Save the data $id = wp_insert_attachment( $object, $file ); return array( 'file' => $file, 'id' => $id ); } ?> wp/dev/wp-admin/includes/class-pclzip.php0000644000106600010660000073263610767013154015666 0ustar zipname = $p_zipname; $this->zip_fd = 0; $this->magic_quotes_status = -1; // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 1); return; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : // create($p_filelist, $p_add_dir="", $p_remove_dir="") // create($p_filelist, $p_option, $p_option_value, ...) // Description : // This method supports two different synopsis. The first one is historical. // This method creates a Zip Archive. The Zip file is created in the // filesystem. The files and directories indicated in $p_filelist // are added in the archive. See the parameters description for the // supported format of $p_filelist. // When a directory is in the list, the directory and its content is added // in the archive. // In this synopsis, the function takes an optional variable list of // options. See bellow the supported options. // Parameters : // $p_filelist : An array containing file or directory names, or // a string containing one filename or one directory name, or // a string containing a list of filenames and/or directory // names separated by spaces. // $p_add_dir : A path to add before the real path of the archived file, // in order to have it memorized in the archive. // $p_remove_dir : A path to remove from the real path of the file to archive, // in order to have a shorter path memorized in the archive. // When $p_add_dir and $p_remove_dir are set, $p_remove_dir // is removed first, before $p_add_dir is added. // Options : // PCLZIP_OPT_ADD_PATH : // PCLZIP_OPT_REMOVE_PATH : // PCLZIP_OPT_REMOVE_ALL_PATH : // PCLZIP_OPT_COMMENT : // PCLZIP_CB_PRE_ADD : // PCLZIP_CB_POST_ADD : // Return Values : // 0 on failure, // The list of the added files, with a status of the add action. // (see PclZip::listContent() for list entry format) // -------------------------------------------------------------------------------- function create($p_filelist) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::create', "filelist='$p_filelist', ..."); $v_result=1; // ----- Reset the error handler $this->privErrorReset(); // ----- Set default values $v_options = array(); $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE; // ----- Look for variable options arguments $v_size = func_num_args(); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); // ----- Look for arguments if ($v_size > 1) { // ----- Get the arguments $v_arg_list = func_get_args(); // ----- Remove from the options list the first argument array_shift($v_arg_list); $v_size--; // ----- Look for first arg if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options detected"); // ----- Parse the options $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, array (PCLZIP_OPT_REMOVE_PATH => 'optional', PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', PCLZIP_OPT_ADD_PATH => 'optional', PCLZIP_CB_PRE_ADD => 'optional', PCLZIP_CB_POST_ADD => 'optional', PCLZIP_OPT_NO_COMPRESSION => 'optional', PCLZIP_OPT_COMMENT => 'optional' //, PCLZIP_OPT_CRYPT => 'optional' )); if ($v_result != 1) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } } // ----- Look for 2 args // Here we need to support the first historic synopsis of the // method. else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis"); // ----- Get the first argument $v_options[PCLZIP_OPT_ADD_PATH] = $v_arg_list[0]; // ----- Look for the optional second argument if ($v_size == 2) { $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1]; } else if ($v_size > 2) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return 0; } } } // ----- Init $v_string_list = array(); $v_att_list = array(); $v_filedescr_list = array(); $p_result_list = array(); // ----- Look if the $p_filelist is really an array if (is_array($p_filelist)) { // ----- Look if the first element is also an array // This will mean that this is a file description entry if (isset($p_filelist[0]) && is_array($p_filelist[0])) { $v_att_list = $p_filelist; } // ----- The list is a list of string names else { $v_string_list = $p_filelist; } } // ----- Look if the $p_filelist is a string else if (is_string($p_filelist)) { // ----- Create a list from the string $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist); } // ----- Invalid variable type for $p_filelist else { PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_filelist"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } // ----- Reformat the string list if (sizeof($v_string_list) != 0) { foreach ($v_string_list as $v_string) { if ($v_string != '') { $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; } else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Ignore an empty filename"); } } } // ----- For each file in the list check the attributes $v_supported_attributes = array ( PCLZIP_ATT_FILE_NAME => 'mandatory' ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional' ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional' ); foreach ($v_att_list as $v_entry) { $v_result = $this->privFileDescrParseAtt($v_entry, $v_filedescr_list[], $v_options, $v_supported_attributes); if ($v_result != 1) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } } // ----- Expand the filelist (expand directories) $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options); if ($v_result != 1) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } // ----- Call the create fct $v_result = $this->privCreate($v_filedescr_list, $p_result_list, $v_options); if ($v_result != 1) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_result_list); return $p_result_list; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : // add($p_filelist, $p_add_dir="", $p_remove_dir="") // add($p_filelist, $p_option, $p_option_value, ...) // Description : // This method supports two synopsis. The first one is historical. // This methods add the list of files in an existing archive. // If a file with the same name already exists, it is added at the end of the // archive, the first one is still present. // If the archive does not exist, it is created. // Parameters : // $p_filelist : An array containing file or directory names, or // a string containing one filename or one directory name, or // a string containing a list of filenames and/or directory // names separated by spaces. // $p_add_dir : A path to add before the real path of the archived file, // in order to have it memorized in the archive. // $p_remove_dir : A path to remove from the real path of the file to archive, // in order to have a shorter path memorized in the archive. // When $p_add_dir and $p_remove_dir are set, $p_remove_dir // is removed first, before $p_add_dir is added. // Options : // PCLZIP_OPT_ADD_PATH : // PCLZIP_OPT_REMOVE_PATH : // PCLZIP_OPT_REMOVE_ALL_PATH : // PCLZIP_OPT_COMMENT : // PCLZIP_OPT_ADD_COMMENT : // PCLZIP_OPT_PREPEND_COMMENT : // PCLZIP_CB_PRE_ADD : // PCLZIP_CB_POST_ADD : // Return Values : // 0 on failure, // The list of the added files, with a status of the add action. // (see PclZip::listContent() for list entry format) // -------------------------------------------------------------------------------- function add($p_filelist) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::add', "filelist='$p_filelist', ..."); $v_result=1; // ----- Reset the error handler $this->privErrorReset(); // ----- Set default values $v_options = array(); $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE; // ----- Look for variable options arguments $v_size = func_num_args(); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); // ----- Look for arguments if ($v_size > 1) { // ----- Get the arguments $v_arg_list = func_get_args(); // ----- Remove form the options list the first argument array_shift($v_arg_list); $v_size--; // ----- Look for first arg if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options detected"); // ----- Parse the options $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, array (PCLZIP_OPT_REMOVE_PATH => 'optional', PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', PCLZIP_OPT_ADD_PATH => 'optional', PCLZIP_CB_PRE_ADD => 'optional', PCLZIP_CB_POST_ADD => 'optional', PCLZIP_OPT_NO_COMPRESSION => 'optional', PCLZIP_OPT_COMMENT => 'optional', PCLZIP_OPT_ADD_COMMENT => 'optional', PCLZIP_OPT_PREPEND_COMMENT => 'optional' //, PCLZIP_OPT_CRYPT => 'optional' )); if ($v_result != 1) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } } // ----- Look for 2 args // Here we need to support the first historic synopsis of the // method. else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis"); // ----- Get the first argument $v_options[PCLZIP_OPT_ADD_PATH] = $v_add_path = $v_arg_list[0]; // ----- Look for the optional second argument if ($v_size == 2) { $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1]; } else if ($v_size > 2) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return 0; } } } // ----- Init $v_string_list = array(); $v_att_list = array(); $v_filedescr_list = array(); $p_result_list = array(); // ----- Look if the $p_filelist is really an array if (is_array($p_filelist)) { // ----- Look if the first element is also an array // This will mean that this is a file description entry if (isset($p_filelist[0]) && is_array($p_filelist[0])) { $v_att_list = $p_filelist; } // ----- The list is a list of string names else { $v_string_list = $p_filelist; } } // ----- Look if the $p_filelist is a string else if (is_string($p_filelist)) { // ----- Create a list from the string $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist); } // ----- Invalid variable type for $p_filelist else { PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type '".gettype($p_filelist)."' for p_filelist"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } // ----- Reformat the string list if (sizeof($v_string_list) != 0) { foreach ($v_string_list as $v_string) { $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; } } // ----- For each file in the list check the attributes $v_supported_attributes = array ( PCLZIP_ATT_FILE_NAME => 'mandatory' ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional' ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional' ); foreach ($v_att_list as $v_entry) { $v_result = $this->privFileDescrParseAtt($v_entry, $v_filedescr_list[], $v_options, $v_supported_attributes); if ($v_result != 1) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } } // ----- Expand the filelist (expand directories) $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options); if ($v_result != 1) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } // ----- Call the create fct $v_result = $this->privAdd($v_filedescr_list, $p_result_list, $v_options); if ($v_result != 1) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_result_list); return $p_result_list; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : listContent() // Description : // This public method, gives the list of the files and directories, with their // properties. // The properties of each entries in the list are (used also in other functions) : // filename : Name of the file. For a create or add action it is the filename // given by the user. For an extract function it is the filename // of the extracted file. // stored_filename : Name of the file / directory stored in the archive. // size : Size of the stored file. // compressed_size : Size of the file's data compressed in the archive // (without the headers overhead) // mtime : Last known modification date of the file (UNIX timestamp) // comment : Comment associated with the file // folder : true | false // index : index of the file in the archive // status : status of the action (depending of the action) : // Values are : // ok : OK ! // filtered : the file / dir is not extracted (filtered by user) // already_a_directory : the file can not be extracted because a // directory with the same name already exists // write_protected : the file can not be extracted because a file // with the same name already exists and is // write protected // newer_exist : the file was not extracted because a newer file exists // path_creation_fail : the file is not extracted because the folder // does not exists and can not be created // write_error : the file was not extracted because there was a // error while writing the file // read_error : the file was not extracted because there was a error // while reading the file // invalid_header : the file was not extracted because of an archive // format error (bad file header) // Note that each time a method can continue operating when there // is an action error on a file, the error is only logged in the file status. // Return Values : // 0 on an unrecoverable failure, // The list of the files in the archive. // -------------------------------------------------------------------------------- function listContent() { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::listContent', ""); $v_result=1; // ----- Reset the error handler $this->privErrorReset(); // ----- Check archive if (!$this->privCheckFormat()) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return(0); } // ----- Call the extracting fct $p_list = array(); if (($v_result = $this->privList($p_list)) != 1) { unset($p_list); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); return(0); } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list); return $p_list; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : // extract($p_path="./", $p_remove_path="") // extract([$p_option, $p_option_value, ...]) // Description : // This method supports two synopsis. The first one is historical. // This method extract all the files / directories from the archive to the // folder indicated in $p_path. // If you want to ignore the 'root' part of path of the memorized files // you can indicate this in the optional $p_remove_path parameter. // By default, if a newer file with the same name already exists, the // file is not extracted. // // If both PCLZIP_OPT_PATH and PCLZIP_OPT_ADD_PATH aoptions // are used, the path indicated in PCLZIP_OPT_ADD_PATH is append // at the end of the path value of PCLZIP_OPT_PATH. // Parameters : // $p_path : Path where the files and directories are to be extracted // $p_remove_path : First part ('root' part) of the memorized path // (if any similar) to remove while extracting. // Options : // PCLZIP_OPT_PATH : // PCLZIP_OPT_ADD_PATH : // PCLZIP_OPT_REMOVE_PATH : // PCLZIP_OPT_REMOVE_ALL_PATH : // PCLZIP_CB_PRE_EXTRACT : // PCLZIP_CB_POST_EXTRACT : // Return Values : // 0 or a negative value on failure, // The list of the extracted files, with a status of the action. // (see PclZip::listContent() for list entry format) // -------------------------------------------------------------------------------- function extract() { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::extract", ""); $v_result=1; // ----- Reset the error handler $this->privErrorReset(); // ----- Check archive if (!$this->privCheckFormat()) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return(0); } // ----- Set default values $v_options = array(); // $v_path = "./"; $v_path = ''; $v_remove_path = ""; $v_remove_all_path = false; // ----- Look for variable options arguments $v_size = func_num_args(); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); // ----- Default values for option $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; // ----- Look for arguments if ($v_size > 0) { // ----- Get the arguments $v_arg_list = func_get_args(); // ----- Look for first arg if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options"); // ----- Parse the options $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, array (PCLZIP_OPT_PATH => 'optional', PCLZIP_OPT_REMOVE_PATH => 'optional', PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', PCLZIP_OPT_ADD_PATH => 'optional', PCLZIP_CB_PRE_EXTRACT => 'optional', PCLZIP_CB_POST_EXTRACT => 'optional', PCLZIP_OPT_SET_CHMOD => 'optional', PCLZIP_OPT_BY_NAME => 'optional', PCLZIP_OPT_BY_EREG => 'optional', PCLZIP_OPT_BY_PREG => 'optional', PCLZIP_OPT_BY_INDEX => 'optional', PCLZIP_OPT_EXTRACT_AS_STRING => 'optional', PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional', PCLZIP_OPT_REPLACE_NEWER => 'optional' ,PCLZIP_OPT_STOP_ON_ERROR => 'optional' ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional' )); if ($v_result != 1) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } // ----- Set the arguments if (isset($v_options[PCLZIP_OPT_PATH])) { $v_path = $v_options[PCLZIP_OPT_PATH]; } if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; } if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; } if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { // ----- Check for '/' in last path char if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) { $v_path .= '/'; } $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; } } // ----- Look for 2 args // Here we need to support the first historic synopsis of the // method. else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis"); // ----- Get the first argument $v_path = $v_arg_list[0]; // ----- Look for the optional second argument if ($v_size == 2) { $v_remove_path = $v_arg_list[1]; } else if ($v_size > 2) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); return 0; } } } // ----- Trace //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "path='$v_path', remove_path='$v_remove_path', remove_all_path='".($v_remove_path?'true':'false')."'"); // ----- Call the extracting fct $p_list = array(); $v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options); if ($v_result < 1) { unset($p_list); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); return(0); } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list); return $p_list; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : // extractByIndex($p_index, $p_path="./", $p_remove_path="") // extractByIndex($p_index, [$p_option, $p_option_value, ...]) // Description : // This method supports two synopsis. The first one is historical. // This method is doing a partial extract of the archive. // The extracted files or folders are identified by their index in the // archive (from 0 to n). // Note that if the index identify a folder, only the folder entry is // extracted, not all the files included in the archive. // Parameters : // $p_index : A single index (integer) or a string of indexes of files to // extract. The form of the string is "0,4-6,8-12" with only numbers // and '-' for range or ',' to separate ranges. No spaces or ';' // are allowed. // $p_path : Path where the files and directories are to be extracted // $p_remove_path : First part ('root' part) of the memorized path // (if any similar) to remove while extracting. // Options : // PCLZIP_OPT_PATH : // PCLZIP_OPT_ADD_PATH : // PCLZIP_OPT_REMOVE_PATH : // PCLZIP_OPT_REMOVE_ALL_PATH : // PCLZIP_OPT_EXTRACT_AS_STRING : The files are extracted as strings and // not as files. // The resulting content is in a new field 'content' in the file // structure. // This option must be used alone (any other options are ignored). // PCLZIP_CB_PRE_EXTRACT : // PCLZIP_CB_POST_EXTRACT : // Return Values : // 0 on failure, // The list of the extracted files, with a status of the action. // (see PclZip::listContent() for list entry format) // -------------------------------------------------------------------------------- //function extractByIndex($p_index, options...) function extractByIndex($p_index) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::extractByIndex", "index='$p_index', ..."); $v_result=1; // ----- Reset the error handler $this->privErrorReset(); // ----- Check archive if (!$this->privCheckFormat()) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return(0); } // ----- Set default values $v_options = array(); // $v_path = "./"; $v_path = ''; $v_remove_path = ""; $v_remove_all_path = false; // ----- Look for variable options arguments $v_size = func_num_args(); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); // ----- Default values for option $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; // ----- Look for arguments if ($v_size > 1) { // ----- Get the arguments $v_arg_list = func_get_args(); // ----- Remove form the options list the first argument array_shift($v_arg_list); $v_size--; // ----- Look for first arg if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options"); // ----- Parse the options $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, array (PCLZIP_OPT_PATH => 'optional', PCLZIP_OPT_REMOVE_PATH => 'optional', PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', PCLZIP_OPT_EXTRACT_AS_STRING => 'optional', PCLZIP_OPT_ADD_PATH => 'optional', PCLZIP_CB_PRE_EXTRACT => 'optional', PCLZIP_CB_POST_EXTRACT => 'optional', PCLZIP_OPT_SET_CHMOD => 'optional', PCLZIP_OPT_REPLACE_NEWER => 'optional' ,PCLZIP_OPT_STOP_ON_ERROR => 'optional' ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional' )); if ($v_result != 1) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } // ----- Set the arguments if (isset($v_options[PCLZIP_OPT_PATH])) { $v_path = $v_options[PCLZIP_OPT_PATH]; } if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; } if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; } if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { // ----- Check for '/' in last path char if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) { $v_path .= '/'; } $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; } if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) { $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Option PCLZIP_OPT_EXTRACT_AS_STRING not set."); } else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Option PCLZIP_OPT_EXTRACT_AS_STRING set."); } } // ----- Look for 2 args // Here we need to support the first historic synopsis of the // method. else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis"); // ----- Get the first argument $v_path = $v_arg_list[0]; // ----- Look for the optional second argument if ($v_size == 2) { $v_remove_path = $v_arg_list[1]; } else if ($v_size > 2) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return 0; } } } // ----- Trace //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "index='$p_index', path='$v_path', remove_path='$v_remove_path', remove_all_path='".($v_remove_path?'true':'false')."'"); // ----- Trick // Here I want to reuse extractByRule(), so I need to parse the $p_index // with privParseOptions() $v_arg_trick = array (PCLZIP_OPT_BY_INDEX, $p_index); $v_options_trick = array(); $v_result = $this->privParseOptions($v_arg_trick, sizeof($v_arg_trick), $v_options_trick, array (PCLZIP_OPT_BY_INDEX => 'optional' )); if ($v_result != 1) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } $v_options[PCLZIP_OPT_BY_INDEX] = $v_options_trick[PCLZIP_OPT_BY_INDEX]; // ----- Call the extracting fct if (($v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options)) < 1) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); return(0); } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list); return $p_list; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : // delete([$p_option, $p_option_value, ...]) // Description : // This method removes files from the archive. // If no parameters are given, then all the archive is emptied. // Parameters : // None or optional arguments. // Options : // PCLZIP_OPT_BY_INDEX : // PCLZIP_OPT_BY_NAME : // PCLZIP_OPT_BY_EREG : // PCLZIP_OPT_BY_PREG : // Return Values : // 0 on failure, // The list of the files which are still present in the archive. // (see PclZip::listContent() for list entry format) // -------------------------------------------------------------------------------- function delete() { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::delete", ""); $v_result=1; // ----- Reset the error handler $this->privErrorReset(); // ----- Check archive if (!$this->privCheckFormat()) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return(0); } // ----- Set default values $v_options = array(); // ----- Look for variable options arguments $v_size = func_num_args(); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); // ----- Look for arguments if ($v_size > 0) { // ----- Get the arguments $v_arg_list = func_get_args(); // ----- Parse the options $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, array (PCLZIP_OPT_BY_NAME => 'optional', PCLZIP_OPT_BY_EREG => 'optional', PCLZIP_OPT_BY_PREG => 'optional', PCLZIP_OPT_BY_INDEX => 'optional' )); if ($v_result != 1) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } } // ----- Magic quotes trick $this->privDisableMagicQuotes(); // ----- Call the delete fct $v_list = array(); if (($v_result = $this->privDeleteByRule($v_list, $v_options)) != 1) { $this->privSwapBackMagicQuotes(); unset($v_list); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); return(0); } // ----- Magic quotes trick $this->privSwapBackMagicQuotes(); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_list); return $v_list; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : deleteByIndex() // Description : // ***** Deprecated ***** // delete(PCLZIP_OPT_BY_INDEX, $p_index) should be prefered. // -------------------------------------------------------------------------------- function deleteByIndex($p_index) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::deleteByIndex", "index='$p_index'"); $p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list); return $p_list; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : properties() // Description : // This method gives the properties of the archive. // The properties are : // nb : Number of files in the archive // comment : Comment associated with the archive file // status : not_exist, ok // Parameters : // None // Return Values : // 0 on failure, // An array with the archive properties. // -------------------------------------------------------------------------------- function properties() { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::properties", ""); // ----- Reset the error handler $this->privErrorReset(); // ----- Magic quotes trick $this->privDisableMagicQuotes(); // ----- Check archive if (!$this->privCheckFormat()) { $this->privSwapBackMagicQuotes(); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return(0); } // ----- Default properties $v_prop = array(); $v_prop['comment'] = ''; $v_prop['nb'] = 0; $v_prop['status'] = 'not_exist'; // ----- Look if file exists if (@is_file($this->zipname)) { // ----- Open the zip file //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) { $this->privSwapBackMagicQuotes(); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), 0); return 0; } // ----- Read the central directory informations $v_central_dir = array(); if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { $this->privSwapBackMagicQuotes(); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } // ----- Close the zip file $this->privCloseFd(); // ----- Set the user attributes $v_prop['comment'] = $v_central_dir['comment']; $v_prop['nb'] = $v_central_dir['entries']; $v_prop['status'] = 'ok'; } // ----- Magic quotes trick $this->privSwapBackMagicQuotes(); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_prop); return $v_prop; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : duplicate() // Description : // This method creates an archive by copying the content of an other one. If // the archive already exist, it is replaced by the new one without any warning. // Parameters : // $p_archive : The filename of a valid archive, or // a valid PclZip object. // Return Values : // 1 on success. // 0 or a negative value on error (error code). // -------------------------------------------------------------------------------- function duplicate($p_archive) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::duplicate", ""); $v_result = 1; // ----- Reset the error handler $this->privErrorReset(); // ----- Look if the $p_archive is a PclZip object if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip')) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The parameter is valid PclZip object '".$p_archive->zipname."'"); // ----- Duplicate the archive $v_result = $this->privDuplicate($p_archive->zipname); } // ----- Look if the $p_archive is a string (so a filename) else if (is_string($p_archive)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The parameter is a filename '$p_archive'"); // ----- Check that $p_archive is a valid zip file // TBC : Should also check the archive format if (!is_file($p_archive)) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "No file with filename '".$p_archive."'"); $v_result = PCLZIP_ERR_MISSING_FILE; } else { // ----- Duplicate the archive $v_result = $this->privDuplicate($p_archive); } } // ----- Invalid variable else { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add"); $v_result = PCLZIP_ERR_INVALID_PARAMETER; } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : merge() // Description : // This method merge the $p_archive_to_add archive at the end of the current // one ($this). // If the archive ($this) does not exist, the merge becomes a duplicate. // If the $p_archive_to_add archive does not exist, the merge is a success. // Parameters : // $p_archive_to_add : It can be directly the filename of a valid zip archive, // or a PclZip object archive. // Return Values : // 1 on success, // 0 or negative values on error (see below). // -------------------------------------------------------------------------------- function merge($p_archive_to_add) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::merge", ""); $v_result = 1; // ----- Reset the error handler $this->privErrorReset(); // ----- Check archive if (!$this->privCheckFormat()) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return(0); } // ----- Look if the $p_archive_to_add is a PclZip object if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip')) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The parameter is valid PclZip object"); // ----- Merge the archive $v_result = $this->privMerge($p_archive_to_add); } // ----- Look if the $p_archive_to_add is a string (so a filename) else if (is_string($p_archive_to_add)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The parameter is a filename"); // ----- Create a temporary archive $v_object_archive = new PclZip($p_archive_to_add); // ----- Merge the archive $v_result = $this->privMerge($v_object_archive); } // ----- Invalid variable else { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add"); $v_result = PCLZIP_ERR_INVALID_PARAMETER; } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : errorCode() // Description : // Parameters : // -------------------------------------------------------------------------------- function errorCode() { if (PCLZIP_ERROR_EXTERNAL == 1) { return(PclErrorCode()); } else { return($this->error_code); } } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : errorName() // Description : // Parameters : // -------------------------------------------------------------------------------- function errorName($p_with_code=false) { $v_name = array ( PCLZIP_ERR_NO_ERROR => 'PCLZIP_ERR_NO_ERROR', PCLZIP_ERR_WRITE_OPEN_FAIL => 'PCLZIP_ERR_WRITE_OPEN_FAIL', PCLZIP_ERR_READ_OPEN_FAIL => 'PCLZIP_ERR_READ_OPEN_FAIL', PCLZIP_ERR_INVALID_PARAMETER => 'PCLZIP_ERR_INVALID_PARAMETER', PCLZIP_ERR_MISSING_FILE => 'PCLZIP_ERR_MISSING_FILE', PCLZIP_ERR_FILENAME_TOO_LONG => 'PCLZIP_ERR_FILENAME_TOO_LONG', PCLZIP_ERR_INVALID_ZIP => 'PCLZIP_ERR_INVALID_ZIP', PCLZIP_ERR_BAD_EXTRACTED_FILE => 'PCLZIP_ERR_BAD_EXTRACTED_FILE', PCLZIP_ERR_DIR_CREATE_FAIL => 'PCLZIP_ERR_DIR_CREATE_FAIL', PCLZIP_ERR_BAD_EXTENSION => 'PCLZIP_ERR_BAD_EXTENSION', PCLZIP_ERR_BAD_FORMAT => 'PCLZIP_ERR_BAD_FORMAT', PCLZIP_ERR_DELETE_FILE_FAIL => 'PCLZIP_ERR_DELETE_FILE_FAIL', PCLZIP_ERR_RENAME_FILE_FAIL => 'PCLZIP_ERR_RENAME_FILE_FAIL', PCLZIP_ERR_BAD_CHECKSUM => 'PCLZIP_ERR_BAD_CHECKSUM', PCLZIP_ERR_INVALID_ARCHIVE_ZIP => 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP', PCLZIP_ERR_MISSING_OPTION_VALUE => 'PCLZIP_ERR_MISSING_OPTION_VALUE', PCLZIP_ERR_INVALID_OPTION_VALUE => 'PCLZIP_ERR_INVALID_OPTION_VALUE', PCLZIP_ERR_UNSUPPORTED_COMPRESSION => 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION', PCLZIP_ERR_UNSUPPORTED_ENCRYPTION => 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION' ,PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE => 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE' ,PCLZIP_ERR_DIRECTORY_RESTRICTION => 'PCLZIP_ERR_DIRECTORY_RESTRICTION' ); if (isset($v_name[$this->error_code])) { $v_value = $v_name[$this->error_code]; } else { $v_value = 'NoName'; } if ($p_with_code) { return($v_value.' ('.$this->error_code.')'); } else { return($v_value); } } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : errorInfo() // Description : // Parameters : // -------------------------------------------------------------------------------- function errorInfo($p_full=false) { if (PCLZIP_ERROR_EXTERNAL == 1) { return(PclErrorString()); } else { if ($p_full) { return($this->errorName(true)." : ".$this->error_string); } else { return($this->error_string." [code ".$this->error_code."]"); } } } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // ***** UNDER THIS LINE ARE DEFINED PRIVATE INTERNAL FUNCTIONS ***** // ***** ***** // ***** THESES FUNCTIONS MUST NOT BE USED DIRECTLY ***** // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privCheckFormat() // Description : // This method check that the archive exists and is a valid zip archive. // Several level of check exists. (futur) // Parameters : // $p_level : Level of check. Default 0. // 0 : Check the first bytes (magic codes) (default value)) // 1 : 0 + Check the central directory (futur) // 2 : 1 + Check each file header (futur) // Return Values : // true on success, // false on error, the error code is set. // -------------------------------------------------------------------------------- function privCheckFormat($p_level=0) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCheckFormat", ""); $v_result = true; // ----- Reset the file system cache clearstatcache(); // ----- Reset the error handler $this->privErrorReset(); // ----- Look if the file exits if (!is_file($this->zipname)) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "Missing archive file '".$this->zipname."'"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, false, PclZip::errorInfo()); return(false); } // ----- Check that the file is readeable if (!is_readable($this->zipname)) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to read archive '".$this->zipname."'"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, false, PclZip::errorInfo()); return(false); } // ----- Check the magic code // TBC // ----- Check the central header // TBC // ----- Check each file header // TBC // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privParseOptions() // Description : // This internal methods reads the variable list of arguments ($p_options_list, // $p_size) and generate an array with the options and values ($v_result_list). // $v_requested_options contains the options that can be present and those that // must be present. // $v_requested_options is an array, with the option value as key, and 'optional', // or 'mandatory' as value. // Parameters : // See above. // Return Values : // 1 on success. // 0 on failure. // -------------------------------------------------------------------------------- function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options=false) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privParseOptions", ""); $v_result=1; // ----- Read the options $i=0; while ($i<$p_size) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Looking for table index $i, option = '".PclZipUtilOptionText($p_options_list[$i])."(".$p_options_list[$i].")'"); // ----- Check if the option is supported if (!isset($v_requested_options[$p_options_list[$i]])) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid optional parameter '".$p_options_list[$i]."' for this method"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Look for next option switch ($p_options_list[$i]) { // ----- Look for options that request a path value case PCLZIP_OPT_PATH : case PCLZIP_OPT_REMOVE_PATH : case PCLZIP_OPT_ADD_PATH : // ----- Check the number of parameters if (($i+1) >= $p_size) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Get the value $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], false); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); $i++; break; case PCLZIP_OPT_EXTRACT_DIR_RESTRICTION : // ----- Check the number of parameters if (($i+1) >= $p_size) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Get the value if ( is_string($p_options_list[$i+1]) && ($p_options_list[$i+1] != '')) { $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], false); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); $i++; } else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." set with an empty value is ignored."); } break; // ----- Look for options that request an array of string for value case PCLZIP_OPT_BY_NAME : // ----- Check the number of parameters if (($i+1) >= $p_size) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Get the value if (is_string($p_options_list[$i+1])) { $v_result_list[$p_options_list[$i]][0] = $p_options_list[$i+1]; } else if (is_array($p_options_list[$i+1])) { $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; } else { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); $i++; break; // ----- Look for options that request an EREG or PREG expression case PCLZIP_OPT_BY_EREG : case PCLZIP_OPT_BY_PREG : //case PCLZIP_OPT_CRYPT : // ----- Check the number of parameters if (($i+1) >= $p_size) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Get the value if (is_string($p_options_list[$i+1])) { $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; } else { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); $i++; break; // ----- Look for options that takes a string case PCLZIP_OPT_COMMENT : case PCLZIP_OPT_ADD_COMMENT : case PCLZIP_OPT_PREPEND_COMMENT : // ----- Check the number of parameters if (($i+1) >= $p_size) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '" .PclZipUtilOptionText($p_options_list[$i]) ."'"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Get the value if (is_string($p_options_list[$i+1])) { $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; } else { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '" .PclZipUtilOptionText($p_options_list[$i]) ."'"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); $i++; break; // ----- Look for options that request an array of index case PCLZIP_OPT_BY_INDEX : // ----- Check the number of parameters if (($i+1) >= $p_size) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Get the value $v_work_list = array(); if (is_string($p_options_list[$i+1])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is a string '".$p_options_list[$i+1]."'"); // ----- Remove spaces $p_options_list[$i+1] = strtr($p_options_list[$i+1], ' ', ''); // ----- Parse items $v_work_list = explode(",", $p_options_list[$i+1]); } else if (is_integer($p_options_list[$i+1])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is an integer '".$p_options_list[$i+1]."'"); $v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1]; } else if (is_array($p_options_list[$i+1])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is an array"); $v_work_list = $p_options_list[$i+1]; } else { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Value must be integer, string or array for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Reduce the index list // each index item in the list must be a couple with a start and // an end value : [0,3], [5-5], [8-10], ... // ----- Check the format of each item $v_sort_flag=false; $v_sort_value=0; for ($j=0; $j= $p_size) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Get the value $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); $i++; break; // ----- Look for options that request a call-back case PCLZIP_CB_PRE_EXTRACT : case PCLZIP_CB_POST_EXTRACT : case PCLZIP_CB_PRE_ADD : case PCLZIP_CB_POST_ADD : /* for futur use case PCLZIP_CB_PRE_DELETE : case PCLZIP_CB_POST_DELETE : case PCLZIP_CB_PRE_LIST : case PCLZIP_CB_POST_LIST : */ // ----- Check the number of parameters if (($i+1) >= $p_size) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Get the value $v_function_name = $p_options_list[$i+1]; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "call-back ".PclZipUtilOptionText($p_options_list[$i])." = '".$v_function_name."'"); // ----- Check that the value is a valid existing function if (!function_exists($v_function_name)) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Function '".$v_function_name."()' is not an existing function for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Set the attribute $v_result_list[$p_options_list[$i]] = $v_function_name; $i++; break; default : // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Unknown parameter '" .$p_options_list[$i]."'"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Next options $i++; } // ----- Look for mandatory options if ($v_requested_options !== false) { for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) { // ----- Look for mandatory option if ($v_requested_options[$key] == 'mandatory') { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Detect a mandatory option : ".PclZipUtilOptionText($key)."(".$key.")"); // ----- Look if present if (!isset($v_result_list[$key])) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } } } } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privFileDescrParseAtt() // Description : // Parameters : // Return Values : // 1 on success. // 0 on failure. // -------------------------------------------------------------------------------- function privFileDescrParseAtt(&$p_file_list, &$p_filedescr, $v_options, $v_requested_options=false) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privFileDescrParseAtt", ""); $v_result=1; // ----- For each file in the list check the attributes foreach ($p_file_list as $v_key => $v_value) { // ----- Check if the option is supported if (!isset($v_requested_options[$v_key])) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file attribute '".$v_key."' for this file"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Look for attribute switch ($v_key) { case PCLZIP_ATT_FILE_NAME : if (!is_string($v_value)) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } $p_filedescr['filename'] = PclZipUtilPathReduction($v_value); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'"); if ($p_filedescr['filename'] == '') { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } break; case PCLZIP_ATT_FILE_NEW_SHORT_NAME : if (!is_string($v_value)) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } $p_filedescr['new_short_name'] = PclZipUtilPathReduction($v_value); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'"); if ($p_filedescr['new_short_name'] == '') { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty short filename for attribute '".PclZipUtilOptionText($v_key)."'"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } break; case PCLZIP_ATT_FILE_NEW_FULL_NAME : if (!is_string($v_value)) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } $p_filedescr['new_full_name'] = PclZipUtilPathReduction($v_value); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'"); if ($p_filedescr['new_full_name'] == '') { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty full filename for attribute '".PclZipUtilOptionText($v_key)."'"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } break; default : // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Unknown parameter '".$v_key."'"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Look for mandatory options if ($v_requested_options !== false) { for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) { // ----- Look for mandatory option if ($v_requested_options[$key] == 'mandatory') { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Detect a mandatory option : ".PclZipUtilOptionText($key)."(".$key.")"); // ----- Look if present if (!isset($p_file_list[$key])) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } } } } // end foreach } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privFileDescrExpand() // Description : // Parameters : // Return Values : // 1 on success. // 0 on failure. // -------------------------------------------------------------------------------- function privFileDescrExpand(&$p_filedescr_list, &$p_options) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privFileDescrExpand", ""); $v_result=1; // ----- Create a result list $v_result_list = array(); // ----- Look each entry for ($i=0; $iprivCalculateStoredFilename($v_descr, $p_options); // ----- Add the descriptor in result list $v_result_list[sizeof($v_result_list)] = $v_descr; // ----- Look for folder if ($v_descr['type'] == 'folder') { // ----- List of items in folder $v_dirlist_descr = array(); $v_dirlist_nb = 0; if ($v_folder_handler = @opendir($v_descr['filename'])) { while (($v_item_handler = @readdir($v_folder_handler)) !== false) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Looking for '".$v_item_handler."' in the directory"); // ----- Skip '.' and '..' if (($v_item_handler == '.') || ($v_item_handler == '..')) { continue; } // ----- Compose the full filename $v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'].'/'.$v_item_handler; // ----- Look for different stored filename // Because the name of the folder was changed, the name of the // files/sub-folders also change if ($v_descr['stored_filename'] != $v_descr['filename']) { $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_descr['stored_filename'].'/'.$v_item_handler; } $v_dirlist_nb++; } } else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to open dir '".$v_descr['filename']."' in read mode. Skipped."); // TBC : unable to open folder in read mode } // ----- Expand each element of the list if ($v_dirlist_nb != 0) { // ----- Expand if (($v_result = $this->privFileDescrExpand($v_dirlist_descr, $p_options)) != 1) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Concat the resulting list //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Merging result list (size '".sizeof($v_result_list)."') with dirlist (size '".sizeof($v_dirlist_descr)."')"); $v_result_list = array_merge($v_result_list, $v_dirlist_descr); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "merged result list is size '".sizeof($v_result_list)."'"); } else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Nothing in this folder to expand."); } // ----- Free local array unset($v_dirlist_descr); } } // ----- Get the result list $p_filedescr_list = $v_result_list; // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privCreate() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privCreate($p_filedescr_list, &$p_result_list, &$p_options) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCreate", "list"); $v_result=1; $v_list_detail = array(); // ----- Magic quotes trick $this->privDisableMagicQuotes(); // ----- Open the file in write mode if (($v_result = $this->privOpenFd('wb')) != 1) { // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Add the list of files $v_result = $this->privAddList($p_filedescr_list, $p_result_list, $p_options); // ----- Close $this->privCloseFd(); // ----- Magic quotes trick $this->privSwapBackMagicQuotes(); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privAdd() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privAdd($p_filedescr_list, &$p_result_list, &$p_options) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAdd", "list"); $v_result=1; $v_list_detail = array(); // ----- Look if the archive exists or is empty if ((!is_file($this->zipname)) || (filesize($this->zipname) == 0)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive does not exist, or is empty, create it."); // ----- Do a create $v_result = $this->privCreate($p_filedescr_list, $p_result_list, $p_options); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Magic quotes trick $this->privDisableMagicQuotes(); // ----- Open the zip file //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); if (($v_result=$this->privOpenFd('rb')) != 1) { // ----- Magic quotes trick $this->privSwapBackMagicQuotes(); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Read the central directory informations $v_central_dir = array(); if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { $this->privCloseFd(); $this->privSwapBackMagicQuotes(); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Go to beginning of File //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'"); @rewind($this->zip_fd); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'"); // ----- Creates a temporay file $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; // ----- Open the temporary file in write mode //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) { $this->privCloseFd(); $this->privSwapBackMagicQuotes(); PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Copy the files from the archive to the temporary file // TBC : Here I should better append the file and go back to erase the central dir $v_size = $v_central_dir['offset']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); $v_buffer = fread($this->zip_fd, $v_read_size); @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; } // ----- Swap the file descriptor // Here is a trick : I swap the temporary fd with the zip fd, in order to use // the following methods on the temporary fil and not the real archive $v_swap = $this->zip_fd; $this->zip_fd = $v_zip_temp_fd; $v_zip_temp_fd = $v_swap; // ----- Add the files $v_header_list = array(); if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) { fclose($v_zip_temp_fd); $this->privCloseFd(); @unlink($v_zip_temp_name); $this->privSwapBackMagicQuotes(); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Store the offset of the central dir $v_offset = @ftell($this->zip_fd); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "New offset of central dir : $v_offset"); // ----- Copy the block of file headers from the old archive $v_size = $v_central_dir['size']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); $v_buffer = @fread($v_zip_temp_fd, $v_read_size); @fwrite($this->zip_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; } // ----- Create the Central Dir files header for ($i=0, $v_count=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) { fclose($v_zip_temp_fd); $this->privCloseFd(); @unlink($v_zip_temp_name); $this->privSwapBackMagicQuotes(); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } $v_count++; } // ----- Transform the header to a 'usable' info $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); } // ----- Zip file comment $v_comment = $v_central_dir['comment']; if (isset($p_options[PCLZIP_OPT_COMMENT])) { $v_comment = $p_options[PCLZIP_OPT_COMMENT]; } if (isset($p_options[PCLZIP_OPT_ADD_COMMENT])) { $v_comment = $v_comment.$p_options[PCLZIP_OPT_ADD_COMMENT]; } if (isset($p_options[PCLZIP_OPT_PREPEND_COMMENT])) { $v_comment = $p_options[PCLZIP_OPT_PREPEND_COMMENT].$v_comment; } // ----- Calculate the size of the central header $v_size = @ftell($this->zip_fd)-$v_offset; // ----- Create the central dir footer if (($v_result = $this->privWriteCentralHeader($v_count+$v_central_dir['entries'], $v_size, $v_offset, $v_comment)) != 1) { // ----- Reset the file list unset($v_header_list); $this->privSwapBackMagicQuotes(); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Swap back the file descriptor $v_swap = $this->zip_fd; $this->zip_fd = $v_zip_temp_fd; $v_zip_temp_fd = $v_swap; // ----- Close $this->privCloseFd(); // ----- Close the temporary file @fclose($v_zip_temp_fd); // ----- Magic quotes trick $this->privSwapBackMagicQuotes(); // ----- Delete the zip file // TBC : I should test the result ... @unlink($this->zipname); // ----- Rename the temporary file // TBC : I should test the result ... //@rename($v_zip_temp_name, $this->zipname); PclZipUtilRename($v_zip_temp_name, $this->zipname); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privOpenFd() // Description : // Parameters : // -------------------------------------------------------------------------------- function privOpenFd($p_mode) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privOpenFd", 'mode='.$p_mode); $v_result=1; // ----- Look if already open if ($this->zip_fd != 0) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Zip file \''.$this->zipname.'\' already open'); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Open the zip file //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Open file in '.$p_mode.' mode'); if (($this->zip_fd = @fopen($this->zipname, $p_mode)) == 0) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in '.$p_mode.' mode'); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privCloseFd() // Description : // Parameters : // -------------------------------------------------------------------------------- function privCloseFd() { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCloseFd", ""); $v_result=1; if ($this->zip_fd != 0) @fclose($this->zip_fd); $this->zip_fd = 0; // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privAddList() // Description : // $p_add_dir and $p_remove_dir will give the ability to memorize a path which is // different from the real path of the file. This is usefull if you want to have PclTar // running in any directory, and memorize relative path from an other directory. // Parameters : // $p_list : An array containing the file or directory names to add in the tar // $p_result_list : list of added files with their properties (specially the status field) // $p_add_dir : Path to add in the filename path archived // $p_remove_dir : Path to remove in the filename path archived // Return Values : // -------------------------------------------------------------------------------- // function privAddList($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options) function privAddList($p_filedescr_list, &$p_result_list, &$p_options) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddList", "list"); $v_result=1; // ----- Add the files $v_header_list = array(); if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) { // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Store the offset of the central dir $v_offset = @ftell($this->zip_fd); // ----- Create the Central Dir files header for ($i=0,$v_count=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) { // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } $v_count++; } // ----- Transform the header to a 'usable' info $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); } // ----- Zip file comment $v_comment = ''; if (isset($p_options[PCLZIP_OPT_COMMENT])) { $v_comment = $p_options[PCLZIP_OPT_COMMENT]; } // ----- Calculate the size of the central header $v_size = @ftell($this->zip_fd)-$v_offset; // ----- Create the central dir footer if (($v_result = $this->privWriteCentralHeader($v_count, $v_size, $v_offset, $v_comment)) != 1) { // ----- Reset the file list unset($v_header_list); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privAddFileList() // Description : // Parameters : // $p_filedescr_list : An array containing the file description // or directory names to add in the zip // $p_result_list : list of added files with their properties (specially the status field) // Return Values : // -------------------------------------------------------------------------------- function privAddFileList($p_filedescr_list, &$p_result_list, &$p_options) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFileList", "filedescr_list"); $v_result=1; $v_header = array(); // ----- Recuperate the current number of elt in list $v_nb = sizeof($p_result_list); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Before add, list have ".$v_nb." elements"); // ----- Loop on the files for ($j=0; ($jprivAddFile($p_filedescr_list[$j], $v_header, $p_options); if ($v_result != 1) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Store the file infos $p_result_list[$v_nb++] = $v_header; } } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "After add, list have ".$v_nb." elements"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privAddFile() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privAddFile($p_filedescr, &$p_header, &$p_options) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFile", "filename='".$p_filedescr['filename']."'"); $v_result=1; // ----- Working variable $p_filename = $p_filedescr['filename']; // TBC : Already done in the fileAtt check ... ? if ($p_filename == "") { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file list parameter (invalid or empty list)"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Look for a stored different filename if (isset($p_filedescr['stored_filename'])) { $v_stored_filename = $p_filedescr['stored_filename']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'Stored filename is NOT the same "'.$v_stored_filename.'"'); } else { $v_stored_filename = $p_filedescr['stored_filename']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'Stored filename is the same'); } // ----- Set the file properties clearstatcache(); $p_header['version'] = 20; $p_header['version_extracted'] = 10; $p_header['flag'] = 0; $p_header['compression'] = 0; $p_header['mtime'] = filemtime($p_filename); $p_header['crc'] = 0; $p_header['compressed_size'] = 0; $p_header['size'] = filesize($p_filename); $p_header['filename_len'] = strlen($p_filename); $p_header['extra_len'] = 0; $p_header['comment_len'] = 0; $p_header['disk'] = 0; $p_header['internal'] = 0; // $p_header['external'] = (is_file($p_filename)?0xFE49FFE0:0x41FF0010); $p_header['external'] = (is_file($p_filename)?0x00000000:0x00000010); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header external extension '".sprintf("0x%X",$p_header['external'])."'"); $p_header['offset'] = 0; $p_header['filename'] = $p_filename; $p_header['stored_filename'] = $v_stored_filename; $p_header['extra'] = ''; $p_header['comment'] = ''; $p_header['status'] = 'ok'; $p_header['index'] = -1; // ----- Look for pre-add callback if (isset($p_options[PCLZIP_CB_PRE_ADD])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_ADD]."()') is defined for the extraction"); // ----- Generate a local information $v_local_header = array(); $this->privConvertHeader2FileInfo($p_header, $v_local_header); // ----- Call the callback // Here I do not use call_user_func() because I need to send a reference to the // header. eval('$v_result = '.$p_options[PCLZIP_CB_PRE_ADD].'(PCLZIP_CB_PRE_ADD, $v_local_header);'); if ($v_result == 0) { // ----- Change the file status $p_header['status'] = "skipped"; $v_result = 1; } // ----- Update the informations // Only some fields can be modified if ($p_header['stored_filename'] != $v_local_header['stored_filename']) { $p_header['stored_filename'] = PclZipUtilPathReduction($v_local_header['stored_filename']); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New stored filename is '".$p_header['stored_filename']."'"); } } // ----- Look for empty stored filename if ($p_header['stored_filename'] == "") { $p_header['status'] = "filtered"; } // ----- Check the path length if (strlen($p_header['stored_filename']) > 0xFF) { $p_header['status'] = 'filename_too_long'; } // ----- Look if no error, or file not skipped if ($p_header['status'] == 'ok') { // ----- Look for a file if (is_file($p_filename)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "'".$p_filename."' is a file"); // ----- Open the source file if (($v_file = @fopen($p_filename, "rb")) == 0) { PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will not be compressed"); // ----- Read the file content $v_content_compressed = @fread($v_file, $p_header['size']); // ----- Calculate the CRC $p_header['crc'] = @crc32($v_content_compressed); // ----- Set header parameters $p_header['compressed_size'] = $p_header['size']; $p_header['compression'] = 0; } else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will be compressed"); // ----- Read the file content $v_content = @fread($v_file, $p_header['size']); // ----- Calculate the CRC $p_header['crc'] = @crc32($v_content); // ----- Compress the file $v_content_compressed = @gzdeflate($v_content); // ----- Set header parameters $p_header['compressed_size'] = strlen($v_content_compressed); $p_header['compression'] = 8; } // ----- Look for encryption /* if ((isset($p_options[PCLZIP_OPT_CRYPT])) && ($p_options[PCLZIP_OPT_CRYPT] != "")) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File need to be crypted ...."); // Should be a random header $v_header = 'xxxxxxxxxxxx'; $v_content_compressed = PclZipUtilZipEncrypt($v_content_compressed, $p_header['compressed_size'], $v_header, $p_header['crc'], "test"); $p_header['compressed_size'] += 12; $p_header['flag'] = 1; // ----- Add the header to the data $v_content_compressed = $v_header.$v_content_compressed; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Size after header : ".strlen($v_content_compressed).""); } */ // ----- Call the header generation if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { @fclose($v_file); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Write the compressed (or not) content @fwrite($this->zip_fd, $v_content_compressed, $p_header['compressed_size']); // ----- Close the file @fclose($v_file); } // ----- Look for a directory else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "'".$p_filename."' is a folder"); // ----- Look for directory last '/' if (@substr($p_header['stored_filename'], -1) != '/') { $p_header['stored_filename'] .= '/'; } // ----- Set the file properties $p_header['size'] = 0; //$p_header['external'] = 0x41FF0010; // Value for a folder : to be checked $p_header['external'] = 0x00000010; // Value for a folder : to be checked // ----- Call the header generation if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } } } // ----- Look for post-add callback if (isset($p_options[PCLZIP_CB_POST_ADD])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_ADD]."()') is defined for the extraction"); // ----- Generate a local information $v_local_header = array(); $this->privConvertHeader2FileInfo($p_header, $v_local_header); // ----- Call the callback // Here I do not use call_user_func() because I need to send a reference to the // header. eval('$v_result = '.$p_options[PCLZIP_CB_POST_ADD].'(PCLZIP_CB_POST_ADD, $v_local_header);'); if ($v_result == 0) { // ----- Ignored $v_result = 1; } // ----- Update the informations // Nothing can be modified } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privCalculateStoredFilename() // Description : // Based on file descriptor properties and global options, this method // calculate the filename that will be stored in the archive. // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privCalculateStoredFilename(&$p_filedescr, &$p_options) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCalculateStoredFilename", "filename='".$p_filedescr['filename']."'"); $v_result=1; // ----- Working variables $p_filename = $p_filedescr['filename']; if (isset($p_options[PCLZIP_OPT_ADD_PATH])) { $p_add_dir = $p_options[PCLZIP_OPT_ADD_PATH]; } else { $p_add_dir = ''; } if (isset($p_options[PCLZIP_OPT_REMOVE_PATH])) { $p_remove_dir = $p_options[PCLZIP_OPT_REMOVE_PATH]; } else { $p_remove_dir = ''; } if (isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { $p_remove_all_dir = $p_options[PCLZIP_OPT_REMOVE_ALL_PATH]; } else { $p_remove_all_dir = 0; } // ----- Look for full name change if (isset($p_filedescr['new_full_name'])) { $v_stored_filename = $p_filedescr['new_full_name']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Changing full name of '".$p_filename."' for '".$v_stored_filename."'"); } // ----- Look for path and/or short name change else { // ----- Look for short name change if (isset($p_filedescr['new_short_name'])) { $v_path_info = pathinfo($p_filename); $v_dir = ''; if ($v_path_info['dirname'] != '') { $v_dir = $v_path_info['dirname'].'/'; } $v_stored_filename = $v_dir.$p_filedescr['new_short_name']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Changing short name of '".$p_filename."' for '".$v_stored_filename."'"); } else { // ----- Calculate the stored filename $v_stored_filename = $p_filename; } // ----- Look for all path to remove if ($p_remove_all_dir) { $v_stored_filename = basename($p_filename); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Remove all path selected change '".$p_filename."' for '".$v_stored_filename."'"); } // ----- Look for partial path remove else if ($p_remove_dir != "") { if (substr($p_remove_dir, -1) != '/') $p_remove_dir .= "/"; if ( (substr($p_filename, 0, 2) == "./") || (substr($p_remove_dir, 0, 2) == "./")) { if ( (substr($p_filename, 0, 2) == "./") && (substr($p_remove_dir, 0, 2) != "./")) { $p_remove_dir = "./".$p_remove_dir; } if ( (substr($p_filename, 0, 2) != "./") && (substr($p_remove_dir, 0, 2) == "./")) { $p_remove_dir = substr($p_remove_dir, 2); } } $v_compare = PclZipUtilPathInclusion($p_remove_dir, $v_stored_filename); if ($v_compare > 0) { if ($v_compare == 2) { $v_stored_filename = ""; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Path to remove is the current folder"); } else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Remove path '$p_remove_dir' in file '$v_stored_filename'"); $v_stored_filename = substr($v_stored_filename, strlen($p_remove_dir)); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Result is '$v_stored_filename'"); } } } // ----- Look for path to add if ($p_add_dir != "") { if (substr($p_add_dir, -1) == "/") $v_stored_filename = $p_add_dir.$v_stored_filename; else $v_stored_filename = $p_add_dir."/".$v_stored_filename; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Add path '$p_add_dir' in file '$p_filename' = '$v_stored_filename'"); } } // ----- Filename (reduce the path of stored name) $v_stored_filename = PclZipUtilPathReduction($v_stored_filename); $p_filedescr['stored_filename'] = $v_stored_filename; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Stored filename will be '".$p_filedescr['stored_filename']."', strlen ".strlen($p_filedescr['stored_filename'])); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privWriteFileHeader() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privWriteFileHeader(&$p_header) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteFileHeader", 'file="'.$p_header['filename'].'", stored as "'.$p_header['stored_filename'].'"'); $v_result=1; // ----- Store the offset position of the file $p_header['offset'] = ftell($this->zip_fd); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'File offset of the header :'.$p_header['offset']); // ----- Transform UNIX mtime to DOS format mdate/mtime //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); $v_date = getdate($p_header['mtime']); $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2; $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday']; // ----- Packed data $v_binary_data = pack("VvvvvvVVVvv", 0x04034b50, $p_header['version_extracted'], $p_header['flag'], $p_header['compression'], $v_mtime, $v_mdate, $p_header['crc'], $p_header['compressed_size'], $p_header['size'], strlen($p_header['stored_filename']), $p_header['extra_len']); // ----- Write the first 148 bytes of the header in the archive fputs($this->zip_fd, $v_binary_data, 30); // ----- Write the variable fields if (strlen($p_header['stored_filename']) != 0) { fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename'])); } if ($p_header['extra_len'] != 0) { fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']); } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privWriteCentralFileHeader() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privWriteCentralFileHeader(&$p_header) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteCentralFileHeader", 'file="'.$p_header['filename'].'", stored as "'.$p_header['stored_filename'].'"'); $v_result=1; // TBC //for(reset($p_header); $key = key($p_header); next($p_header)) { // //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "header[$key] = ".$p_header[$key]); //} // ----- Transform UNIX mtime to DOS format mdate/mtime //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); $v_date = getdate($p_header['mtime']); $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2; $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday']; // ----- Packed data $v_binary_data = pack("VvvvvvvVVVvvvvvVV", 0x02014b50, $p_header['version'], $p_header['version_extracted'], $p_header['flag'], $p_header['compression'], $v_mtime, $v_mdate, $p_header['crc'], $p_header['compressed_size'], $p_header['size'], strlen($p_header['stored_filename']), $p_header['extra_len'], $p_header['comment_len'], $p_header['disk'], $p_header['internal'], $p_header['external'], $p_header['offset']); // ----- Write the 42 bytes of the header in the zip file fputs($this->zip_fd, $v_binary_data, 46); // ----- Write the variable fields if (strlen($p_header['stored_filename']) != 0) { fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename'])); } if ($p_header['extra_len'] != 0) { fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']); } if ($p_header['comment_len'] != 0) { fputs($this->zip_fd, $p_header['comment'], $p_header['comment_len']); } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privWriteCentralHeader() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteCentralHeader", 'nb_entries='.$p_nb_entries.', size='.$p_size.', offset='.$p_offset.', comment="'.$p_comment.'"'); $v_result=1; // ----- Packed data $v_binary_data = pack("VvvvvVVv", 0x06054b50, 0, 0, $p_nb_entries, $p_nb_entries, $p_size, $p_offset, strlen($p_comment)); // ----- Write the 22 bytes of the header in the zip file fputs($this->zip_fd, $v_binary_data, 22); // ----- Write the variable fields if (strlen($p_comment) != 0) { fputs($this->zip_fd, $p_comment, strlen($p_comment)); } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privList() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privList(&$p_list) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privList", "list"); $v_result=1; // ----- Magic quotes trick $this->privDisableMagicQuotes(); // ----- Open the zip file //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) { // ----- Magic quotes trick $this->privSwapBackMagicQuotes(); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Read the central directory informations $v_central_dir = array(); if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { $this->privSwapBackMagicQuotes(); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Go to beginning of Central Dir //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Offset : ".$v_central_dir['offset']."'"); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'"); @rewind($this->zip_fd); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'"); if (@fseek($this->zip_fd, $v_central_dir['offset'])) { $this->privSwapBackMagicQuotes(); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'"); // ----- Read each entry for ($i=0; $i<$v_central_dir['entries']; $i++) { // ----- Read the file header if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) { $this->privSwapBackMagicQuotes(); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } $v_header['index'] = $i; // ----- Get the only interesting attributes $this->privConvertHeader2FileInfo($v_header, $p_list[$i]); unset($v_header); } // ----- Close the zip file $this->privCloseFd(); // ----- Magic quotes trick $this->privSwapBackMagicQuotes(); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privConvertHeader2FileInfo() // Description : // This function takes the file informations from the central directory // entries and extract the interesting parameters that will be given back. // The resulting file infos are set in the array $p_info // $p_info['filename'] : Filename with full path. Given by user (add), // extracted in the filesystem (extract). // $p_info['stored_filename'] : Stored filename in the archive. // $p_info['size'] = Size of the file. // $p_info['compressed_size'] = Compressed size of the file. // $p_info['mtime'] = Last modification date of the file. // $p_info['comment'] = Comment associated with the file. // $p_info['folder'] = true/false : indicates if the entry is a folder or not. // $p_info['status'] = status of the action on the file. // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privConvertHeader2FileInfo($p_header, &$p_info) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privConvertHeader2FileInfo", "Filename='".$p_header['filename']."'"); $v_result=1; // ----- Get the interesting attributes $p_info['filename'] = $p_header['filename']; $p_info['stored_filename'] = $p_header['stored_filename']; $p_info['size'] = $p_header['size']; $p_info['compressed_size'] = $p_header['compressed_size']; $p_info['mtime'] = $p_header['mtime']; $p_info['comment'] = $p_header['comment']; $p_info['folder'] = (($p_header['external']&0x00000010)==0x00000010); $p_info['index'] = $p_header['index']; $p_info['status'] = $p_header['status']; // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privExtractByRule() // Description : // Extract a file or directory depending of rules (by index, by name, ...) // Parameters : // $p_file_list : An array where will be placed the properties of each // extracted file // $p_path : Path to add while writing the extracted files // $p_remove_path : Path to remove (from the file memorized path) while writing the // extracted files. If the path does not match the file path, // the file is extracted with its memorized path. // $p_remove_path does not apply to 'list' mode. // $p_path and $p_remove_path are commulative. // Return Values : // 1 on success,0 or less on error (see error code list) // -------------------------------------------------------------------------------- function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privExtractByRule", "path='$p_path', remove_path='$p_remove_path', remove_all_path='".($p_remove_all_path?'true':'false')."'"); $v_result=1; // ----- Magic quotes trick $this->privDisableMagicQuotes(); // ----- Check the path if ( ($p_path == "") || ( (substr($p_path, 0, 1) != "/") && (substr($p_path, 0, 3) != "../") && (substr($p_path,1,2)!=":/"))) $p_path = "./".$p_path; // ----- Reduce the path last (and duplicated) '/' if (($p_path != "./") && ($p_path != "/")) { // ----- Look for the path end '/' while (substr($p_path, -1) == "/") { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Destination path [$p_path] ends by '/'"); $p_path = substr($p_path, 0, strlen($p_path)-1); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Modified to [$p_path]"); } } // ----- Look for path to remove format (should end by /) if (($p_remove_path != "") && (substr($p_remove_path, -1) != '/')) { $p_remove_path .= '/'; } $p_remove_path_size = strlen($p_remove_path); // ----- Open the zip file //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); if (($v_result = $this->privOpenFd('rb')) != 1) { $this->privSwapBackMagicQuotes(); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Read the central directory informations $v_central_dir = array(); if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { // ----- Close the zip file $this->privCloseFd(); $this->privSwapBackMagicQuotes(); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Start at beginning of Central Dir $v_pos_entry = $v_central_dir['offset']; // ----- Read each entry $j_start = 0; for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Read next file header entry : '$i'"); // ----- Read next Central dir entry //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Position before rewind : ".ftell($this->zip_fd)."'"); @rewind($this->zip_fd); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Position after rewind : ".ftell($this->zip_fd)."'"); if (@fseek($this->zip_fd, $v_pos_entry)) { // ----- Close the zip file $this->privCloseFd(); $this->privSwapBackMagicQuotes(); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position after fseek : ".ftell($this->zip_fd)."'"); // ----- Read the file header $v_header = array(); if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) { // ----- Close the zip file $this->privCloseFd(); $this->privSwapBackMagicQuotes(); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Store the index $v_header['index'] = $i; // ----- Store the file position $v_pos_entry = ftell($this->zip_fd); // ----- Look for the specific extract rules $v_extract = false; // ----- Look for extract by name rule if ( (isset($p_options[PCLZIP_OPT_BY_NAME])) && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByName'"); // ----- Look if the filename is in the list for ($j=0; ($j strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) && (substr($v_header['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The directory is in the file path"); $v_extract = true; } } // ----- Look for a filename elseif ($v_header['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The file is the right one."); $v_extract = true; } } } // ----- Look for extract by ereg rule else if ( (isset($p_options[PCLZIP_OPT_BY_EREG])) && ($p_options[PCLZIP_OPT_BY_EREG] != "")) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract by ereg '".$p_options[PCLZIP_OPT_BY_EREG]."'"); if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header['stored_filename'])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression"); $v_extract = true; } } // ----- Look for extract by preg rule else if ( (isset($p_options[PCLZIP_OPT_BY_PREG])) && ($p_options[PCLZIP_OPT_BY_PREG] != "")) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByEreg'"); if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression"); $v_extract = true; } } // ----- Look for extract by index rule else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX])) && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByIndex'"); // ----- Look if the index is in the list for ($j=$j_start; ($j=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found as part of an index range"); $v_extract = true; } if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Do not look this index range for next loop"); $j_start = $j+1; } if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Index range is greater than index, stop loop"); break; } } } // ----- Look for no rule, which means extract all the archive else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with no rule (extract all)"); $v_extract = true; } // ----- Check compression method if ( ($v_extract) && ( ($v_header['compression'] != 8) && ($v_header['compression'] != 0))) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unsupported compression method (".$v_header['compression'].")"); $v_header['status'] = 'unsupported_compression'; // ----- Look for PCLZIP_OPT_STOP_ON_ERROR if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped"); $this->privSwapBackMagicQuotes(); PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION, "Filename '".$v_header['stored_filename']."' is " ."compressed by an unsupported compression " ."method (".$v_header['compression'].") "); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } } // ----- Check encrypted files if (($v_extract) && (($v_header['flag'] & 1) == 1)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unsupported file encryption"); $v_header['status'] = 'unsupported_encryption'; // ----- Look for PCLZIP_OPT_STOP_ON_ERROR if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped"); $this->privSwapBackMagicQuotes(); PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, "Unsupported encryption for " ." filename '".$v_header['stored_filename'] ."'"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } } // ----- Look for real extraction if (($v_extract) && ($v_header['status'] != 'ok')) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "No need for extract"); $v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++]); if ($v_result != 1) { $this->privCloseFd(); $this->privSwapBackMagicQuotes(); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } $v_extract = false; } // ----- Look for real extraction if ($v_extract) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file '".$v_header['filename']."', index '$i'"); // ----- Go to the file position //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position before rewind : ".ftell($this->zip_fd)."'"); @rewind($this->zip_fd); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'"); if (@fseek($this->zip_fd, $v_header['offset'])) { // ----- Close the zip file $this->privCloseFd(); $this->privSwapBackMagicQuotes(); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'"); // ----- Look for extraction as string if ($p_options[PCLZIP_OPT_EXTRACT_AS_STRING]) { // ----- Extracting the file $v_result1 = $this->privExtractFileAsString($v_header, $v_string); if ($v_result1 < 1) { $this->privCloseFd(); $this->privSwapBackMagicQuotes(); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1); return $v_result1; } // ----- Get the only interesting attributes if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted])) != 1) { // ----- Close the zip file $this->privCloseFd(); $this->privSwapBackMagicQuotes(); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Set the file content $p_file_list[$v_nb_extracted]['content'] = $v_string; // ----- Next extracted file $v_nb_extracted++; // ----- Look for user callback abort if ($v_result1 == 2) { break; } } // ----- Look for extraction in standard output elseif ( (isset($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) && ($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) { // ----- Extracting the file in standard output $v_result1 = $this->privExtractFileInOutput($v_header, $p_options); if ($v_result1 < 1) { $this->privCloseFd(); $this->privSwapBackMagicQuotes(); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1); return $v_result1; } // ----- Get the only interesting attributes if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) { $this->privCloseFd(); $this->privSwapBackMagicQuotes(); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Look for user callback abort if ($v_result1 == 2) { break; } } // ----- Look for normal extraction else { // ----- Extracting the file $v_result1 = $this->privExtractFile($v_header, $p_path, $p_remove_path, $p_remove_all_path, $p_options); if ($v_result1 < 1) { $this->privCloseFd(); $this->privSwapBackMagicQuotes(); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1); return $v_result1; } // ----- Get the only interesting attributes if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) { // ----- Close the zip file $this->privCloseFd(); $this->privSwapBackMagicQuotes(); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Look for user callback abort if ($v_result1 == 2) { break; } } } } // ----- Close the zip file $this->privCloseFd(); $this->privSwapBackMagicQuotes(); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privExtractFile() // Description : // Parameters : // Return Values : // // 1 : ... ? // PCLZIP_ERR_USER_ABORTED(2) : User ask for extraction stop in callback // -------------------------------------------------------------------------------- function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFile', "path='$p_path', remove_path='$p_remove_path', remove_all_path='".($p_remove_all_path?'true':'false')."'"); $v_result=1; // ----- Read the file header if (($v_result = $this->privReadFileHeader($v_header)) != 1) { // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'"); // ----- Check that the file header is coherent with $p_entry info if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { // TBC } // ----- Look for all path to remove if ($p_remove_all_path == true) { // ----- Look for folder entry that not need to be extracted if (($p_entry['external']&0x00000010)==0x00000010) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The entry is a folder : need to be filtered"); $p_entry['status'] = "filtered"; //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "All path is removed"); // ----- Get the basename of the path $p_entry['filename'] = basename($p_entry['filename']); } // ----- Look for path to remove else if ($p_remove_path != "") { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Look for some path to remove"); if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The folder is the same as the removed path '".$p_entry['filename']."'"); // ----- Change the file status $p_entry['status'] = "filtered"; // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } $p_remove_path_size = strlen($p_remove_path); if (substr($p_entry['filename'], 0, $p_remove_path_size) == $p_remove_path) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found path '$p_remove_path' to remove in file '".$p_entry['filename']."'"); // ----- Remove the path $p_entry['filename'] = substr($p_entry['filename'], $p_remove_path_size); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Resulting file is '".$p_entry['filename']."'"); } } // ----- Add the path if ($p_path != '') { $p_entry['filename'] = $p_path."/".$p_entry['filename']; } // ----- Check a base_dir_restriction if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Check the extract directory restriction"); $v_inclusion = PclZipUtilPathInclusion($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION], $p_entry['filename']); if ($v_inclusion == 0) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_EXTRACT_DIR_RESTRICTION is selected, file is outside restriction"); PclZip::privErrorLog(PCLZIP_ERR_DIRECTORY_RESTRICTION, "Filename '".$p_entry['filename']."' is " ."outside PCLZIP_OPT_EXTRACT_DIR_RESTRICTION"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } } // ----- Look for pre-extract callback if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_EXTRACT]."()') is defined for the extraction"); // ----- Generate a local information $v_local_header = array(); $this->privConvertHeader2FileInfo($p_entry, $v_local_header); // ----- Call the callback // Here I do not use call_user_func() because I need to send a reference to the // header. eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); if ($v_result == 0) { // ----- Change the file status $p_entry['status'] = "skipped"; $v_result = 1; } // ----- Look for abort result if ($v_result == 2) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction"); // ----- This status is internal and will be changed in 'skipped' $p_entry['status'] = "aborted"; $v_result = PCLZIP_ERR_USER_ABORTED; } // ----- Update the informations // Only some fields can be modified $p_entry['filename'] = $v_local_header['filename']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New filename is '".$p_entry['filename']."'"); } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file (with path) '".$p_entry['filename']."', size '$v_header[size]'"); // ----- Look if extraction should be done if ($p_entry['status'] == 'ok') { // ----- Look for specific actions while the file exist if (file_exists($p_entry['filename'])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$p_entry['filename']."' already exists"); // ----- Look if file is a directory if (is_dir($p_entry['filename'])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is a directory"); // ----- Change the file status $p_entry['status'] = "already_a_directory"; // ----- Look for PCLZIP_OPT_STOP_ON_ERROR // For historical reason first PclZip implementation does not stop // when this kind of error occurs. if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped"); PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY, "Filename '".$p_entry['filename']."' is " ."already used by an existing directory"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } } // ----- Look if file is write protected else if (!is_writeable($p_entry['filename'])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is write protected"); // ----- Change the file status $p_entry['status'] = "write_protected"; // ----- Look for PCLZIP_OPT_STOP_ON_ERROR // For historical reason first PclZip implementation does not stop // when this kind of error occurs. if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped"); PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, "Filename '".$p_entry['filename']."' exists " ."and is write protected"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } } // ----- Look if the extracted file is older else if (filemtime($p_entry['filename']) > $p_entry['mtime']) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is newer (".date("l dS of F Y h:i:s A", filemtime($p_entry['filename'])).") than the extracted file (".date("l dS of F Y h:i:s A", $p_entry['mtime']).")"); // ----- Change the file status if ( (isset($p_options[PCLZIP_OPT_REPLACE_NEWER])) && ($p_options[PCLZIP_OPT_REPLACE_NEWER]===true)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_REPLACE_NEWER is selected, file will be replaced"); } else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will not be replaced"); $p_entry['status'] = "newer_exist"; // ----- Look for PCLZIP_OPT_STOP_ON_ERROR // For historical reason first PclZip implementation does not stop // when this kind of error occurs. if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped"); PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, "Newer version of '".$p_entry['filename']."' exists " ."and option PCLZIP_OPT_REPLACE_NEWER is not selected"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } } } else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is older than the extrated one - will be replaced by the extracted one (".date("l dS of F Y h:i:s A", filemtime($p_entry['filename'])).") than the extracted file (".date("l dS of F Y h:i:s A", $p_entry['mtime']).")"); } } // ----- Check the directory availability and create it if necessary else { if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/')) $v_dir_to_check = $p_entry['filename']; else if (!strstr($p_entry['filename'], "/")) $v_dir_to_check = ""; else $v_dir_to_check = dirname($p_entry['filename']); if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to create path for '".$p_entry['filename']."'"); // ----- Change the file status $p_entry['status'] = "path_creation_fail"; // ----- Return ////--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); //return $v_result; $v_result = 1; } } } // ----- Look if extraction should be done if ($p_entry['status'] == 'ok') { // ----- Do the extraction (if not a folder) if (!(($p_entry['external']&0x00000010)==0x00000010)) { // ----- Look for not compressed file if ($p_entry['compression'] == 0) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file"); // ----- Opening destination file if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode"); // ----- Change the file status $p_entry['status'] = "write_error"; // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Read '".$p_entry['size']."' bytes"); // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks $v_size = $p_entry['compressed_size']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Read $v_read_size bytes"); $v_buffer = @fread($this->zip_fd, $v_read_size); /* Try to speed up the code $v_binary_data = pack('a'.$v_read_size, $v_buffer); @fwrite($v_dest_file, $v_binary_data, $v_read_size); */ @fwrite($v_dest_file, $v_buffer, $v_read_size); $v_size -= $v_read_size; } // ----- Closing the destination file fclose($v_dest_file); // ----- Change the file mtime touch($p_entry['filename'], $p_entry['mtime']); } else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file (Compression method ".$p_entry['compression'].")"); // ----- TBC // Need to be finished if (($p_entry['flag'] & 1) == 1) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File is encrypted"); /* // ----- Read the encryption header //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read 12 encryption header bytes"); $v_encryption_header = @fread($this->zip_fd, 12); // ----- Read the encrypted & compressed file in a buffer //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read '".($p_entry['compressed_size']-12)."' compressed & encrypted bytes"); $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']-12); // ----- Decrypt the buffer $this->privDecrypt($v_encryption_header, $v_buffer, $p_entry['compressed_size']-12, $p_entry['crc']); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Buffer is '".$v_buffer."'"); */ } else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read '".$p_entry['compressed_size']."' compressed bytes"); // ----- Read the compressed file in a buffer (one shot) $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); } // ----- Decompress the file $v_file_content = @gzinflate($v_buffer); unset($v_buffer); if ($v_file_content === FALSE) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to inflate compressed file"); // ----- Change the file status // TBC $p_entry['status'] = "error"; //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Opening destination file if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode"); // ----- Change the file status $p_entry['status'] = "write_error"; //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Write the uncompressed data @fwrite($v_dest_file, $v_file_content, $p_entry['size']); unset($v_file_content); // ----- Closing the destination file @fclose($v_dest_file); // ----- Change the file mtime @touch($p_entry['filename'], $p_entry['mtime']); } // ----- Look for chmod option if (isset($p_options[PCLZIP_OPT_SET_CHMOD])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "chmod option activated '".$p_options[PCLZIP_OPT_SET_CHMOD]."'"); // ----- Change the mode of the file @chmod($p_entry['filename'], $p_options[PCLZIP_OPT_SET_CHMOD]); } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done"); } } // ----- Change abort status if ($p_entry['status'] == "aborted") { $p_entry['status'] = "skipped"; } // ----- Look for post-extract callback elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_EXTRACT]."()') is defined for the extraction"); // ----- Generate a local information $v_local_header = array(); $this->privConvertHeader2FileInfo($p_entry, $v_local_header); // ----- Call the callback // Here I do not use call_user_func() because I need to send a reference to the // header. eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); // ----- Look for abort result if ($v_result == 2) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction"); $v_result = PCLZIP_ERR_USER_ABORTED; } } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privExtractFileInOutput() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privExtractFileInOutput(&$p_entry, &$p_options) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFileInOutput', ""); $v_result=1; // ----- Read the file header if (($v_result = $this->privReadFileHeader($v_header)) != 1) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'"); // ----- Check that the file header is coherent with $p_entry info if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { // TBC } // ----- Look for pre-extract callback if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_EXTRACT]."()') is defined for the extraction"); // ----- Generate a local information $v_local_header = array(); $this->privConvertHeader2FileInfo($p_entry, $v_local_header); // ----- Call the callback // Here I do not use call_user_func() because I need to send a reference to the // header. eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); if ($v_result == 0) { // ----- Change the file status $p_entry['status'] = "skipped"; $v_result = 1; } // ----- Look for abort result if ($v_result == 2) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction"); // ----- This status is internal and will be changed in 'skipped' $p_entry['status'] = "aborted"; $v_result = PCLZIP_ERR_USER_ABORTED; } // ----- Update the informations // Only some fields can be modified $p_entry['filename'] = $v_local_header['filename']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New filename is '".$p_entry['filename']."'"); } // ----- Trace //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file (with path) '".$p_entry['filename']."', size '$v_header[size]'"); // ----- Look if extraction should be done if ($p_entry['status'] == 'ok') { // ----- Do the extraction (if not a folder) if (!(($p_entry['external']&0x00000010)==0x00000010)) { // ----- Look for not compressed file if ($p_entry['compressed_size'] == $p_entry['size']) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file"); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Reading '".$p_entry['size']."' bytes"); // ----- Read the file in a buffer (one shot) $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); // ----- Send the file to the output echo $v_buffer; unset($v_buffer); } else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file"); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Reading '".$p_entry['size']."' bytes"); // ----- Read the compressed file in a buffer (one shot) $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); // ----- Decompress the file $v_file_content = gzinflate($v_buffer); unset($v_buffer); // ----- Send the file to the output echo $v_file_content; unset($v_file_content); } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done"); } } // ----- Change abort status if ($p_entry['status'] == "aborted") { $p_entry['status'] = "skipped"; } // ----- Look for post-extract callback elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_EXTRACT]."()') is defined for the extraction"); // ----- Generate a local information $v_local_header = array(); $this->privConvertHeader2FileInfo($p_entry, $v_local_header); // ----- Call the callback // Here I do not use call_user_func() because I need to send a reference to the // header. eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); // ----- Look for abort result if ($v_result == 2) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction"); $v_result = PCLZIP_ERR_USER_ABORTED; } } //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privExtractFileAsString() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privExtractFileAsString(&$p_entry, &$p_string) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFileAsString', "p_entry['filename']='".$p_entry['filename']."'"); $v_result=1; // ----- Read the file header $v_header = array(); if (($v_result = $this->privReadFileHeader($v_header)) != 1) { // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'"); // ----- Check that the file header is coherent with $p_entry info if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { // TBC } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file in string (with path) '".$p_entry['filename']."', size '$v_header[size]'"); // ----- Do the extraction (if not a folder) if (!(($p_entry['external']&0x00000010)==0x00000010)) { // ----- Look for not compressed file // if ($p_entry['compressed_size'] == $p_entry['size']) if ($p_entry['compression'] == 0) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file"); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Reading '".$p_entry['size']."' bytes"); // ----- Reading the file $p_string = @fread($this->zip_fd, $p_entry['compressed_size']); } else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file (compression method '".$p_entry['compression']."')"); // ----- Reading the file $v_data = @fread($this->zip_fd, $p_entry['compressed_size']); // ----- Decompress the file if (($p_string = @gzinflate($v_data)) === FALSE) { // TBC } } // ----- Trace //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done"); } else { // TBC : error : can not extract a folder in a string } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privReadFileHeader() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privReadFileHeader(&$p_header) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadFileHeader", ""); $v_result=1; // ----- Read the 4 bytes signature $v_binary_data = @fread($this->zip_fd, 4); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary data is : '".sprintf("%08x", $v_binary_data)."'"); $v_data = unpack('Vid', $v_binary_data); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'"); // ----- Check signature if ($v_data['id'] != 0x04034b50) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Invalid File header"); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure'); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Read the first 42 bytes of the header $v_binary_data = fread($this->zip_fd, 26); // ----- Look for invalid block size if (strlen($v_binary_data) != 26) { $p_header['filename'] = ""; $p_header['status'] = "invalid_header"; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid block size : ".strlen($v_binary_data)); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data)); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Extract the values //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Header : '".$v_binary_data."'"); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Header (Hex) : '".bin2hex($v_binary_data)."'"); $v_data = unpack('vversion/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len', $v_binary_data); // ----- Get filename //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "File name length : ".$v_data['filename_len']); $p_header['filename'] = fread($this->zip_fd, $v_data['filename_len']); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Filename : \''.$p_header['filename'].'\''); // ----- Get extra_fields //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extra field length : ".$v_data['extra_len']); if ($v_data['extra_len'] != 0) { $p_header['extra'] = fread($this->zip_fd, $v_data['extra_len']); } else { $p_header['extra'] = ''; } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Extra field : \''.bin2hex($p_header['extra']).'\''); // ----- Extract properties $p_header['version_extracted'] = $v_data['version']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version need to extract : ('.$p_header['version_extracted'].') \''.($p_header['version_extracted']/10).'.'.($p_header['version_extracted']%10).'\''); $p_header['compression'] = $v_data['compression']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compression method : \''.$p_header['compression'].'\''); $p_header['size'] = $v_data['size']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size : \''.$p_header['size'].'\''); $p_header['compressed_size'] = $v_data['compressed_size']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compressed Size : \''.$p_header['compressed_size'].'\''); $p_header['crc'] = $v_data['crc']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'CRC : \''.sprintf("0x%X", $p_header['crc']).'\''); $p_header['flag'] = $v_data['flag']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Flag : \''.$p_header['flag'].'\''); $p_header['filename_len'] = $v_data['filename_len']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Filename_len : \''.$p_header['filename_len'].'\''); // ----- Recuperate date in UNIX format $p_header['mdate'] = $v_data['mdate']; $p_header['mtime'] = $v_data['mtime']; if ($p_header['mdate'] && $p_header['mtime']) { // ----- Extract time $v_hour = ($p_header['mtime'] & 0xF800) >> 11; $v_minute = ($p_header['mtime'] & 0x07E0) >> 5; $v_seconde = ($p_header['mtime'] & 0x001F)*2; // ----- Extract date $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980; $v_month = ($p_header['mdate'] & 0x01E0) >> 5; $v_day = $p_header['mdate'] & 0x001F; // ----- Get UNIX date format $p_header['mtime'] = mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); } else { $p_header['mtime'] = time(); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date is actual : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); } // TBC //for(reset($v_data); $key = key($v_data); next($v_data)) { // //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Attribut[$key] = ".$v_data[$key]); //} // ----- Set the stored filename $p_header['stored_filename'] = $p_header['filename']; // ----- Set the status field $p_header['status'] = "ok"; // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privReadCentralFileHeader() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privReadCentralFileHeader(&$p_header) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadCentralFileHeader", ""); $v_result=1; // ----- Read the 4 bytes signature $v_binary_data = @fread($this->zip_fd, 4); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary data is : '".sprintf("%08x", $v_binary_data)."'"); $v_data = unpack('Vid', $v_binary_data); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'"); // ----- Check signature if ($v_data['id'] != 0x02014b50) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Invalid Central Dir File signature"); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure'); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Read the first 42 bytes of the header $v_binary_data = fread($this->zip_fd, 42); // ----- Look for invalid block size if (strlen($v_binary_data) != 42) { $p_header['filename'] = ""; $p_header['status'] = "invalid_header"; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid block size : ".strlen($v_binary_data)); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data)); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Extract the values //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header : '".$v_binary_data."'"); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header (Hex) : '".bin2hex($v_binary_data)."'"); $p_header = unpack('vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset', $v_binary_data); // ----- Get filename //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "File name length : ".$p_header['filename_len']); if ($p_header['filename_len'] != 0) $p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']); else $p_header['filename'] = ''; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Filename : \''.$p_header['filename'].'\''); // ----- Get extra //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Extra length : ".$p_header['extra_len']); if ($p_header['extra_len'] != 0) $p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']); else $p_header['extra'] = ''; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Extra : \''.$p_header['extra'].'\''); // ----- Get comment //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Comment length : ".$p_header['comment_len']); if ($p_header['comment_len'] != 0) $p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']); else $p_header['comment'] = ''; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Comment : \''.$p_header['comment'].'\''); // ----- Extract properties //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version : \''.($p_header['version']/10).'.'.($p_header['version']%10).'\''); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version need to extract : \''.($p_header['version_extracted']/10).'.'.($p_header['version_extracted']%10).'\''); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Size : \''.$p_header['size'].'\''); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Compressed Size : \''.$p_header['compressed_size'].'\''); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'CRC : \''.sprintf("0x%X", $p_header['crc']).'\''); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Flag : \''.$p_header['flag'].'\''); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Offset : \''.$p_header['offset'].'\''); // ----- Recuperate date in UNIX format if ($p_header['mdate'] && $p_header['mtime']) { // ----- Extract time $v_hour = ($p_header['mtime'] & 0xF800) >> 11; $v_minute = ($p_header['mtime'] & 0x07E0) >> 5; $v_seconde = ($p_header['mtime'] & 0x001F)*2; // ----- Extract date $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980; $v_month = ($p_header['mdate'] & 0x01E0) >> 5; $v_day = $p_header['mdate'] & 0x001F; // ----- Get UNIX date format $p_header['mtime'] = mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); } else { $p_header['mtime'] = time(); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Date is actual : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); } // ----- Set the stored filename $p_header['stored_filename'] = $p_header['filename']; // ----- Set default status to ok $p_header['status'] = 'ok'; // ----- Look if it is a directory //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Internal (Hex) : '".sprintf("Ox%04X", $p_header['internal'])."'"); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "External (Hex) : '".sprintf("Ox%04X", $p_header['external'])."' (".(($p_header['external']&0x00000010)==0x00000010?'is a folder':'is a file').')'); if (substr($p_header['filename'], -1) == '/') { //$p_header['external'] = 0x41FF0010; $p_header['external'] = 0x00000010; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Force folder external : \''.sprintf("Ox%04X", $p_header['external']).'\''); } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Header of filename : \''.$p_header['filename'].'\''); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privCheckFileHeaders() // Description : // Parameters : // Return Values : // 1 on success, // 0 on error; // -------------------------------------------------------------------------------- function privCheckFileHeaders(&$p_local_header, &$p_central_header) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCheckFileHeaders", ""); $v_result=1; // ----- Check the static values // TBC if ($p_local_header['filename'] != $p_central_header['filename']) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "filename" : TBC To Be Completed'); } if ($p_local_header['version_extracted'] != $p_central_header['version_extracted']) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "version_extracted" : TBC To Be Completed'); } if ($p_local_header['flag'] != $p_central_header['flag']) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "flag" : TBC To Be Completed'); } if ($p_local_header['compression'] != $p_central_header['compression']) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "compression" : TBC To Be Completed'); } if ($p_local_header['mtime'] != $p_central_header['mtime']) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "mtime" : TBC To Be Completed'); } if ($p_local_header['filename_len'] != $p_central_header['filename_len']) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "filename_len" : TBC To Be Completed'); } // ----- Look for flag bit 3 if (($p_local_header['flag'] & 8) == 8) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Purpose bit flag bit 3 set !'); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'File size, compression size and crc found in central header'); $p_local_header['size'] = $p_central_header['size']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size : \''.$p_local_header['size'].'\''); $p_local_header['compressed_size'] = $p_central_header['compressed_size']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compressed Size : \''.$p_local_header['compressed_size'].'\''); $p_local_header['crc'] = $p_central_header['crc']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'CRC : \''.sprintf("0x%X", $p_local_header['crc']).'\''); } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privReadEndCentralDir() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privReadEndCentralDir(&$p_central_dir) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadEndCentralDir", ""); $v_result=1; // ----- Go to the end of the zip file $v_size = filesize($this->zipname); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Size of the file :$v_size"); @fseek($this->zip_fd, $v_size); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position at end of zip file : \''.ftell($this->zip_fd).'\''); if (@ftell($this->zip_fd) != $v_size) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \''.$this->zipname.'\''); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- First try : look if this is an archive with no commentaries (most of the time) // in this case the end of central dir is at 22 bytes of the file end $v_found = 0; if ($v_size > 26) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Look for central dir with no comment'); @fseek($this->zip_fd, $v_size-22); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position after min central position : \''.ftell($this->zip_fd).'\''); if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22)) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Read for bytes $v_binary_data = @fread($this->zip_fd, 4); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Binary data is : '".sprintf("%08x", $v_binary_data)."'"); $v_data = @unpack('Vid', $v_binary_data); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'"); // ----- Check signature if ($v_data['id'] == 0x06054b50) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found central dir at the default position."); $v_found = 1; } $v_pos = ftell($this->zip_fd); } // ----- Go back to the maximum possible size of the Central Dir End Record if (!$v_found) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Start extended search of end central dir'); $v_maximum_size = 65557; // 0xFFFF + 22; if ($v_maximum_size > $v_size) $v_maximum_size = $v_size; @fseek($this->zip_fd, $v_size-$v_maximum_size); if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size)) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position after max central position : \''.ftell($this->zip_fd).'\''); // ----- Read byte per byte in order to find the signature $v_pos = ftell($this->zip_fd); $v_bytes = 0x00000000; while ($v_pos < $v_size) { // ----- Read a byte $v_byte = @fread($this->zip_fd, 1); // ----- Add the byte // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number // Otherwise on systems where we have 64bit integers the check below for the magic number will fail. $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte); // ----- Compare the bytes if ($v_bytes == 0x504b0506) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Found End Central Dir signature at position : \''.ftell($this->zip_fd).'\''); $v_pos++; break; } $v_pos++; } // ----- Look if not found end of central dir if ($v_pos == $v_size) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to find End of Central Dir Record signature"); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Unable to find End of Central Dir Record signature"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } } // ----- Read the first 18 bytes of the header $v_binary_data = fread($this->zip_fd, 18); // ----- Look for invalid block size if (strlen($v_binary_data) != 18) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid End of Central Dir Record size : ".strlen($v_binary_data)); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid End of Central Dir Record size : ".strlen($v_binary_data)); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Extract the values ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Central Dir Record : '".$v_binary_data."'"); ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Central Dir Record (Hex) : '".bin2hex($v_binary_data)."'"); $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data); // ----- Check the global size //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Comment length : ".$v_data['comment_size']); if (($v_pos + $v_data['comment_size'] + 18) != $v_size) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The central dir is not at the end of the archive. Some trailing bytes exists after the archive."); // ----- Removed in release 2.2 see readme file // The check of the file size is a little too strict. // Some bugs where found when a zip is encrypted/decrypted with 'crypt'. // While decrypted, zip has training 0 bytes if (0) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'The central dir is not at the end of the archive.' .' Some trailing bytes exists after the archive.'); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } } // ----- Get comment if ($v_data['comment_size'] != 0) $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']); else $p_central_dir['comment'] = ''; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Comment : \''.$p_central_dir['comment'].'\''); $p_central_dir['entries'] = $v_data['entries']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Nb of entries : \''.$p_central_dir['entries'].'\''); $p_central_dir['disk_entries'] = $v_data['disk_entries']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Nb of entries for this disk : \''.$p_central_dir['disk_entries'].'\''); $p_central_dir['offset'] = $v_data['offset']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Offset of Central Dir : \''.$p_central_dir['offset'].'\''); $p_central_dir['size'] = $v_data['size']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size of Central Dir : \''.$p_central_dir['size'].'\''); $p_central_dir['disk'] = $v_data['disk']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Disk number : \''.$p_central_dir['disk'].'\''); $p_central_dir['disk_start'] = $v_data['disk_start']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Start disk number : \''.$p_central_dir['disk_start'].'\''); // TBC //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) { // //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "central_dir[$key] = ".$p_central_dir[$key]); //} // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privDeleteByRule() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privDeleteByRule(&$p_result_list, &$p_options) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDeleteByRule", ""); $v_result=1; $v_list_detail = array(); // ----- Open the zip file //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); if (($v_result=$this->privOpenFd('rb')) != 1) { // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Read the central directory informations $v_central_dir = array(); if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { $this->privCloseFd(); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Go to beginning of File //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'"); @rewind($this->zip_fd); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'"); // ----- Scan all the files // ----- Start at beginning of Central Dir $v_pos_entry = $v_central_dir['offset']; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position before rewind : ".ftell($this->zip_fd)."'"); @rewind($this->zip_fd); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'"); if (@fseek($this->zip_fd, $v_pos_entry)) { // ----- Close the zip file $this->privCloseFd(); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'"); // ----- Read each entry $v_header_list = array(); $j_start = 0; for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Read next file header entry (index '$i')"); // ----- Read the file header $v_header_list[$v_nb_extracted] = array(); if (($v_result = $this->privReadCentralFileHeader($v_header_list[$v_nb_extracted])) != 1) { // ----- Close the zip file $this->privCloseFd(); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename (index '$i') : '".$v_header_list[$v_nb_extracted]['stored_filename']."'"); // ----- Store the index $v_header_list[$v_nb_extracted]['index'] = $i; // ----- Look for the specific extract rules $v_found = false; // ----- Look for extract by name rule if ( (isset($p_options[PCLZIP_OPT_BY_NAME])) && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByName'"); // ----- Look if the filename is in the list for ($j=0; ($j strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) && (substr($v_header_list[$v_nb_extracted]['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The directory is in the file path"); $v_found = true; } elseif ( (($v_header_list[$v_nb_extracted]['external']&0x00000010)==0x00000010) /* Indicates a folder */ && ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_options[PCLZIP_OPT_BY_NAME][$j])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The entry is the searched directory"); $v_found = true; } } // ----- Look for a filename elseif ($v_header_list[$v_nb_extracted]['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The file is the right one."); $v_found = true; } } } // ----- Look for extract by ereg rule else if ( (isset($p_options[PCLZIP_OPT_BY_EREG])) && ($p_options[PCLZIP_OPT_BY_EREG] != "")) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract by ereg '".$p_options[PCLZIP_OPT_BY_EREG]."'"); if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header_list[$v_nb_extracted]['stored_filename'])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression"); $v_found = true; } } // ----- Look for extract by preg rule else if ( (isset($p_options[PCLZIP_OPT_BY_PREG])) && ($p_options[PCLZIP_OPT_BY_PREG] != "")) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByEreg'"); if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression"); $v_found = true; } } // ----- Look for extract by index rule else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX])) && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByIndex'"); // ----- Look if the index is in the list for ($j=$j_start; ($j=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found as part of an index range"); $v_found = true; } if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Do not look this index range for next loop"); $j_start = $j+1; } if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Index range is greater than index, stop loop"); break; } } } else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "No argument mean remove all file"); $v_found = true; } // ----- Look for deletion if ($v_found) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$v_header_list[$v_nb_extracted]['stored_filename']."', index '$i' need to be deleted"); unset($v_header_list[$v_nb_extracted]); } else { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$v_header_list[$v_nb_extracted]['stored_filename']."', index '$i' will not be deleted"); $v_nb_extracted++; } } // ----- Look if something need to be deleted if ($v_nb_extracted > 0) { // ----- Creates a temporay file $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; // ----- Creates a temporary zip archive $v_temp_zip = new PclZip($v_zip_temp_name); // ----- Open the temporary zip file in write mode //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary write mode"); if (($v_result = $v_temp_zip->privOpenFd('wb')) != 1) { $this->privCloseFd(); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Look which file need to be kept for ($i=0; $izip_fd)."'"); @rewind($this->zip_fd); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'"); if (@fseek($this->zip_fd, $v_header_list[$i]['offset'])) { // ----- Close the zip file $this->privCloseFd(); $v_temp_zip->privCloseFd(); @unlink($v_zip_temp_name); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'"); // ----- Read the file header $v_local_header = array(); if (($v_result = $this->privReadFileHeader($v_local_header)) != 1) { // ----- Close the zip file $this->privCloseFd(); $v_temp_zip->privCloseFd(); @unlink($v_zip_temp_name); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Check that local file header is same as central file header if ($this->privCheckFileHeaders($v_local_header, $v_header_list[$i]) != 1) { // TBC } unset($v_local_header); // ----- Write the file header if (($v_result = $v_temp_zip->privWriteFileHeader($v_header_list[$i])) != 1) { // ----- Close the zip file $this->privCloseFd(); $v_temp_zip->privCloseFd(); @unlink($v_zip_temp_name); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Offset for this file is '".$v_header_list[$i]['offset']."'"); // ----- Read/write the data block if (($v_result = PclZipUtilCopyBlock($this->zip_fd, $v_temp_zip->zip_fd, $v_header_list[$i]['compressed_size'])) != 1) { // ----- Close the zip file $this->privCloseFd(); $v_temp_zip->privCloseFd(); @unlink($v_zip_temp_name); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } } // ----- Store the offset of the central dir $v_offset = @ftell($v_temp_zip->zip_fd); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "New offset of central dir : $v_offset"); // ----- Re-Create the Central Dir files header //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Creates the new central directory"); for ($i=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) { $v_temp_zip->privCloseFd(); $this->privCloseFd(); @unlink($v_zip_temp_name); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Transform the header to a 'usable' info $v_temp_zip->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Creates the central directory footer"); // ----- Zip file comment $v_comment = ''; if (isset($p_options[PCLZIP_OPT_COMMENT])) { $v_comment = $p_options[PCLZIP_OPT_COMMENT]; } // ----- Calculate the size of the central header $v_size = @ftell($v_temp_zip->zip_fd)-$v_offset; // ----- Create the central dir footer if (($v_result = $v_temp_zip->privWriteCentralHeader(sizeof($v_header_list), $v_size, $v_offset, $v_comment)) != 1) { // ----- Reset the file list unset($v_header_list); $v_temp_zip->privCloseFd(); $this->privCloseFd(); @unlink($v_zip_temp_name); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Close $v_temp_zip->privCloseFd(); $this->privCloseFd(); // ----- Delete the zip file // TBC : I should test the result ... @unlink($this->zipname); // ----- Rename the temporary file // TBC : I should test the result ... //@rename($v_zip_temp_name, $this->zipname); PclZipUtilRename($v_zip_temp_name, $this->zipname); // ----- Destroy the temporary archive unset($v_temp_zip); } // ----- Remove every files : reset the file else if ($v_central_dir['entries'] != 0) { $this->privCloseFd(); if (($v_result = $this->privOpenFd('wb')) != 1) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } if (($v_result = $this->privWriteCentralHeader(0, 0, 0, '')) != 1) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } $this->privCloseFd(); } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privDirCheck() // Description : // Check if a directory exists, if not it creates it and all the parents directory // which may be useful. // Parameters : // $p_dir : Directory path to check. // Return Values : // 1 : OK // -1 : Unable to create directory // -------------------------------------------------------------------------------- function privDirCheck($p_dir, $p_is_dir=false) { $v_result = 1; //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDirCheck", "entry='$p_dir', is_dir='".($p_is_dir?"true":"false")."'"); // ----- Remove the final '/' if (($p_is_dir) && (substr($p_dir, -1)=='/')) { $p_dir = substr($p_dir, 0, strlen($p_dir)-1); } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Looking for entry '$p_dir'"); // ----- Check the directory availability if ((is_dir($p_dir)) || ($p_dir == "")) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, "'$p_dir' is a directory"); return 1; } // ----- Extract parent directory $p_parent_dir = dirname($p_dir); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Parent directory is '$p_parent_dir'"); // ----- Just a check if ($p_parent_dir != $p_dir) { // ----- Look for parent directory if ($p_parent_dir != "") { if (($v_result = $this->privDirCheck($p_parent_dir)) != 1) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } } } // ----- Create the directory //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Create directory '$p_dir'"); if (!@mkdir($p_dir, 0777)) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_DIR_CREATE_FAIL, "Unable to create directory '$p_dir'"); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result, "Directory '$p_dir' created"); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privMerge() // Description : // If $p_archive_to_add does not exist, the function exit with a success result. // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privMerge(&$p_archive_to_add) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privMerge", "archive='".$p_archive_to_add->zipname."'"); $v_result=1; // ----- Look if the archive_to_add exists if (!is_file($p_archive_to_add->zipname)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive to add does not exist. End of merge."); // ----- Nothing to merge, so merge is a success $v_result = 1; // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Look if the archive exists if (!is_file($this->zipname)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive does not exist, duplicate the archive_to_add."); // ----- Do a duplicate $v_result = $this->privDuplicate($p_archive_to_add->zipname); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Open the zip file //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); if (($v_result=$this->privOpenFd('rb')) != 1) { // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Read the central directory informations $v_central_dir = array(); if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { $this->privCloseFd(); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Go to beginning of File //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in zip : ".ftell($this->zip_fd)."'"); @rewind($this->zip_fd); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in zip : ".ftell($this->zip_fd)."'"); // ----- Open the archive_to_add file //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open archive_to_add in binary read mode"); if (($v_result=$p_archive_to_add->privOpenFd('rb')) != 1) { $this->privCloseFd(); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Read the central directory informations $v_central_dir_to_add = array(); if (($v_result = $p_archive_to_add->privReadEndCentralDir($v_central_dir_to_add)) != 1) { $this->privCloseFd(); $p_archive_to_add->privCloseFd(); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Go to beginning of File //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in archive_to_add : ".ftell($p_archive_to_add->zip_fd)."'"); @rewind($p_archive_to_add->zip_fd); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in archive_to_add : ".ftell($p_archive_to_add->zip_fd)."'"); // ----- Creates a temporay file $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; // ----- Open the temporary file in write mode //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) { $this->privCloseFd(); $p_archive_to_add->privCloseFd(); PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Copy the files from the archive to the temporary file // TBC : Here I should better append the file and go back to erase the central dir $v_size = $v_central_dir['offset']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); $v_buffer = fread($this->zip_fd, $v_read_size); @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; } // ----- Copy the files from the archive_to_add into the temporary file $v_size = $v_central_dir_to_add['offset']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); $v_buffer = fread($p_archive_to_add->zip_fd, $v_read_size); @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; } // ----- Store the offset of the central dir $v_offset = @ftell($v_zip_temp_fd); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "New offset of central dir : $v_offset"); // ----- Copy the block of file headers from the old archive $v_size = $v_central_dir['size']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); $v_buffer = @fread($this->zip_fd, $v_read_size); @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; } // ----- Copy the block of file headers from the archive_to_add $v_size = $v_central_dir_to_add['size']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); $v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size); @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; } // ----- Merge the file comments $v_comment = $v_central_dir['comment'].' '.$v_central_dir_to_add['comment']; // ----- Calculate the size of the (new) central header $v_size = @ftell($v_zip_temp_fd)-$v_offset; // ----- Swap the file descriptor // Here is a trick : I swap the temporary fd with the zip fd, in order to use // the following methods on the temporary fil and not the real archive fd $v_swap = $this->zip_fd; $this->zip_fd = $v_zip_temp_fd; $v_zip_temp_fd = $v_swap; // ----- Create the central dir footer if (($v_result = $this->privWriteCentralHeader($v_central_dir['entries']+$v_central_dir_to_add['entries'], $v_size, $v_offset, $v_comment)) != 1) { $this->privCloseFd(); $p_archive_to_add->privCloseFd(); @fclose($v_zip_temp_fd); $this->zip_fd = null; // ----- Reset the file list unset($v_header_list); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Swap back the file descriptor $v_swap = $this->zip_fd; $this->zip_fd = $v_zip_temp_fd; $v_zip_temp_fd = $v_swap; // ----- Close $this->privCloseFd(); $p_archive_to_add->privCloseFd(); // ----- Close the temporary file @fclose($v_zip_temp_fd); // ----- Delete the zip file // TBC : I should test the result ... @unlink($this->zipname); // ----- Rename the temporary file // TBC : I should test the result ... //@rename($v_zip_temp_name, $this->zipname); PclZipUtilRename($v_zip_temp_name, $this->zipname); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privDuplicate() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privDuplicate($p_archive_filename) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDuplicate", "archive_filename='$p_archive_filename'"); $v_result=1; // ----- Look if the $p_archive_filename exists if (!is_file($p_archive_filename)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive to duplicate does not exist. End of duplicate."); // ----- Nothing to duplicate, so duplicate is a success. $v_result = 1; // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Open the zip file //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); if (($v_result=$this->privOpenFd('wb')) != 1) { // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Open the temporary file in write mode //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); if (($v_zip_temp_fd = @fopen($p_archive_filename, 'rb')) == 0) { $this->privCloseFd(); PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \''.$p_archive_filename.'\' in binary write mode'); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Copy the files from the archive to the temporary file // TBC : Here I should better append the file and go back to erase the central dir $v_size = filesize($p_archive_filename); while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read $v_read_size bytes"); $v_buffer = fread($v_zip_temp_fd, $v_read_size); @fwrite($this->zip_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; } // ----- Close $this->privCloseFd(); // ----- Close the temporary file @fclose($v_zip_temp_fd); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privErrorLog() // Description : // Parameters : // -------------------------------------------------------------------------------- function privErrorLog($p_error_code=0, $p_error_string='') { if (PCLZIP_ERROR_EXTERNAL == 1) { PclError($p_error_code, $p_error_string); } else { $this->error_code = $p_error_code; $this->error_string = $p_error_string; } } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privErrorReset() // Description : // Parameters : // -------------------------------------------------------------------------------- function privErrorReset() { if (PCLZIP_ERROR_EXTERNAL == 1) { PclErrorReset(); } else { $this->error_code = 0; $this->error_string = ''; } } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privDecrypt() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privDecrypt($p_encryption_header, &$p_buffer, $p_size, $p_crc) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privDecrypt', "size=".$p_size.""); $v_result=1; // ----- To Be Modified ;-) $v_pwd = "test"; $p_buffer = PclZipUtilZipDecrypt($p_buffer, $p_size, $p_encryption_header, $p_crc, $v_pwd); // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privDisableMagicQuotes() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privDisableMagicQuotes() { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privDisableMagicQuotes', ""); $v_result=1; // ----- Look if function exists if ( (!function_exists("get_magic_quotes_runtime")) || (!function_exists("set_magic_quotes_runtime"))) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Functions *et_magic_quotes_runtime are not supported"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Look if already done if ($this->magic_quotes_status != -1) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "magic_quote already disabled"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Get and memorize the magic_quote value $this->magic_quotes_status = @get_magic_quotes_runtime(); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Current magic_quotes_runtime status is '".($this->magic_quotes_status==0?'disable':'enable')."'"); // ----- Disable magic_quotes if ($this->magic_quotes_status == 1) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Disable magic_quotes"); @set_magic_quotes_runtime(0); } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privSwapBackMagicQuotes() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privSwapBackMagicQuotes() { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privSwapBackMagicQuotes', ""); $v_result=1; // ----- Look if function exists if ( (!function_exists("get_magic_quotes_runtime")) || (!function_exists("set_magic_quotes_runtime"))) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Functions *et_magic_quotes_runtime are not supported"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Look if something to do if ($this->magic_quotes_status != -1) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "magic_quote not modified"); //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Swap back magic_quotes if ($this->magic_quotes_status == 1) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Enable back magic_quotes"); @set_magic_quotes_runtime($this->magic_quotes_status); } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- } // End of class // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : PclZipUtilPathReduction() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function PclZipUtilPathReduction($p_dir) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilPathReduction", "dir='$p_dir'"); $v_result = ""; // ----- Look for not empty path if ($p_dir != "") { // ----- Explode path by directory names $v_list = explode("/", $p_dir); // ----- Study directories from last to first $v_skip = 0; for ($i=sizeof($v_list)-1; $i>=0; $i--) { // ----- Look for current path if ($v_list[$i] == ".") { // ----- Ignore this directory // Should be the first $i=0, but no check is done } else if ($v_list[$i] == "..") { $v_skip++; } else if ($v_list[$i] == "") { // ----- First '/' i.e. root slash if ($i == 0) { $v_result = "/".$v_result; if ($v_skip > 0) { // ----- It is an invalid path, so the path is not modified // TBC $v_result = $p_dir; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Invalid path is unchanged"); $v_skip = 0; } } // ----- Last '/' i.e. indicates a directory else if ($i == (sizeof($v_list)-1)) { $v_result = $v_list[$i]; } // ----- Double '/' inside the path else { // ----- Ignore only the double '//' in path, // but not the first and last '/' } } else { // ----- Look for item to skip if ($v_skip > 0) { $v_skip--; } else { $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?"/".$v_result:""); } } } // ----- Look for skip if ($v_skip > 0) { while ($v_skip > 0) { $v_result = '../'.$v_result; $v_skip--; } } } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : PclZipUtilPathInclusion() // Description : // This function indicates if the path $p_path is under the $p_dir tree. Or, // said in an other way, if the file or sub-dir $p_path is inside the dir // $p_dir. // The function indicates also if the path is exactly the same as the dir. // This function supports path with duplicated '/' like '//', but does not // support '.' or '..' statements. // Parameters : // Return Values : // 0 if $p_path is not inside directory $p_dir // 1 if $p_path is inside directory $p_dir // 2 if $p_path is exactly the same as $p_dir // -------------------------------------------------------------------------------- function PclZipUtilPathInclusion($p_dir, $p_path) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilPathInclusion", "dir='$p_dir', path='$p_path'"); $v_result = 1; // ----- Look for path beginning by ./ if ( ($p_dir == '.') || ((strlen($p_dir) >=2) && (substr($p_dir, 0, 2) == './'))) { $p_dir = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_dir, 1); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Replacing ./ by full path in p_dir '".$p_dir."'"); } if ( ($p_path == '.') || ((strlen($p_path) >=2) && (substr($p_path, 0, 2) == './'))) { $p_path = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_path, 1); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Replacing ./ by full path in p_path '".$p_path."'"); } // ----- Explode dir and path by directory separator $v_list_dir = explode("/", $p_dir); $v_list_dir_size = sizeof($v_list_dir); $v_list_path = explode("/", $p_path); $v_list_path_size = sizeof($v_list_path); // ----- Study directories paths $i = 0; $j = 0; while (($i < $v_list_dir_size) && ($j < $v_list_path_size) && ($v_result)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Working on dir($i)='".$v_list_dir[$i]."' and path($j)='".$v_list_path[$j]."'"); // ----- Look for empty dir (path reduction) if ($v_list_dir[$i] == '') { $i++; continue; } if ($v_list_path[$j] == '') { $j++; continue; } // ----- Compare the items if (($v_list_dir[$i] != $v_list_path[$j]) && ($v_list_dir[$i] != '') && ( $v_list_path[$j] != '')) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Items ($i,$j) are different"); $v_result = 0; } // ----- Next items $i++; $j++; } // ----- Look if everything seems to be the same if ($v_result) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Look for tie break"); // ----- Skip all the empty items while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) $j++; while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) $i++; //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Looking on dir($i)='".($i < $v_list_dir_size?$v_list_dir[$i]:'')."' and path($j)='".($j < $v_list_path_size?$v_list_path[$j]:'')."'"); if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) { // ----- There are exactly the same $v_result = 2; } else if ($i < $v_list_dir_size) { // ----- The path is shorter than the dir $v_result = 0; } } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : PclZipUtilCopyBlock() // Description : // Parameters : // $p_mode : read/write compression mode // 0 : src & dest normal // 1 : src gzip, dest normal // 2 : src normal, dest gzip // 3 : src & dest gzip // Return Values : // -------------------------------------------------------------------------------- function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode=0) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilCopyBlock", "size=$p_size, mode=$p_mode"); $v_result = 1; if ($p_mode==0) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Src offset before read :".(@ftell($p_src))); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Dest offset before write :".(@ftell($p_dest))); while ($p_size != 0) { $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); $v_buffer = @fread($p_src, $v_read_size); @fwrite($p_dest, $v_buffer, $v_read_size); $p_size -= $v_read_size; } //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Src offset after read :".(@ftell($p_src))); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Dest offset after write :".(@ftell($p_dest))); } else if ($p_mode==1) { while ($p_size != 0) { $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); $v_buffer = @gzread($p_src, $v_read_size); @fwrite($p_dest, $v_buffer, $v_read_size); $p_size -= $v_read_size; } } else if ($p_mode==2) { while ($p_size != 0) { $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); $v_buffer = @fread($p_src, $v_read_size); @gzwrite($p_dest, $v_buffer, $v_read_size); $p_size -= $v_read_size; } } else if ($p_mode==3) { while ($p_size != 0) { $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); $v_buffer = @gzread($p_src, $v_read_size); @gzwrite($p_dest, $v_buffer, $v_read_size); $p_size -= $v_read_size; } } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : PclZipUtilRename() // Description : // This function tries to do a simple rename() function. If it fails, it // tries to copy the $p_src file in a new $p_dest file and then unlink the // first one. // Parameters : // $p_src : Old filename // $p_dest : New filename // Return Values : // 1 on success, 0 on failure. // -------------------------------------------------------------------------------- function PclZipUtilRename($p_src, $p_dest) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilRename", "source=$p_src, destination=$p_dest"); $v_result = 1; // ----- Try to rename the files if (!@rename($p_src, $p_dest)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to rename file, try copy+unlink"); // ----- Try to copy & unlink the src if (!@copy($p_src, $p_dest)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to copy file"); $v_result = 0; } else if (!@unlink($p_src)) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to unlink old filename"); $v_result = 0; } } // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : PclZipUtilOptionText() // Description : // Translate option value in text. Mainly for debug purpose. // Parameters : // $p_option : the option value. // Return Values : // The option text value. // -------------------------------------------------------------------------------- function PclZipUtilOptionText($p_option) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilOptionText", "option='".$p_option."'"); $v_list = get_defined_constants(); for (reset($v_list); $v_key = key($v_list); next($v_list)) { $v_prefix = substr($v_key, 0, 10); if (( ($v_prefix == 'PCLZIP_OPT') || ($v_prefix == 'PCLZIP_CB_') || ($v_prefix == 'PCLZIP_ATT')) && ($v_list[$v_key] == $p_option)) { //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_key); return $v_key; } } $v_result = 'Unknown'; //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : PclZipUtilTranslateWinPath() // Description : // Translate windows path by replacing '\' by '/' and optionally removing // drive letter. // Parameters : // $p_path : path to translate. // $p_remove_disk_letter : true | false // Return Values : // The path translated. // -------------------------------------------------------------------------------- function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter=true) { if (stristr(php_uname(), 'windows')) { // ----- Look for potential disk letter if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) { $p_path = substr($p_path, $v_position+1); } // ----- Change potential windows directory separator if ((strpos($p_path, '\\') > 0) || (substr($p_path, 0,1) == '\\')) { $p_path = strtr($p_path, '\\', '/'); } } return $p_path; } // -------------------------------------------------------------------------------- ?> wp/dev/wp-admin/includes/taxonomy.php0000644000106600010660000000646211047350067015126 0ustar $cat_name, 'category_parent' => $parent) ); } function wp_create_categories($categories, $post_id = '') { $cat_ids = array (); foreach ($categories as $category) { if ($id = category_exists($category)) $cat_ids[] = $id; else if ($id = wp_create_category($category)) $cat_ids[] = $id; } if ($post_id) wp_set_post_categories($post_id, $cat_ids); return $cat_ids; } function wp_delete_category($cat_ID) { $cat_ID = (int) $cat_ID; $default = get_option('default_category'); // Don't delete the default cat if ( $cat_ID == $default ) return 0; return wp_delete_term($cat_ID, 'category', array('default' => $default)); } function wp_insert_category($catarr, $wp_error = false) { $cat_defaults = array('cat_ID' => 0, 'cat_name' => '', 'category_description' => '', 'category_nicename' => '', 'category_parent' => ''); $cat_arr = wp_parse_args($cat_arr, $cat_defaults); extract($catarr, EXTR_SKIP); if ( trim( $cat_name ) == '' ) { if ( ! $wp_error ) return 0; else return new WP_Error( 'cat_name', __('You did not enter a category name.') ); } $cat_ID = (int) $cat_ID; // Are we updating or creating? if ( !empty ($cat_ID) ) $update = true; else $update = false; $name = $cat_name; $description = $category_description; $slug = $category_nicename; $parent = $category_parent; $parent = (int) $parent; if ( $parent < 0 ) $parent = 0; if ( empty($parent) || !category_exists( $parent ) || ($cat_ID && cat_is_ancestor_of($cat_ID, $parent) ) ) $parent = 0; $args = compact('name', 'slug', 'parent', 'description'); if ( $update ) $cat_ID = wp_update_term($cat_ID, 'category', $args); else $cat_ID = wp_insert_term($cat_name, 'category', $args); if ( is_wp_error($cat_ID) ) { if ( $wp_error ) return $cat_ID; else return 0; } return $cat_ID['term_id']; } function wp_update_category($catarr) { $cat_ID = (int) $catarr['cat_ID']; if ( $cat_ID == $catarr['category_parent'] ) return false; // First, get all of the original fields $category = get_category($cat_ID, ARRAY_A); // Escape data pulled from DB. $category = add_magic_quotes($category); // Merge old and new fields with new fields overwriting old ones. $catarr = array_merge($category, $catarr); return wp_insert_category($catarr); } // // Tags // function get_tags_to_edit( $post_id ) { $post_id = (int) $post_id; if ( !$post_id ) return false; $tags = wp_get_post_tags($post_id); if ( !$tags ) return false; foreach ( $tags as $tag ) $tag_names[] = $tag->name; $tags_to_edit = join( ',', $tag_names ); $tags_to_edit = attribute_escape( $tags_to_edit ); $tags_to_edit = apply_filters( 'tags_to_edit', $tags_to_edit ); return $tags_to_edit; } function tag_exists($tag_name) { return is_term($tag_name, 'post_tag'); } function wp_create_tag($tag_name) { if ( $id = tag_exists($tag_name) ) return $id; return wp_insert_term($tag_name, 'post_tag'); } ?> wp/dev/wp-admin/includes/class-wp-filesystem-ftpext.php0000644000106600010660000002425311017563774020501 0ustar FTP_ASCII, 'css'=>FTP_ASCII, 'txt'=>FTP_ASCII, 'js'=>FTP_ASCII, 'html'=>FTP_ASCII, 'htm'=>FTP_ASCII, 'xml'=>FTP_ASCII, 'jpg'=>FTP_BINARY, 'png'=>FTP_BINARY, 'gif'=>FTP_BINARY, 'bmp'=>FTP_BINARY ); function WP_Filesystem_FTPext($opt='') { $this->method = 'ftpext'; $this->errors = new WP_Error(); //Check if possible to use ftp functions. if ( ! extension_loaded('ftp') ) { $this->errors->add('no_ftp_ext', __('The ftp PHP extension is not available')); return false; } // Set defaults: if ( empty($opt['port']) ) $this->options['port'] = 21; else $this->options['port'] = $opt['port']; if ( empty($opt['hostname']) ) $this->errors->add('empty_hostname', __('FTP hostname is required')); else $this->options['hostname'] = $opt['hostname']; if ( isset($opt['base']) && ! empty($opt['base']) ) $this->wp_base = $opt['base']; // Check if the options provided are OK. if ( empty ($opt['username']) ) $this->errors->add('empty_username', __('FTP username is required')); else $this->options['username'] = $opt['username']; if ( empty ($opt['password']) ) $this->errors->add('empty_password', __('FTP password is required')); else $this->options['password'] = $opt['password']; $this->options['ssl'] = ( !empty($opt['ssl']) ); } function connect() { if ( $this->options['ssl'] && function_exists('ftp_ssl_connect') ) $this->link = @ftp_ssl_connect($this->options['hostname'], $this->options['port'],$this->timeout); else $this->link = @ftp_connect($this->options['hostname'], $this->options['port'],$this->timeout); if ( ! $this->link ) { $this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port'])); return false; } if ( ! @ftp_login($this->link,$this->options['username'], $this->options['password']) ) { $this->errors->add('auth', sprintf(__('Username/Password incorrect for %s'), $this->options['username'])); return false; } return true; } function setDefaultPermissions($perm) { $this->permission = $perm; } function get_contents($file, $type = '', $resumepos = 0 ){ if( empty($type) ){ $extension = substr(strrchr($file, "."), 1); $type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_ASCII; } $temp = tmpfile(); if ( ! $temp ) return false; if( ! @ftp_fget($this->link, $temp, $file, $type, $resumepos) ) return false; fseek($temp, 0); //Skip back to the start of the file being written to $contents = ''; while (!feof($temp)) { $contents .= fread($temp, 8192); } fclose($temp); return $contents; } function get_contents_array($file) { return explode("\n", $this->get_contents($file)); } function put_contents($file, $contents, $type = '' ) { if( empty($type) ) { $extension = substr(strrchr($file, "."), 1); $type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_ASCII; } $temp = tmpfile(); if ( ! $temp ) return false; fwrite($temp, $contents); fseek($temp, 0); //Skip back to the start of the file being written to $ret = @ftp_fput($this->link, $file, $temp, $type); fclose($temp); return $ret; } function cwd() { $cwd = ftp_pwd($this->link); if( $cwd ) $cwd = trailingslashit($cwd); return $cwd; } function chdir($dir) { return @ftp_chdir($dir); } function chgrp($file, $group, $recursive = false ) { return false; } function chmod($file, $mode = false, $recursive = false) { if( ! $mode ) $mode = $this->permission; if( ! $mode ) return false; if ( ! $this->exists($file) ) return false; if ( ! $recursive || ! $this->is_dir($file) ) { if ( ! function_exists('ftp_chmod') ) return @ftp_site($this->link, sprintf('CHMOD %o %s', $mode, $file)); return @ftp_chmod($this->link, $mode, $file); } //Is a directory, and we want recursive $filelist = $this->dirlist($file); foreach($filelist as $filename){ $this->chmod($file . '/' . $filename, $mode, $recursive); } return true; } function chown($file, $owner, $recursive = false ) { return false; } function owner($file) { $dir = $this->dirlist($file); return $dir[$file]['owner']; } function getchmod($file) { $dir = $this->dirlist($file); return $dir[$file]['permsn']; } function group($file) { $dir = $this->dirlist($file); return $dir[$file]['group']; } function copy($source, $destination, $overwrite = false ) { if( ! $overwrite && $this->exists($destination) ) return false; $content = $this->get_contents($source); if( false === $content) return false; return $this->put_contents($destination, $content); } function move($source, $destination, $overwrite = false) { return ftp_rename($this->link, $source, $destination); } function delete($file,$recursive=false) { if ( $this->is_file($file) ) return @ftp_delete($this->link, $file); if ( !$recursive ) return @ftp_rmdir($this->link, $file); $filelist = $this->dirlist($file); foreach ((array) $filelist as $filename => $fileinfo) { $this->delete($file . '/' . $filename, $recursive); } return @ftp_rmdir($this->link, $file); } function exists($file) { $list = ftp_rawlist($this->link, $file, false); if( ! $list ) return false; return count($list) == 1 ? true : false; } function is_file($file) { return $this->is_dir($file) ? false : true; } function is_dir($path) { $cwd = $this->cwd(); $result = @ftp_chdir($this->link, $path); if( $result && $path == $this->cwd() || $this->cwd() != $cwd ) { @ftp_chdir($this->link, $cwd); return true; } return false; } function is_readable($file) { //Get dir list, Check if the file is writable by the current user?? return true; } function is_writable($file) { //Get dir list, Check if the file is writable by the current user?? return true; } function atime($file) { return false; } function mtime($file) { return ftp_mdtm($this->link, $file); } function size($file) { return ftp_size($this->link, $file); } function touch($file, $time = 0, $atime = 0) { return false; } function mkdir($path, $chmod = false, $chown = false, $chgrp = false) { if( !@ftp_mkdir($this->link, $path) ) return false; if( $chmod ) $this->chmod($path, $chmod); if( $chown ) $this->chown($path, $chown); if( $chgrp ) $this->chgrp($path, $chgrp); return true; } function rmdir($path, $recursive = false) { if( ! $recursive ) return @ftp_rmdir($this->link, $path); //TODO: Recursive Directory delete, Have to delete files from the folder first. //$dir = $this->dirlist($path); //foreach($dir as $file) } function parselisting($line) { $is_windows = ($this->OS_remote == FTP_OS_Windows); if ($is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|) +(.+)/", $line, $lucifer)) { $b = array(); if ($lucifer[3]<70) { $lucifer[3] +=2000; } else { $lucifer[3]+=1900; } // 4digit year fix $b['isdir'] = ($lucifer[7]==""); if ( $b['isdir'] ) $b['type'] = 'd'; else $b['type'] = 'f'; $b['size'] = $lucifer[7]; $b['month'] = $lucifer[1]; $b['day'] = $lucifer[2]; $b['year'] = $lucifer[3]; $b['hour'] = $lucifer[4]; $b['minute'] = $lucifer[5]; $b['time'] = @mktime($lucifer[4]+(strcasecmp($lucifer[6],"PM")==0?12:0),$lucifer[5],0,$lucifer[1],$lucifer[2],$lucifer[3]); $b['am/pm'] = $lucifer[6]; $b['name'] = $lucifer[8]; } else if (!$is_windows && $lucifer=preg_split("/[ ]/",$line,9,PREG_SPLIT_NO_EMPTY)) { //echo $line."\n"; $lcount=count($lucifer); if ($lcount<8) return ''; $b = array(); $b['isdir'] = $lucifer[0]{0} === "d"; $b['islink'] = $lucifer[0]{0} === "l"; if ( $b['isdir'] ) $b['type'] = 'd'; elseif ( $b['islink'] ) $b['type'] = 'l'; else $b['type'] = 'f'; $b['perms'] = $lucifer[0]; $b['number'] = $lucifer[1]; $b['owner'] = $lucifer[2]; $b['group'] = $lucifer[3]; $b['size'] = $lucifer[4]; if ($lcount==8) { sscanf($lucifer[5],"%d-%d-%d",$b['year'],$b['month'],$b['day']); sscanf($lucifer[6],"%d:%d",$b['hour'],$b['minute']); $b['time'] = @mktime($b['hour'],$b['minute'],0,$b['month'],$b['day'],$b['year']); $b['name'] = $lucifer[7]; } else { $b['month'] = $lucifer[5]; $b['day'] = $lucifer[6]; if (preg_match("/([0-9]{2}):([0-9]{2})/",$lucifer[7],$l2)) { $b['year'] = date("Y"); $b['hour'] = $l2[1]; $b['minute'] = $l2[2]; } else { $b['year'] = $lucifer[7]; $b['hour'] = 0; $b['minute'] = 0; } $b['time'] = strtotime(sprintf("%d %s %d %02d:%02d",$b['day'],$b['month'],$b['year'],$b['hour'],$b['minute'])); $b['name'] = $lucifer[8]; } } return $b; } function dirlist($path = '.', $incdot = false, $recursive = false) { if( $this->is_file($path) ) { $limitFile = basename($path); $path = dirname($path) . '/'; } else { $limitFile = false; } $list = @ftp_rawlist($this->link, '-a ' . $path, false); if ( $list === false ) return false; $dirlist = array(); foreach ( $list as $k => $v ) { $entry = $this->parselisting($v); if ( empty($entry) ) continue; if ( '.' == $entry["name"] || '..' == $entry["name"] ) continue; $dirlist[ $entry['name'] ] = $entry; } if ( ! $dirlist ) return false; if ( empty($dirlist) ) return array(); $ret = array(); foreach ( $dirlist as $struc ) { if ( 'd' == $struc['type'] ) { $struc['files'] = array(); if ( $incdot ){ //We're including the doted starts if( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder if ($recursive) $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive); } } else { //No dots if ($recursive) $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive); } } //File $ret[$struc['name']] = $struc; } return $ret; } function __destruct(){ if( $this->link ) ftp_close($this->link); } } ?> wp/dev/wp-admin/includes/upgrade.php0000644000106600010660000013632411037421065014674 0ustar set_role('administrator'); wp_install_defaults($user_id); $wp_rewrite->flush_rules(); wp_new_blog_notification($blog_title, $guessurl, $user_id, $random_password); wp_cache_flush(); return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $random_password); } endif; if ( !function_exists('wp_install_defaults') ) : function wp_install_defaults($user_id) { global $wpdb; // Default category $cat_name = $wpdb->escape(__('Uncategorized')); $cat_slug = sanitize_title(_c('Uncategorized|Default category slug')); $wpdb->query("INSERT INTO $wpdb->terms (name, slug, term_group) VALUES ('$cat_name', '$cat_slug', '0')"); $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('1', 'category', '', '0', '1')"); // Default link category $cat_name = $wpdb->escape(__('Blogroll')); $cat_slug = sanitize_title(_c('Blogroll|Default link category slug')); $wpdb->query("INSERT INTO $wpdb->terms (name, slug, term_group) VALUES ('$cat_name', '$cat_slug', '0')"); $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('2', 'link_category', '', '0', '7')"); // Now drop in some default links $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://codex.wordpress.org/', 'Documentation', 0, '', '');"); $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (1, 2)" ); $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/development/', 'Development Blog', 0, 'http://wordpress.org/development/feed/', '');"); $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (2, 2)" ); $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/extend/ideas/', 'Suggest Ideas', 0, '', '');"); $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (3, 2)" ); $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/support/', 'Support Forum', 0, '', '');"); $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (4, 2)" ); $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/extend/plugins/', 'Plugins', 0, '', '');"); $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (5, 2)" ); $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/extend/themes/', 'Themes', 0, '', '');"); $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (6, 2)" ); $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://planet.wordpress.org/', 'WordPress Planet', 0, '', '');"); $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (7, 2)" ); // First post $now = date('Y-m-d H:i:s'); $now_gmt = gmdate('Y-m-d H:i:s'); $first_post_guid = get_option('home') . '/?p=1'; $wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_excerpt, post_title, post_category, post_name, post_modified, post_modified_gmt, guid, comment_count, to_ping, pinged, post_content_filtered) VALUES ($user_id, '$now', '$now_gmt', '".$wpdb->escape(__('Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!'))."', '', '".$wpdb->escape(__('Hello world!'))."', '0', '".$wpdb->escape(_c('hello-world|Default post slug'))."', '$now', '$now_gmt', '$first_post_guid', '1', '', '', '')"); $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (1, 1)" ); // Default comment $wpdb->query("INSERT INTO $wpdb->comments (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_date, comment_date_gmt, comment_content) VALUES ('1', '".$wpdb->escape(__('Mr WordPress'))."', '', 'http://wordpress.org/', '$now', '$now_gmt', '".$wpdb->escape(__('Hi, this is a comment.
    To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.'))."')"); // First Page $first_post_guid = get_option('home') . '/?page_id=2'; $wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_excerpt, post_title, post_category, post_name, post_modified, post_modified_gmt, guid, post_status, post_type, to_ping, pinged, post_content_filtered) VALUES ($user_id, '$now', '$now_gmt', '".$wpdb->escape(__('This is an example of a WordPress page, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress.'))."', '', '".$wpdb->escape(__('About'))."', '0', '".$wpdb->escape(_c('about|Default page slug'))."', '$now', '$now_gmt','$first_post_guid', 'publish', 'page', '', '', '')"); } endif; if ( !function_exists('wp_new_blog_notification') ) : function wp_new_blog_notification($blog_title, $blog_url, $user_id, $password) { $user = new WP_User($user_id); $email = $user->user_email; $name = $user->user_login; $message_headers = 'From: "' . $blog_title . '" '; $message = sprintf(__("Your new WordPress blog has been successfully set up at: %1\$s You can log in to the administrator account with the following information: Username: %2\$s Password: %3\$s We hope you enjoy your new blog. Thanks! --The WordPress Team http://wordpress.org/ "), $blog_url, $name, $password); @wp_mail($email, __('New WordPress Blog'), $message, $message_headers); } endif; if ( !function_exists('wp_upgrade') ) : function wp_upgrade() { global $wp_current_db_version, $wp_db_version; $wp_current_db_version = __get_option('db_version'); // We are up-to-date. Nothing to do. if ( $wp_db_version == $wp_current_db_version ) return; wp_check_mysql_version(); wp_cache_flush(); make_db_current_silent(); upgrade_all(); wp_cache_flush(); } endif; // Functions to be called in install and upgrade scripts function upgrade_all() { global $wp_current_db_version, $wp_db_version, $wp_rewrite; $wp_current_db_version = __get_option('db_version'); // We are up-to-date. Nothing to do. if ( $wp_db_version == $wp_current_db_version ) return; // If the version is not set in the DB, try to guess the version. if ( empty($wp_current_db_version) ) { $wp_current_db_version = 0; // If the template option exists, we have 1.5. $template = __get_option('template'); if ( !empty($template) ) $wp_current_db_version = 2541; } if ( $wp_current_db_version < 6039 ) upgrade_230_options_table(); populate_options(); if ( $wp_current_db_version < 2541 ) { upgrade_100(); upgrade_101(); upgrade_110(); upgrade_130(); } if ( $wp_current_db_version < 3308 ) upgrade_160(); if ( $wp_current_db_version < 4772 ) upgrade_210(); if ( $wp_current_db_version < 4351 ) upgrade_old_slugs(); if ( $wp_current_db_version < 5539 ) upgrade_230(); if ( $wp_current_db_version < 6124 ) upgrade_230_old_tables(); if ( $wp_current_db_version < 7499 ) upgrade_250(); if ( $wp_current_db_version < 7796 ) upgrade_251(); if ( $wp_current_db_version < 7935 ) upgrade_252(); if ( $wp_current_db_version < 8201 ) upgrade_260(); maybe_disable_automattic_widgets(); $wp_rewrite->flush_rules(); update_option('db_version', $wp_db_version); } function upgrade_100() { global $wpdb; // Get the title and ID of every post, post_name to check if it already has a value $posts = $wpdb->get_results("SELECT ID, post_title, post_name FROM $wpdb->posts WHERE post_name = ''"); if ($posts) { foreach($posts as $post) { if ('' == $post->post_name) { $newtitle = sanitize_title($post->post_title); $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_name = %s WHERE ID = %d", $newtitle, $post->ID) ); } } } $categories = $wpdb->get_results("SELECT cat_ID, cat_name, category_nicename FROM $wpdb->categories"); foreach ($categories as $category) { if ('' == $category->category_nicename) { $newtitle = sanitize_title($category->cat_name); $wpdb->query( $wpdb->prepare("UPDATE $wpdb->categories SET category_nicename = %s WHERE cat_ID = %d", $newtitle, $category->cat_ID) ); } } $wpdb->query("UPDATE $wpdb->options SET option_value = REPLACE(option_value, 'wp-links/links-images/', 'wp-images/links/') WHERE option_name LIKE 'links_rating_image%' AND option_value LIKE 'wp-links/links-images/%'"); $done_ids = $wpdb->get_results("SELECT DISTINCT post_id FROM $wpdb->post2cat"); if ($done_ids) : foreach ($done_ids as $done_id) : $done_posts[] = $done_id->post_id; endforeach; $catwhere = ' AND ID NOT IN (' . implode(',', $done_posts) . ')'; else: $catwhere = ''; endif; $allposts = $wpdb->get_results("SELECT ID, post_category FROM $wpdb->posts WHERE post_category != '0' $catwhere"); if ($allposts) : foreach ($allposts as $post) { // Check to see if it's already been imported $cat = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->post2cat WHERE post_id = %d AND category_id = %d", $post->ID, $post->post_category) ); if (!$cat && 0 != $post->post_category) { // If there's no result $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->post2cat (post_id, category_id) VALUES (%s, %s) ", $post->ID, $post->post_category) ); } } endif; } function upgrade_101() { global $wpdb; // Clean up indices, add a few add_clean_index($wpdb->posts, 'post_name'); add_clean_index($wpdb->posts, 'post_status'); add_clean_index($wpdb->categories, 'category_nicename'); add_clean_index($wpdb->comments, 'comment_approved'); add_clean_index($wpdb->comments, 'comment_post_ID'); add_clean_index($wpdb->links , 'link_category'); add_clean_index($wpdb->links , 'link_visible'); } function upgrade_110() { global $wpdb; // Set user_nicename. $users = $wpdb->get_results("SELECT ID, user_nickname, user_nicename FROM $wpdb->users"); foreach ($users as $user) { if ('' == $user->user_nicename) { $newname = sanitize_title($user->user_nickname); $wpdb->query( $wpdb->prepare("UPDATE $wpdb->users SET user_nicename = %s WHERE ID = %d", $newname, $user->ID) ); } } $users = $wpdb->get_results("SELECT ID, user_pass from $wpdb->users"); foreach ($users as $row) { if (!preg_match('/^[A-Fa-f0-9]{32}$/', $row->user_pass)) { $wpdb->query('UPDATE '.$wpdb->users.' SET user_pass = MD5(\''.$row->user_pass.'\') WHERE ID = \''.$row->ID.'\''); } } // Get the GMT offset, we'll use that later on $all_options = get_alloptions_110(); $time_difference = $all_options->time_difference; $server_time = time()+date('Z'); $weblogger_time = $server_time + $time_difference*3600; $gmt_time = time(); $diff_gmt_server = ($gmt_time - $server_time) / 3600; $diff_weblogger_server = ($weblogger_time - $server_time) / 3600; $diff_gmt_weblogger = $diff_gmt_server - $diff_weblogger_server; $gmt_offset = -$diff_gmt_weblogger; // Add a gmt_offset option, with value $gmt_offset add_option('gmt_offset', $gmt_offset); // Check if we already set the GMT fields (if we did, then // MAX(post_date_gmt) can't be '0000-00-00 00:00:00' // I just slapped myself silly for not thinking about it earlier $got_gmt_fields = ($wpdb->get_var("SELECT MAX(post_date_gmt) FROM $wpdb->posts") == '0000-00-00 00:00:00') ? false : true; if (!$got_gmt_fields) { // Add or substract time to all dates, to get GMT dates $add_hours = intval($diff_gmt_weblogger); $add_minutes = intval(60 * ($diff_gmt_weblogger - $add_hours)); $wpdb->query("UPDATE $wpdb->posts SET post_date_gmt = DATE_ADD(post_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)"); $wpdb->query("UPDATE $wpdb->posts SET post_modified = post_date"); $wpdb->query("UPDATE $wpdb->posts SET post_modified_gmt = DATE_ADD(post_modified, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE) WHERE post_modified != '0000-00-00 00:00:00'"); $wpdb->query("UPDATE $wpdb->comments SET comment_date_gmt = DATE_ADD(comment_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)"); $wpdb->query("UPDATE $wpdb->users SET user_registered = DATE_ADD(user_registered, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)"); } } function upgrade_130() { global $wpdb; // Remove extraneous backslashes. $posts = $wpdb->get_results("SELECT ID, post_title, post_content, post_excerpt, guid, post_date, post_name, post_status, post_author FROM $wpdb->posts"); if ($posts) { foreach($posts as $post) { $post_content = addslashes(deslash($post->post_content)); $post_title = addslashes(deslash($post->post_title)); $post_excerpt = addslashes(deslash($post->post_excerpt)); if ( empty($post->guid) ) $guid = get_permalink($post->ID); else $guid = $post->guid; $wpdb->query("UPDATE $wpdb->posts SET post_title = '$post_title', post_content = '$post_content', post_excerpt = '$post_excerpt', guid = '$guid' WHERE ID = '$post->ID'"); } } // Remove extraneous backslashes. $comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_content FROM $wpdb->comments"); if ($comments) { foreach($comments as $comment) { $comment_content = addslashes(deslash($comment->comment_content)); $comment_author = addslashes(deslash($comment->comment_author)); $wpdb->query("UPDATE $wpdb->comments SET comment_content = '$comment_content', comment_author = '$comment_author' WHERE comment_ID = '$comment->comment_ID'"); } } // Remove extraneous backslashes. $links = $wpdb->get_results("SELECT link_id, link_name, link_description FROM $wpdb->links"); if ($links) { foreach($links as $link) { $link_name = addslashes(deslash($link->link_name)); $link_description = addslashes(deslash($link->link_description)); $wpdb->query("UPDATE $wpdb->links SET link_name = '$link_name', link_description = '$link_description' WHERE link_id = '$link->link_id'"); } } // The "paged" option for what_to_show is no more. if ($wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'what_to_show'") == 'paged') { $wpdb->query("UPDATE $wpdb->options SET option_value = 'posts' WHERE option_name = 'what_to_show'"); } $active_plugins = __get_option('active_plugins'); // If plugins are not stored in an array, they're stored in the old // newline separated format. Convert to new format. if ( !is_array( $active_plugins ) ) { $active_plugins = explode("\n", trim($active_plugins)); update_option('active_plugins', $active_plugins); } // Obsolete tables $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optionvalues'); $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optiontypes'); $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optiongroups'); $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optiongroup_options'); // Update comments table to use comment_type $wpdb->query("UPDATE $wpdb->comments SET comment_type='trackback', comment_content = REPLACE(comment_content, '', '') WHERE comment_content LIKE '%'"); $wpdb->query("UPDATE $wpdb->comments SET comment_type='pingback', comment_content = REPLACE(comment_content, '', '') WHERE comment_content LIKE '%'"); // Some versions have multiple duplicate option_name rows with the same values $options = $wpdb->get_results("SELECT option_name, COUNT(option_name) AS dupes FROM `$wpdb->options` GROUP BY option_name"); foreach ( $options as $option ) { if ( 1 != $option->dupes ) { // Could this be done in the query? $limit = $option->dupes - 1; $dupe_ids = $wpdb->get_col( $wpdb->prepare("SELECT option_id FROM $wpdb->options WHERE option_name = %s LIMIT %d", $option->option_name, $limit) ); $dupe_ids = join($dupe_ids, ','); $wpdb->query("DELETE FROM $wpdb->options WHERE option_id IN ($dupe_ids)"); } } make_site_theme(); } function upgrade_160() { global $wpdb, $wp_current_db_version; populate_roles_160(); $users = $wpdb->get_results("SELECT * FROM $wpdb->users"); foreach ( $users as $user ) : if ( !empty( $user->user_firstname ) ) update_usermeta( $user->ID, 'first_name', $wpdb->escape($user->user_firstname) ); if ( !empty( $user->user_lastname ) ) update_usermeta( $user->ID, 'last_name', $wpdb->escape($user->user_lastname) ); if ( !empty( $user->user_nickname ) ) update_usermeta( $user->ID, 'nickname', $wpdb->escape($user->user_nickname) ); if ( !empty( $user->user_level ) ) update_usermeta( $user->ID, $wpdb->prefix . 'user_level', $user->user_level ); if ( !empty( $user->user_icq ) ) update_usermeta( $user->ID, 'icq', $wpdb->escape($user->user_icq) ); if ( !empty( $user->user_aim ) ) update_usermeta( $user->ID, 'aim', $wpdb->escape($user->user_aim) ); if ( !empty( $user->user_msn ) ) update_usermeta( $user->ID, 'msn', $wpdb->escape($user->user_msn) ); if ( !empty( $user->user_yim ) ) update_usermeta( $user->ID, 'yim', $wpdb->escape($user->user_icq) ); if ( !empty( $user->user_description ) ) update_usermeta( $user->ID, 'description', $wpdb->escape($user->user_description) ); if ( isset( $user->user_idmode ) ): $idmode = $user->user_idmode; if ($idmode == 'nickname') $id = $user->user_nickname; if ($idmode == 'login') $id = $user->user_login; if ($idmode == 'firstname') $id = $user->user_firstname; if ($idmode == 'lastname') $id = $user->user_lastname; if ($idmode == 'namefl') $id = $user->user_firstname.' '.$user->user_lastname; if ($idmode == 'namelf') $id = $user->user_lastname.' '.$user->user_firstname; if (!$idmode) $id = $user->user_nickname; $wpdb->query( $wpdb->prepare("UPDATE $wpdb->users SET display_name = %s WHERE ID = %d", $id, $user->ID) ); endif; // FIXME: RESET_CAPS is temporary code to reset roles and caps if flag is set. $caps = get_usermeta( $user->ID, $wpdb->prefix . 'capabilities'); if ( empty($caps) || defined('RESET_CAPS') ) { $level = get_usermeta($user->ID, $wpdb->prefix . 'user_level'); $role = translate_level_to_role($level); update_usermeta( $user->ID, $wpdb->prefix . 'capabilities', array($role => true) ); } endforeach; $old_user_fields = array( 'user_firstname', 'user_lastname', 'user_icq', 'user_aim', 'user_msn', 'user_yim', 'user_idmode', 'user_ip', 'user_domain', 'user_browser', 'user_description', 'user_nickname', 'user_level' ); $wpdb->hide_errors(); foreach ( $old_user_fields as $old ) $wpdb->query("ALTER TABLE $wpdb->users DROP $old"); $wpdb->show_errors(); // populate comment_count field of posts table $comments = $wpdb->get_results( "SELECT comment_post_ID, COUNT(*) as c FROM $wpdb->comments WHERE comment_approved = '1' GROUP BY comment_post_ID" ); if( is_array( $comments ) ) { foreach ($comments as $comment) { $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET comment_count = %d WHERE ID = %d", $comment->c, $comment->comment_post_ID) ); } } // Some alpha versions used a post status of object instead of attachment and put // the mime type in post_type instead of post_mime_type. if ( $wp_current_db_version > 2541 && $wp_current_db_version <= 3091 ) { $objects = $wpdb->get_results("SELECT ID, post_type FROM $wpdb->posts WHERE post_status = 'object'"); foreach ($objects as $object) { $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_status = 'attachment', post_mime_type = %s, post_type = '' WHERE ID = %d", $object->post_type, $object->ID) ); $meta = get_post_meta($object->ID, 'imagedata', true); if ( ! empty($meta['file']) ) update_attached_file( $object->ID, $meta['file'] ); } } } function upgrade_210() { global $wpdb, $wp_current_db_version; if ( $wp_current_db_version < 3506 ) { // Update status and type. $posts = $wpdb->get_results("SELECT ID, post_status FROM $wpdb->posts"); if ( ! empty($posts) ) foreach ($posts as $post) { $status = $post->post_status; $type = 'post'; if ( 'static' == $status ) { $status = 'publish'; $type = 'page'; } else if ( 'attachment' == $status ) { $status = 'inherit'; $type = 'attachment'; } $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_status = %s, post_type = %s WHERE ID = %d", $status, $type, $post->ID) ); } } if ( $wp_current_db_version < 3845 ) { populate_roles_210(); } if ( $wp_current_db_version < 3531 ) { // Give future posts a post_status of future. $now = gmdate('Y-m-d H:i:59'); $wpdb->query ("UPDATE $wpdb->posts SET post_status = 'future' WHERE post_status = 'publish' AND post_date_gmt > '$now'"); $posts = $wpdb->get_results("SELECT ID, post_date FROM $wpdb->posts WHERE post_status ='future'"); if ( !empty($posts) ) foreach ( $posts as $post ) wp_schedule_single_event(mysql2date('U', $post->post_date), 'publish_future_post', array($post->ID)); } } function upgrade_230() { global $wp_current_db_version, $wpdb; if ( $wp_current_db_version < 5200 ) { populate_roles_230(); } // Convert categories to terms. $tt_ids = array(); $have_tags = false; $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_ID"); foreach ($categories as $category) { $term_id = (int) $category->cat_ID; $name = $category->cat_name; $description = $category->category_description; $slug = $category->category_nicename; $parent = $category->category_parent; $term_group = 0; // Associate terms with the same slug in a term group and make slugs unique. if ( $exists = $wpdb->get_results( $wpdb->prepare("SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug) ) ) { $term_group = $exists[0]->term_group; $id = $exists[0]->term_id; $num = 2; do { $alt_slug = $slug . "-$num"; $num++; $slug_check = $wpdb->get_var( $wpdb->prepare("SELECT slug FROM $wpdb->terms WHERE slug = %s", $alt_slug) ); } while ( $slug_check ); $slug = $alt_slug; if ( empty( $term_group ) ) { $term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms GROUP BY term_group") + 1; $wpdb->query( $wpdb->prepare("UPDATE $wpdb->terms SET term_group = %d WHERE term_id = %d", $term_group, $id) ); } } $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->terms (term_id, name, slug, term_group) VALUES (%d, %s, %s, %d)", $term_id, $name, $slug, $term_group) ); $count = 0; if ( !empty($category->category_count) ) { $count = (int) $category->category_count; $taxonomy = 'category'; $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ( %d, %s, %s, %d, %d)", $term_id, $taxonomy, $description, $parent, $count) ); $tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id; } if ( !empty($category->link_count) ) { $count = (int) $category->link_count; $taxonomy = 'link_category'; $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ( %d, %s, %s, %d, %d)", $term_id, $taxonomy, $description, $parent, $count) ); $tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id; } if ( !empty($category->tag_count) ) { $have_tags = true; $count = (int) $category->tag_count; $taxonomy = 'post_tag'; $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ( %d, %s, %s, %d, %d)", $term_id, $taxonomy, $description, $parent, $count) ); $tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id; } if ( empty($count) ) { $count = 0; $taxonomy = 'category'; $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ( %d, %s, %s, %d, %d)", $term_id, $taxonomy, $description, $parent, $count) ); $tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id; } } $select = 'post_id, category_id'; if ( $have_tags ) $select .= ', rel_type'; $posts = $wpdb->get_results("SELECT $select FROM $wpdb->post2cat GROUP BY post_id, category_id"); foreach ( $posts as $post ) { $post_id = (int) $post->post_id; $term_id = (int) $post->category_id; $taxonomy = 'category'; if ( !empty($post->rel_type) && 'tag' == $post->rel_type) $taxonomy = 'tag'; $tt_id = $tt_ids[$term_id][$taxonomy]; if ( empty($tt_id) ) continue; $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ( %d, %d)", $post_id, $tt_id) ); } // < 3570 we used linkcategories. >= 3570 we used categories and link2cat. if ( $wp_current_db_version < 3570 ) { // Create link_category terms for link categories. Create a map of link cat IDs // to link_category terms. $link_cat_id_map = array(); $default_link_cat = 0; $tt_ids = array(); $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM " . $wpdb->prefix . 'linkcategories'); foreach ( $link_cats as $category) { $cat_id = (int) $category->cat_id; $term_id = 0; $name = $wpdb->escape($category->cat_name); $slug = sanitize_title($name); $term_group = 0; // Associate terms with the same slug in a term group and make slugs unique. if ( $exists = $wpdb->get_results( $wpdb->prepare("SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug) ) ) { $term_group = $exists[0]->term_group; $term_id = $exists[0]->term_id; } if ( empty($term_id) ) { $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->terms (name, slug, term_group) VALUES (%s, %s, %d)", $name, $slug, $term_group) ); $term_id = (int) $wpdb->insert_id; } $link_cat_id_map[$cat_id] = $term_id; $default_link_cat = $term_id; $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES (%d, 'link_category', '', '0', '0')", $term_id) ); $tt_ids[$term_id] = (int) $wpdb->insert_id; } // Associate links to cats. $links = $wpdb->get_results("SELECT link_id, link_category FROM $wpdb->links"); if ( !empty($links) ) foreach ( $links as $link ) { if ( 0 == $link->link_category ) continue; if ( ! isset($link_cat_id_map[$link->link_category]) ) continue; $term_id = $link_cat_id_map[$link->link_category]; $tt_id = $tt_ids[$term_id]; if ( empty($tt_id) ) continue; $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ( %d, %d)", $link->link_id, $tt_id) ); } // Set default to the last category we grabbed during the upgrade loop. update_option('default_link_category', $default_link_cat); } else { $links = $wpdb->get_results("SELECT link_id, category_id FROM $wpdb->link2cat GROUP BY link_id, category_id"); foreach ( $links as $link ) { $link_id = (int) $link->link_id; $term_id = (int) $link->category_id; $taxonomy = 'link_category'; $tt_id = $tt_ids[$term_id][$taxonomy]; if ( empty($tt_id) ) continue; $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ( %d, %d)", $link_id, $tt_id) ); } } if ( $wp_current_db_version < 4772 ) { // Obsolete linkcategories table $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'linkcategories'); } // Recalculate all counts $terms = $wpdb->get_results("SELECT term_taxonomy_id, taxonomy FROM $wpdb->term_taxonomy"); foreach ( (array) $terms as $term ) { if ( ('post_tag' == $term->taxonomy) || ('category' == $term->taxonomy) ) $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND post_status = 'publish' AND post_type = 'post' AND term_taxonomy_id = %d", $term->term_taxonomy_id) ); else $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $term->term_taxonomy_id) ); $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET count = %d WHERE term_taxonomy_id = %d", $count, $term->term_taxonomy_id) ); } } function upgrade_230_options_table() { global $wpdb; $old_options_fields = array( 'option_can_override', 'option_type', 'option_width', 'option_height', 'option_description', 'option_admin_level' ); $wpdb->hide_errors(); foreach ( $old_options_fields as $old ) $wpdb->query("ALTER TABLE $wpdb->options DROP $old"); $wpdb->show_errors(); } function upgrade_230_old_tables() { global $wpdb; $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'categories'); $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'link2cat'); $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'post2cat'); } function upgrade_old_slugs() { // upgrade people who were using the Redirect Old Slugs plugin global $wpdb; $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '_wp_old_slug' WHERE meta_key = 'old_slug'"); } function upgrade_250() { global $wp_current_db_version; if ( $wp_current_db_version < 6689 ) { populate_roles_250(); } } function upgrade_251() { global $wp_current_db_version; // Make the secret longer update_option('secret', wp_generate_password(64)); } function upgrade_252() { global $wpdb; $wpdb->query("UPDATE $wpdb->users SET user_activation_key = ''"); } function upgrade_260() { if ( $wp_current_db_version < 8000 ) populate_roles_260(); if ( $wp_current_db_version < 8201 ) { update_option('enable_app', 1); update_option('enable_xmlrpc', 1); } } // The functions we use to actually do stuff // General function maybe_create_table($table_name, $create_ddl) { global $wpdb; foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { if ($table == $table_name) { return true; } } //didn't find it try to create it. $q = $wpdb->query($create_ddl); // we cannot directly tell that whether this succeeded! foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { if ($table == $table_name) { return true; } } return false; } function drop_index($table, $index) { global $wpdb; $wpdb->hide_errors(); $wpdb->query("ALTER TABLE `$table` DROP INDEX `$index`"); // Now we need to take out all the extra ones we may have created for ($i = 0; $i < 25; $i++) { $wpdb->query("ALTER TABLE `$table` DROP INDEX `{$index}_$i`"); } $wpdb->show_errors(); return true; } function add_clean_index($table, $index) { global $wpdb; drop_index($table, $index); $wpdb->query("ALTER TABLE `$table` ADD INDEX ( `$index` )"); return true; } /** ** maybe_add_column() ** Add column to db table if it doesn't exist. ** Returns: true if already exists or on successful completion ** false on error */ function maybe_add_column($table_name, $column_name, $create_ddl) { global $wpdb, $debug; foreach ($wpdb->get_col("DESC $table_name", 0) as $column ) { if ($debug) echo("checking $column == $column_name
    "); if ($column == $column_name) { return true; } } //didn't find it try to create it. $q = $wpdb->query($create_ddl); // we cannot directly tell that whether this succeeded! foreach ($wpdb->get_col("DESC $table_name", 0) as $column ) { if ($column == $column_name) { return true; } } return false; } // get_alloptions as it was for 1.2. function get_alloptions_110() { global $wpdb; if ($options = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options")) { foreach ($options as $option) { // "When trying to design a foolproof system, // never underestimate the ingenuity of the fools :)" -- Dougal if ('siteurl' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value); if ('home' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value); if ('category_base' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value); $all_options->{$option->option_name} = stripslashes($option->option_value); } } return $all_options; } // Version of get_option that is private to install/upgrade. function __get_option($setting) { global $wpdb; if ( $setting == 'home' && defined( 'WP_HOME' ) ) { return preg_replace( '|/+$|', '', constant( 'WP_HOME' ) ); } if ( $setting == 'siteurl' && defined( 'WP_SITEURL' ) ) { return preg_replace( '|/+$|', '', constant( 'WP_SITEURL' ) ); } $option = $wpdb->get_var( $wpdb->prepare("SELECT option_value FROM $wpdb->options WHERE option_name = %s", $setting) ); if ( 'home' == $setting && '' == $option ) return __get_option('siteurl'); if ( 'siteurl' == $setting || 'home' == $setting || 'category_base' == $setting ) $option = preg_replace('|/+$|', '', $option); @ $kellogs = unserialize($option); if ($kellogs !== FALSE) return $kellogs; else return $option; } function deslash($content) { // Note: \\\ inside a regex denotes a single backslash. // Replace one or more backslashes followed by a single quote with // a single quote. $content = preg_replace("/\\\+'/", "'", $content); // Replace one or more backslashes followed by a double quote with // a double quote. $content = preg_replace('/\\\+"/', '"', $content); // Replace one or more backslashes with one backslash. $content = preg_replace("/\\\+/", "\\", $content); return $content; } function dbDelta($queries, $execute = true) { global $wpdb; // Separate individual queries into an array if( !is_array($queries) ) { $queries = explode( ';', $queries ); if('' == $queries[count($queries) - 1]) array_pop($queries); } $cqueries = array(); // Creation Queries $iqueries = array(); // Insertion Queries $for_update = array(); // Create a tablename index for an array ($cqueries) of queries foreach($queries as $qry) { if(preg_match("|CREATE TABLE ([^ ]*)|", $qry, $matches)) { $cqueries[strtolower($matches[1])] = $qry; $for_update[$matches[1]] = 'Created table '.$matches[1]; } else if(preg_match("|CREATE DATABASE ([^ ]*)|", $qry, $matches)) { array_unshift($cqueries, $qry); } else if(preg_match("|INSERT INTO ([^ ]*)|", $qry, $matches)) { $iqueries[] = $qry; } else if(preg_match("|UPDATE ([^ ]*)|", $qry, $matches)) { $iqueries[] = $qry; } else { // Unrecognized query type } } // Check to see which tables and fields exist if($tables = $wpdb->get_col('SHOW TABLES;')) { // For every table in the database foreach($tables as $table) { // If a table query exists for the database table... if( array_key_exists(strtolower($table), $cqueries) ) { // Clear the field and index arrays unset($cfields); unset($indices); // Get all of the field names in the query from between the parens preg_match("|\((.*)\)|ms", $cqueries[strtolower($table)], $match2); $qryline = trim($match2[1]); // Separate field lines into an array $flds = explode("\n", $qryline); //echo "
    \n".print_r(strtolower($table), true).":\n".print_r($cqueries, true)."

    "; // For every field line specified in the query foreach($flds as $fld) { // Extract the field name preg_match("|^([^ ]*)|", trim($fld), $fvals); $fieldname = $fvals[1]; // Verify the found field name $validfield = true; switch(strtolower($fieldname)) { case '': case 'primary': case 'index': case 'fulltext': case 'unique': case 'key': $validfield = false; $indices[] = trim(trim($fld), ", \n"); break; } $fld = trim($fld); // If it's a valid field, add it to the field array if($validfield) { $cfields[strtolower($fieldname)] = trim($fld, ", \n"); } } // Fetch the table column structure from the database $tablefields = $wpdb->get_results("DESCRIBE {$table};"); // For every field in the table foreach($tablefields as $tablefield) { // If the table field exists in the field array... if(array_key_exists(strtolower($tablefield->Field), $cfields)) { // Get the field type from the query preg_match("|".$tablefield->Field." ([^ ]*( unsigned)?)|i", $cfields[strtolower($tablefield->Field)], $matches); $fieldtype = $matches[1]; // Is actual field type different from the field type in query? if($tablefield->Type != $fieldtype) { // Add a query to change the column type $cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN {$tablefield->Field} " . $cfields[strtolower($tablefield->Field)]; $for_update[$table.'.'.$tablefield->Field] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}"; } // Get the default value from the array //echo "{$cfields[strtolower($tablefield->Field)]}
    "; if(preg_match("| DEFAULT '(.*)'|i", $cfields[strtolower($tablefield->Field)], $matches)) { $default_value = $matches[1]; if($tablefield->Default != $default_value) { // Add a query to change the column's default value $cqueries[] = "ALTER TABLE {$table} ALTER COLUMN {$tablefield->Field} SET DEFAULT '{$default_value}'"; $for_update[$table.'.'.$tablefield->Field] = "Changed default value of {$table}.{$tablefield->Field} from {$tablefield->Default} to {$default_value}"; } } // Remove the field from the array (so it's not added) unset($cfields[strtolower($tablefield->Field)]); } else { // This field exists in the table, but not in the creation queries? } } // For every remaining field specified for the table foreach($cfields as $fieldname => $fielddef) { // Push a query line into $cqueries that adds the field to that table $cqueries[] = "ALTER TABLE {$table} ADD COLUMN $fielddef"; $for_update[$table.'.'.$fieldname] = 'Added column '.$table.'.'.$fieldname; } // Index stuff goes here // Fetch the table index structure from the database $tableindices = $wpdb->get_results("SHOW INDEX FROM {$table};"); if($tableindices) { // Clear the index array unset($index_ary); // For every index in the table foreach($tableindices as $tableindex) { // Add the index to the index data array $keyname = $tableindex->Key_name; $index_ary[$keyname]['columns'][] = array('fieldname' => $tableindex->Column_name, 'subpart' => $tableindex->Sub_part); $index_ary[$keyname]['unique'] = ($tableindex->Non_unique == 0)?true:false; } // For each actual index in the index array foreach($index_ary as $index_name => $index_data) { // Build a create string to compare to the query $index_string = ''; if($index_name == 'PRIMARY') { $index_string .= 'PRIMARY '; } else if($index_data['unique']) { $index_string .= 'UNIQUE '; } $index_string .= 'KEY '; if($index_name != 'PRIMARY') { $index_string .= $index_name; } $index_columns = ''; // For each column in the index foreach($index_data['columns'] as $column_data) { if($index_columns != '') $index_columns .= ','; // Add the field to the column list string $index_columns .= $column_data['fieldname']; if($column_data['subpart'] != '') { $index_columns .= '('.$column_data['subpart'].')'; } } // Add the column list to the index create string $index_string .= ' ('.$index_columns.')'; if(!(($aindex = array_search($index_string, $indices)) === false)) { unset($indices[$aindex]); //echo "
    {$table}:
    Found index:".$index_string."
    \n"; } //else echo "
    {$table}:
    Did not find index:".$index_string."
    ".print_r($indices, true)."
    \n"; } } // For every remaining index specified for the table foreach ( (array) $indices as $index ) { // Push a query line into $cqueries that adds the index to that table $cqueries[] = "ALTER TABLE {$table} ADD $index"; $for_update[$table.'.'.$fieldname] = 'Added index '.$table.' '.$index; } // Remove the original table creation query from processing unset($cqueries[strtolower($table)]); unset($for_update[strtolower($table)]); } else { // This table exists in the database, but not in the creation queries? } } } $allqueries = array_merge($cqueries, $iqueries); if($execute) { foreach($allqueries as $query) { //echo "
    ".print_r($query, true)."
    \n"; $wpdb->query($query); } } return $for_update; } function make_db_current() { global $wp_queries; $alterations = dbDelta($wp_queries); echo "
      \n"; foreach($alterations as $alteration) echo "
    1. $alteration
    2. \n"; echo "
    \n"; } function make_db_current_silent() { global $wp_queries; $alterations = dbDelta($wp_queries); } function make_site_theme_from_oldschool($theme_name, $template) { $home_path = get_home_path(); $site_dir = WP_CONTENT_DIR . "/themes/$template"; if (! file_exists("$home_path/index.php")) return false; // Copy files from the old locations to the site theme. // TODO: This does not copy arbitarary include dependencies. Only the // standard WP files are copied. $files = array('index.php' => 'index.php', 'wp-layout.css' => 'style.css', 'wp-comments.php' => 'comments.php', 'wp-comments-popup.php' => 'comments-popup.php'); foreach ($files as $oldfile => $newfile) { if ($oldfile == 'index.php') $oldpath = $home_path; else $oldpath = ABSPATH; if ($oldfile == 'index.php') { // Check to make sure it's not a new index $index = implode('', file("$oldpath/$oldfile")); if (strpos($index, 'WP_USE_THEMES') !== false) { if (! @copy(WP_CONTENT_DIR . '/themes/default/index.php', "$site_dir/$newfile")) return false; continue; // Don't copy anything } } if (! @copy("$oldpath/$oldfile", "$site_dir/$newfile")) return false; chmod("$site_dir/$newfile", 0777); // Update the blog header include in each file. $lines = explode("\n", implode('', file("$site_dir/$newfile"))); if ($lines) { $f = fopen("$site_dir/$newfile", 'w'); foreach ($lines as $line) { if (preg_match('/require.*wp-blog-header/', $line)) $line = '//' . $line; // Update stylesheet references. $line = str_replace("/wp-layout.css", "", $line); // Update comments template inclusion. $line = str_replace("", "", $line); fwrite($f, "{$line}\n"); } fclose($f); } } // Add a theme header. $header = "/*\nTheme Name: $theme_name\nTheme URI: " . __get_option('siteurl') . "\nDescription: A theme automatically created by the upgrade.\nVersion: 1.0\nAuthor: Moi\n*/\n"; $stylelines = file_get_contents("$site_dir/style.css"); if ($stylelines) { $f = fopen("$site_dir/style.css", 'w'); fwrite($f, $header); fwrite($f, $stylelines); fclose($f); } return true; } function make_site_theme_from_default($theme_name, $template) { $site_dir = WP_CONTENT_DIR . "/themes/$template"; $default_dir = WP_CONTENT_DIR . '/themes/default'; // Copy files from the default theme to the site theme. //$files = array('index.php', 'comments.php', 'comments-popup.php', 'footer.php', 'header.php', 'sidebar.php', 'style.css'); $theme_dir = @ opendir("$default_dir"); if ($theme_dir) { while(($theme_file = readdir( $theme_dir )) !== false) { if (is_dir("$default_dir/$theme_file")) continue; if (! @copy("$default_dir/$theme_file", "$site_dir/$theme_file")) return; chmod("$site_dir/$theme_file", 0777); } } @closedir($theme_dir); // Rewrite the theme header. $stylelines = explode("\n", implode('', file("$site_dir/style.css"))); if ($stylelines) { $f = fopen("$site_dir/style.css", 'w'); foreach ($stylelines as $line) { if (strpos($line, 'Theme Name:') !== false) $line = 'Theme Name: ' . $theme_name; elseif (strpos($line, 'Theme URI:') !== false) $line = 'Theme URI: ' . __get_option('url'); elseif (strpos($line, 'Description:') !== false) $line = 'Description: Your theme.'; elseif (strpos($line, 'Version:') !== false) $line = 'Version: 1'; elseif (strpos($line, 'Author:') !== false) $line = 'Author: You'; fwrite($f, $line . "\n"); } fclose($f); } // Copy the images. umask(0); if (! mkdir("$site_dir/images", 0777)) { return false; } $images_dir = @ opendir("$default_dir/images"); if ($images_dir) { while(($image = readdir($images_dir)) !== false) { if (is_dir("$default_dir/images/$image")) continue; if (! @copy("$default_dir/images/$image", "$site_dir/images/$image")) return; chmod("$site_dir/images/$image", 0777); } } @closedir($images_dir); } // Create a site theme from the default theme. function make_site_theme() { // Name the theme after the blog. $theme_name = __get_option('blogname'); $template = sanitize_title($theme_name); $site_dir = WP_CONTENT_DIR . "/themes/$template"; // If the theme already exists, nothing to do. if ( is_dir($site_dir)) { return false; } // We must be able to write to the themes dir. if (! is_writable(WP_CONTENT_DIR . "/themes")) { return false; } umask(0); if (! mkdir($site_dir, 0777)) { return false; } if (file_exists(ABSPATH . 'wp-layout.css')) { if (! make_site_theme_from_oldschool($theme_name, $template)) { // TODO: rm -rf the site theme directory. return false; } } else { if (! make_site_theme_from_default($theme_name, $template)) // TODO: rm -rf the site theme directory. return false; } // Make the new site theme active. $current_template = __get_option('template'); if ($current_template == 'default') { update_option('template', $template); update_option('stylesheet', $template); } return $template; } function translate_level_to_role($level) { switch ($level) { case 10: case 9: case 8: return 'administrator'; case 7: case 6: case 5: return 'editor'; case 4: case 3: case 2: return 'author'; case 1: return 'contributor'; case 0: return 'subscriber'; } } function wp_check_mysql_version() { global $wpdb; $result = $wpdb->check_database_version(); if ( is_wp_error( $result ) ) die( $result->get_error_message() ); } function maybe_disable_automattic_widgets() { $plugins = __get_option( 'active_plugins' ); foreach ( (array) $plugins as $plugin ) { if ( basename( $plugin ) == 'widgets.php' ) { array_splice( $plugins, array_search( $plugin, $plugins ), 1 ); update_option( 'active_plugins', $plugins ); break; } } } ?> wp/dev/wp-admin/includes/user.php0000644000106600010660000003156611043033365014224 0ustar id || $wp_roles->role_objects[$_POST['role']]->has_cap( 'edit_users' ) ) { $user = new WP_User( $user_id ); $user->set_role( $_POST['role'] ); } } } else { add_action( 'user_register', 'add_user' ); // See above return edit_user(); } } function edit_user( $user_id = 0 ) { global $current_user, $wp_roles, $wpdb; if ( $user_id != 0 ) { $update = true; $user->ID = (int) $user_id; $userdata = get_userdata( $user_id ); $user->user_login = $wpdb->escape( $userdata->user_login ); } else { $update = false; $user = ''; } if ( isset( $_POST['user_login'] )) $user->user_login = wp_specialchars( trim( $_POST['user_login'] )); $pass1 = $pass2 = ''; if ( isset( $_POST['pass1'] )) $pass1 = $_POST['pass1']; if ( isset( $_POST['pass2'] )) $pass2 = $_POST['pass2']; if ( isset( $_POST['role'] ) && current_user_can( 'edit_users' ) ) { if( $user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap( 'edit_users' )) $user->role = $_POST['role']; } if ( isset( $_POST['email'] )) $user->user_email = wp_specialchars( trim( $_POST['email'] )); if ( isset( $_POST['url'] ) ) { $user->user_url = clean_url( trim( $_POST['url'] )); $user->user_url = preg_match('/^(https?|ftps?|mailto|news|irc|gopher|nntp|feed|telnet):/is', $user->user_url) ? $user->user_url : 'http://'.$user->user_url; } if ( isset( $_POST['first_name'] )) $user->first_name = wp_specialchars( trim( $_POST['first_name'] )); if ( isset( $_POST['last_name'] )) $user->last_name = wp_specialchars( trim( $_POST['last_name'] )); if ( isset( $_POST['nickname'] )) $user->nickname = wp_specialchars( trim( $_POST['nickname'] )); if ( isset( $_POST['display_name'] )) $user->display_name = wp_specialchars( trim( $_POST['display_name'] )); if ( isset( $_POST['description'] )) $user->description = trim( $_POST['description'] ); if ( isset( $_POST['jabber'] )) $user->jabber = wp_specialchars( trim( $_POST['jabber'] )); if ( isset( $_POST['aim'] )) $user->aim = wp_specialchars( trim( $_POST['aim'] )); if ( isset( $_POST['yim'] )) $user->yim = wp_specialchars( trim( $_POST['yim'] )); if ( !$update ) $user->rich_editing = 'true'; // Default to true for new users. else if ( isset( $_POST['rich_editing'] ) ) $user->rich_editing = $_POST['rich_editing']; else $user->rich_editing = 'false'; if ( !$update ) $user->admin_color = 'fresh'; // Default to fresh for new users. else if ( isset( $_POST['admin_color'] ) ) $user->admin_color = $_POST['admin_color']; else $user->admin_color = 'fresh'; $errors = new WP_Error(); /* checking that username has been typed */ if ( $user->user_login == '' ) $errors->add( 'user_login', __( 'ERROR: Please enter a username.' )); /* checking the password has been typed twice */ do_action_ref_array( 'check_passwords', array ( $user->user_login, & $pass1, & $pass2 )); if ( $update ) { if ( empty($pass1) && !empty($pass2) ) $errors->add( 'pass', __( 'ERROR: You entered your new password only once.' ), array( 'form-field' => 'pass1' ) ); elseif ( !empty($pass1) && empty($pass2) ) $errors->add( 'pass', __( 'ERROR: You entered your new password only once.' ), array( 'form-field' => 'pass2' ) ); } else { if ( empty($pass1) ) $errors->add( 'pass', __( 'ERROR: Please enter your password.' ), array( 'form-field' => 'pass1' ) ); elseif ( empty($pass2) ) $errors->add( 'pass', __( 'ERROR: Please enter your password twice.' ), array( 'form-field' => 'pass2' ) ); } /* Check for "\" in password */ if( strpos( " ".$pass1, "\\" ) ) $errors->add( 'pass', __( 'ERROR: Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) ); /* checking the password has been typed twice the same */ if ( $pass1 != $pass2 ) $errors->add( 'pass', __( 'ERROR: Please enter the same password in the two password fields.' ), array( 'form-field' => 'pass1' ) ); if (!empty ( $pass1 )) $user->user_pass = $pass1; if ( !$update && !validate_username( $user->user_login ) ) $errors->add( 'user_login', __( 'ERROR: This username is invalid. Please enter a valid username.' )); if (!$update && username_exists( $user->user_login )) $errors->add( 'user_login', __( 'ERROR: This username is already registered. Please choose another one.' )); /* checking e-mail address */ if ( empty ( $user->user_email ) ) { $errors->add( 'user_email', __( 'ERROR: Please enter an e-mail address.' ), array( 'form-field' => 'email' ) ); } else if (!is_email( $user->user_email ) ) { $errors->add( 'user_email', __( "ERROR: The e-mail address isn't correct." ), array( 'form-field' => 'email' ) ); } if ( $errors->get_error_codes() ) return $errors; if ( $update ) { $user_id = wp_update_user( get_object_vars( $user )); } else { $user_id = wp_insert_user( get_object_vars( $user )); wp_new_user_notification( $user_id ); } return $user_id; } function get_author_user_ids() { global $wpdb; $level_key = $wpdb->prefix . 'user_level'; return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) ); } function get_editable_authors( $user_id ) { global $wpdb; $editable = get_editable_user_ids( $user_id ); if( !$editable ) { return false; } else { $editable = join(',', $editable); $authors = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($editable) ORDER BY display_name" ); } return apply_filters('get_editable_authors', $authors); } function get_editable_user_ids( $user_id, $exclude_zeros = true ) { global $wpdb; $user = new WP_User( $user_id ); if ( ! $user->has_cap('edit_others_posts') ) { if ( $user->has_cap('edit_posts') || $exclude_zeros == false ) return array($user->id); else return false; } $level_key = $wpdb->prefix . 'user_level'; $query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", $level_key); if ( $exclude_zeros ) $query .= " AND meta_value != '0'"; return $wpdb->get_col( $query ); } function get_nonauthor_user_ids() { global $wpdb; $level_key = $wpdb->prefix . 'user_level'; return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) ); } function get_others_unpublished_posts($user_id, $type='any') { global $wpdb; $editable = get_editable_user_ids( $user_id ); if ( in_array($type, array('draft', 'pending')) ) $type_sql = " post_status = '$type' "; else $type_sql = " ( post_status = 'draft' OR post_status = 'pending' ) "; $dir = ( 'pending' == $type ) ? 'ASC' : 'DESC'; if( !$editable ) { $other_unpubs = ''; } else { $editable = join(',', $editable); $other_unpubs = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_title, post_author FROM $wpdb->posts WHERE post_type = 'post' AND $type_sql AND post_author IN ($editable) AND post_author != %d ORDER BY post_modified $dir", $user_id) ); } return apply_filters('get_others_drafts', $other_unpubs); } function get_others_drafts($user_id) { return get_others_unpublished_posts($user_id, 'draft'); } function get_others_pending($user_id) { return get_others_unpublished_posts($user_id, 'pending'); } function get_user_to_edit( $user_id ) { $user = new WP_User( $user_id ); $user->user_login = attribute_escape($user->user_login); $user->user_email = attribute_escape($user->user_email); $user->user_url = clean_url($user->user_url); $user->first_name = attribute_escape($user->first_name); $user->last_name = attribute_escape($user->last_name); $user->display_name = attribute_escape($user->display_name); $user->nickname = attribute_escape($user->nickname); $user->aim = attribute_escape($user->aim); $user->yim = attribute_escape($user->yim); $user->jabber = attribute_escape($user->jabber); $user->description = wp_specialchars($user->description); return $user; } function get_users_drafts( $user_id ) { global $wpdb; $query = $wpdb->prepare("SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'draft' AND post_author = %d ORDER BY post_modified DESC", $user_id); $query = apply_filters('get_users_drafts', $query); return $wpdb->get_results( $query ); } function wp_delete_user($id, $reassign = 'novalue') { global $wpdb; $id = (int) $id; if ($reassign == 'novalue') { $post_ids = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id) ); if ($post_ids) { foreach ($post_ids as $post_id) wp_delete_post($post_id); } // Clean links $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->links WHERE link_owner = %d", $id) ); } else { $reassign = (int) $reassign; $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_author = %d WHERE post_author = %d", $reassign, $id) ); $wpdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_owner = %d WHERE link_owner = %d", $reassign, $id) ); } // FINALLY, delete user do_action('delete_user', $id); $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->users WHERE ID = %d", $id) ); $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d", $id) ); wp_cache_delete($id, 'users'); wp_cache_delete($user->user_login, 'userlogins'); wp_cache_delete($user->user_email, 'useremail'); return true; } function wp_revoke_user($id) { $id = (int) $id; $user = new WP_User($id); $user->remove_all_caps(); } // WP_User_Search class // by Mark Jaquith if ( !class_exists('WP_User_Search') ) : class WP_User_Search { var $results; var $search_term; var $page; var $role; var $raw_page; var $users_per_page = 50; var $first_user; var $last_user; var $query_limit; var $query_sort; var $query_from_where; var $total_users_for_query = 0; var $too_many_total_users = false; var $search_errors; function WP_User_Search ($search_term = '', $page = '', $role = '') { // constructor $this->search_term = $search_term; $this->raw_page = ( '' == $page ) ? false : (int) $page; $this->page = (int) ( '' == $page ) ? 1 : $page; $this->role = $role; $this->prepare_query(); $this->query(); $this->prepare_vars_for_template_usage(); $this->do_paging(); } function prepare_query() { global $wpdb; $this->first_user = ($this->page - 1) * $this->users_per_page; $this->query_limit = $wpdb->prepare(" LIMIT %d, %d", $this->first_user, $this->users_per_page); $this->query_sort = ' ORDER BY user_login'; $search_sql = ''; if ( $this->search_term ) { $searches = array(); $search_sql = 'AND ('; foreach ( array('user_login', 'user_nicename', 'user_email', 'user_url', 'display_name') as $col ) $searches[] = $col . " LIKE '%$this->search_term%'"; $search_sql .= implode(' OR ', $searches); $search_sql .= ')'; } $this->query_from_where = "FROM $wpdb->users"; if ( $this->role ) $this->query_from_where .= $wpdb->prepare(" INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id WHERE $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE %s", '%' . $this->role . '%'); else $this->query_from_where .= " WHERE 1=1"; $this->query_from_where .= " $search_sql"; } function query() { global $wpdb; $this->results = $wpdb->get_col('SELECT ID ' . $this->query_from_where . $this->query_sort . $this->query_limit); if ( $this->results ) $this->total_users_for_query = $wpdb->get_var('SELECT COUNT(ID) ' . $this->query_from_where); // no limit else $this->search_errors = new WP_Error('no_matching_users_found', __('No matching users were found!')); } function prepare_vars_for_template_usage() { $this->search_term = stripslashes($this->search_term); // done with DB, from now on we want slashes gone } function do_paging() { if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results $args = array(); if( ! empty($this->search_term) ) $args['usersearch'] = urlencode($this->search_term); if( ! empty($this->role) ) $args['role'] = urlencode($this->role); $this->paging_text = paginate_links( array( 'total' => ceil($this->total_users_for_query / $this->users_per_page), 'current' => $this->page, 'base' => 'users.php?%_%', 'format' => 'userspage=%#%', 'add_args' => $args ) ); } } function get_results() { return (array) $this->results; } function page_links() { echo $this->paging_text; } function results_are_paged() { if ( $this->paging_text ) return true; return false; } function is_search() { if ( $this->search_term ) return true; return false; } } endif; ?> wp/dev/wp-admin/includes/widgets.php0000644000106600010660000002340211033446331014702 0ustar
      $widget ) : if ( 'all' == $show && in_array( $widget['callback'], $already_shown ) ) // We already showed this multi-widget continue; if ( $search_terms ) { $hit = false; // Simple case-insensitive search. Boolean OR. $search_text = preg_replace( '/[^\w]/', '', $widget['name'] ); if ( isset($widget['description']) ) $search_text .= preg_replace( '/[^\w]/', '', $widget['description'] ); foreach ( $search_terms as $search_term ) { if ( stristr( $search_text, $search_term ) ) { $hit = true; break; } } if ( !$hit ) continue; } $sidebar = is_active_widget( $widget['callback'], $widget['id'] ); if ( ( 'unused' == $show && $sidebar ) || ( 'used' == $show && !$sidebar ) ) continue; ob_start(); $args = wp_list_widget_controls_dynamic_sidebar( array( 0 => array( 'widget_id' => $widget['id'], 'widget_name' => $widget['name'], '_display' => 'template', '_show' => $show ), 1 => $widget['params'][0] ) ); $sidebar_args = call_user_func_array( 'wp_widget_control', $args ); $widget_control_template = ob_get_contents(); ob_end_clean(); $widget_id = $widget['id']; // save this for later in case we mess with $widget['id'] $is_multi = false !== strpos( $widget_control_template, '%i%' ); if ( !$sidebar || $is_multi ) { $add_query = array( 'sidebar' => $sidebar, 'key' => false, 'edit' => false ); if ( 'all' == $show && $is_multi ) { // it's a multi-widget. We only need to show it in the list once. $already_shown[] = $widget['callback']; $num = (int) array_pop( $ids = explode( '-', $widget['id'] ) ); $id_base = $wp_registered_widget_controls[$widget['id']]['id_base']; // so that we always add a new one when clicking "add" while ( isset($wp_registered_widgets["$id_base-$num"]) ) $num++; $widget['id'] = "$id_base-$num"; $add_query['base'] = $id_base; $add_query['key'] = $num; $add_query['sidebar'] = $GLOBALS['sidebar']; } $add_query['add'] = $widget['id']; $action = 'add'; $add_url = clean_url( wp_nonce_url( add_query_arg( $add_query ), "add-widget_$widget[id]" ) ); } else { $action = 'edit'; $edit_url = clean_url( add_query_arg( array( 'sidebar' => $sidebar, 'edit' => $widget['id'], 'key' => array_search( $widget['id'], $sidebars_widgets[$sidebar] ), ) ) ); $widget_control_template = ''; } $widget_control_template = $sidebar_args['before_widget'] . $widget_control_template . $sidebar_args['after_widget']; $no_widgets_shown = false; if ( 'all' != $show && $sidebar_args['_widget_title'] ) $widget_title = $sidebar_args['_widget_title']; else $widget_title = $widget['name']; ?>


      "; ?>
    \n"; $params[0]['after_widget'] = ""; $params[0]['before_title'] = "%BEG_OF_TITLE%"; $params[0]['after_title'] = "%END_OF_TITLE%"; if ( is_callable( $wp_registered_widgets[$widget_id]['callback'] ) ) { $wp_registered_widgets[$widget_id]['_callback'] = $wp_registered_widgets[$widget_id]['callback']; $wp_registered_widgets[$widget_id]['callback'] = 'wp_widget_control'; } return $params; } /* * Meta widget used to display the control form for a widget. Called from dynamic_sidebar() */ function wp_widget_control( $sidebar_args ) { global $wp_registered_widgets, $wp_registered_widget_controls, $sidebars_widgets, $edit_widget; $widget_id = $sidebar_args['widget_id']; $sidebar_id = isset($sidebar_args['id']) ? $sidebar_args['id'] : false; $control = $wp_registered_widget_controls[$widget_id]; $widget = $wp_registered_widgets[$widget_id]; $key = $sidebar_id ? array_search( $widget_id, $sidebars_widgets[$sidebar_id] ) : 'no-key'; // position of widget in sidebar $edit = -1 < $edit_widget && is_numeric($key) && $edit_widget === $key; // (bool) are we currently editing this widget $id_format = $widget['id']; // We aren't showing a widget control, we're outputing a template for a mult-widget control if ( 'all' == $sidebar_args['_show'] && 'template' == $sidebar_args['_display'] && isset($control['params'][0]['number']) ) { // number == -1 implies a template where id numbers are replaced by a generic '%i%' $control['params'][0]['number'] = -1; // if given, id_base means widget id's should be constructed like {$id_base}-{$id_number} if ( isset($control['id_base']) ) $id_format = $control['id_base'] . '-%i%'; } $widget_title = ''; // We grab the normal widget output to find the widget's title if ( ( 'all' != $sidebar_args['_show'] || 'template' != $sidebar_args['_display'] ) && is_callable( $widget['_callback'] ) ) { ob_start(); $args = func_get_args(); call_user_func_array( $widget['_callback'], $args ); $widget_title = ob_get_clean(); $widget_title = wp_widget_control_ob_filter( $widget_title ); } $wp_registered_widgets[$widget_id]['callback'] = $wp_registered_widgets[$widget_id]['_callback']; unset($wp_registered_widgets[$widget_id]['_callback']); if ( $widget_title && $widget_title != $sidebar_args['widget_name'] ) $widget_title = sprintf( _c('%1$s: %2$s|1: widget name, 2: widget title' ), $sidebar_args['widget_name'], $widget_title ); else $widget_title = wp_specialchars( strip_tags( $sidebar_args['widget_name'] ) ); $sidebar_args['_widget_title'] = $widget_title; if ( empty($sidebar_args['_display']) || 'template' != $sidebar_args['_display'] ) echo $sidebar_args['before_widget']; ?>


    > ' . __('There are no options for this widget.') . '

    '; ?>
    ">
    wp/dev/wp-admin/includes/template.php0000644000106600010660000012777111042371454015070 0ustar 0); if ( !empty($_GET['s']) ) $args['search'] = $_GET['s']; $categories = get_categories( $args ); } if ( !$categories ) return false; $children = _get_term_hierarchy('category'); $start = ($page - 1) * $per_page; $end = $start + $per_page; $i = -1; ob_start(); foreach ( $categories as $category ) { if ( $count >= $end ) break; $i++; if ( $category->parent != $parent ) continue; // If the page starts in a subtree, print the parents. if ( $count == $start && $category->parent > 0 ) { $my_parents = array(); $my_parent = $category->parent; while ( $my_parent) { $my_parent = get_category($my_parent); $my_parents[] = $my_parent; if ( !$my_parent->parent ) break; $my_parent = $my_parent->parent; } $num_parents = count($my_parents); while( $my_parent = array_pop($my_parents) ) { echo "\t" . _cat_row( $my_parent, $level - $num_parents ); $num_parents--; } } if ( $count >= $start ) echo "\t" . _cat_row( $category, $level ); unset($categories[$i]); // Prune the working set $count++; if ( isset($children[$category->term_id]) ) _cat_rows( $categories, $count, $category->term_id, $level + 1, $page, $per_page ); } $output = ob_get_contents(); ob_end_clean(); $output = apply_filters('cat_rows', $output); echo $output; } function _cat_row( $category, $level, $name_override = false ) { global $class; $category = get_category( $category ); $pad = str_repeat( '— ', $level ); $name = ( $name_override ? $name_override : $pad . ' ' . $category->name ); if ( current_user_can( 'manage_categories' ) ) { $edit = "name)) . "'>$name"; } else { $edit = $name; } $class = " class='alternate'" == $class ? '' : " class='alternate'"; $category->count = number_format_i18n( $category->count ); $posts_count = ( $category->count > 0 ) ? "$category->count" : $category->count; $output = " "; if ( absint(get_option( 'default_category' ) ) != $category->term_id ) { $output .= ""; } else { $output .= " "; } $output .= " $edit $category->description $posts_count\n\t\n"; return apply_filters('cat_row', $output); } function link_cat_row( $category ) { global $class; if ( !$category = get_term( $category, 'link_category' ) ) return false; if ( is_wp_error( $category ) ) return $category; $name = ( $name_override ? $name_override : $category->name ); if ( current_user_can( 'manage_categories' ) ) { $edit = "name)) . "' class='edit'>$name"; $default_cat_id = (int) get_option( 'default_link_category' ); } else { $edit = $name; } $class = " class='alternate'" == $class ? '' : " class='alternate'"; $category->count = number_format_i18n( $category->count ); $count = ( $category->count > 0 ) ? "$category->count" : $category->count; $output = " "; if ( absint( get_option( 'default_link_category' ) ) != $category->term_id ) { $output .= ""; } else { $output .= " "; } $output .= " $edit $category->description $count"; return apply_filters( 'link_cat_row', $output ); } function checked( $checked, $current) { if ( $checked == $current) echo ' checked="checked"'; } function selected( $selected, $current) { if ( $selected == $current) echo ' selected="selected"'; } // // Category Checklists // // Deprecated. Use wp_link_category_checklist function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) { global $post_ID; wp_category_checklist($post_ID); } class Walker_Category_Checklist extends Walker { var $tree_type = 'category'; var $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this function start_lvl(&$output, $depth, $args) { $indent = str_repeat("\t", $depth); $output .= "$indent
      \n"; } function end_lvl(&$output, $depth, $args) { $indent = str_repeat("\t", $depth); $output .= "$indent
    \n"; } function start_el(&$output, $category, $depth, $args) { extract($args); $class = in_array( $category->term_id, $popular_cats ) ? ' class="popular-category"' : ''; $output .= "\n
  • " . ''; } function end_el(&$output, $category, $depth, $args) { $output .= "
  • \n"; } } function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false ) { $walker = new Walker_Category_Checklist; $descendants_and_self = (int) $descendants_and_self; $args = array(); if ( is_array( $selected_cats ) ) $args['selected_cats'] = $selected_cats; elseif ( $post_id ) $args['selected_cats'] = wp_get_post_categories($post_id); else $args['selected_cats'] = array(); if ( is_array( $popular_cats ) ) $args['popular_cats'] = $popular_cats; else $args['popular_cats'] = get_terms( 'category', array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) ); if ( $descendants_and_self ) { $categories = get_categories( "child_of=$descendants_and_self&hierarchical=0&hide_empty=0" ); $self = get_category( $descendants_and_self ); array_unshift( $categories, $self ); } else { $categories = get_categories('get=all'); } // Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache) $checked_categories = array(); for ( $i = 0; isset($categories[$i]); $i++ ) { if ( in_array($categories[$i]->term_id, $args['selected_cats']) ) { $checked_categories[] = $categories[$i]; unset($categories[$i]); } } // Put checked cats on top echo call_user_func_array(array(&$walker, 'walk'), array($checked_categories, 0, $args)); // Then the rest of them echo call_user_func_array(array(&$walker, 'walk'), array($categories, 0, $args)); } function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $echo = true ) { global $post_ID; if ( $post_ID ) $checked_categories = wp_get_post_categories($post_ID); else $checked_categories = array(); $categories = get_terms( $taxonomy, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => $number, 'hierarchical' => false ) ); $popular_ids = array(); foreach ( (array) $categories as $category ) { $popular_ids[] = $category->term_id; if ( !$echo ) // hack for AJAX use continue; $id = "popular-category-$category->term_id"; ?> term_id; $name = wp_specialchars( apply_filters('the_category', $category->name)); $checked = in_array( $cat_id, $checked_categories ); echo '"; } } // Tag stuff // Returns a single tag row (see tag_rows below) // Note: this is also used in admin-ajax.php! function _tag_row( $tag, $class = '' ) { $count = number_format_i18n( $tag->count ); $count = ( $count > 0 ) ? "$count" : $count; $name = apply_filters( 'term_name', $tag->name ); $out = ''; $out .= ''; $out .= ' '; $out .= '' . $name . ''; $out .= "$count"; $out .= ''; return $out; } // Outputs appropriate rows for the Nth page of the Tag Management screen, // assuming M tags displayed at a time on the page // Returns the number of tags displayed function tag_rows( $page = 1, $pagesize = 20, $searchterms = '' ) { // Get a page worth of tags $start = ($page - 1) * $pagesize; $args = array('offset' => $start, 'number' => $pagesize, 'hide_empty' => 0); if ( !empty( $searchterms ) ) { $args['search'] = $searchterms; } $tags = get_terms( 'post_tag', $args ); // convert it to table rows $out = ''; $class = ''; $count = 0; foreach( $tags as $tag ) $out .= _tag_row( $tag, ++$count % 2 ? ' class="alternate"' : '' ); // filter and send to screen $out = apply_filters('tag_rows', $out); echo $out; return $count; } // define the columns to display, the syntax is 'internal name' => 'display name' function wp_manage_posts_columns() { $posts_columns = array(); $posts_columns['cb'] = ''; if ( 'draft' === $_GET['post_status'] ) $posts_columns['modified'] = __('Modified'); elseif ( 'pending' === $_GET['post_status'] ) $posts_columns['modified'] = __('Submitted'); else $posts_columns['date'] = __('Date'); $posts_columns['title'] = __('Title'); $posts_columns['author'] = __('Author'); $posts_columns['categories'] = __('Categories'); $posts_columns['tags'] = __('Tags'); if ( !in_array($_GET['post_status'], array('pending', 'draft', 'future')) ) $posts_columns['comments'] = '
    Comments
    '; $posts_columns['status'] = __('Status'); $posts_columns = apply_filters('manage_posts_columns', $posts_columns); return $posts_columns; } // define the columns to display, the syntax is 'internal name' => 'display name' function wp_manage_media_columns() { $posts_columns = array(); $posts_columns['cb'] = ''; $posts_columns['icon'] = ''; $posts_columns['media'] = _c('Media|media column header'); $posts_columns['desc'] = _c('Description|media column header'); $posts_columns['date'] = _c('Date Added|media column header'); $posts_columns['parent'] = _c('Appears with|media column header'); $posts_columns['comments'] = '
    Comments
    '; $posts_columns['location'] = _c('Location|media column header'); $posts_columns = apply_filters('manage_media_columns', $posts_columns); return $posts_columns; } function wp_manage_pages_columns() { $posts_columns = array(); $posts_columns['cb'] = ''; if ( 'draft' === $_GET['post_status'] ) $posts_columns['modified'] = __('Modified'); elseif ( 'pending' === $_GET['post_status'] ) $posts_columns['modified'] = __('Submitted'); else $posts_columns['date'] = __('Date'); $posts_columns['title'] = __('Title'); $posts_columns['author'] = __('Author'); if ( !in_array($_GET['post_status'], array('pending', 'draft', 'future')) ) $posts_columns['comments'] = '
    '; $posts_columns['status'] = __('Status'); $posts_columns = apply_filters('manage_pages_columns', $posts_columns); return $posts_columns; } /* * display one row if the page doesn't have any children * otherwise, display the row and its children in subsequent rows */ function display_page_row( $page, $level = 0 ) { global $post; static $class; $post = $page; setup_postdata($page); $page->post_title = wp_specialchars( $page->post_title ); $pad = str_repeat( '— ', $level ); $id = (int) $page->ID; $class = ('alternate' == $class ) ? '' : 'alternate'; $posts_columns = wp_manage_pages_columns(); $title = get_the_title(); if ( empty($title) ) $title = __('(no title)'); ?> $column_display_name) { switch ($column_name) { case 'cb': ?> post_date && 'date' == $column_name ) { $t_time = $h_time = __('Unpublished'); } else { if ( 'modified' == $column_name ) { $t_time = get_the_modified_time(__('Y/m/d g:i:s A')); $m_time = $page->post_modified; $time = get_post_modified_time('G', true); } else { $t_time = get_the_time(__('Y/m/d g:i:s A')); $m_time = $page->post_date; $time = get_post_time('G', true); } if ( ( abs(time() - $time) ) < 86400 ) { if ( ( 'future' == $page->post_status) ) $h_time = sprintf( __('%s from now'), human_time_diff( $time ) ); else $h_time = sprintf( __('%s ago'), human_time_diff( $time ) ); } else { $h_time = mysql2date(__('Y/m/d'), $m_time); } } ?> "> post_status) _e(' — Private'); ?>
    ID ); $pending_phrase = sprintf( __('%s pending'), number_format( $left ) ); if ( $left ) echo ''; comments_number("" . __('0') . '', "" . __('1') . '', "" . __('%') . ''); if ( $left ) echo ''; ?>
    " rel="permalink"> post_status ) { case 'publish' : case 'private' : _e('Published'); break; case 'future' : _e('Scheduled'); break; case 'pending' : _e('Pending Review'); break; case 'draft' : _e('Unpublished'); break; } ?> 'menu_order') ); if ( ! $pages ) return false; } /* * arrange pages into two parts: top level pages and children_pages * children_pages is two dimensional array, eg. * children_pages[10][] contains all sub-pages whose parent is 10. * It only takes O(N) to arrange this and it takes O(1) for subsequent lookup operations * If searching, ignore hierarchy and treat everything as top level */ if ( empty($_GET['s']) ) { $top_level_pages = array(); $children_pages = array(); foreach ( $pages as $page ) { // catch and repair bad pages if ( $page->post_parent == $page->ID ) { $page->post_parent = 0; $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_parent = '0' WHERE ID = %d", $page->ID) ); clean_page_cache( $page->ID ); } if ( 0 == $page->post_parent ) $top_level_pages[] = $page; else $children_pages[ $page->post_parent ][] = $page; } $pages = &$top_level_pages; } $count = 0; $start = ($pagenum - 1) * $per_page; $end = $start + $per_page; foreach ( $pages as $page ) { if ( $count >= $end ) break; if ( $count >= $start ) echo "\t" . display_page_row( $page, $level ); $count++; if ( isset($children_pages) ) _page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page ); } // if it is the last pagenum and there are orphaned pages, display them with paging as well if ( isset($children_pages) && $count < $end ){ foreach( $children_pages as $orphans ){ foreach ( $orphans as $op ) { if ( $count >= $end ) break; if ( $count >= $start ) echo "\t" . display_page_row( $op, 0 ); $count++; } } } } /* * Given a top level page ID, display the nested hierarchy of sub-pages * together with paging support */ function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page ) { if ( ! isset( $children_pages[$parent] ) ) return; $start = ($pagenum - 1) * $per_page; $end = $start + $per_page; foreach ( $children_pages[$parent] as $page ) { if ( $count >= $end ) break; // If the page starts in a subtree, print the parents. if ( $count == $start && $page->post_parent > 0 ) { $my_parents = array(); $my_parent = $page->post_parent; while ( $my_parent) { $my_parent = get_post($my_parent); $my_parents[] = $my_parent; if ( !$my_parent->post_parent ) break; $my_parent = $my_parent->post_parent; } $num_parents = count($my_parents); while( $my_parent = array_pop($my_parents) ) { echo "\t" . display_page_row( $my_parent, $level - $num_parents ); $num_parents--; } } if ( $count >= $start ) echo "\t" . display_page_row( $page, $level ); $count++; _page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page ); } unset( $children_pages[$parent] ); //required in order to keep track of orphans } function user_row( $user_object, $style = '', $role = '' ) { global $wp_roles; $current_user = wp_get_current_user(); if ( !( is_object( $user_object) && is_a( $user_object, 'WP_User' ) ) ) $user_object = new WP_User( (int) $user_object ); $email = $user_object->user_email; $url = $user_object->user_url; $short_url = str_replace( 'http://', '', $url ); $short_url = str_replace( 'www.', '', $short_url ); if ('/' == substr( $short_url, -1 )) $short_url = substr( $short_url, 0, -1 ); if ( strlen( $short_url ) > 35 ) $short_url = substr( $short_url, 0, 32 ).'...'; $numposts = get_usernumposts( $user_object->ID ); if ( current_user_can( 'edit_user', $user_object->ID ) ) { if ($current_user->ID == $user_object->ID) { $edit = 'profile.php'; } else { $edit = clean_url( add_query_arg( 'wp_http_referer', urlencode( clean_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), "user-edit.php?user_id=$user_object->ID" ) ); } $edit = "$user_object->user_login"; } else { $edit = $user_object->user_login; } $role_name = $wp_roles->role_names[$role] ? translate_with_context($wp_roles->role_names[$role]) : __('None'); $r = " $edit $user_object->first_name $user_object->last_name $email $role_name"; $r .= "\n\t\t"; if ( $numposts > 0 ) { $r .= ""; $r .= $numposts; $r .= ''; } else { $r .= 0; } $r .= "\n\t"; return $r; } function _wp_get_comment_list( $status = '', $s = false, $start, $num ) { global $wpdb; $start = abs( (int) $start ); $num = (int) $num; if ( 'moderated' == $status ) $approved = "comment_approved = '0'"; elseif ( 'approved' == $status ) $approved = "comment_approved = '1'"; elseif ( 'spam' == $status ) $approved = "comment_approved = 'spam'"; else $approved = "( comment_approved = '0' OR comment_approved = '1' )"; if ( $s ) { $s = $wpdb->escape($s); $comments = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments WHERE (comment_author LIKE '%$s%' OR comment_author_email LIKE '%$s%' OR comment_author_url LIKE ('%$s%') OR comment_author_IP LIKE ('%$s%') OR comment_content LIKE ('%$s%') ) AND $approved ORDER BY comment_date_gmt DESC LIMIT $start, $num"); } else { $comments = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments USE INDEX (comment_date_gmt) WHERE $approved ORDER BY comment_date_gmt DESC LIMIT $start, $num" ); } update_comment_cache($comments); $total = $wpdb->get_var( "SELECT FOUND_ROWS()" ); return array($comments, $total); } function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true ) { global $comment, $post; $comment = get_comment( $comment_id ); $post = get_post($comment->comment_post_ID); $authordata = get_userdata($post->post_author); $the_comment_status = wp_get_comment_status($comment->comment_ID); $class = ('unapproved' == $the_comment_status) ? 'unapproved' : ''; if ( current_user_can( 'edit_post', $post->ID ) ) { $post_link = ""; $post_link .= get_the_title($comment->comment_post_ID) . ''; $edit_link_start = ""; $edit_link_end = ''; } else { $post_link = get_the_title($comment->comment_post_ID); $edit_link_start = $edit_link_end =''; } $author_url = get_comment_author_url(); if ( 'http://' == $author_url ) $author_url = ''; $author_url_display = $author_url; if ( strlen($author_url_display) > 50 ) $author_url_display = substr($author_url_display, 0, 49) . '...'; $ptime = date('G', strtotime( $comment->comment_date ) ); if ( ( abs(time() - $ptime) ) < 86400 ) $ptime = sprintf( __('%s ago'), human_time_diff( $ptime ) ); else $ptime = mysql2date(__('Y/m/d \a\t g:i A'), $comment->comment_date ); $delete_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); $approve_url = clean_url( wp_nonce_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) ); $unapprove_url = clean_url( wp_nonce_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "unapprove-comment_$comment->comment_ID" ) ); $spam_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); ?> comment_post_ID) ) { ?>


    | ID ) ) : ?> comment_author_email) ): ?> |

    comment_post_ID) ) { $actions['approve'] = "" . __( 'Approve' ) . ' | '; $actions['unapprove'] = "" . __( 'Unapprove' ) . ' | '; // we're looking at list of only approved or only unapproved comments if ( 'moderated' == $comment_status ) { $actions['approve'] = "" . __( 'Approve' ) . ' | '; unset($actions['unapprove']); } elseif ( 'approved' == $comment_status ) { $actions['unapprove'] = "" . __( 'Unapprove' ) . ' | '; unset($actions['approve']); } $actions['spam'] = "" . __( 'Spam' ) . ' | '; $actions['delete'] = "" . __('Delete') . ''; $actions = apply_filters( 'comment_row_actions', $actions, $comment ); foreach ( $actions as $action => $link ) echo "$link"; } ?> 0) ); if ( $categories ) { foreach ( $categories as $category ) { if ( $currentcat != $category->term_id && $parent == $category->parent) { $pad = str_repeat( '– ', $level ); $category->name = wp_specialchars( $category->name ); echo "\n\t"; wp_dropdown_cats( $currentcat, $currentparent, $category->term_id, $level +1, $categories ); } } } else { return false; } } function list_meta( $meta ) { // Exit if no meta if (!$meta ) { echo ' '; //TBODY needed for list-manipulation JS return; } $count = 0; ?> "; } function _list_meta_row( $entry, &$count ) { static $update_nonce = false; if ( !$update_nonce ) $update_nonce = wp_create_nonce( 'add-meta' ); $r = ''; ++ $count; if ( $count % 2 ) $style = 'alternate'; else $style = ''; if ('_' == $entry['meta_key'] { 0 } ) $style .= ' hidden'; if ( is_serialized( $entry['meta_value'] ) ) { if ( is_serialized_string( $entry['meta_value'] ) ) { // this is a serialized string, so we should display it $entry['meta_value'] = maybe_unserialize( $entry['meta_value'] ); } else { // this is a serialized array/object so we should NOT display it --$count; return; } } $entry['meta_key'] = attribute_escape($entry['meta_key']); $entry['meta_value'] = htmlspecialchars($entry['meta_value']); // using a "; $r .= "\n\t\t
    "; $r .= "\n\t\t"; $r .= wp_nonce_field( 'change-meta', '_ajax_nonce', false, false ); $r .= "\n\t"; return $r; } function meta_form() { global $wpdb; $limit = (int) apply_filters( 'postmeta_form_limit', 30 ); $keys = $wpdb->get_col( " SELECT meta_key FROM $wpdb->postmeta WHERE meta_key NOT LIKE '\_%' GROUP BY meta_key ORDER BY meta_id DESC LIMIT $limit" ); if ( $keys ) natcasesort($keys); ?>

    post_status, array('draft', 'pending') ) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true; $tab_index_attribute = ''; if ( (int) $tab_index > 0 ) $tab_index_attribute = " tabindex=\"$tab_index\""; // echo '
    '; $time_adj = time() + (get_option( 'gmt_offset' ) * 3600 ); $post_date = ($for_post) ? $post->post_date : $comment->comment_date; $jj = ($edit) ? mysql2date( 'd', $post_date ) : gmdate( 'd', $time_adj ); $mm = ($edit) ? mysql2date( 'm', $post_date ) : gmdate( 'm', $time_adj ); $aa = ($edit) ? mysql2date( 'Y', $post_date ) : gmdate( 'Y', $time_adj ); $hh = ($edit) ? mysql2date( 'H', $post_date ) : gmdate( 'H', $time_adj ); $mn = ($edit) ? mysql2date( 'i', $post_date ) : gmdate( 'i', $time_adj ); $ss = ($edit) ? mysql2date( 's', $post_date ) : gmdate( 's', $time_adj ); $month = "'; $day = ''; $year = ''; $hour = ''; $minute = ''; printf(_c('%1$s%2$s, %3$s
    @ %4$s : %5$s|1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input'), $month, $day, $year, $hour, $minute); echo "\n\n"; foreach ( array('mm', 'jj', 'aa', 'hh', 'mn') as $timeunit ) echo '' . "\n"; ?> $template"; endforeach; } function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) { global $wpdb, $post_ID; $items = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order", $parent) ); if ( $items ) { foreach ( $items as $item ) { // A page cannot be its own parent. if (!empty ( $post_ID ) ) { if ( $item->ID == $post_ID ) { continue; } } $pad = str_repeat( ' ', $level * 3 ); if ( $item->ID == $default) $current = ' selected="selected"'; else $current = ''; echo "\n\t"; parent_dropdown( $default, $item->ID, $level +1 ); } } else { return false; } } function browse_happy() { $getit = __( 'WordPress recommends a better browser' ); echo ' Browse Happy '; } if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) add_action( 'in_admin_footer', 'browse_happy' ); function the_attachment_links( $id = false ) { $id = (int) $id; $post = & get_post( $id ); if ( $post->post_type != 'attachment' ) return false; $icon = get_attachment_icon( $post->ID ); $attachment_data = wp_get_attachment_metadata( $id ); $thumb = isset( $attachment_data['thumb'] ); ?> role_names as $role => $name ) { $name = translate_with_context($name); if ( $default == $role ) // Make default first in list $p = "\n\t"; else $r .= "\n\t"; } echo $p . $r; } function wp_convert_hr_to_bytes( $size ) { $size = strtolower($size); $bytes = (int) $size; if ( strpos($size, 'k') !== false ) $bytes = intval($size) * 1024; elseif ( strpos($size, 'm') !== false ) $bytes = intval($size) * 1024 * 1024; elseif ( strpos($size, 'g') !== false ) $bytes = intval($size) * 1024 * 1024 * 1024; return $bytes; } function wp_convert_bytes_to_hr( $bytes ) { $units = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB' ); $log = log( $bytes, 1024 ); $power = (int) $log; $size = pow(1024, $log - $power); return $size . $units[$power]; } function wp_max_upload_size() { $u_bytes = wp_convert_hr_to_bytes( ini_get( 'upload_max_filesize' ) ); $p_bytes = wp_convert_hr_to_bytes( ini_get( 'post_max_size' ) ); $bytes = apply_filters( 'upload_size_limit', min($u_bytes, $p_bytes), $u_bytes, $p_bytes ); return $bytes; } function wp_import_upload_form( $action ) { $bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() ); $size = wp_convert_bytes_to_hr( $bytes ); ?>

    ()

    post_name); // just in case if ( strlen($name) ) echo ''; } /** * add_meta_box() - Add a meta box to an edit form * * @since 2.5 * * @param string $id String for use in the 'id' attribute of tags. * @param string $title Title of the meta box * @param string $callback Function that fills the box with the desired content. The function should echo its output. * @param string $page The type of edit page on which to show the box (post, page, link) * @param string $context The context within the page where the boxes should show ('normal', 'advanced') * @param string $priority The priority within the context where the boxes should show ('high', 'low') */ function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $priority = 'default') { global $wp_meta_boxes; if ( !isset($wp_meta_boxes) ) $wp_meta_boxes = array(); if ( !isset($wp_meta_boxes[$page]) ) $wp_meta_boxes[$page] = array(); if ( !isset($wp_meta_boxes[$page][$context]) ) $wp_meta_boxes[$page][$context] = array(); foreach ( array('high', 'core', 'default', 'low') as $a_priority ) { if ( !isset($wp_meta_boxes[$page][$context][$a_priority][$id]) ) continue; // If a core box was previously added or removed by a plugin, don't add. if ( 'core' == $priority ) { // If core box previously deleted, don't add if ( false === $wp_meta_boxes[$page][$context][$a_priority][$id] ) return; // If box was added with default priority, give it core priority to maintain sort order if ( 'default' == $a_priority ) { $wp_meta_boxes[$page][$context]['core'][$id] = $wp_meta_boxes[$page][$context]['default'][$id]; unset($wp_meta_boxes[$page][$context]['default'][$id]); } return; } // If no priority given and id already present, use existing priority if ( empty($priority) ) $priority = $a_priority; // An id can be in only one priority if ( $priority != $a_priority ) unset($wp_meta_boxes[$page][$context][$a_priority][$id]); } if ( empty($priority) ) $priority = low; if ( !isset($wp_meta_boxes[$page][$context][$priority]) ) $wp_meta_boxes[$page][$context][$priority] = array(); $wp_meta_boxes[$page][$context][$priority][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback); } function do_meta_boxes($page, $context, $object) { global $wp_meta_boxes; do_action('do_meta_boxes', $page, $context, $object); if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) ) return; foreach ( array('high', 'core', 'default', 'low') as $priority ) { foreach ( (array) $wp_meta_boxes[$page][$context][$priority] as $box ) { if ( false === $box ) continue; echo '
    ' . "\n"; echo "

    {$box['title']}

    \n"; echo '
    ' . "\n"; call_user_func($box['callback'], $object, $box); echo "
    \n"; echo "
    \n"; } } } /** * remove_meta_box() - Remove a meta box from an edit form * * @since 2.6 * * @param string $id String for use in the 'id' attribute of tags. * @param string $page The type of edit page on which to show the box (post, page, link) * @param string $context The context within the page where the boxes should show ('normal', 'advanced') */ function remove_meta_box($id, $page, $context) { global $wp_meta_boxes; if ( !isset($wp_meta_boxes) ) $wp_meta_boxes = array(); if ( !isset($wp_meta_boxes[$page]) ) $wp_meta_boxes[$page] = array(); if ( !isset($wp_meta_boxes[$page][$context]) ) $wp_meta_boxes[$page][$context] = array(); foreach ( array('high', 'core', 'default', 'low') as $priority ) $wp_meta_boxes[$page][$context][$priority][$id] = false; } ?> wp/dev/wp-admin/includes/class-ftp-pure.php0000644000106600010660000001204210765614603016111 0ustar __construct($verb, $le); } function __construct($verb=FALSE, $le=FALSE) { parent::__construct(false, $verb, $le); } // // // function _settimeout($sock) { if(!@stream_set_timeout($sock, $this->_timeout)) { $this->PushError('_settimeout','socket set send timeout'); $this->_quit(); return FALSE; } return TRUE; } function _connect($host, $port) { $this->SendMSG("Creating socket"); $sock = @fsockopen($host, $port, $errno, $errstr, $this->_timeout); if (!$sock) { $this->PushError('_connect','socket connect failed', $errstr." (".$errno.")"); return FALSE; } $this->_connected=true; return $sock; } function _readmsg($fnction="_readmsg"){ if(!$this->_connected) { $this->PushError($fnction, 'Connect first'); return FALSE; } $result=true; $this->_message=""; $this->_code=0; $go=true; do { $tmp=@fgets($this->_ftp_control_sock, 512); if($tmp===false) { $go=$result=false; $this->PushError($fnction,'Read failed'); } else { $this->_message.=$tmp; if(preg_match("/^([0-9]{3})(-(.*[".CRLF."]{1,2})+\\1)? [^".CRLF."]+[".CRLF."]{1,2}$/", $this->_message, $regs)) $go=false; } } while($go); if($this->LocalEcho) echo "GET < ".rtrim($this->_message, CRLF).CRLF; $this->_code=(int)$regs[1]; return $result; } function _exec($cmd, $fnction="_exec") { if(!$this->_ready) { $this->PushError($fnction,'Connect first'); return FALSE; } if($this->LocalEcho) echo "PUT > ",$cmd,CRLF; $status=@fputs($this->_ftp_control_sock, $cmd.CRLF); if($status===false) { $this->PushError($fnction,'socket write failed'); return FALSE; } $this->_lastaction=time(); if(!$this->_readmsg($fnction)) return FALSE; return TRUE; } function _data_prepare($mode=FTP_ASCII) { if(!$this->_settype($mode)) return FALSE; if($this->_passive) { if(!$this->_exec("PASV", "pasv")) { $this->_data_close(); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); return FALSE; } $ip_port = explode(",", ereg_replace("^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*".CRLF."$", "\\1", $this->_message)); $this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3]; $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]); $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); $this->_ftp_data_sock=@fsockopen($this->_datahost, $this->_dataport, $errno, $errstr, $this->_timeout); if(!$this->_ftp_data_sock) { $this->PushError("_data_prepare","fsockopen fails", $errstr." (".$errno.")"); $this->_data_close(); return FALSE; } else $this->_ftp_data_sock; } else { $this->SendMSG("Only passive connections available!"); return FALSE; } return TRUE; } function _data_read($mode=FTP_ASCII, $fp=NULL) { if(is_resource($fp)) $out=0; else $out=""; if(!$this->_passive) { $this->SendMSG("Only passive connections available!"); return FALSE; } while (!feof($this->_ftp_data_sock)) { $block=fread($this->_ftp_data_sock, $this->_ftp_buff_size); if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_local], $block); if(is_resource($fp)) $out+=fwrite($fp, $block, strlen($block)); else $out.=$block; } return $out; } function _data_write($mode=FTP_ASCII, $fp=NULL) { if(is_resource($fp)) $out=0; else $out=""; if(!$this->_passive) { $this->SendMSG("Only passive connections available!"); return FALSE; } if(is_resource($fp)) { while(!feof($fp)) { $block=fread($fp, $this->_ftp_buff_size); if(!$this->_data_write_block($mode, $block)) return false; } } elseif(!$this->_data_write_block($mode, $fp)) return false; return TRUE; } function _data_write_block($mode, $block) { if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_remote], $block); do { if(($t=@fwrite($this->_ftp_data_sock, $block))===FALSE) { $this->PushError("_data_write","Can't write to socket"); return FALSE; } $block=substr($block, $t); } while(!empty($block)); return true; } function _data_close() { @fclose($this->_ftp_data_sock); $this->SendMSG("Disconnected data from remote host"); return TRUE; } function _quit($force=FALSE) { if($this->_connected or $force) { @fclose($this->_ftp_control_sock); $this->_connected=false; $this->SendMSG("Socket closed"); } } } ?> wp/dev/wp-admin/includes/media.php0000644000106600010660000014506711047641230014327 0ustar __('Choose File'), // handler action suffix => tab text 'gallery' => __('Gallery'), 'library' => __('Media Library'), ); return apply_filters('media_upload_tabs', $_default_tabs); } function update_gallery_tab($tabs) { global $wpdb; if ( !isset($_REQUEST['post_id']) ) { unset($tabs['gallery']); return $tabs; } if ( intval($_REQUEST['post_id']) ) $attachments = intval($wpdb->get_var($wpdb->prepare("SELECT count(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent = %d", $_REQUEST['post_id']))); $tabs['gallery'] = sprintf(__('Gallery (%s)'), "$attachments"); return $tabs; } add_filter('media_upload_tabs', 'update_gallery_tab'); function the_media_upload_tabs() { global $redir_tab; $tabs = media_upload_tabs(); if ( !empty($tabs) ) { echo "
      \n"; if ( isset($redir_tab) && array_key_exists($redir_tab, $tabs) ) $current = $redir_tab; elseif ( isset($_GET['tab']) && array_key_exists($_GET['tab'], $tabs) ) $current = $_GET['tab']; else { $keys = array_keys($tabs); $current = array_shift($keys); } foreach ( $tabs as $callback => $text ) { $class = ''; if ( $current == $callback ) $class = " class='current'"; $href = add_query_arg(array('tab'=>$callback, 's'=>false, 'paged'=>false, 'post_mime_type'=>false, 'm'=>false)); $link = "$text"; echo "\t
    • $link
    • \n"; } echo "
    \n"; } } function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = false, $size='medium') { $html = get_image_tag($id, $alt, $title, $align, $size); $rel = $rel ? ' rel="attachment wp-att-'.attribute_escape($id).'"' : ''; if ( $url ) $html = '$html"; $html = apply_filters( 'image_send_to_editor', $html, $id, $alt, $title, $align, $url, $size ); return $html; } function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) { if ( empty($alt) || apply_filters( 'disable_captions', '' ) ) return $html; $id = ( 0 < (int) $id ) ? 'attachment_' . $id : ''; preg_match( '/width="([0-9]+)/', $html, $matches ); if ( ! isset($matches[1]) ) return $html; $width = $matches[1]; $html = preg_replace( '/align[^\s\'"]+\s?/', '', $html ); if ( empty($align) ) $align = 'none'; $shcode = '[caption id="' . $id . '" align="align' . $align . '" width="' . $width . '" caption="' . $alt . '"]' . $html . '[/caption]'; return apply_filters( 'image_add_caption_shortcode', $shcode, $html ); } add_filter( 'image_send_to_editor', 'image_add_caption', 20, 7 ); function media_send_to_editor($html) { ?> false); $file = wp_handle_upload($_FILES[$file_id], $overrides); if ( isset($file['error']) ) return new WP_Error( 'upload_error', $file['error'] ); $url = $file['url']; $type = $file['type']; $file = $file['file']; $title = preg_replace('/\.[^.]+$/', '', basename($file)); $content = ''; // use image exif/iptc data for title and caption defaults if possible if ( $image_meta = @wp_read_image_metadata($file) ) { if ( trim($image_meta['title']) ) $title = $image_meta['title']; if ( trim($image_meta['caption']) ) $content = $image_meta['caption']; } // Construct the attachment array $attachment = array_merge( array( 'post_mime_type' => $type, 'guid' => $url, 'post_parent' => $post_id, 'post_title' => $title, 'post_content' => $content, ), $post_data ); // Save the data $id = wp_insert_attachment($attachment, $file, $post_parent); if ( !is_wp_error($id) ) { wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) ); } return $id; } function media_handle_sideload($file_array, $post_id, $desc = null, $post_data = array()) { $overrides = array('test_form'=>false); $file = wp_handle_sideload($file_array, $overrides); if ( isset($file['error']) ) return new WP_Error( 'upload_error', $file['error'] ); $url = $file['url']; $type = $file['type']; $file = $file['file']; $title = preg_replace('/\.[^.]+$/', '', basename($file)); $content = ''; // use image exif/iptc data for title and caption defaults if possible if ( $image_meta = @wp_read_image_metadata($file) ) { if ( trim($image_meta['title']) ) $title = $image_meta['title']; if ( trim($image_meta['caption']) ) $content = $image_meta['caption']; } $title = @$desc; // Construct the attachment array $attachment = array_merge( array( 'post_mime_type' => $type, 'guid' => $url, 'post_parent' => $post_id, 'post_title' => $title, 'post_content' => $content, ), $post_data ); // Save the data $id = wp_insert_attachment($attachment, $file, $post_parent); if ( !is_wp_error($id) ) { wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) ); return $url; } return $id; } // wrap iframe content (produced by $content_func) in a doctype, html head/body etc // any additional function args will be passed to content_func function wp_iframe($content_func /* ... */) { ?> > <?php bloginfo('name') ?> › <?php _e('Uploads'); ?> — <?php _e('WordPress'); ?> > $image_title $video_title $audio_title $media_title EOF; printf($context, $out); } add_action( 'media_buttons', 'media_buttons' ); add_action('media_upload_media', 'media_upload_handler'); function media_upload_form_handler() { check_admin_referer('media-form'); if ( !empty($_POST['attachments']) ) foreach ( $_POST['attachments'] as $attachment_id => $attachment ) { $post = $_post = get_post($attachment_id, ARRAY_A); if ( isset($attachment['post_content']) ) $post['post_content'] = $attachment['post_content']; if ( isset($attachment['post_title']) ) $post['post_title'] = $attachment['post_title']; if ( isset($attachment['post_excerpt']) ) $post['post_excerpt'] = $attachment['post_excerpt']; if ( isset($attachment['menu_order']) ) $post['menu_order'] = $attachment['menu_order']; $post = apply_filters('attachment_fields_to_save', $post, $attachment); if ( isset($post['errors']) ) { $errors[$attachment_id] = $post['errors']; unset($post['errors']); } if ( $post != $_post ) wp_update_post($post); foreach ( get_attachment_taxonomies($post) as $t ) if ( isset($attachment[$t]) ) wp_set_object_terms($attachment_id, array_map('trim', preg_split('/,+/', $attachment[$t])), $t, false); } if ( isset($_POST['insert-gallery']) ) return media_send_to_editor('[gallery]'); if ( isset($_POST['send']) ) { $keys = array_keys($_POST['send']); $send_id = (int) array_shift($keys); $attachment = stripslashes_deep( $_POST['attachments'][$send_id] ); $html = $attachment['post_title']; if ( !empty($attachment['url']) ) { if ( strpos($attachment['url'], 'attachment_id') || false !== strpos($attachment['url'], get_permalink($_POST['post_id'])) ) $rel = " rel='attachment wp-att-".attribute_escape($send_id)."'"; $html = "$html"; } $html = apply_filters('media_send_to_editor', $html, $send_id, $attachment); return media_send_to_editor($html); } return $errors; } function media_upload_image() { if ( isset($_POST['html-upload']) && !empty($_FILES) ) { // Upload File button was clicked $id = media_handle_upload('async-upload', $_REQUEST['post_id']); unset($_FILES); if ( is_wp_error($id) ) { $errors['upload_error'] = $id; $id = false; } } if ( !empty($_POST['insertonlybutton']) ) { $src = $_POST['insertonly']['src']; if ( !empty($src) && !strpos($src, '://') ) $src = "http://$src"; $alt = attribute_escape($_POST['insertonly']['alt']); if ( isset($_POST['insertonly']['align']) ) { $align = attribute_escape($_POST['insertonly']['align']); $class = " class='align$align'"; } if ( !empty($src) ) $html = "$alt"; return media_send_to_editor($html); } if ( !empty($_POST) ) { $return = media_upload_form_handler(); if ( is_string($return) ) return $return; if ( is_array($return) ) $errors = $return; } if ( isset($_POST['save']) ) { $errors['upload_notice'] = __('Saved.'); return media_upload_gallery(); } return wp_iframe( 'media_upload_type_form', 'image', $errors, $id ); } function media_sideload_image($file, $post_id, $desc = null) { if (!empty($file) ) { $file_array['name'] = basename($file); $file_array['tmp_name'] = download_url($file); $desc = @$desc; $id = media_handle_sideload($file_array, $post_id, $desc); $src = $id; if ( is_wp_error($id) ) { @unlink($file_array['tmp_name']); return $id; } } if ( !empty($src) ) { $alt = @$desc; $html = "$alt"; return $html; } } function media_upload_audio() { if ( isset($_POST['html-upload']) && !empty($_FILES) ) { // Upload File button was clicked $id = media_handle_upload('async-upload', $_REQUEST['post_id']); unset($_FILES); if ( is_wp_error($id) ) { $errors['upload_error'] = $id; $id = false; } } if ( !empty($_POST['insertonlybutton']) ) { $href = $_POST['insertonly']['href']; if ( !empty($href) && !strpos($href, '://') ) $href = "http://$href"; $title = attribute_escape($_POST['insertonly']['title']); if ( empty($title) ) $title = basename($href); if ( !empty($title) && !empty($href) ) $html = "$title"; return media_send_to_editor($html); } if ( !empty($_POST) ) { $return = media_upload_form_handler(); if ( is_string($return) ) return $return; if ( is_array($return) ) $errors = $return; } if ( isset($_POST['save']) ) { $errors['upload_notice'] = __('Saved.'); return media_upload_gallery(); } return wp_iframe( 'media_upload_type_form', 'audio', $errors, $id ); } function media_upload_video() { if ( isset($_POST['html-upload']) && !empty($_FILES) ) { // Upload File button was clicked $id = media_handle_upload('async-upload', $_REQUEST['post_id']); unset($_FILES); if ( is_wp_error($id) ) { $errors['upload_error'] = $id; $id = false; } } if ( !empty($_POST['insertonlybutton']) ) { $href = $_POST['insertonly']['href']; if ( !empty($href) && !strpos($href, '://') ) $href = "http://$href"; $title = attribute_escape($_POST['insertonly']['title']); if ( empty($title) ) $title = basename($href); if ( !empty($title) && !empty($href) ) $html = "$title"; return media_send_to_editor($html); } if ( !empty($_POST) ) { $return = media_upload_form_handler(); if ( is_string($return) ) return $return; if ( is_array($return) ) $errors = $return; } if ( isset($_POST['save']) ) { $errors['upload_notice'] = __('Saved.'); return media_upload_gallery(); } return wp_iframe( 'media_upload_type_form', 'video', $errors, $id ); } function media_upload_file() { if ( isset($_POST['html-upload']) && !empty($_FILES) ) { // Upload File button was clicked $id = media_handle_upload('async-upload', $_REQUEST['post_id']); unset($_FILES); if ( is_wp_error($id) ) { $errors['upload_error'] = $id; $id = false; } } if ( !empty($_POST['insertonlybutton']) ) { $href = $_POST['insertonly']['href']; if ( !empty($href) && !strpos($href, '://') ) $href = "http://$href"; $title = attribute_escape($_POST['insertonly']['title']); if ( empty($title) ) $title = basename($href); if ( !empty($title) && !empty($href) ) $html = "$title"; return media_send_to_editor($html); } if ( !empty($_POST) ) { $return = media_upload_form_handler(); if ( is_string($return) ) return $return; if ( is_array($return) ) $errors = $return; } if ( isset($_POST['save']) ) { $errors['upload_notice'] = __('Saved.'); return media_upload_gallery(); } return wp_iframe( 'media_upload_type_form', 'file', $errors, $id ); } function media_upload_gallery() { if ( !empty($_POST) ) { $return = media_upload_form_handler(); if ( is_string($return) ) return $return; if ( is_array($return) ) $errors = $return; } wp_enqueue_script('admin-gallery'); return wp_iframe( 'media_upload_gallery_form', $errors ); } function media_upload_library() { if ( !empty($_POST) ) { $return = media_upload_form_handler(); if ( is_string($return) ) return $return; if ( is_array($return) ) $errors = $return; } return wp_iframe( 'media_upload_library_form', $errors ); } function image_attachment_fields_to_edit($form_fields, $post) { if ( substr($post->post_mime_type, 0, 5) == 'image' ) { $form_fields['post_title']['required'] = true; $form_fields['post_excerpt']['label'] = __('Caption'); $form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image'); $form_fields['post_content']['label'] = __('Description'); $thumb = wp_get_attachment_thumb_url($post->ID); $form_fields['align'] = array( 'label' => __('Alignment'), 'input' => 'html', 'html' => " \n", ); $form_fields['image-size'] = array( 'label' => __('Size'), 'input' => 'html', 'html' => " " . ( $thumb ? " " : '' ) . " ", ); } return $form_fields; } add_filter('attachment_fields_to_edit', 'image_attachment_fields_to_edit', 10, 2); function media_single_attachment_fields_to_edit( $form_fields, $post ) { unset($form_fields['url'], $form_fields['align'], $form_fields['image-size']); return $form_fields; } function image_attachment_fields_to_save($post, $attachment) { if ( substr($post['post_mime_type'], 0, 5) == 'image' ) { if ( strlen(trim($post['post_title'])) == 0 ) { $post['post_title'] = preg_replace('/\.\w+$/', '', basename($post['guid'])); $post['errors']['post_title']['errors'][] = __('Empty Title filled from filename.'); } } return $post; } add_filter('attachment_fields_to_save', 'image_attachment_fields_to_save', 10, 2); function image_media_send_to_editor($html, $attachment_id, $attachment) { $post =& get_post($attachment_id); if ( substr($post->post_mime_type, 0, 5) == 'image' ) { $url = $attachment['url']; if ( isset($attachment['align']) ) $align = $attachment['align']; else $align = 'none'; if ( !empty($attachment['image-size']) ) $size = $attachment['image-size']; else $size = 'medium'; $rel = ( $url == get_attachment_link($attachment_id) ); return get_image_send_to_editor($attachment_id, $attachment['post_excerpt'], $attachment['post_title'], $align, $url, $rel, $size); } return $html; } add_filter('media_send_to_editor', 'image_media_send_to_editor', 10, 3); function get_attachment_fields_to_edit($post, $errors = null) { if ( is_int($post) ) $post =& get_post($post); if ( is_array($post) ) $post = (object) $post; $edit_post = sanitize_post($post, 'edit'); $file = wp_get_attachment_url($post->ID); $link = get_attachment_link($post->ID); $form_fields = array( 'post_title' => array( 'label' => __('Title'), 'value' => $edit_post->post_title, ), 'post_excerpt' => array( 'label' => __('Caption'), 'value' => $edit_post->post_excerpt, ), 'post_content' => array( 'label' => __('Description'), 'value' => $edit_post->post_content, 'input' => 'textarea', ), 'url' => array( 'label' => __('Link URL'), 'input' => 'html', 'html' => "
    \n", 'helps' => __('Enter a link URL or click above for presets.'), ), 'menu_order' => array( 'label' => __('Order'), 'value' => $edit_post->menu_order ), ); foreach ( get_attachment_taxonomies($post) as $taxonomy ) { $t = (array) get_taxonomy($taxonomy); if ( empty($t['label']) ) $t['label'] = $taxonomy; if ( empty($t['args']) ) $t['args'] = array(); $terms = get_object_term_cache($post->ID, $taxonomy); if ( empty($terms) ) $terms = wp_get_object_terms($post->ID, $taxonomy, $t['args']); $values = array(); foreach ( $terms as $term ) $values[] = $term->name; $t['value'] = join(', ', $values); $form_fields[$taxonomy] = $t; } // Merge default fields with their errors, so any key passed with the error (e.g. 'error', 'helps', 'value') will replace the default // The recursive merge is easily traversed with array casting: foreach( (array) $things as $thing ) $form_fields = array_merge_recursive($form_fields, (array) $errors); $form_fields = apply_filters('attachment_fields_to_edit', $form_fields, $post); return $form_fields; } function get_media_items( $post_id, $errors ) { if ( $post_id ) { $post = get_post($post_id); if ( $post && $post->post_type == 'attachment' ) $attachments = array($post->ID => $post); else $attachments = get_children( array( 'post_parent' => $post_id, 'post_type' => 'attachment', 'orderby' => 'menu_order ASC, ID', 'order' => 'DESC') ); } else { if ( is_array($GLOBALS['wp_the_query']->posts) ) foreach ( $GLOBALS['wp_the_query']->posts as $attachment ) $attachments[$attachment->ID] = $attachment; } if ( empty($attachments) ) return ''; foreach ( $attachments as $id => $attachment ) if ( $item = get_media_item( $id, array( 'errors' => isset($errors[$id]) ? $errors[$id] : null) ) ) $output .= "\n
    $item\n
    "; return $output; } function get_media_item( $attachment_id, $args = null ) { global $redir_tab; $default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true ); $args = wp_parse_args( $args, $default_args ); extract( $args, EXTR_SKIP ); global $post_mime_types; if ( ( $attachment_id = intval($attachment_id) ) && $thumb_url = get_attachment_icon_src( $attachment_id ) ) $thumb_url = $thumb_url[0]; else return false; $title_label = __('Title'); $description_label = __('Description'); $tags_label = __('Tags'); $toggle_on = __('Show'); $toggle_off = __('Hide'); $post = get_post($attachment_id); $filename = basename($post->guid); $title = attribute_escape($post->post_title); $description = attribute_escape($post->post_content); if ( $_tags = get_the_tags($attachment_id) ) { foreach ( $_tags as $tag ) $tags[] = $tag->name; $tags = attribute_escape(join(', ', $tags)); } if ( isset($post_mime_types) ) { $keys = array_keys(wp_match_mime_types(array_keys($post_mime_types), $post->post_mime_type)); $type = array_shift($keys); $type = ""; } $form_fields = get_attachment_fields_to_edit($post, $errors); if ( $toggle ) { $class = empty($errors) ? 'startclosed' : 'startopen'; $toggle_links = " $toggle_on $toggle_off"; } else { $class = 'form-table'; $toggle_links = ''; } $display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case $display_title = wp_html_excerpt($display_title, 60); $gallery = ( (isset($_REQUEST['tab']) && 'gallery' == $_REQUEST['tab']) || (isset($redir_tab) && 'gallery' == $redir_tab) ) ? true : false; $order = ''; foreach ( $form_fields as $key => $val ) { if ( 'menu_order' == $key ) { if ( $gallery ) $order = ''; else $order = ''; unset($form_fields['menu_order']); break; } } $item = " $type $toggle_links $order
    $display_title
    \n"; $defaults = array( 'input' => 'text', 'required' => false, 'value' => '', 'extra_rows' => array(), ); $delete_href = wp_nonce_url("post.php?action=delete-post&post=$attachment_id", 'delete-post_' . $attachment_id); if ( $send ) $send = ""; if ( $delete ) $delete = "" . __('Delete') . ""; if ( ( $send || $delete ) && !isset($form_fields['buttons']) ) $form_fields['buttons'] = array('tr' => "\t\t\n"); $hidden_fields = array(); foreach ( $form_fields as $id => $field ) { if ( $id{0} == '_' ) continue; if ( !empty($field['tr']) ) { $item .= $field['tr']; continue; } $field = array_merge($defaults, $field); $name = "attachments[$attachment_id][$id]"; if ( $field['input'] == 'hidden' ) { $hidden_fields[$name] = $field['value']; continue; } $required = $field['required'] ? '*' : ''; $aria_required = $field['required'] ? " aria-required='true' " : ''; $class = $id; $class .= $field['required'] ? ' form-required' : ''; $item .= "\t\t\n\t\t\t\n\t\t\t\n\t\t\n"; $extra_rows = array(); if ( !empty($field['errors']) ) foreach ( array_unique((array) $field['errors']) as $error ) $extra_rows['error'][] = $error; if ( !empty($field['extra_rows']) ) foreach ( $field['extra_rows'] as $class => $rows ) foreach ( (array) $rows as $html ) $extra_rows[$class][] = $html; foreach ( $extra_rows as $class => $rows ) foreach ( $rows as $html ) $item .= "\t\t\n"; } if ( !empty($form_fields['_final']) ) $item .= "\t\t\n"; $item .= "\t\n"; $item .= "\t
    $filename
    $post->post_mime_type
    " . mysql2date($post->post_date, get_option('time_format')) . "
    " . apply_filters('media_meta', '', $post) . "
    $send $delete
    " . sprintf(__("You are about to delete %s."), $filename) . " " . __('Continue') . " " . __('Cancel') . "
    "; if ( !empty($field[$field['input']]) ) $item .= $field[$field['input']]; elseif ( $field['input'] == 'textarea' ) { $item .= ""; } else { $item .= ""; } if ( !empty($field['helps']) ) $item .= "

    " . join( "

    \n

    ", array_unique((array) $field['helps']) ) . '

    '; $item .= "
    $html
    {$form_fields['_final']}
    \n"; foreach ( $hidden_fields as $name => $value ) $item .= "\t\n"; return $item; } function media_upload_header() { ?>
    get_error_message(); ?>


    add_query_arg( 'paged', '%#%' ), 'format' => '', 'total' => ceil($wp_query->found_posts / 10), 'current' => $_GET['paged'] )); if ( $page_links ) echo "
    $page_links
    "; ?>
    posts WHERE post_type = 'attachment' ORDER BY post_date DESC"; $arc_result = $wpdb->get_results( $arc_query ); $month_count = count($arc_result); if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) { ?>

    required *

    ' . $alt_help . '


    ' . __('Enter a link URL or click above for presets.') . '

    '; } function type_form_audio() { return '
    *
    *
    ' . __('Link text, e.g. "Still Alive by Jonathan Coulton"') . '
    '; } function type_form_video() { return '
    *
    *
    ' . __('Link text, e.g. "Lucy on YouTube"') . '
    '; } function type_form_file() { return '
    *
    *
    ' . __('Link text, e.g. "Ransom Demands (PDF)"') . '
    '; } // support a GET parameter for disabling the flash uploader function media_upload_use_flash($flash) { if ( array_key_exists('flash', $_REQUEST) ) $flash = !empty($_REQUEST['flash']); return $flash; } add_filter('flash_uploader', 'media_upload_use_flash'); function media_upload_flash_bypass() { echo '

    '; printf( __('You are using the Flash uploader. Problems? Try the Browser uploader instead.'), clean_url(add_query_arg('flash', 0)) ); echo '

    '; } add_action('post-flash-upload-ui', 'media_upload_flash_bypass'); function media_upload_html_bypass() { echo '

    '; if ( array_key_exists('flash', $_REQUEST) ) // the user manually selected the browser uploader, so let them switch back to Flash printf( __('You are using the Browser uploader. Try the Flash uploader instead.'), clean_url(add_query_arg('flash', 1)) ); else // the user probably doesn't have Flash printf( __('You are using the Browser uploader.') ); echo '

    '; } add_action('post-flash-upload-ui', 'media_upload_flash_bypass'); add_action('post-html-upload-ui', 'media_upload_html_bypass'); // make sure the GET parameter sticks when we submit a form function media_upload_bypass_url($url) { if ( array_key_exists('flash', $_REQUEST) ) $url = add_query_arg('flash', intval($_REQUEST['flash'])); return $url; } add_filter('media_upload_form_url', 'media_upload_bypass_url'); add_filter('async_upload_image', 'get_media_item', 10, 2); add_filter('async_upload_audio', 'get_media_item', 10, 2); add_filter('async_upload_video', 'get_media_item', 10, 2); add_filter('async_upload_file', 'get_media_item', 10, 2); add_action('media_upload_image', 'media_upload_image'); add_action('media_upload_audio', 'media_upload_audio'); add_action('media_upload_video', 'media_upload_video'); add_action('media_upload_file', 'media_upload_file'); add_filter('media_upload_gallery', 'media_upload_gallery'); add_filter('media_upload_library', 'media_upload_library'); ?> wp/dev/wp-admin/includes/class-wp-filesystem-direct.php0000644000106600010660000001463611020023715020421 0ustar method = 'direct'; $this->errors = new WP_Error(); $this->permission = umask(); } function connect() { return true; } function setDefaultPermissions($perm) { $this->permission = $perm; } function get_contents($file) { return @file_get_contents($file); } function get_contents_array($file) { return @file($file); } function put_contents($file, $contents, $mode = false, $type = '') { if ( ! ($fp = @fopen($file, 'w' . $type)) ) return false; @fwrite($fp, $contents); @fclose($fp); $this->chmod($file,$mode); return true; } function cwd() { return @getcwd(); } function chdir($dir) { return @chdir($dir); } function chgrp($file, $group, $recursive = false) { if( ! $this->exists($file) ) return false; if( ! $recursive ) return @chgrp($file, $group); if( ! $this->is_dir($file) ) return @chgrp($file, $group); //Is a directory, and we want recursive $file = trailingslashit($file); $filelist = $this->dirlist($file); foreach($filelist as $filename) $this->chgrp($file . $filename, $group, $recursive); return true; } function chmod($file, $mode = false, $recursive = false) { if( ! $mode ) $mode = $this->permission; if( ! $this->exists($file) ) return false; if( ! $recursive ) return @chmod($file,$mode); if( ! $this->is_dir($file) ) return @chmod($file, $mode); //Is a directory, and we want recursive $file = trailingslashit($file); $filelist = $this->dirlist($file); foreach($filelist as $filename) $this->chmod($file . $filename, $mode, $recursive); return true; } function chown($file, $owner, $recursive = false) { if( ! $this->exists($file) ) return false; if( ! $recursive ) return @chown($file, $owner); if( ! $this->is_dir($file) ) return @chown($file, $owner); //Is a directory, and we want recursive $filelist = $this->dirlist($file); foreach($filelist as $filename){ $this->chown($file . '/' . $filename, $owner, $recursive); } return true; } function owner($file) { $owneruid = @fileowner($file); if( ! $owneruid ) return false; if( ! function_exists('posix_getpwuid') ) return $owneruid; $ownerarray = posix_getpwuid($owneruid); return $ownerarray['name']; } function getchmod($file) { return @fileperms($file); } function group($file) { $gid = @filegroup($file); if( ! $gid ) return false; if( ! function_exists('posix_getgrgid') ) return $gid; $grouparray = posix_getgrgid($gid); return $grouparray['name']; } function copy($source, $destination, $overwrite = false) { if( ! $overwrite && $this->exists($destination) ) return false; return copy($source, $destination); } function move($source, $destination, $overwrite = false) { //Possible to use rename()? if( $this->copy($source, $destination, $overwrite) && $this->exists($destination) ){ $this->delete($source); return true; } else { return false; } } function delete($file, $recursive = false) { $file = str_replace('\\', '/', $file); //for win32, occasional problems deleteing files otherwise if( $this->is_file($file) ) return @unlink($file); if( ! $recursive && $this->is_dir($file) ) return @rmdir($file); //At this point its a folder, and we're in recursive mode $file = trailingslashit($file); $filelist = $this->dirlist($file, true); $retval = true; if( is_array($filelist) ) //false if no files, So check first. foreach($filelist as $filename => $fileinfo) if( ! $this->delete($file . $filename, $recursive) ) $retval = false; if( ! @rmdir($file) ) return false; return $retval; } function exists($file) { return @file_exists($file); } function is_file($file) { return @is_file($file); } function is_dir($path) { return @is_dir($path); } function is_readable($file) { return @is_readable($file); } function is_writable($file) { return @is_writable($file); } function atime($file) { return @fileatime($file); } function mtime($file) { return @filemtime($file); } function size($file) { return @filesize($file); } function touch($file, $time = 0, $atime = 0){ if($time == 0) $time = time(); if($atime == 0) $atime = time(); return @touch($file, $time, $atime); } function mkdir($path, $chmod = false, $chown = false, $chgrp = false){ if( ! $chmod) $chmod = $this->permission; if( ! @mkdir($path, $chmod) ) return false; if( $chown ) $this->chown($path, $chown); if( $chgrp ) $this->chgrp($path, $chgrp); return true; } function rmdir($path, $recursive = false) { //Currently unused and untested, Use delete() instead. if( ! $recursive ) return @rmdir($path); //recursive: $filelist = $this->dirlist($path); foreach($filelist as $filename => $det) { if ( '/' == substr($filename, -1, 1) ) $this->rmdir($path . '/' . $filename, $recursive); @rmdir($filename); } return @rmdir($path); } function dirlist($path, $incdot = false, $recursive = false) { if( $this->is_file($path) ) { $limitFile = basename($path); $path = dirname($path); } else { $limitFile = false; } if( ! $this->is_dir($path) ) return false; $ret = array(); $dir = dir($path); while (false !== ($entry = $dir->read()) ) { $struc = array(); $struc['name'] = $entry; if( '.' == $struc['name'] || '..' == $struc['name'] ) continue; //Do not care about these folders. if( '.' == $struc['name'][0] && !$incdot) continue; if( $limitFile && $struc['name'] != $limitFile) continue; $struc['perms'] = $this->gethchmod($path.'/'.$entry); $struc['permsn'] = $this->getnumchmodfromh($struc['perms']); $struc['number'] = false; $struc['owner'] = $this->owner($path.'/'.$entry); $struc['group'] = $this->group($path.'/'.$entry); $struc['size'] = $this->size($path.'/'.$entry); $struc['lastmodunix']= $this->mtime($path.'/'.$entry); $struc['lastmod'] = date('M j',$struc['lastmodunix']); $struc['time'] = date('h:i:s',$struc['lastmodunix']); $struc['type'] = $this->is_dir($path.'/'.$entry) ? 'd' : 'f'; if ( 'd' == $struc['type'] ) { if( $recursive ) $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive); else $struc['files'] = array(); } $ret[ $struc['name'] ] = $struc; } $dir->close(); unset($dir); return $ret; } } ?> wp/dev/wp-admin/includes/file.php0000644000106600010660000004037611030473020014154 0ustar __( 'Main Index Template' ), 'style.css' => __( 'Stylesheet' ), 'rtl.css' => __( 'RTL Stylesheet' ), 'comments.php' => __( 'Comments' ), 'comments-popup.php' => __( 'Popup Comments' ), 'footer.php' => __( 'Footer' ), 'header.php' => __( 'Header' ), 'sidebar.php' => __( 'Sidebar' ), 'archive.php' => __( 'Archives' ), 'category.php' => __( 'Category Template' ), 'page.php' => __( 'Page Template' ), 'search.php' => __( 'Search Results' ), 'searchform.php' => __( 'Search Form' ), 'single.php' => __( 'Single Post' ), '404.php' => __( '404 Template' ), 'link.php' => __( 'Links Template' ), 'functions.php' => __( 'Theme Functions' ), 'attachment.php' => __( 'Attachment Template' ), 'my-hacks.php' => __( 'my-hacks.php (legacy hacks support)' ), '.htaccess' => __( '.htaccess (for rewrite rules )' ), // Deprecated files 'wp-layout.css' => __( 'Stylesheet' ), 'wp-comments.php' => __( 'Comments Template' ), 'wp-comments-popup.php' => __( 'Popup Comments Template' )); function get_file_description( $file ) { global $wp_file_descriptions; if ( isset( $wp_file_descriptions[basename( $file )] ) ) { return $wp_file_descriptions[basename( $file )]; } elseif ( file_exists( ABSPATH . $file ) && is_file( ABSPATH . $file ) ) { $template_data = implode( '', file( ABSPATH . $file ) ); if ( preg_match( "|Template Name:(.*)|i", $template_data, $name )) return $name[1]; } return basename( $file ); } function get_home_path() { $home = get_option( 'home' ); if ( $home != '' && $home != get_option( 'siteurl' ) ) { $home_path = parse_url( $home ); $home_path = $home_path['path']; $root = str_replace( $_SERVER["PHP_SELF"], '', $_SERVER["SCRIPT_FILENAME"] ); $home_path = trailingslashit( $root.$home_path ); } else { $home_path = ABSPATH; } return $home_path; } function get_real_file_to_edit( $file ) { if ('index.php' == $file || '.htaccess' == $file ) { $real_file = get_home_path() . $file; } else { $real_file = WP_CONTENT_DIR . $file; } return $real_file; } //$folder = Full path to folder //$levels = Levels of folders to follow, Default: 100 (PHP Loop limit) function list_files( $folder = '', $levels = 100 ) { if( empty($folder) ) return false; if( ! $levels ) return false; $files = array(); if ( $dir = @opendir( $folder ) ) { while (($file = readdir( $dir ) ) !== false ) { if ( in_array($file, array('.', '..') ) ) continue; if ( is_dir( $folder . '/' . $file ) ) { $files2 = list_files( $folder . '/' . $file, $levels - 1); if( $files2 ) $files = array_merge($files, $files2 ); else $files[] = $folder . '/' . $file . '/'; } else { $files[] = $folder . '/' . $file; } } } @closedir( $dir ); return $files; } function get_temp_dir() { if ( defined('WP_TEMP_DIR') ) return trailingslashit(WP_TEMP_DIR); $temp = WP_CONTENT_DIR . '/'; if ( is_dir($temp) && is_writable($temp) ) return $temp; if ( function_exists('sys_get_temp_dir') ) return trailingslashit(sys_get_temp_dir()); return '/tmp/'; } function wp_tempnam($filename = '', $dir = ''){ if ( empty($dir) ) $dir = get_temp_dir(); $filename = basename($filename); if ( empty($filename) ) $filename = time(); $filename = $dir . wp_unique_filename($dir, $filename); touch($filename); return $filename; } function validate_file_to_edit( $file, $allowed_files = '' ) { $file = stripslashes( $file ); $code = validate_file( $file, $allowed_files ); if (!$code ) return $file; switch ( $code ) { case 1 : wp_die( __('Sorry, can’t edit files with ".." in the name. If you are trying to edit a file in your WordPress home directory, you can just type the name of the file in.' )); case 2 : wp_die( __('Sorry, can’t call files with their real path.' )); case 3 : wp_die( __('Sorry, that file cannot be edited.' )); } } // array wp_handle_upload ( array &file [, array overrides] ) // file: reference to a single element of $_FILES. Call the function once for each uploaded file. // overrides: an associative array of names=>values to override default variables with extract( $overrides, EXTR_OVERWRITE ). // On success, returns an associative array of file attributes. // On failure, returns $overrides['upload_error_handler'](&$file, $message ) or array( 'error'=>$message ). function wp_handle_upload( &$file, $overrides = false ) { // The default error handler. if (! function_exists( 'wp_handle_upload_error' ) ) { function wp_handle_upload_error( &$file, $message ) { return array( 'error'=>$message ); } } // You may define your own function and pass the name in $overrides['upload_error_handler'] $upload_error_handler = 'wp_handle_upload_error'; // $_POST['action'] must be set and its value must equal $overrides['action'] or this: $action = 'wp_handle_upload'; // Courtesy of php.net, the strings that describe the error indicated in $_FILES[{form field}]['error']. $upload_error_strings = array( false, __( "The uploaded file exceeds the upload_max_filesize directive in php.ini." ), __( "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form." ), __( "The uploaded file was only partially uploaded." ), __( "No file was uploaded." ), __( "Missing a temporary folder." ), __( "Failed to write file to disk." )); // All tests are on by default. Most can be turned off by $override[{test_name}] = false; $test_form = true; $test_size = true; // If you override this, you must provide $ext and $type!!!! $test_type = true; $mimes = false; // Install user overrides. Did we mention that this voids your warranty? if ( is_array( $overrides ) ) extract( $overrides, EXTR_OVERWRITE ); // A correct form post will pass this test. if ( $test_form && (!isset( $_POST['action'] ) || ($_POST['action'] != $action ) ) ) return $upload_error_handler( $file, __( 'Invalid form submission.' )); // A successful upload will pass this test. It makes no sense to override this one. if ( $file['error'] > 0 ) return $upload_error_handler( $file, $upload_error_strings[$file['error']] ); // A non-empty file will pass this test. if ( $test_size && !($file['size'] > 0 ) ) return $upload_error_handler( $file, __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini.' )); // A properly uploaded file will pass this test. There should be no reason to override this one. if (! @ is_uploaded_file( $file['tmp_name'] ) ) return $upload_error_handler( $file, __( 'Specified file failed upload test.' )); // A correct MIME type will pass this test. Override $mimes or use the upload_mimes filter. if ( $test_type ) { $wp_filetype = wp_check_filetype( $file['name'], $mimes ); extract( $wp_filetype ); if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) ) return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' )); if ( !$ext ) $ext = ltrim(strrchr($file['name'], '.'), '.'); if ( !$type ) $type = $file['type']; } // A writable uploads dir will pass this test. Again, there's no point overriding this one. if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) ) return $upload_error_handler( $file, $uploads['error'] ); $filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback ); // Move the file to the uploads dir $new_file = $uploads['path'] . "/$filename"; if ( false === @ move_uploaded_file( $file['tmp_name'], $new_file ) ) { return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ) ); } // Set correct file permissions $stat = stat( dirname( $new_file )); $perms = $stat['mode'] & 0000666; @ chmod( $new_file, $perms ); // Compute the URL $url = $uploads['url'] . "/$filename"; $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) ); return $return; } // Pass this function an array similar to that of a $_FILES POST array. function wp_handle_sideload( &$file, $overrides = false ) { // The default error handler. if (! function_exists( 'wp_handle_upload_error' ) ) { function wp_handle_upload_error( &$file, $message ) { return array( 'error'=>$message ); } } // You may define your own function and pass the name in $overrides['upload_error_handler'] $upload_error_handler = 'wp_handle_upload_error'; // $_POST['action'] must be set and its value must equal $overrides['action'] or this: $action = 'wp_handle_sideload'; // Courtesy of php.net, the strings that describe the error indicated in $_FILES[{form field}]['error']. $upload_error_strings = array( false, __( "The file exceeds the upload_max_filesize directive in php.ini." ), __( "The file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form." ), __( "The file was only partially uploaded." ), __( "No file was sent." ), __( "Missing a temporary folder." ), __( "Failed to write file to disk." )); // All tests are on by default. Most can be turned off by $override[{test_name}] = false; $test_form = true; $test_size = true; // If you override this, you must provide $ext and $type!!!! $test_type = true; $mimes = false; // Install user overrides. Did we mention that this voids your warranty? if ( is_array( $overrides ) ) extract( $overrides, EXTR_OVERWRITE ); // A correct form post will pass this test. if ( $test_form && (!isset( $_POST['action'] ) || ($_POST['action'] != $action ) ) ) return $upload_error_handler( $file, __( 'Invalid form submission.' )); // A successful upload will pass this test. It makes no sense to override this one. if ( $file['error'] > 0 ) return $upload_error_handler( $file, $upload_error_strings[$file['error']] ); // A non-empty file will pass this test. if ( $test_size && !(filesize($file['tmp_name']) > 0 ) ) return $upload_error_handler( $file, __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini.' )); // A properly uploaded file will pass this test. There should be no reason to override this one. if (! @ is_file( $file['tmp_name'] ) ) return $upload_error_handler( $file, __( 'Specified file does not exist.' )); // A correct MIME type will pass this test. Override $mimes or use the upload_mimes filter. if ( $test_type ) { $wp_filetype = wp_check_filetype( $file['name'], $mimes ); extract( $wp_filetype ); if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) ) return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' )); if ( !$ext ) $ext = ltrim(strrchr($file['name'], '.'), '.'); if ( !$type ) $type = $file['type']; } // A writable uploads dir will pass this test. Again, there's no point overriding this one. if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) ) return $upload_error_handler( $file, $uploads['error'] ); $filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback ); // Strip the query strings. $filename = str_replace('?','-', $filename); $filename = str_replace('&','-', $filename); // Move the file to the uploads dir $new_file = $uploads['path'] . "/$filename"; if ( false === @ rename( $file['tmp_name'], $new_file ) ) { return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ) ); } // Set correct file permissions $stat = stat( dirname( $new_file )); $perms = $stat['mode'] & 0000666; @ chmod( $new_file, $perms ); // Compute the URL $url = $uploads['url'] . "/$filename"; $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) ); return $return; } /** * Downloads a url to a local file using the Snoopy HTTP Class * * @param string $url the URL of the file to download * @return mixed WP_Error on failure, string Filename on success. */ function download_url( $url ) { //WARNING: The file is not automatically deleted, The script must unlink() the file. if( ! $url ) return new WP_Error('http_no_url', __('Invalid URL Provided')); $tmpfname = wp_tempnam($url); if( ! $tmpfname ) return new WP_Error('http_no_file', __('Could not create Temporary file')); $handle = @fopen($tmpfname, 'w'); if( ! $handle ) return new WP_Error('http_no_file', __('Could not create Temporary file')); require_once( ABSPATH . 'wp-includes/class-snoopy.php' ); $snoopy = new Snoopy(); $snoopy->fetch($url); if( $snoopy->status != '200' ){ fclose($handle); unlink($tmpfname); return new WP_Error('http_404', trim($snoopy->response_code)); } fwrite($handle, $snoopy->results); fclose($handle); return $tmpfname; } function unzip_file($file, $to) { global $wp_filesystem; if ( ! $wp_filesystem || !is_object($wp_filesystem) ) return new WP_Error('fs_unavailable', __('Could not access filesystem.')); $fs =& $wp_filesystem; require_once(ABSPATH . 'wp-admin/includes/class-pclzip.php'); $archive = new PclZip($file); // Is the archive valid? if ( false == ($archive_files = $archive->extract(PCLZIP_OPT_EXTRACT_AS_STRING)) ) return new WP_Error('incompatible_archive', __('Incompatible archive'), $archive->errorInfo(true)); if ( 0 == count($archive_files) ) return new WP_Error('empty_archive', __('Empty archive')); $to = trailingslashit($to); $path = explode('/', $to); $tmppath = ''; for ( $j = 0; $j < count($path) - 1; $j++ ) { $tmppath .= $path[$j] . '/'; if ( ! $fs->is_dir($tmppath) ) $fs->mkdir($tmppath, 0755); } foreach ($archive_files as $file) { $path = explode('/', $file['filename']); $tmppath = ''; // Loop through each of the items and check that the folder exists. for ( $j = 0; $j < count($path) - 1; $j++ ) { $tmppath .= $path[$j] . '/'; if ( ! $fs->is_dir($to . $tmppath) ) if ( !$fs->mkdir($to . $tmppath, 0755) ) return new WP_Error('mkdir_failed', __('Could not create directory'), $to . $tmppath); } // We've made sure the folders are there, so let's extract the file now: if ( ! $file['folder'] ) if ( !$fs->put_contents( $to . $file['filename'], $file['content']) ) return new WP_Error('copy_failed', __('Could not copy file'), $to . $file['filename']); $fs->chmod($to . $file['filename'], 0644); } return true; } function copy_dir($from, $to) { global $wp_filesystem; $dirlist = $wp_filesystem->dirlist($from); $from = trailingslashit($from); $to = trailingslashit($to); foreach ( (array) $dirlist as $filename => $fileinfo ) { if ( 'f' == $fileinfo['type'] ) { if ( ! $wp_filesystem->copy($from . $filename, $to . $filename, true) ) return new WP_Error('copy_failed', __('Could not copy file'), $to . $filename); $wp_filesystem->chmod($to . $filename, 0644); } elseif ( 'd' == $fileinfo['type'] ) { if ( !$wp_filesystem->mkdir($to . $filename, 0755) ) return new WP_Error('mkdir_failed', __('Could not create directory'), $to . $filename); $result = copy_dir($from . $filename, $to . $filename); if ( is_wp_error($result) ) return $result; } } } function WP_Filesystem( $args = false ) { global $wp_filesystem; require_once(ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php'); $method = get_filesystem_method(); if ( ! $method ) return false; $abstraction_file = apply_filters('filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-'.$method.'.php', $method); if( ! file_exists($abstraction_file) ) return; require_once($abstraction_file); $method = "WP_Filesystem_$method"; $wp_filesystem = new $method($args); if ( $wp_filesystem->errors->get_error_code() ) return false; if ( !$wp_filesystem->connect() ) return false; //There was an erorr connecting to the server. return true; } function get_filesystem_method() { $method = false; if( function_exists('getmyuid') && function_exists('fileowner') ){ $temp_file = wp_tempnam(); if ( getmyuid() == fileowner($temp_file) ) $method = 'direct'; unlink($temp_file); } if ( ! $method && extension_loaded('ftp') ) $method = 'ftpext'; if ( ! $method && ( extension_loaded('sockets') || function_exists('fsockopen') ) ) $method = 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread return apply_filters('filesystem_method', $method); } ?>wp/dev/wp-admin/includes/class-wp-filesystem-ftpsockets.php0000644000106600010660000001721411020023715021327 0ustar FTP_ASCII, 'css' => FTP_ASCII, 'txt' => FTP_ASCII, 'js' => FTP_ASCII, 'html'=> FTP_ASCII, 'htm' => FTP_ASCII, 'xml' => FTP_ASCII, 'jpg' => FTP_BINARY, 'png' => FTP_BINARY, 'gif' => FTP_BINARY, 'bmp' => FTP_BINARY ); function WP_Filesystem_ftpsockets($opt='') { $this->method = 'ftpsockets'; $this->errors = new WP_Error(); //Check if possible to use ftp functions. if( ! @include_once ABSPATH . 'wp-admin/includes/class-ftp.php' ) return false; $this->ftp = new ftp(); //Set defaults: if ( empty($opt['port']) ) $this->options['port'] = 21; else $this->options['port'] = $opt['port']; if ( empty($opt['hostname']) ) $this->errors->add('empty_hostname', __('FTP hostname is required')); else $this->options['hostname'] = $opt['hostname']; if ( isset($opt['base']) && ! empty($opt['base']) ) $this->wp_base = $opt['base']; // Check if the options provided are OK. if ( empty ($opt['username']) ) $this->errors->add('empty_username', __('FTP username is required')); else $this->options['username'] = $opt['username']; if ( empty ($opt['password']) ) $this->errors->add('empty_password', __('FTP password is required')); else $this->options['password'] = $opt['password']; } function connect() { if ( ! $this->ftp ) return false; //$this->ftp->Verbose = true; if ( ! $this->ftp->SetServer($this->options['hostname'], $this->options['port']) ) { $this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port'])); return false; } if ( ! $this->ftp->connect() ) { $this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port'])); return false; } if ( ! $this->ftp->login($this->options['username'], $this->options['password']) ) { $this->errors->add('auth', sprintf(__('Username/Password incorrect for %s'), $this->options['username'])); return false; } $this->ftp->SetType(FTP_AUTOASCII); $this->ftp->Passive(true); return true; } function setDefaultPermissions($perm) { $this->permission = $perm; } function get_contents($file, $type = '', $resumepos = 0){ if( ! $this->exists($file) ) return false; if( empty($type) ){ $extension = substr(strrchr($file, '.'), 1); $type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_AUTOASCII; } $this->ftp->SetType($type); $temp = wp_tempnam( $file ); if ( ! $temphandle = fopen($temp, 'w+') ) return false; if ( ! $this->ftp->fget($temphandle, $file) ) { fclose($temphandle); unlink($temp); return ''; //Blank document, File does exist, Its just blank. } fseek($temphandle, 0); //Skip back to the start of the file being written to $contents = ''; while ( ! feof($temphandle) ) $contents .= fread($temphandle, 8192); fclose($temphandle); unlink($temp); return $contents; } function get_contents_array($file){ return explode("\n", $this->get_contents($file) ); } function put_contents($file, $contents, $type = '' ) { if( empty($type) ){ $extension = substr(strrchr($file, '.'), 1); $type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_AUTOASCII; } $this->ftp->SetType($type); $temp = wp_tempnam( $file ); if ( ! $temphandle = fopen($temp, 'w+') ){ unlink($temp); return false; } fwrite($temphandle, $contents); fseek($temphandle, 0); //Skip back to the start of the file being written to $ret = $this->ftp->fput($file, $temphandle); fclose($temphandle); unlink($temp); return $ret; } function cwd() { $cwd = $this->ftp->pwd(); if( $cwd ) $cwd = trailingslashit($cwd); return $cwd; } function chdir($file) { return $this->ftp->chdir($file); } function chgrp($file, $group, $recursive = false ) { return false; } function chmod($file, $mode = false, $recursive = false ){ if( ! $mode ) $mode = $this->permission; if( ! $mode ) return false; //if( ! $this->exists($file) ) // return false; if( ! $recursive || ! $this->is_dir($file) ) { return $this->ftp->chmod($file,$mode); } //Is a directory, and we want recursive $filelist = $this->dirlist($file); foreach($filelist as $filename){ $this->chmod($file . '/' . $filename, $mode, $recursive); } return true; } function chown($file, $owner, $recursive = false ) { return false; } function owner($file) { $dir = $this->dirlist($file); return $dir[$file]['owner']; } function getchmod($file) { $dir = $this->dirlist($file); return $dir[$file]['permsn']; } function group($file) { $dir = $this->dirlist($file); return $dir[$file]['group']; } function copy($source, $destination, $overwrite = false ) { if( ! $overwrite && $this->exists($destination) ) return false; $content = $this->get_contents($source); if ( false === $content ) return false; return $this->put_contents($destination, $content); } function move($source, $destination, $overwrite = false ) { return $this->ftp->rename($source, $destination); } function delete($file, $recursive = false ) { if ( $this->is_file($file) ) return $this->ftp->delete($file); if ( !$recursive ) return $this->ftp->rmdir($file); return $this->ftp->mdel($file); } function exists($file) { return $this->ftp->is_exists($file); } function is_file($file) { return $this->is_dir($file) ? false : true; } function is_dir($path) { $cwd = $this->cwd(); if ( $this->chdir($path) ) { $this->chdir($cwd); return true; } return false; } function is_readable($file) { //Get dir list, Check if the file is writable by the current user?? return true; } function is_writable($file) { //Get dir list, Check if the file is writable by the current user?? return true; } function atime($file) { return false; } function mtime($file) { return $this->ftp->mdtm($file); } function size($file) { return $this->ftp->filesize($file); } function touch($file, $time = 0, $atime = 0 ){ return false; } function mkdir($path, $chmod = false, $chown = false, $chgrp = false ) { if( ! $this->ftp->mkdir($path) ) return false; if( $chmod ) $this->chmod($path, $chmod); if( $chown ) $this->chown($path, $chown); if( $chgrp ) $this->chgrp($path, $chgrp); return true; } function rmdir($path, $recursive = false ) { if( ! $recursive ) return $this->ftp->rmdir($path); return $this->ftp->mdel($path); } function dirlist($path = '.', $incdot = false, $recursive = false ) { if( $this->is_file($path) ) { $limitFile = basename($path); $path = dirname($path) . '/'; } else { $limitFile = false; } $list = $this->ftp->dirlist($path); if( ! $list ) return false; if( empty($list) ) return array(); $ret = array(); foreach ( $list as $struc ) { if ( 'd' == $struc['type'] ) { $struc['files'] = array(); if ( $incdot ){ //We're including the doted starts if( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder if ($recursive) $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive); } } else { //No dots if ($recursive) $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive); } } //File $ret[$struc['name']] = $struc; } return $ret; } function __destruct(){ $this->ftp->quit(); } } ?> wp/dev/wp-admin/edit-form.php0000644000106600010660000000605310767052153013327 0ustar

    post_category); ?>

    100)) { $rows = 10; } ?>

    (Separate multiple URLs with spaces.)'), 'http://wordpress.org/docs/reference/post/#trackback'); echo '
    '; ?>

    '; } ?>

    wp/dev/wp-admin/page-new.php0000644000106600010660000000162411021065061013125 0ustar

    |

    wp/dev/wp-admin/comment.php0000644000106600010660000001551211017276127013101 0ustar

    $msg

    "; include('admin-footer.php'); die; } switch( $action ) { case 'editcomment' : $title = __('Edit Comment'); wp_enqueue_script('comment'); require_once('admin-header.php'); $comment_id = absint( $_GET['c'] ); if ( !$comment = get_comment( $comment_id ) ) comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' '.__('Go back').'!', 'javascript:history.go(-1)') ); if ( !current_user_can('edit_post', $comment->comment_post_ID) ) comment_footer_die( __('You are not allowed to edit comments on this post.') ); $comment = get_comment_to_edit( $comment_id ); include('edit-form-comment.php'); break; case 'cdc' : case 'mac' : require_once('admin-header.php'); $comment_id = absint( $_GET['c'] ); $formaction = 'cdc' == $action ? 'deletecomment' : 'approvecomment'; $nonce_action = 'cdc' == $action ? 'delete-comment_' : 'approve-comment_'; $nonce_action .= $comment_id; if ( !$comment = get_comment_to_edit( $comment_id ) ) comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' '.__('Go back').'!', 'edit.php') ); if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) comment_footer_die( 'cdc' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); ?>

    ' onclick="self.location='" />
    comment_author_email ) { ?> comment_author_url ) { ?>
    comment_author; ?>
    comment_author_email; ?>
    comment_author_url; ?>
    comment_content; ?>
    '.__('Go back').'!', 'edit-comments.php') ); if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) comment_footer_die( __('You are not allowed to edit comments on this post.') ); if ( 'spam' == $_REQUEST['dt'] ) wp_set_comment_status( $comment->comment_ID, 'spam' ); else wp_delete_comment( $comment->comment_ID ); if ( '' != wp_get_referer() && false == $noredir && false === strpos(wp_get_referer(), 'comment.php' ) ) wp_redirect( wp_get_referer() ); else if ( '' != wp_get_original_referer() && false == $noredir ) wp_redirect( wp_get_original_referer() ); else wp_redirect( admin_url('edit-comments.php') ); die; break; case 'unapprovecomment' : $comment_id = absint( $_GET['c'] ); check_admin_referer( 'unapprove-comment_' . $comment_id ); if ( isset( $_GET['noredir'] ) ) $noredir = true; else $noredir = false; if ( !$comment = get_comment( $comment_id ) ) comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' '.__('Go back').'!', 'edit.php') ); if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') ); wp_set_comment_status( $comment->comment_ID, 'hold' ); if ( '' != wp_get_referer() && false == $noredir ) wp_redirect( wp_get_referer() ); else wp_redirect( admin_url('edit.php?p=' . absint( $comment->comment_post_ID ) . '#comments') ); exit(); break; case 'approvecomment' : $comment_id = absint( $_GET['c'] ); check_admin_referer( 'approve-comment_' . $comment_id ); if ( isset( $_GET['noredir'] ) ) $noredir = true; else $noredir = false; if ( !$comment = get_comment( $comment_id ) ) comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' '.__('Go back').'!', 'edit.php') ); if ( !current_user_can('edit_post', $comment->comment_post_ID) ) comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); wp_set_comment_status( $comment->comment_ID, 'approve' ); if ( '' != wp_get_referer() && false == $noredir ) wp_redirect( wp_get_referer() ); else wp_redirect( admin_url('edit.php?p=' . absint( $comment->comment_post_ID ) . '#comments') ); exit(); break; case 'editedcomment' : $comment_id = absint( $_POST['comment_ID'] ); $comment_post_id = absint( $_POST['comment_post_id'] ); check_admin_referer( 'update-comment_' . $comment_id ); edit_comment(); $location = ( empty( $_POST['referredby'] ) ? "edit.php?p=$comment_post_id" : $_POST['referredby'] ) . '#comment-' . $comment_id; $location = apply_filters( 'comment_edit_redirect', $location, $comment_id ); wp_redirect( $location ); exit(); break; default: wp_die( __('Unknown action.') ); break; } // end switch include('admin-footer.php'); ?> wp/dev/wp-admin/css/0000755000106600010660000000000011051167753011514 5ustar wp/dev/wp-admin/css/colors-classic.css0000644000106600010660000003334011035335670015146 0ustar a.page-numbers:hover { border-color: #999; } body, .form-table .pre { background-color: #fff; color: #333; } body > #upload-menu { border-bottom-color: #fff; } div#current-widgets, #postcustomstuff table, #your-profile fieldset, a.page-numbers, #rightnow, div.dashboard-widget, .widefat { border-color: #ccc; } div.dashboard-widget-error { background-color: #c43; } div.dashboard-widget-notice { background-color: #F0F6FB; } div.dashboard-widget-submit, ul.widget-control-list div.widget-control-actions { border-top-color: #ccc; } input.disabled, textarea.disabled { background-color: #ccc; } #user_info a:hover, li.widget-list-control-item h4.widget-title a:hover, .submit a, #dashmenu a:hover, #footer a, #upload-menu li a.upload-tab-link, li.widget-list-control-item h4.widget-title a, #dragHelper li.widget-list-control-item h4.widget-title a, #draghelper li.widget-list-control-item h4.widget-title a:visited, .login #backtoblog a:hover { color: #fff; } ul#category-tabs li.ui-tabs-selected, li.widget-list-control-item, div.nav, .tablenav, .submitbox, h3.dashboard-widget-title, h3.dashboard-widget-title span, h3.dashboard-widget-title small, ul.view-switch li.current, .form-table tr, #poststuff h3, .login form, h3.info-box-title { background-color: #cfebf7; } div.ui-tabs-panel { border-color: #cfebf7; } select { background-color: #fff; border-color: #ddd; } strong .post-com-count span { background-color: #2583ad; } .button-secondary, #login form .submit input { background-color: #8ebddc !important; } ul#widget-list li.widget-list-item h4.widget-title { background-color: #f0f0f0; color: #000; } .sorthelper { background-color: #ccf3fa; } .ac_match, .subsubsub a.current, h2 { color: #000; } .ac_over { background-color: #f0f0b8; } .ac_results { background-color: #fff; border-color: #808080; } .ac_results li { color: #101010; } .alternate { background-color: #f9f9f9; } .available-theme a.screenshot { background-color: #f1f1f1; border-color: #ccc; } .bar { background-color: #e8e8e8; border-right-color: #99d; } .describe { border-top-color: #d0d0d0; } .error, #login #login_error { background-color: #ffebe8; border-color: #c00; } .error a { color: #c00; } .form-invalid { background-color: #ffebe8 !important; } .form-invalid input { border-color: #c00 !important; } .form-table input, .form-table textarea { border-color: #c6d9e9; } .form-table td, .form-table th { border-bottom-color: #fff; } .highlight { background-color: #cfebf7; color: #d54e21; } .howto, .nonessential, #sidemenu, #edit-slug-box, .form-input-tip, #dashboard_primary span.rss-date, .subsubsub, #dashboard_secondary div.dashboard-widget-content ul li a cite { color: #999; } #dashmenu a, #user_info a { color: #88b4d7; } .media-item { border-bottom-color: #d0d0d0; } .media-upload-form label.form-help, td.help { color: #9a9a9a; } .page-numbers { background-color: #fff; border-color: #fff; } .page-numbers.current { background-color: #328ab2; border-color: #328ab2; color: #fff; } .post-com-count { background-image: url(../images/bubble_bg.gif); color: #fff; } .post-com-count span { background-color: #bbb; color: #fff; } .post-com-count:hover span { background-color: #d54e21; } .quicktags, .search { background-color: #ccc; color: #000; } .side-info h5, .bordertitle { border-bottom-color: #dadada; } .side-info ul, .widget-description { color: #666; } .submit input, .button, .button-secondary, #login form .submit input, div.dashboard-widget-submit input, #edit-slug-buttons a.save { background-color: #e5e5e5; color: #07273e; border-color: #a3a3a3; } .button[disabled], .button:disabled { background-color: #999; } .tablenav .button-secondary { border-color: #5396c5; } .submit input:hover, .button:hover, #edit-slug-buttons a.save:hover { border-color: #535353; } .submit input:hover, .button:hover, .button-secondary:hover, #wphead #viewsite a:hover, #submenu a.current, #submenu a:hover, .submitbox #previewview a:hover, #the-comment-list .comment a:hover, #rightnow a:hover, a:hover, .subsubsub a:hover, .subsubsub a.current:hover, #login form .submit input:hover, div.dashboard-widget-submit input:hover, #edit-slug-buttons a.save:hover, #media-upload a.del-link:hover { color: #d54e21; } #adminmenu a:hover, #sidemenu a:hover, .ui-tabs-nav a:hover { color: #97c4d8; } .button-secondary:hover, #login form .submit input:hover { border-color: #328ab2; background-color: #a6d2e5 !important; } .submitbox #autosave .error, ul.view-switch li.current a { color: #333; } .submitbox #previewview { background-color: #5488af; } .submitbox #previewview a, #rightnow .rbutton { background-color: #ebebeb; color: #264761; } .submitbox .submit { background-color: #464646; color: #ccc; } .submitbox .submitdelete { border-bottom-color: #999; } .submitbox .submitdelete:hover, #media-upload a.delete:hover { color: #fff; background-color: #f00; border-bottom-color: #f00; } .tablenav .dots { background-color: #cfebf7; border-color: #cfebf7; } .tablenav .next, .tablenav .prev{ background-color: #cfebf7; border-bottom-color: #cfebf7; border-color: #cfebf7; color: #2583ad; } .tablenav .next:hover, .tablenav .prev:hover { border-bottom-color: #d54e21; border-color: #cfebf7; color: #d54e21; } .updated, .login #login_error, .login .message { background-color: #ffffe0; border-color: #e6db55; } .updated a { border-bottom-color: #2583ad; } .widefat td, .widefat th, div#available-widgets-filter, ul#widget-list li.widget-list-item, .commentlist li { border-bottom-color: #ccc; } .widefat thead, .thead { background-color: #464646; color: #d7d7d7; } .widget-control-save, .widget-control-remove { background-color: #83b4d5; color: #246; } .wrap h2 { border-bottom-color: #dadada; color: #5a5a5a; } #poststuff #edButtonPreview, #poststuff #edButtonHTML, #the-comment-list p.comment-author strong a, #media-upload a.del-link, #media-upload a.delete, a { color: #2e7ca0; } #adminmenu a, .ui-tabs-nav a { color: #cfebf6; } #submenu a { color: #2782af } /* Because we don't want visited on these links */ #adminmenu a.current, #sidemenu a.current, body.press-this .ui-tabs-selected a, body.press-this .ui-tabs-selected a:hover { background-color: #fff; border-color: #07273e; border-bottom-color: #fff; color: #d54e21; font-weight: bold; } #adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins { background-image: url(../images/comment-stalk-classic.gif); } #adminmenu li a #awaiting-mod span, #sidemenu li a #update-plugins span { background-color: #d54e21; color: #fff; } #rightnow .reallynow { background-color: #114973; color: #fff; } #adminmenu li a:hover #awaiting-mod span, #sidemenu li a:hover #update-plugins span { background-color: #07273E; } #adminmenu, div#media-upload-header { background-color: #14568a; border-bottom-color: #07273e; } #currenttheme img { border-color: #666; } #current-widgets .drop-widget-here { background-color: #ffc; } #dashboard_secondary div.dashboard-widget-content ul li a { background-color: #f9f9f9; } input.readonly { background-color: #ddd; } #dashmenu a.current { background-color: #14568a; color: #cfebf6; } #dragHelper h4.widget-title, li.widget-list-control-item h4, #dragHelper li.widget-list-control-item h4 { background-color: #2683ae; color: #fff; } #ed_toolbar input { background: url( ../images/fade-butt.png ) #fff repeat-x 0 -2px; } #editable-post-name { background-color: #fffbcc; } #edit-slug-box strong, .login #nav a { color: #777; } #edit-slug-buttons a.save { background-color: #ebebeb; } #footer { background: url(../images/logo-ghost.png) #464646 no-repeat 20px 10px; color: #999; } #media-items { border-color: #c0c0c0; } #pass-strength-result { background-color: #e3e3e3; border-color: #000; } #pass-strength-result.bad { background-color: #ffeff7; border-color: #c69; } #pass-strength-result.good { background-color: #effff4; border-color: #66cc87; } #pass-strength-result.short { background-color: #e3e3e3; } #pass-strength-result.strong { background-color: #59ef86; border-color: #319f52; } .checkbox, .side-info, #your-profile #rich_editing { background-color: #fff; } .plugins .active { background-color: #BBEEBB; } .plugins .togl { border-right-color: #ccc; } #the-comment-list .unapproved { background-color: #ffffe0; } .plugins tr { background-color: #fff; } #poststuff #editor-toolbar .active { background-color: #83b4d5; color: #333; } #poststuff .closed .togbox { background-color: #2583ad; background-image: url(../images/toggle-arrow.gif); } #poststuff .postbox, #titlediv, #poststuff .postarea, #poststuff .stuffbox { border-color: #ebebeb; border-right-color: #ccc; border-bottom-color: #ccc; } #poststuff .togbox { background-color: #b2b2b2; background-image: url(../images/toggle-arrow.gif); } #quicktags #ed_link { color: #00f; } #rightnow .youhave { background-color: #f0f6fb; } #rightnow a { color: #448abd; } #sidemenu a { background-color: #14568a; border-bottom-color: #07273e; border-top-color: #14568a; color: #cfebf6; } #tagchecklist span a { background: url(../images/xit.gif) no-repeat; } #tagchecklist span a:hover { background: url(../images/xit.gif) no-repeat -10px 0; } #the-comment-list .comment a { border-bottom-color: #ababab; color: #666; } #update-nag, .plugin-update { background-color: #fffeeb; border-bottom-color: #ccc; border-top-color: #ccc; color: #555; } #upload-files a.file-link { background-color: #d1e2ef; } #upload-file-view a img { border-bottom-color: #69c; } #upload-menu li #current-tab-nav, #upload-file { background-color: #f9fcfe; } #upload-menu li span a.page-numbers { color: #00019b; } #upload-menu li.current { border-right-color: #448abd; color: #000; } #upload-menu li.current a.upload-tab-link, #upload-menu li a:hover { background-color: #f9fcfe; color: #000; } #upload-menu, #upload-menu li { border-top-color: #247fab; } #user_info, .login #backtoblog a { color: #ccc; } #wphead { background-color: #14568a; } #wphead, body.login { border-top-color: #07273e; } #wphead #viewsite a { background-color: #5488af; color: #cfebf7; border-color: #0b3d64; } #wphead #viewsite a:hover { color: #07273e; } #wphead h1, #dashmenu a.current:hover { color: #cfebf6; } div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover, .delete:hover { color: #f00; } /* TinyMCE */ .wp_themeSkin *, .wp_themeSkin a:hover, .wp_themeSkin a:link, .wp_themeSkin a:visited, .wp_themeSkin a:active { color: #000; } /* Containers */ .wp_themeSkin table, #wp_editbtns { background: #83B4D5; } .wp_themeSkin iframe { background: #fff; } /* Layout */ .wp_themeSkin .mceStatusbar { color:#000; background-color: #eaf3fa; } /* Button */ .wp_themeSkin .mceButton { background-color: #e9e8e8; border-color: #83B4D5; } .wp_themeSkin a.mceButtonEnabled:hover, .wp_themeSkin a.mceButtonActive, .wp_themeSkin a.mceButtonSelected { background-color: #d6d8da; border-color: #7789ba !important; } .wp_themeSkin .mceButtonDisabled { border-color: #83B4D5 !important; } /* ListBox */ .wp_themeSkin .mceListBox .mceText, .wp_themeSkin .mceListBox .mceOpen { border-color: #83B4D5; background-color: #e9e8e8; } .wp_themeSkin table.mceListBoxEnabled:hover .mceOpen, .wp_themeSkin .mceListBoxHover .mceOpen, .wp_themeSkin .mceListBoxSelected .mceOpen, .wp_themeSkin .mceListBoxSelected .mceText { border-color: #7789ba !important; background-color: #d6d8da; } .wp_themeSkin table.mceListBoxEnabled:hover .mceText, .wp_themeSkin .mceListBoxHover .mceText { border-color: #7789ba !important; } .wp_themeSkin select.mceListBox { border-color: #b3c7e1; background-color: #fff; } /* SplitButton */ .wp_themeSkin .mceSplitButton a.mceAction, .wp_themeSkin .mceSplitButton a.mceOpen { background-color: #e9e8e8; border-color: #83B4D5; } .wp_themeSkin .mceSplitButton a.mceOpen:hover, .wp_themeSkin .mceSplitButtonSelected a.mceOpen, .wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction, .wp_themeSkin .mceSplitButton a.mceAction:hover { background-color: #d6d8da; border-color: #7789ba !important; } .wp_themeSkin .mceSplitButtonActive { background-color: #d6d8da; } /* ColorSplitButton */ .wp_themeSkin div.mceColorSplitMenu table { background-color: #ebeaeb; border-color: #808080; } .wp_themeSkin .mceColorSplitMenu a { border-color: #808080; } .wp_themeSkin .mceColorSplitMenu a.mceMoreColors { border-color: #fff; } .wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover { border-color: #0A246A; background-color: #B6BDD2; } .wp_themeSkin a.mceMoreColors:hover { border-color: #0A246A; } /* Menu */ .wp_themeSkin .mceMenu { border-color: #ddd; } .wp_themeSkin .mceMenu table { background-color: #ebeaeb; } .wp_themeSkin .mceMenu .mceText { color: #000; } .wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover, .wp_themeSkin .mceMenu .mceMenuItemActive, #quicktags { background-color: #83B4D5; } .wp_themeSkin td.mceMenuItemSeparator { background-color: #aaa; } .wp_themeSkin .mceMenuItemTitle a { background-color: #ccc; border-bottom-color: #aaa; } .wp_themeSkin .mceMenuItemTitle span.mceText { color: #000; } .wp_themeSkin .mceMenuItemDisabled .mceText { color: #888; } /* pop-up */ .clearlooks2 .mceTop .mceLeft, .clearlooks2 .mceTop .mceRight { background-color: #cee1ef; border-color: #c6d9e9; } .clearlooks2 .mceFocus .mceTop .mceLeft, .clearlooks2 .mceFocus .mceTop .mceRight { background-color: #5488AF; border-color: #464646; } #editorcontainer { border-color: #ccc; } #poststuff #titlewrap { border-color: #ccc; } #tTips p#tTips_inside { background-color: #ddd; color: #333; } /* Diff */ table.diff .diff-deletedline { background-color: #ffdddd; } table.diff .diff-deletedline del { background-color: #ff9999; } table.diff .diff-addedline { background-color: #ddffdd; } table.diff .diff-addedline ins { background-color: #99ff99; } wp/dev/wp-admin/css/dashboard.css0000644000106600010660000001127110770773417014166 0ustar /* Right Now */ #rightnow { border-width: 1px; border-style: solid; padding: 2px; margin-top: 10px; margin-right: 7px; } #rightnow .reallynow { padding: 6px; font-size: 15px; line-height: 2; margin: 0; } #rightnow .rbutton { font-weight: normal; padding: 6px; border-bottom: none; -moz-border-radius: 2px; -khtml-border-radius: 2px; -webkit-border-radius: 2px; border-radius: 2px; text-decoration: none; } #rightnow .reallynow span { display: block; text-align: left; float: left; padding: 0 6px; } #rightnow .reallynow a { display: block; text-align: right; float: right; padding: 0 6px; font-size: 14px; margin: 1px 6px 0 0; } #rightnow .youhave { font-size: 14px; padding: 10px; } #rightnow h3, #rightnow p { padding: 0 10px; } #rightnow a { font-weight: bold; } /* Widgets */ div#dashboard-widgets-wrap { margin-top: -20px; margin-right: -13px; /* 20 (div.dashboard-widget margin-right) - 7 (#rightnow margin-right) */ } div#dashboard-widgets { width: 100%; } div.dashboard-widget-holder { margin-top: 20px; width: 50%; float: left; } div.dashboard-widget-holder.third { width: 33.3%; } div.dashboard-widget-holder.fourth { width: 25%; } div.dashboard-widget-holder.full { width: 100%; } div.dashboard-widget-holder.double div.dashboard-widget { height: 54em; padding-bottom: 28px /* lame */ } div.dashboard-widget { position: relative; margin-right: 20px; border-width: 1px; border-style: solid; padding: 2px; height: 27em; overflow: auto; font-size: 11px; } h3.dashboard-widget-title { margin: 0; padding: 0 7px; font-size: 14px; line-height: 2; } h3.dashboard-widget-title span { display: block; text-align: left; float: left; } h3.dashboard-widget-title small { display: block; text-align: right; float: right; font-size: 75%; line-height: 2.67; /* math: it works, bitches */ } h3.dashboard-widget-title img.rss-icon { vertical-align: middle; margin: .5em 0; } div.dashboard-widget-notice { padding: 0 14px; font-size: 1.2em; line-height: 2; } div.dashboard-widget-error { padding: 0 20px; font-size: 1.2em; line-height: 2; } div.dashboard-widget-content { padding: 10px 15px; } div.dashboard-widget-submit { border-top: 1px solid #ccc; padding: 1em 0 0 0; margin: 10px 0 0 0; } div.dashboard-widget-submit input { font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; padding: 4px 6px; border: none; font-size: 13px; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; cursor: pointer; text-decoration: none; } div.dashboard-widget-content ul, div.dashboard-widget-content ol, div.dashboard-widget-content dl { margin: 0; text-indent: 0; padding-left: 15px; } div.dashboard-widget-content li { margin: .5em 0 1em; } div.dashboard-widget-content blockquote { margin: -1em 0; } div#dashboard_recent_comments p { font-size: 14px; } div.dashboard-widget-content p.comment-meta { font-size: 11px !important; } #dashboard_secondary div.dashboard-widget { height: auto; } #dashboard_secondary div.dashboard-widget-content ul { list-style: none; padding: 0; } #dashboard_secondary div.dashboard-widget-content ul li { display: block; width: 19.95%; padding-bottom: 10px; margin: 0; float: left; font-size: 95%; } #dashboard_secondary div.dashboard-widget-content { margin: 10px 5px; padding: 0; } #dashboard_secondary div.dashboard-widget-content ul li .post { display:block; font-family:Georgia,"Times New Roman",Times,serif; font-size:18px; line-height: 1.2em; height:90px; overflow:hidden; } #dashboard_secondary div.dashboard-widget-content ul li a { display: block; height:100%; overflow:hidden; margin: 5px 10px; text-decoration: none; padding: .5em; border-right: 1px solid #dadada; border-bottom: 1px solid #dadada; } #dashboard_secondary div.dashboard-widget-content ul li a cite { display: block; font-family: "Lucida Sans", "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; } #dashboard-widgets .widget_rss ul { list-style: none; padding: 0; } #dashboard-widgets .widget_rss ul li { clear: both; } #dashboard-widgets .widget_rss ul li span.rss-date { float: left; margin: 0; } #dashboard-widgets .widget_rss ul li a { float: left; margin: 0 .5em .2em 0; font-weight: bold; } #dashboard-widgets .widget_rss ul li div { clear: both; line-height: 1.5em; } #dashboard_primary a.rsswidget, #dashboard_plugins h5 { font-size: 14px; } #dashboard_primary span.rss-date { font-size: 14px; } #dashboard_plugins h4 { font-size: 1em; margin: 0 0 .1em; } #dashboard_plugins h5 { margin: 0; display: inline; line-height: 1.4em; } #dashboard_plugins p { margin: 0 0 1em; line-height: 1.5em; } .widget-loading { } wp/dev/wp-admin/css/install.css0000644000106600010660000000424511035437745013704 0ustar html { background: #f1f1f1; } body { background: #fff; color: #333; font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; margin: 2em auto 0 auto; width: 700px; padding: 1em 2em; -moz-border-radius: 12px; -khtml-border-radius: 12px; -webkit-border-radius: 12px; border-radius: 12px; } a { color: #2583ad; text-decoration: none; } a:hover { color: #d54e21; } h1 { font-size: 18px; margin-bottom: 0; } h2 { font-size: 16px; } p, li { padding-bottom: 2px; font-size: 13px; line-height: 18px; } code { font-size: 13px; } ul, ol { padding: 5px 5px 5px 22px; } #logo { margin: 6px 0 14px 0px; border-bottom: none;} .step { margin: 20px 0 15px; } .step input { font-size: 18px; } a.button { font-size: 18px; } .step, th { text-align: left; padding: 0; } .submit input, .button, .button-secondary { font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; padding: 5px 7px 7px; border: 1px solid #a3a3a3; margin-left: 0; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; color: #246; background: #e5e5e5; } .button-secondary { background: #cee1ef; } .submit input:hover, .button:hover, .button-secondary:hover { color: #d54e21; border-color: #535353; } .form-table { border-collapse: collapse; margin-top: 1em; width: 100%; } .form-table td { margin-bottom: 9px; padding: 10px; border-bottom: 8px solid #fff; font-size: 12px; } .form-table th { font-size: 13px; text-align: left; padding: 16px 10px 10px 10px; border-bottom: 8px solid #fff; width: 110px; vertical-align: top; } .form-table tr { background: #eaf3fa; } .form-table code { line-height: 18px; font-size: 18px; } .form-table p { margin: 4px 0 0 0; font-size: 11px; } .form-table input { line-height: 20px; font-size: 15px; padding: 2px; } h1 { border-bottom: 1px solid #dadada; clear: both; color: #666666; font: 24px Georgia, "Times New Roman", Times, serif; margin: 5px 0 0 -4px; padding: 0; padding-bottom: 7px; } #error-page { margin-top: 50px; } #error-page p { font-size: 14px; line-height: 16px; margin: 25px 0 20px; } #error-page code { font-size: 15px; }wp/dev/wp-admin/css/widgets.css0000644000106600010660000000621311015130746013666 0ustar /* 2 column liquid layout */ div.widget-liquid-left-holder { float: left; clear: left; width: 100%; margin-right: -310px; } div.widget-liquid-left { margin-right: 320px; } div.widget-liquid-right { float: right; clear: right; width: 300px; position: relative; } /* pasitioning etc. */ form#widgets-filter { position: relative; } div#available-widgets-filter { border-bottom-width: 1px; border-bottom-style: solid; } p#widget-search { position: absolute; right: 0; top: 0; margin: 0; } ul#widget-list { list-style: none; margin: 0; padding: 0; } ul#widget-list li.widget-list-item { padding: .7em 0.9em; margin: 0; border-bottom-width: 1px; border-bottom-style: solid; line-height: 1; } h4.widget-title span { float: left; } h4.widget-title a { float: right; text-decoration: underline; border-bottom: none; margin-left: 1em; } ul#widget-list li.widget-list-item h4.widget-title { position: relative; margin: 0; padding: .5em 1em; width: 200px; float: left; font-size: 13px; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } #dragHelper h4.widget-title { padding: .5em 1em; margin: 0; } ul#widget-list li.widget-list-item div.widget-description { display: block; margin: 0 0 0 200px; padding: 0 0 0 4em; font-size: 11px; } ul#widget-list li.widget-list-item ul.widget-control-info { display: none; } div#sidebar-info { padding: 0 1em; margin-bottom: 1em; font-size: 11px; } ul.widget-control-list { list-style: none; margin: 0; padding: 0 1em; } div#current-widgets p.submit { padding: 1em; } li.widget-list-control-item { margin: 1em 0; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } li.widget-list-control-item h4, #dragHelper li.widget-list-control-item h4, li.widget-sortable h4 { margin: 0; cursor: move; font-size: 13px; padding: 0.4em 0.8em; position: relative; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } .widget-control-save, .widget-control-remove { padding: 3px 5px; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; margin-right: 8px; float: left; text-decoration: none; } li.widget-list-control-item h4.widget-title a, #dragHelper li.widget-list-control-item h4.widget-title a, #draghelper li.widget-list-control-item h4.widget-title a:visited { right: 1em; } li.widget-list-control-item h4.widget-title a:hover { text-decoration: none; border-bottom: none; } li.widget-list-control-item div.widget-control { display: none; padding: 15px; font-size: 11px; position: relative; } li.widget-list-control-item div.widget-control p { margin: 0 0 1em; padding: 0; } ul.widget-control-list div.widget-control-actions { border-top-width: 1px; border-top-style: solid; padding: 0.5em 0 0; } .widget-control-edit { font-size: 10px; font-weight: normal; } div#current-widgets { padding-top: 1em; border-width: 1px; border-style: solid none none; } #widget-controls .widefat { width: 92%; padding: 3px; } #widget-controls select.widefat { width: auto; display: block; } wp/dev/wp-admin/css/install-rtl.css0000644000106600010660000000062311050411575014465 0ustar body { font-family: Tahoma; } /* Half the page disapears on IE6 */ * html body { width: 700px; position: absolute; left: 50%; margin-right: 350px; } ul, ol { padding: 5px 22px 5px 5px; } .step, th { text-align:right; } .submit input, .button, .button-secondary { font-family: Tahoma; margin-right:0; } .form-table th { text-align:right; } h1 { font-family:arial; margin: 5px -4px 0 0; } wp/dev/wp-admin/css/colors-classic-rtl.css0000644000106600010660000000110211050411575015730 0ustar .post-com-count { } #adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins { background-image: url(../images/comment-stalk-rtl.gif); background-position:right bottom; } #footer { background-position:99% 10px; } #poststuff .closed .togbox, #poststuff .togbox { background-image: url(../images/toggle-arrow-rtl.gif) !important; } .bar { border-right-color: transparent; border-left-color: #99d; } .plugins .togl { border-right-color: transparent; border-left-color: #ccc; } #upload-menu li.current { border-right-color: transparent; border-left-color: #448abd; } wp/dev/wp-admin/css/ie-rtl.css0000644000106600010660000000235111050411575013414 0ustar #poststuff .postbox h3 { padding-left:0; padding-right: 23px; } * html #poststuff .postarea, * html #poststuff #titlediv { margin-left:0; margin-right: 3%; } * html #poststuff h2 { margin-right: 0; } #bh { padding-right:0; padding-left: 15px; } div#dashboard-widgets { padding-right:0; padding-left: 1px; } #tagchecklist span a { margin: 4px -9px 0 0; } #poststuff .togbox { margin-left:0; margin-right: -19px; } .widefat th input { margin: 0 5px 0 0; } /* ---------- add by navid */ #dashmenu { /* fix top right bottom in admin */ direction:ltr; } #sidemenu a { /* fix left admin buttom ex. plugins, options */ float:left; } .wrap h2 { margin:5px 4px 0 0; } #editor-toolbar {/* fix hover in media uploader icon */ direction:ltr; } #TB_window { /* fix theme preview */ left:2%; } /* fix widget page */ form#widgets-filter { position:static; } #widget-search { display:none; } /* fix manage comment page */ ul.view-switch li { float:left; } form#posts-filter { position:static; } #post-search { display:none; } #submenu { margin-right: 20px; } /* Fixes for media-upload window */ /* Center media-upload panel on screen */ #TB_window { width: 670px; position: absolute; top: 50%; left: 50%; margin-right: 335px !important; } wp/dev/wp-admin/css/media.css0000644000106600010660000001133611035303340013273 0ustar div#media-upload-header { margin: 0; padding: 0 5px; font-weight: bold; position: relative; border-bottom-width: 1px; border-bottom-style: solid; height: 2.5em; } body#media-upload ul#sidemenu { font-weight: normal; margin: 0 5px; position: absolute; left: 0px; bottom: -1px; } div#media-upload-error { margin: 1em; font-weight: bold; } form { margin: 1em; } #search-filter { text-align: right; } .media-upload-form label, .media-upload-form legend { display:block; font-weight: bold; font-size: 13px; margin-bottom: 0.5em; margin: 0 0 0.5em 0; } th { position: relative; } .media-upload-form label.form-help, td.help { font-style: italic; font-weight: normal; } .media-upload-form p.help { margin: 0; padding: 0; } .media-upload-form fieldset { width: 100%; border: none; text-align: justify; margin: 0 0 1em 0; padding: 0; } /* specific to the image upload form */ .align .field label { display: inline; padding: 0 0 0 28px; margin: 0 1em 0 0; } .image-align-none-label { background: url(../images/align-none.png) no-repeat center left; } .image-align-left-label { background: url(../images/align-left.png) no-repeat center left; } .image-align-center-label { background: url(../images/align-center.png) no-repeat center left; } .image-align-right-label { background: url(../images/align-right.png) no-repeat center left; } #flash-upload-ui, .insert-gallery { display: none; } tr.image-size label { display: inline; margin: 0 1em 0 0; } .pinkynail { max-width: 40px; max-height: 40px; } .filename.original { float: left; } .crunching { display: block; line-height: 32px; text-align: right; margin-right: 5px; } button.dismiss { position: absolute; top: 5px; right: 5px; z-index: 4; } .file-error { margin: 0 0 5px 50px; font-weight: bold; } .progress { position: absolute; top: 0px; left: 0px; width: 623px; height: 36px; } .bar { width: 0px; height: 100%; border-right-width: 3px; border-right-style: solid; } #library-form .progress, #gallery-form .progress { display: none; } .media-item .thumbnail { max-width: 128px; max-height: 128px; } .media-item .pinkynail { float: left; margin: 2px; height: 32px; max-width: 40px; } thead.media-item-info tr { background-color: transparent; } thead.media-item-info th, thead.media-item-info td { border: none; margin: 0; } .form-table thead.media-item-info { border: 8px solid #fff; } .describe.startopen, .describe.startclosed { display: none; } abbr.required { text-decoration: none; border: none; } .describe label { display: inline; } .describe td { vertical-align: middle; } .describe td.A1 { width: 132px; } .describe input[type="text"], .describe textarea { width: 460px; } .describe-toggle-on, .describe-toggle-off { display: block; line-height: 36px; float: right; margin-right: 20px; } .describe-toggle-off { display: none; } .clickmask { } .hidden { height: 0px; width: 0px; overflow: hidden; border: none; } /* Specific to Uploader */ #media-upload .media-upload-form p { margin: 0 1em 1em 0; } #media-upload .media-upload-form p.ml-submit { padding: 1em 0; } #media-upload p.help { font-style: italic; font-weight: normal; } #media-upload tr.image-size td.field { text-align: center; } #media-upload #media-items { border-width: 1px; border-style: solid; border-bottom: none; width: 623px; } #media-upload .media-item { position: relative; border-bottom-width: 1px; border-bottom-style: solid; min-height: 36px; width: 100%; } #media-upload .ui-sortable .media-item { cursor: move; } .filename { float: left; line-height: 36px; margin-left: 10px; overflow: hidden; max-width: 430px; } #media-upload .describe { border-top-width: 1px; border-top-style: solid; padding: 5px; width: 100%; clear: both; cursor: default; } #media-upload .describe th.label { padding-top: .5em; text-align: left; } #media-upload tr.align td.field { text-align: center; } #media-upload tr.image-size { margin-bottom: 1em; height: 3em; } #media-upload #filter { width: 623px; } #media-upload #filter .subsubsub { margin: 8px 0; } #filter .tablenav select { border-style:solid; border-width:1px; padding:2px; vertical-align:top; } #media-upload a.delete, #media-upload a.del-link { padding: 0 3px 1px; } #media-upload .del-attachment { display: none; margin: 5px 0; } .menu_order { float: right; font-size: 11px; margin: 10px 10px 0; } .menu_order_input { border: 1px solid #DDDDDD; font-size: 10px; padding: 1px; width: 23px; } .ui-sortable-helper { background-color: #fff; border: 1px solid #aaa; opacity: 0.6; filter: alpha(opacity=60); } #media-upload th.order-head { width: 25%; text-align: center; } #media-upload .widefat { width: 626px; border-style: solid solid none; } .sorthelper { z-index: -1; } wp/dev/wp-admin/css/theme-editor-rtl.css0000644000106600010660000000031411050411575015402 0ustar #template textarea { font-family:monospace; } #templateside { float:left; } #themeselector { padding-right:0; padding-left: 5px; float: left; } div.tablenav { margin-right:0; margin-left: 210px; } wp/dev/wp-admin/css/theme-editor.css0000644000106600010660000000145510766610447014626 0ustar #template textarea { font-family: 'Courier New', Courier, monospace; font-size: 12px; width: 97%; } #template p { width: 97%; } #templateside { float: right; width: 190px; margin-top:-3.4em; } #templateside h3, #postcustomstuff p.submit { margin: 0; } h3#bordertitle { margin-bottom: 10px; } #templateside h4 { margin-bottom: 0px; } #templateside ol, #templateside ul { list-style: none; margin: .5em; padding: 0; } #templateside ol li, #templateside ul li { margin: 1px 0px; } #themeselector { padding-right: 5px; float: right; position: relative; bottom: 25px; } #themeselector select { margin: 0; padding: 0; } .nonessential { font-size: small; } .highlight { padding: 1px; } div.bordertitle h2 { border: none; padding-bottom: 0px; } div.tablenav { margin-right: 210px; } wp/dev/wp-admin/css/upload-rtl.css0000644000106600010660000000020310771244433014303 0ustar html { direction: ltr; } #uploadoptions, table { direction: rtl; } td { padding: 1px 6px 0; } .submit { text-align: left; }wp/dev/wp-admin/css/login.css0000644000106600010660000000263410764613256013347 0ustar * { margin: 0; padding: 0; } body { border-top-width: 30px; border-top-style: solid; font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; } form { margin-left: 8px; padding: 16px 16px 40px 16px; font-weight: bold; -moz-border-radius: 5px; -khtml-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; } form .forgetmenot { font-weight: normal; float: left; margin-bottom: 0;} #login form .submit input { font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; padding: 3px 5px; border: none; font-size: 13px; border-width: 1px; border-style: solid; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; cursor: default; text-decoration: none; margin-top: -6px; } form .submit { float: right; } form p { margin-bottom: 24px; } h1 a { background: url(../images/logo-login.gif) no-repeat; width: 292px; height: 66px; text-indent: -9999px; overflow: hidden; padding-bottom: 15px; display: block; } #backtoblog a { position: absolute; top: 7px; left: 15px; text-decoration: none; } #login { width: 292px; margin: 7em auto; } #login_error, .message { margin: 0 0 16px 8px; border-width: 1px; border-style: solid; padding: 12px; } #nav { margin: 0 0 0 8px; padding: 16px; } #user_pass, #user_login, #user_email { font-size: 20px; width: 97%; padding: 3px; margin-right: 6px; }wp/dev/wp-admin/css/ie.css0000644000106600010660000000443711002230355012614 0ustar /* Fixes for IE bugs */ #poststuff .postbox h3 { padding-left: 23px; } #submenu li a.current { background:none; border:none; } * html body.minwidth { _width: expression(document.documentElement.clientWidth < 810 ? "808px" : "99.9%"); } * html #wpbody { _width: expression(document.documentElement.clientWidth > 982 ? "980px" : "99.9%"); } * html #poststuff .postarea, * html #poststuff #titlediv { width: 95%; margin-left: 3%; } .submitbox { margin-top: 10px; } * html div.widget-liquid-left-holder, * html div.widget-liquid-right { display: block; position: relative; } #wpwrap, #wpcontent, #post, #wrap, #postdivrich, #postdiv, #poststuff, #titlediv, #post-body, #editorcontainer, .tablenav, .widget-control-list, li.widget-list-control-item, #dragHelper, li.widget-list-control-item h4, .widget-sortable, .widget-control-actions { display: block; zoom: 100%; } * html #editorcontainer { padding: 0; } * html #editorcontainer #content { position: relative; overflow: auto; padding: 6px; margin: auto; width: 98%; } form#template div { width: 100%; } #ed_toolbar input { overflow: visible; padding: 0 4px; } #poststuff h2 { font-size: 1.6em; } * html #poststuff h2 { margin-left: 0; } #bh { padding-right: 15px; } /* without this dashboard widgets appear in one column for some screen widths */ div#dashboard-widgets { padding-right: 1px; } #tagchecklist { display: block; zoom: 100%; } #tagchecklist span, #tagchecklist span a { display: inline-block; display: block; } #tagchecklist span a { margin: 4px 0 0 -9px; } #poststuff .togbox { margin-left: -19px; } .tablenav .button-secondary, .nav .button-secondary { padding: 0 1px; vertical-align: middle; } .tablenav select { font-size: 13px; display: inline-block; vertical-align: top; margin-top: 2px; } .tablenav-pages .page-numbers { display: inline-block; } .tablenav-pages { display: block; margin-top: -3px; } table.ie-fixed { table-layout: fixed; } #post-search .button, #widget-search .button { padding: 1px; } .widefat tr, .widefat th { margin-bottom: 0; border-spacing: 0; } .widefat th input { margin: 0 0 0 5px; } .widefat .check-column { padding: 6px 0 2px; } .widefat tbody th.check-column { padding: 4px 0 22px; } .tablenav a.button-secondary { display: inline-block; padding: 2px 5px; } wp/dev/wp-admin/css/press-this-rtl.css0000644000106600010660000000250111050411575015115 0ustar body { font-family: Tahoma; } .ui-tabs-nav { padding-left:0; padding-right:8px; } .ui-tabs-nav li { float: right; } .button { font-family: Tahoma; margin-left:0; margin-right: 5px; } #wphead #viewsite { margin-left:0; margin-right: 10px; } #viewsite { right:auto; left: 8px; } #wphead #viewsite a { font-family: Tahoma; } h1 { right:auto; left:0; } div#posting { padding-left:0; padding-right: 16px; } #photo_directions span { right:auto; left:3px; } #img_container a { float:right; } #img_container a, #img_container a:link, #img_container a:visited { margin:0 0 4px 4px; } div#categories { right:auto; left:16px; } div#categories h2 { margin: .5em 1em .5em 0; } #tagsdiv #newtag { margin-right:0; margin-left: 5px; } #jaxtag { padding-left:0; padding-right: 1em; } #tagchecklist { padding-left:0; padding-right: 1em; } #tagchecklist span { margin-right: 10px; margin-left: .5em; float: right; } #tagchecklist span a { margin: 6px -9px 0pt 0; float: right; } .submitbox { float: left; } .submitbox .submit input { text-align:right; } .video_split #extra_fields { float:right; } .video_split .editor_area { float: left; } .ac_results li { text-align:right; } #TB_ajaxContent #options { right:auto; left:25px; } #post_status { margin-left:0; margin-right: 10px; } #footer { padding: 10px 60px 0 0; } wp/dev/wp-admin/css/media-rtl.css0000644000106600010660000000202711050411575014076 0ustar body#media-upload ul#sidemenu { left:auto; right:0; width: 620px; } #search-filter { text-align:left; } .align .field label { padding: 0 28px 0 0; margin: 0 0 0 1em; } .image-align-none-label, .image-align-left-label, .image-align-center-label, .image-align-right-label { background-position:center right; } tr.image-size label { margin: 0 0 0 1em; } .filename.original { float: right; } .crunching { text-align: left; margin-right:0; margin-left: 5px; } button.dismiss { right:auto; left:5px; } .file-error { margin: 0 50px 5px 0; } .progress { left:auto; right:0; } .bar { border-right-width:0; border-left-width: 3px; border-left-style: solid; } .media-item .pinkynail { float:right; } .describe-toggle-on, .describe-toggle-off { float: left; margin-right:0; margin-left: 20px; } /* Specific to Uploader */ #media-upload .media-upload-form p { margin: 0 0 1em 1em; } .filename { float: right; margin-left:0; margin-right: 10px; } #media-upload .describe th.label { text-align:right; } .menu_order { float:left; } wp/dev/wp-admin/css/global.css0000644000106600010660000000571311010633563013464 0ustar /* styles for use by people extending the WordPress interface */ body { margin: 0; padding: 0; } body, td { font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; } form, label input { margin: 0; padding: 0; } img { border: 0; } label { cursor: pointer; } li, dd { margin-bottom: 6px; } p, li, dl, dd, dt { line-height: 140%; } textarea, input, select { font: 13px Verdana, Arial, Helvetica, sans-serif; margin: 1px; padding: 3px; } .alignleft { float: left; } .alignright { float: right; } .textleft { text-align: left; } .textright { text-align: right; } .clear { clear: both; height: 2px; } .hidden { display: none; } h1 { display: block; font-size: 2em; font-weight: bold; margin: .67em 0; } h2 { display: block; font-size: 1.5em; font-weight: bold; margin: .83em 0; } h3 { display: block; font-size: 1.17em; font-weight: bold; margin: 1em 0; } h4 { display: block; font-weight: bold; margin: 1.33em 0; } h5 { display: block; font-size: 0.83em; font-weight: bold; margin: 1.67em 0; } h6 { display: block; font-size: 0.67em; font-weight: bold; margin: 2.33em 0; } .subsubsub { list-style: none; margin: 14px 0 8px 0; padding: 0; white-space: nowrap; font-size: 12px; } .subsubsub a { line-height: 200%; padding: 3px; text-decoration: none; } .subsubsub a.current { font-weight: bold; background: none; border: none;} .subsubsub li { display: inline; margin: 0; padding: 0; } .widefat { border-width: 1px; border-style: solid; border-collapse: collapse; width: 100%; clear: both; margin: 0; } .widefat a { text-decoration: none; } .widefat abbr { white-space: nowrap; } .widefat td, .widefat th { border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #ccc; font-size: 11px; vertical-align: text-top; } .widefat td { padding: 7px 15px 9px 10px; vertical-align: top; } .widefat th { padding: 9px 15px 6px 10px; text-align: left; line-height: 1.3em; } .widefat th input { margin: 0 0 0 8px; padding: 0; } .widefat .check-column { text-align: right; width: 1.5em; padding: 0; } .widefat tbody th.check-column { padding: 8px 0 22px; } /* th.check-column + th, th.check-column + td { padding-left: 5px; } */ .widefat .num { text-align: center; } .wrap, .updated, .error { margin: 0; margin-left: 15px; margin-right: 15px; padding: 0; max-width: 980px; } .updated, .error { border-width: 1px; border-style: solid; padding: 0 0.6em; max-width: 950px; margin-bottom: 1em; } .updated p, .error p { margin: 0.6em 0; } .wrap .updated, .wrap .error { margin: auto 0 0; } .updated a, .error a { text-decoration: underline; } .updated a { text-decoration: none; padding-bottom: 2px; } .wrap h2 { border-bottom-width: 1px; border-bottom-style: solid; clear: both; font: 24px Georgia, "Times New Roman", Times, serif; margin: 5px 0 0 -4px; padding: 0; padding-bottom: 7px; padding-right: 280px; } .wrap h2.long-header { padding-right: 0; } wp/dev/wp-admin/css/login-rtl.css0000644000106600010660000000074511050411575014134 0ustar body { font-family: Tahoma; } form { margin-left:0; margin-right: 8px; } form .forgetmenot { float:right; } #login form .submit input { font-family: Tahoma; } form .submit { float:left; } #backtoblog a { left:auto; right:15px; } #login_error, .message { margin: 0 8px 16px 0; } #nav { margin:0 8px 0 0; } #user_pass, #user_login, #user_email { margin-right:0; margin-left: 6px; } h1 a { text-decoration:none; } /* ltr input */ #user_login, #user_pass { direction:ltr; } wp/dev/wp-admin/css/colors-fresh-rtl.css0000644000106600010660000000106611050411575015427 0ustar .bar { border-right-color: transparent; border-left-color: #99d; } .post-com-count { } #adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins { background-image: url(../images/comment-stalk-rtl.gif); background-position:right bottom; } #footer { background-position:99% 10px; } .plugins .togl { border-right-color: transparent; border-left-color: #ccc; } #poststuff .closed .togbox, #poststuff .togbox { background-image: url(../images/toggle-arrow-rtl.gif); } #upload-menu li.current { border-right-color:transparent; border-left-color: #448abd; } wp/dev/wp-admin/css/dashboard-rtl.css0000644000106600010660000000237211050411575014751 0ustar /* Right Now */ #rightnow { margin-right:0; margin-left: 7px; } #rightnow .reallynow span { text-align: right; float: right; } #rightnow .reallynow a { text-align: left; float: left; margin: 1px 0 0 6px; } /* Widgets */ div#dashboard-widgets-wrap { margin-right:0; margin-left:-13px; } div.dashboard-widget-holder { float:right; } div.dashboard-widget { margin-right:0; margin-left: 20px; } h3.dashboard-widget-title span { text-align: right; float: right; } h3.dashboard-widget-title small { text-align: left; float:left; } div.dashboard-widget-submit input { font-family: Tahoma; } div.dashboard-widget-content ul, div.dashboard-widget-content ol, div.dashboard-widget-content dl { padding-left:0; padding-right:15px; } #dashboard_secondary div.dashboard-widget-content ul li { float:right; } #dashboard_secondary div.dashboard-widget-content ul li .post { font-family:arial; } #dashboard_secondary div.dashboard-widget-content ul li a { border-right:0 none; border-left: 1px solid #dadada; height:110px; } #dashboard_secondary div.dashboard-widget-content ul li a cite { font-family: Tahoma; } #dashboard-widgets .widget_rss ul li span.rss-date { float:right; } #dashboard-widgets .widget_rss ul li a { float: right; margin: 0 0 .2em .5em; } wp/dev/wp-admin/css/widgets-rtl.css0000644000106600010660000000156211050411575014470 0ustar /* 2 column liquid layout */ div.widget-liquid-left-holder { float: right; clear: right; margin-right:0; margin-left: -310px; } div.widget-liquid-left { margin-right:0; margin-left: 320px; } div.widget-liquid-right { float: left; clear: left; } p#widget-search { right:auto; left:0; } h4.widget-title span { float: right; } h4.widget-title a { float: left; margin-left:0; margin-right: 1em; } ul#widget-list li.widget-list-item h4.widget-title { float:right; } ul#widget-list li.widget-list-item div.widget-description { margin: 0 200px 0 0; padding: 0 4em 0 0; } .widget-control-save, .widget-control-remove { margin-right:0; margin-left: 8px; float: right; } li.widget-list-control-item h4.widget-title a, #dragHelper li.widget-list-control-item h4.widget-title a, #draghelper li.widget-list-control-item h4.widget-title a:visited { right:auto; left: 1em; } wp/dev/wp-admin/css/global-rtl.css0000644000106600010660000000071111050411575014255 0ustar body, td { font-family: Tahoma; } textarea, input, select { font-family: Tahoma; } h1, h2, h3 { font-family:arial; } .widefat td { padding: 7px 10px 9px 15px; } .widefat th { padding: 9px 10px 6px 15px; text-align: right; } .widefat th input { margin: 0 8px 0 0; } .widefat .check-column { text-align: left; } .wrap h2 { font-family:arial; margin: 5px -4px 0 0; padding-right:0; padding-left: 280px; } .wrap h2.long-header { padding-left: 0; } wp/dev/wp-admin/css/press-this-ie-rtl.css0000644000106600010660000000004411050411575015510 0ustar .ui-tabs-nav { margin-right: 0; } wp/dev/wp-admin/css/press-this-ie.css0000644000106600010660000000016111036305435014712 0ustar #posting { position: static !important; } .ui-tabs-nav { margin-left: 0; border: 0 !important; } wp/dev/wp-admin/css/colors-fresh.css0000644000106600010660000003302311035335670014632 0ustar a.page-numbers:hover { border-color: #999; } body, .form-table .pre { background-color: #fff; color: #333; } body > #upload-menu { border-bottom-color: #fff; } div#current-widgets, #postcustomstuff table, #your-profile fieldset, a.page-numbers, #rightnow, div.dashboard-widget, .widefat { border-color: #ccc; } div.dashboard-widget-error { background-color: #c43; } div.dashboard-widget-notice { background-color: #cfe1ef; } div.dashboard-widget-submit, ul.widget-control-list div.widget-control-actions { border-top-color: #ccc; } div.ui-tabs-panel { border-color: #cee1ef; } input.disabled, textarea.disabled { background-color: #ccc; } #user_info a:hover, li.widget-list-control-item h4.widget-title a:hover, .submit a, #dashmenu a:hover, #footer a, #upload-menu li a.upload-tab-link, li.widget-list-control-item h4.widget-title a, #dragHelper li.widget-list-control-item h4.widget-title a, #draghelper li.widget-list-control-item h4.widget-title a:visited, .login #backtoblog a:hover { color: #fff; } li.widget-list-control-item, div.nav, .tablenav, .submitbox, h3.dashboard-widget-title, h3.dashboard-widget-title span, h3.dashboard-widget-title small, ul.view-switch li.current, .form-table tr, #poststuff h3, .login form, h3.info-box-title { background-color: #eaf3fa; } select { background-color: #fff; border-color: #ddd; } strong .post-com-count span { background-color: #2583ad; } ul#category-tabs li.ui-tabs-selected, .button-secondary, #quicktags, #login form .submit input { background-color: #cee1ef !important; } ul#widget-list li.widget-list-item h4.widget-title { background-color: #f0f0f0; color: #000; } .sorthelper { background-color: #ccf3fa; } .ac_match, .subsubsub a.current, h2 { color: #000; } .ac_over { background-color: #f0f0b8; } .ac_results { background-color: #fff; border-color: #808080; } .ac_results li { color: #101010; } .alternate { background-color: #f9f9f9; } .available-theme a.screenshot { background-color: #f1f1f1; border-color: #ccc; } .bar { background-color: #e8e8e8; border-right-color: #99d; } .describe { border-top-color: #d0d0d0; } .error, #login #login_error { background-color: #ffebe8; border-color: #c00; } .error a { color: #c00; } .form-invalid { background-color: #ffebe8 !important; } .form-invalid input { border-color: #c00 !important; } .form-table input, .form-table textarea { border-color: #c6d9e9; } .form-table td, .form-table th { border-bottom-color: #fff; } .highlight { background-color: #e4f2fd; color: #d54e21; } #user_info, .howto, .nonessential, #dashmenu a, #sidemenu, #edit-slug-box, .form-input-tip, #dashboard_primary span.rss-date, .subsubsub, #dashboard_secondary div.dashboard-widget-content ul li a cite { color: #999; } .media-item { border-bottom-color: #d0d0d0; } .media-upload-form label.form-help, td.help { color: #9a9a9a; } .page-numbers { background-color: #fff; border-color: #fff; } .page-numbers.current { background-color: #328ab2; border-color: #328ab2; color: #fff; } .post-com-count { background-image: url(../images/bubble_bg.gif); color: #fff; } .post-com-count span { background-color: #bbb; color: #fff; } .post-com-count:hover span { background-color: #d54e21; } .quicktags, .search { background-color: #ccc; color: #000; } .side-info h5, .bordertitle { border-bottom-color: #dadada; } .side-info ul, .widget-description { color: #666; } .submit input, .button, .button-secondary, #login form .submit input, div.dashboard-widget-submit input, #edit-slug-buttons a.save { background-color: #e5e5e5; color: #246; border-color: #80b5d0; } .button[disabled], .button:disabled { background-color: #999; } .submit input:hover, .button:hover, #edit-slug-buttons a.save:hover { border-color: #535353; } .submit input:hover, .button:hover, .button-secondary:hover, #wphead #viewsite a:hover, #adminmenu a:hover, #sidemenu a:hover, #submenu a.current, #submenu a:hover, .submitbox #previewview a:hover, #the-comment-list .comment a:hover, #rightnow a:hover, a:hover, .subsubsub a:hover, .subsubsub a.current:hover, #login form .submit input:hover, div.dashboard-widget-submit input:hover, #edit-slug-buttons a.save:hover, #media-upload a.delete:hover, #media-upload a.del-link:hover, .ui-tabs-nav a:hover { color: #d54e21; } .button-secondary:hover, #login form .submit input:hover { border-color: #328ab2; } .submitbox #autosave .error, ul.view-switch li.current a { color: #333; } .submitbox #previewview { background-color: #2683ae; } .submitbox #previewview a, #rightnow .rbutton { background-color: #ebebeb; color: #264761; } .submitbox .submit { background-color: #464646; color: #ccc; } .submitbox .submitdelete { border-bottom-color: #999; } .submitbox .submitdelete:hover, #media-upload a.delete:hover { color: #fff; background-color: #f00; border-bottom-color: #f00; } .tablenav .dots { background-color: #e4f2fd; border-color: #e4f2fd; } .tablenav .next, .tablenav .prev{ background-color: #e4f2fd; border-bottom-color: #2583ad; border-color: #e4f2fd; color: #2583ad; } .tablenav .next:hover, .tablenav .prev:hover { border-bottom-color: #d54e21; border-color: #e4f2fd; color: #d54e21; } .updated, .login #login_error, .login .message { background-color: #ffffe0; border-color: #e6db55; } .updated a { border-bottom-color: #2583ad; } .widefat td, .widefat th, div#available-widgets-filter, ul#widget-list li.widget-list-item, .commentlist li { border-bottom-color: #ccc; } .widefat thead, .thead { background-color: #464646; color: #d7d7d7; } .widget-control-save, .widget-control-remove { background-color: #cee1ef; color: #246; } .wrap h2 { border-bottom-color: #dadada; color: #666; } #adminmenu a, #submenu a, #poststuff #edButtonPreview, #poststuff #edButtonHTML, #the-comment-list p.comment-author strong a, #media-upload a.del-link, #media-upload a.delete, .ui-tabs-nav a, a { color: #2583ad; } /* Because we don't want visited on these links */ #adminmenu a.current, #sidemenu a.current, body.press-this .ui-tabs-selected a, body.press-this .ui-tabs-selected a:hover { background-color: #fff; border-color: #c6d9e9; border-bottom-color: #fff; color: #d54e21; } #adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins { background-image: url(../images/comment-stalk-fresh.gif); } #adminmenu li a #awaiting-mod span, #sidemenu li a #update-plugins span, #rightnow .reallynow { background-color: #d54e21; color: #fff; } #adminmenu li a:hover #awaiting-mod span, #sidemenu li a:hover #update-plugins span { background-color: #264761; } #adminmenu, div#media-upload-header { background-color: #e4f2fd; border-bottom-color: #c6d9e9; } #currenttheme img { border-color: #666; } #current-widgets .drop-widget-here { background-color: #ffc; } #dashboard_secondary div.dashboard-widget-content ul li a { background-color: #f9f9f9; } input.readonly { background-color: #ddd; } #dashmenu a.current { background-color: #e4f2fd; color: #555; } #dragHelper h4.widget-title, li.widget-list-control-item h4, #dragHelper li.widget-list-control-item h4 { background-color: #2683ae; color: #fff; } #ed_toolbar input { background: url( ../images/fade-butt.png ) #fff repeat-x 0 -2px; } #editable-post-name { background-color: #fffbcc; } #edit-slug-box strong, .login #nav a { color: #777; } #footer { background: url(../images/logo-ghost.png) #464646 no-repeat 20px 10px; color: #999; } #media-items { border-color: #c0c0c0; } #pass-strength-result { background-color: #e3e3e3; border-color: #000; } #pass-strength-result.bad { background-color: #ffeff7; border-color: #c69; } #pass-strength-result.good { background-color: #effff4; border-color: #66cc87; } #pass-strength-result.short { background-color: #e3e3e3; } #pass-strength-result.strong { background-color: #59ef86; border-color: #319f52; } .checkbox, .side-info, #your-profile #rich_editing { background-color: #fff; } .plugins .active { background-color: #e7f7d3; } .plugins .togl { border-right-color: #ccc; } #the-comment-list .unapproved { background-color: #ffffe0; } .plugins tr { background-color: #fff; } #poststuff #editor-toolbar .active { background-color: #cee1ef; color: #333; } #poststuff .closed .togbox { background-color: #2583ad; background-image: url(../images/toggle-arrow.gif); } #poststuff .postbox, #titlediv, #poststuff .postarea, #poststuff .stuffbox { border-color: #ebebeb; border-right-color: #ccc; border-bottom-color: #ccc; } #poststuff .togbox { background-color: #b2b2b2; background-image: url(../images/toggle-arrow.gif); } #quicktags #ed_link { color: #00f; } #rightnow .youhave { background-color: #f0f6fb; } #rightnow a { color: #448abd; } #sidemenu a { background-color: #e4f2fd; border-bottom-color: #c6d9e9; border-top-color: #e4f2fd; } #tagchecklist span a { background: url(../images/xit.gif) no-repeat; } #tagchecklist span a:hover { background: url(../images/xit.gif) no-repeat -10px 0; } #the-comment-list .comment a { border-bottom-color: #ababab; color: #666; } #update-nag, .plugin-update { background-color: #fffeeb; border-bottom-color: #ccc; border-top-color: #ccc; color: #555; } #upload-files a.file-link { background-color: #d1e2ef; } #upload-file-view a img { border-bottom-color: #69c; } #upload-menu li #current-tab-nav, #upload-file { background-color: #f9fcfe; } #upload-menu li span a.page-numbers { color: #00019b; } #upload-menu li.current { border-right-color: #448abd; color: #000; } #upload-menu li.current a.upload-tab-link, #upload-menu li a:hover { background-color: #f9fcfe; color: #000; } #upload-menu, #upload-menu li { border-top-color: #247fab; } .login #backtoblog a, .curtime, #user_info a { color: #ccc; } #wphead { background-color: #e4f2fd; } #wphead, body.login { border-top-color: #464646; } #wphead #viewsite a { background-color: #c6d9e9; color: #246; border-color: #80b5d0; } #wphead #viewsite a:hover { border-color: #328ab2; } #wphead h1, #dashmenu a.current:hover, #login form input { color: #555; } div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover, .delete:hover { color: #f00; } #media-upload a.delete { color: #888; } /* TinyMCE */ .wp_themeSkin *, .wp_themeSkin a:hover, .wp_themeSkin a:link, .wp_themeSkin a:visited, .wp_themeSkin a:active { color: #000; } /* Containers */ .wp_themeSkin table, #wp_editbtns { background: #cee1ef; } .wp_themeSkin iframe { background: #fff; } /* Layout */ .wp_themeSkin .mceStatusbar { color:#000; background-color: #eaf3fa; } /* Button */ .wp_themeSkin .mceButton { background-color: #e9e8e8; border-color: #abc0fb; } .wp_themeSkin a.mceButtonEnabled:hover, .wp_themeSkin a.mceButtonActive, .wp_themeSkin a.mceButtonSelected { background-color: #d6d8da; border-color: #7789ba !important; } .wp_themeSkin .mceButtonDisabled { border-color: #bdd !important; } /* ListBox */ .wp_themeSkin .mceListBox .mceText, .wp_themeSkin .mceListBox .mceOpen { border-color: #abc0fb; background-color: #e9e8e8; } .wp_themeSkin table.mceListBoxEnabled:hover .mceOpen, .wp_themeSkin .mceListBoxHover .mceOpen, .wp_themeSkin .mceListBoxSelected .mceOpen, .wp_themeSkin .mceListBoxSelected .mceText { border-color: #7789ba !important; background-color: #d6d8da; } .wp_themeSkin table.mceListBoxEnabled:hover .mceText, .wp_themeSkin .mceListBoxHover .mceText { border-color: #7789ba !important; } .wp_themeSkin select.mceListBox { border-color: #b3c7e1; background-color: #fff; } /* SplitButton */ .wp_themeSkin .mceSplitButton a.mceAction, .wp_themeSkin .mceSplitButton a.mceOpen { background-color: #e9e8e8; border-color: #abc0fb; } .wp_themeSkin .mceSplitButton a.mceOpen:hover, .wp_themeSkin .mceSplitButtonSelected a.mceOpen, .wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction, .wp_themeSkin .mceSplitButton a.mceAction:hover { background-color: #d6d8da; border-color: #7789ba !important; } .wp_themeSkin .mceSplitButtonActive { background-color: #d6d8da; } /* ColorSplitButton */ .wp_themeSkin div.mceColorSplitMenu table { background-color: #ebeaeb; border-color: #808080; } .wp_themeSkin .mceColorSplitMenu a { border-color: #808080; } .wp_themeSkin .mceColorSplitMenu a.mceMoreColors { border-color: #fff; } .wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover { border-color: #0A246A; background-color: #B6BDD2; } .wp_themeSkin a.mceMoreColors:hover { border-color: #0A246A; } /* Menu */ .wp_themeSkin .mceMenu { border-color: #ddd; } .wp_themeSkin .mceMenu table { background-color: #ebeaeb; } .wp_themeSkin .mceMenu .mceText { color: #000; } .wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover, .wp_themeSkin .mceMenu .mceMenuItemActive { background-color: #CEE1EF; } .wp_themeSkin td.mceMenuItemSeparator { background-color: #aaa; } .wp_themeSkin .mceMenuItemTitle a { background-color: #ccc; border-bottom-color: #aaa; } .wp_themeSkin .mceMenuItemTitle span.mceText { color: #000; } .wp_themeSkin .mceMenuItemDisabled .mceText { color: #888; } /* pop-up */ .clearlooks2 .mceTop .mceLeft, .clearlooks2 .mceTop .mceRight { background-color: #cee1ef; border-color: #c6d9e9; } .clearlooks2 .mceFocus .mceTop .mceLeft, .clearlooks2 .mceFocus .mceTop .mceRight { background-color: #2683ae; border-color: #464646; } #editorcontainer { border-color: #ccc; } #poststuff #titlewrap { border-color: #ccc; } .curtime { color: #666; } #tTips p#tTips_inside { background-color: #ddd; color: #333; } /* Diff */ table.diff .diff-deletedline { background-color: #ffdddd; } table.diff .diff-deletedline del { background-color: #ff9999; } table.diff .diff-addedline { background-color: #ddffdd; } table.diff .diff-addedline ins { background-color: #99ff99; } wp/dev/wp-admin/css/press-this.css0000644000106600010660000002015111046105152014313 0ustar body { font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; color: #333; margin: 0px; padding: 0px; } img { border: 0; } /* Tabs */ @media projection , screen { .ui-tabs-hide { display: none; } } @media print { .ui-tabs-nav { display: none; } } .ui-tabs-nav { list-style: none; border-bottom: 1px solid #C6D9E9; padding-left: 8px; margin-bottom: .5em; margin-top: -2em; } /* Additional IE specific bug fixes... */ * html .ui-tabs-nav { /* auto clear, @ IE 6 & IE 7 Quirks Mode */ display: inline-block; } * :first-child+html .ui-tabs-nav { /* @ IE 7 Standards Mode - do not group selectors, otherwise IE 6 will ignore complete rule (because of the unknown + combinator)... */ display: inline-block; } .ui-tabs-nav:after { /* clearing without presentational markup, IE gets extra treatment */ display: block; clear: both; content: " "; } .ui-tabs-nav li { float: left; margin: 0; height: 2em; line-height: 2em; } .ui-tabs-nav a,.ui-tabs-nav a span { display: block; } .ui-tabs-nav a { margin: 1px 0 0; /* position: relative makes opacity fail for disabled tab in IE */ padding-left: 0; color: #27537a; font-weight: bold; line-height: 2em; text-align: center; text-decoration: none; white-space: nowrap; /* required in IE 6 */ outline: 0; /* prevent dotted border in Firefox */ padding: 0 1em; } .ui-tabs-nav .ui-tabs-selected a { position: relative; top: 1px; z-index: 2; margin-top: 0; -moz-border-radius-topleft: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-left-radius: 4px; -webkit-border-top-right-radius: 4px; border-style: solid; border-width: 1px; background: white; border-bottom-width: 2px; margin-top: -2px; } .ui-tabs-nav a:hover,.ui-tabs-nav a:focus,.ui-tabs-nav a:active, .ui-tabs-nav .ui-tabs-selected a:link,.ui-tabs-nav .ui-tabs-selected a:visited { cursor: pointer; } /* Header */ #wphead { border-top: none; height: 2em; padding-top: 8px; } .button { font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; padding: 3px 5px; font-size: 12px; line-height: 1.5em; border-width: 1px; border-style: solid; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; cursor: pointer; margin-left: 5px; text-decoration: none; } .howto { font-size: 11px; font-style: italic; display: block; } #wphead #viewsite { position: absolute; margin-top: 12px; margin-left: 10px; } #viewsite { position: relative; right: 8px; top: 6px; margin: 0 !important; } #wphead #viewsite a { font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; padding: 3px 4px; display: block; letter-spacing: normal; border-width: 1px; border-style: solid; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; text-decoration: none; } #previewview { padding-top: 8px !important; padding-bottom: 8px !important; } h1 { font-size: .75em; line-height: 2.666em; top: .5em; right: 0; margin: 0 !important; padding: 0 !important; width: 236px; background: none; } input.text { border: 0pt none; outline-color: -moz-use-text-color; outline-style: none; outline-width: medium; padding: 0pt; width: 100%; border-style: solid; color: #333333; } /* Editor/Main Column */ div#container { margin: 0; min-width: 500px; } div#container form { margin: 0px; padding: 0px; } div#posting { padding-left: 16px; position: absolute; z-index: 1; width: 66%; } #post_title { width: 99%; } .titlewrap { border-style: solid; border-width: 1px; padding: 2px 3px; border-color: #CCCCCC; } div#posting h2 { margin: .5em 0 .25em 0; font-size: 12px; padding: 3px; background: ; } .editor-container { border-width: 1px; border-color: #ccc; border-style: solid; margin-bottom: 1em; } /* Photo Styles */ #photo_directions { margin-top: .25em; display: block; position: relative; } #photo_directions span { display: block; position: absolute; top: 0; right: 3px; } #photo_saving { margin: 0 8px 8px; vertical-align: middle; } #img_container { background-color: #fff; overflow: auto; height: 100px; } #img_container a { display: block; width: 79px; height: 79px; float: left; } #img_container img { width: 75px; height: 75px; border: 0px; padding: 2px; background-color: #f4f4f4; cursor: pointer; } #img_container a, #img_container a:link, #img_container a:visited { border: 2px solid #ccc; margin: 0 4px 4px 0; } #img_container a:hover, #img_container a:active { border: 2px solid #000; } /* Submit Column */ div#categories { font-size: 85%; position: absolute; top: 50px; right: 16px; width: 27%; z-index: 2; } div#categories h2 { color: #333; font-size: 12px; margin: .5em 0 .5em 1em; padding: 0; } #categories-all { overflow: auto; padding: 0 1em 1em 1em; height: 15em; } #categories ul { list-style: none; padding: 0; margin: 0; } #tagsdiv #newtag { padding: 3px; margin-right: 5px; width: 16em; } #jaxtag { clear: both; padding-left: 1em; margin: 0; } #tagchecklist { padding-left: 1em; margin-bottom: 1em; font-size: 12px; overflow: auto; } #tagchecklist strong { position: absolute; font-size: .75em; } #tagchecklist span { margin-right: .5em; margin-left: 10px; display: block; float: left; font-size: 11px; line-height: 1.8em; white-space: nowrap; cursor: default; } #tagchecklist span a { margin: 6px 0pt 0pt -9px; cursor: pointer; width: 10px; height: 10px; display: block; float: left; text-indent: -9999px; overflow: hidden; position: absolute; } .submit { -moz-border-radius-bottomleft: 3px; -khtml-border-bottom-left-radius: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; -moz-border-radius-bottomright: 3px; -khtml-border-bottom-right-radius: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; margin: 0; padding: 10px; } .submitbox { width: 100%; float: right; } .submitbox .submit a:hover { border-bottom-width: 1px; border-bottom-style: solid; } .submitbox .submit input { border: none; text-align: left; padding: 6px 4px; font-size: 12px; margin: 2px; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; cursor: pointer; } .submitbox #previewview { padding: 15px 10px; -moz-border-radius-topleft: 3px; -khtml-border-top-left-radius: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; -moz-border-radius-topright: 3px; -khtml-border-top-right-radius: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; } /* Video Styles */ .video_split #extra_fields { width: 27%; height: 300px; float: left; } #embed_code { border: 0; width: 99%; height: 200px; } .video_split .editor_area { width: 70%; float: right; } .ac_results { padding: 0; margin: 0; list-style: none; position: absolute; z-index: 10000; display: none; border-width: 1px; border-style: solid; } .ac_results li { padding: 2px 5px; white-space: nowrap; text-align: left; } .ac_over { cursor: pointer; } .ac_match { text-decoration: underline; } .photolist { display: none; } #extra_fields small { display: block; margin-top: .5em; padding-bottom: .25em; } #TB_ajaxContent #options { position: absolute; top: 20px; right: 25px; padding: 5px; } #TB_ajaxContent h3 { margin-bottom: .25em; } .updated { margin: 0; margin-left: 15px; margin-right: 15px; padding: 0; max-width: 980px; border-width: 1px; border-style: solid; padding: 0 0.6em; max-width: 950px; margin-top: 1em; margin-bottom: 1em; } .updated p, .error p { margin: 0.6em 0; } .updated a, .error a { text-decoration: underline; } .updated a { text-decoration: none; padding-bottom: 2px; } #post_status { margin-left: 10px; margin-bottom: 1em; display: block; } /* Footer */ #footer { height: 65px; display: block; width: 640px; padding: 10px 0 0 60px; margin: 0; position: absolute; bottom: 0; font-size: 12px; } #footer p { margin: 0; padding: 7px 0; } #footer p a { text-decoration: none; } #footer p a:hover { text-decoration: underline; } /* Utility Classes */ .centered { text-align: center; } .hidden { display: none; }wp/dev/wp-admin/admin-header.php0000644000106600010660000001473311041677002013753 0ustar > <?php bloginfo('name') ?> › <?php echo wp_specialchars( strip_tags( $title ) ); ?> — WordPress

    %2$s!'), 'profile.php', $user_identity) ?> | | Help') ?> | Forums'); if ( ! $is_opera ) { ?> |

    wp/dev/wp-admin/edit.php0000644000106600010660000001741011017044331012351 0ustar post_type == 'attachment' ) { if ( ! wp_delete_attachment($post_id_del) ) wp_die( __('Error in deleting...') ); } else { if ( !wp_delete_post($post_id_del) ) wp_die( __('Error in deleting...') ); } } $sendback = wp_get_referer(); if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('post-new.php'); elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); wp_redirect($sendback); exit(); } elseif ( !empty($_GET['_wp_http_referer']) ) { wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); exit; } $title = __('Posts'); $parent_file = 'edit.php'; wp_enqueue_script('admin-forms'); list($post_stati, $avail_post_stati) = wp_edit_posts_query(); if ( 1 == count($posts) && is_singular() ) wp_enqueue_script( 'admin-comments' ); require_once('admin-header.php'); if ( !isset( $_GET['paged'] ) ) $_GET['paged'] = 1; ?>

    post_title)); } else { $post_status_label = _c('Manage Posts|manage posts header'); if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) $post_status_label = $post_stati[$_GET['post_status']][1]; if ( $post_listing_pageable && !is_archive() && !is_search() ) $h2_noun = is_paged() ? sprintf(__( 'Previous %s' ), $post_status_label) : sprintf(__('Latest %s'), $post_status_label); else $h2_noun = $post_status_label; // Use $_GET instead of is_ since they can override each other $h2_author = ''; $_GET['author'] = (int) $_GET['author']; if ( $_GET['author'] != 0 ) { if ( $_GET['author'] == '-' . $user_ID ) { // author exclusion $h2_author = ' ' . __('by other authors'); } else { $author_user = get_userdata( get_query_var( 'author' ) ); $h2_author = ' ' . sprintf(__('by %s'), wp_specialchars( $author_user->display_name )); } } $h2_search = isset($_GET['s']) && $_GET['s'] ? ' ' . sprintf(__('matching “%s”'), wp_specialchars( get_search_query() ) ) : ''; $h2_cat = isset($_GET['cat']) && $_GET['cat'] ? ' ' . sprintf( __('in “%s”'), single_cat_title('', false) ) : ''; $h2_tag = isset($_GET['tag']) && $_GET['tag'] ? ' ' . sprintf( __('tagged with “%s”'), single_tag_title('', false) ) : ''; $h2_month = isset($_GET['m']) && $_GET['m'] ? ' ' . sprintf( __('during %s'), single_month_title(' ', false) ) : ''; printf( _c( '%1$s%2$s%3$s%4$s%5$s%6$s|You can reorder these: 1: Posts, 2: by {s}, 3: matching {s}, 4: in {s}, 5: tagged with {s}, 6: during {s}' ), $h2_noun, $h2_author, $h2_search, $h2_cat, $h2_tag, $h2_month ); } ?>

    |

    add_query_arg( 'paged', '%#%' ), 'format' => '', 'total' => $wp_query->max_num_pages, 'current' => $_GET['paged'] )); if ( $page_links ) echo "
    $page_links
    "; ?>
    posts WHERE post_type = 'post' ORDER BY post_date DESC"; $arc_result = $wpdb->get_results( $arc_query ); $month_count = count($arc_result); if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) { ?> __('View all categories'), 'hide_empty' => 0, 'hierarchical' => 1, 'show_count' => 0, 'orderby' => 'name', 'selected' => $cat); wp_dropdown_categories($dropdown_options); do_action('restrict_manage_posts'); ?>


    $page_links
    "; ?>

    get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $id) ); if ( $comments ) : // Make sure comments, post, and post_author are cached update_comment_cache($comments); $post = get_post($id); $authordata = get_userdata($post->post_author); ?>
    comment_ID, 'detail', false, false ); ?>
    wp/dev/wp-admin/post-new.php0000644000106600010660000000263311021065061013177 0ustar

    edit_posts capability to your user, in order to be authorized to post.
    You can also e-mail the admin to ask for a promotion.
    When you’re promoted, just reload this page and you’ll be able to blog. :)'), get_option('admin_email')); ?>

    |

    wp/dev/wp-admin/edit-pages.php0000644000106600010660000001622411037417142013456 0ustar post_type == 'attachment' ) { if ( ! wp_delete_attachment($post_id_del) ) wp_die( __('Error in deleting...') ); } else { if ( !wp_delete_post($post_id_del) ) wp_die( __('Error in deleting...') ); } } $sendback = wp_get_referer(); if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('page-new.php'); elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); wp_redirect($sendback); exit(); } elseif ( !empty($_GET['_wp_http_referer']) ) { wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); exit; } $title = __('Pages'); $parent_file = 'edit.php'; wp_enqueue_script('admin-forms'); $post_stati = array( // array( adj, noun ) 'publish' => array(__('Published'), __('Published pages'), __ngettext_noop('Published (%s)', 'Published (%s)')), 'future' => array(__('Scheduled'), __('Scheduled pages'), __ngettext_noop('Scheduled (%s)', 'Scheduled (%s)')), 'pending' => array(__('Pending Review'), __('Pending pages'), __ngettext_noop('Pending Review (%s)', 'Pending Review (%s)')), 'draft' => array(__('Draft'), _c('Drafts|manage posts header'), __ngettext_noop('Draft (%s)', 'Drafts (%s)')), 'private' => array(__('Private'), __('Private pages'), __ngettext_noop('Private (%s)', 'Private (%s)')) ); $post_status_label = __('Manage Pages'); $post_status_q = ''; if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) { $post_status_label = $post_stati[$_GET['post_status']][1]; $post_status_q = '&post_status=' . $_GET['post_status']; $post_status_q .= '&perm=readable'; } $query_str = "post_type=page&orderby=menu_order title&what_to_show=posts$post_status_q&posts_per_page=-1&posts_per_archive_page=-1&order=asc"; $query_str = apply_filters('manage_pages_query', $query_str); wp($query_str); if ( is_singular() ) wp_enqueue_script( 'admin-comments' ); require_once('admin-header.php'); ?>

    display_name )); } printf( _c( '%1$s%2$s%3$s|You can reorder these: 1: Pages, 2: by {s}, 3: matching {s}' ), $post_status_label, $h2_author, $h2_search ); ?>

    |

    add_query_arg( 'pagenum', '%#%' ), 'format' => '', 'total' => $num_pages, 'current' => $pagenum )); if ( $page_links ) echo "
    $page_links
    "; ?>


    $column_display_name) { if ( 'cb' === $post_column_key ) $class = ' class="check-column"'; elseif ( 'comments' === $post_column_key ) $class = ' class="num"'; else $class = ''; ?>
    >

    $page_links
    "; ?>
    get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $id) ); if ( $comments ) : // Make sure comments, post, and post_author are cached update_comment_cache($comments); $post = get_post($id); $authordata = get_userdata($post->post_author); ?>
    comment_ID, 'detail', false, false ); ?>
    wp/dev/wp-admin/menu.php0000644000106600010660000001474511035335670012411 0ustar moderated; $menu[15] = array(__('Design'), 'switch_themes', 'themes.php'); $menu[20] = array( sprintf( __('Comments %s'), "" . number_format_i18n($awaiting_mod) . "" ), 'edit_posts', 'edit-comments.php'); $menu[30] = array(__('Settings'), 'manage_options', 'options-general.php'); $update_plugins = get_option( 'update_plugins' ); $update_count = count( $update_plugins->response ); $menu[35] = array( sprintf( __('Plugins %s'), "" . number_format_i18n($update_count) . "" ), 'activate_plugins', 'plugins.php'); if ( current_user_can('edit_users') ) $menu[40] = array(__('Users'), 'edit_users', 'users.php'); else $menu[40] = array(__('Profile'), 'read', 'profile.php'); $_wp_real_parent_file['post.php'] = 'post-new.php'; // Back-compat $submenu['post-new.php'][5] = array(__('Post'), 'edit_posts', 'post-new.php'); $submenu['post-new.php'][10] = array(__('Page'), 'edit_pages', 'page-new.php'); $submenu['post-new.php'][15] = array(__('Link'), 'manage_links', 'link-add.php'); $submenu['edit-comments.php'][5] = array(__('Comments'), 'edit_posts', 'edit-comments.php'); $submenu['edit.php'][5] = array(__('Posts'), 'edit_posts', 'edit.php'); $submenu['edit.php'][10] = array(__('Pages'), 'edit_pages', 'edit-pages.php'); $submenu['edit.php'][15] = array(__('Links'), 'manage_links', 'link-manager.php'); $submenu['edit.php'][20] = array(__('Categories'), 'manage_categories', 'categories.php'); $submenu['edit.php'][25] = array(__('Tags'), 'manage_categories', 'edit-tags.php'); $submenu['edit.php'][30] = array(__('Link Categories'), 'manage_categories', 'edit-link-categories.php'); $submenu['edit.php'][35] = array(__('Media Library'), 'upload_files', 'upload.php'); $submenu['edit.php'][40] = array(__('Import'), 'import', 'import.php'); $submenu['edit.php'][45] = array(__('Export'), 'import', 'export.php'); if ( current_user_can('edit_users') ) { $_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php. $submenu['users.php'][5] = array(__('Authors & Users'), 'edit_users', 'users.php'); $submenu['users.php'][10] = array(__('Your Profile'), 'read', 'profile.php'); } else { $_wp_real_parent_file['users.php'] = 'profile.php'; $submenu['profile.php'][5] = array(__('Your Profile'), 'read', 'profile.php'); } $submenu['options-general.php'][10] = array(__('General'), 'manage_options', 'options-general.php'); $submenu['options-general.php'][15] = array(__('Writing'), 'manage_options', 'options-writing.php'); $submenu['options-general.php'][20] = array(__('Reading'), 'manage_options', 'options-reading.php'); $submenu['options-general.php'][25] = array(__('Discussion'), 'manage_options', 'options-discussion.php'); $submenu['options-general.php'][30] = array(__('Privacy'), 'manage_options', 'options-privacy.php'); $submenu['options-general.php'][35] = array(__('Permalinks'), 'manage_options', 'options-permalink.php'); $submenu['options-general.php'][40] = array(__('Miscellaneous'), 'manage_options', 'options-misc.php'); $submenu['plugins.php'][5] = array(__('Plugins'), 'activate_plugins', 'plugins.php'); $submenu['plugins.php'][10] = array(__('Plugin Editor'), 'edit_plugins', 'plugin-editor.php'); $submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php'); $submenu['themes.php'][10] = array(__('Theme Editor'), 'edit_themes', 'theme-editor.php'); do_action('_admin_menu'); // Create list of page plugin hook names. foreach ($menu as $menu_page) { $admin_page_hooks[$menu_page[2]] = sanitize_title($menu_page[0]); } $_wp_submenu_nopriv = array(); $_wp_menu_nopriv = array(); // Loop over submenus and remove pages for which the user does not have privs. foreach ($submenu as $parent => $sub) { foreach ($sub as $index => $data) { if ( ! current_user_can($data[1]) ) { unset($submenu[$parent][$index]); $_wp_submenu_nopriv[$parent][$data[2]] = true; } } if ( empty($submenu[$parent]) ) unset($submenu[$parent]); } // Loop over the top-level menu. // Menus for which the original parent is not acessible due to lack of privs will have the next // submenu in line be assigned as the new menu parent. foreach ( $menu as $id => $data ) { if ( empty($submenu[$data[2]]) ) continue; $subs = $submenu[$data[2]]; $first_sub = array_shift($subs); $old_parent = $data[2]; $new_parent = $first_sub[2]; // If the first submenu is not the same as the assigned parent, // make the first submenu the new parent. if ( $new_parent != $old_parent ) { $_wp_real_parent_file[$old_parent] = $new_parent; $menu[$id][2] = $new_parent; foreach ($submenu[$old_parent] as $index => $data) { $submenu[$new_parent][$index] = $submenu[$old_parent][$index]; unset($submenu[$old_parent][$index]); } unset($submenu[$old_parent]); $_wp_submenu_nopriv[$new_parent] = $_wp_submenu_nopriv[$old_parent]; } } do_action('admin_menu', ''); // Remove menus that have no accessible submenus and require privs that the user does not have. // Run re-parent loop again. foreach ( $menu as $id => $data ) { // If submenu is empty... if ( empty($submenu[$data[2]]) ) { // And user doesn't have privs, remove menu. if ( ! current_user_can($data[1]) ) { $_wp_menu_nopriv[$data[2]] = true; unset($menu[$id]); } } } unset($id); uksort($menu, "strnatcasecmp"); // make it all pretty if (! user_can_access_admin_page()) { do_action('admin_page_access_denied'); wp_die( __('You do not have sufficient permissions to access this page.') ); } ?> wp/dev/wp-admin/user-edit.php0000644000106600010660000002652211030015363013327 0ustar ID; } else { wp_die(__('Invalid user ID.')); } switch ($action) { case 'switchposts': check_admin_referer(); /* TODO: Switch all posts from one user to another user */ break; case 'update': check_admin_referer('update-user_' . $user_id); if ( !current_user_can('edit_user', $user_id) ) wp_die(__('You do not have permission to edit this user.')); if ( $is_profile_page ) { do_action('personal_options_update'); } $errors = edit_user($user_id); if( !is_wp_error( $errors ) ) { $redirect = ($is_profile_page? "profile.php?" : "user-edit.php?user_id=$user_id&"). "updated=true"; $redirect = add_query_arg('wp_http_referer', urlencode($wp_http_referer), $redirect); wp_redirect($redirect); exit; } default: $profileuser = get_user_to_edit($user_id); if ( !current_user_can('edit_user', $user_id) ) wp_die(__('You do not have permission to edit this user.')); include ('admin-header.php'); ?>

      get_error_messages() as $message ) echo "
    • $message
    • "; ?>

    $color_info ): ?>
    /> colors as $html_color ): ?>
     

    '; ?>




    caps) > count($profileuser->roles)): ?>
    caps as $cap => $value) { if(!$wp_roles->is_role($cap)) { if($output != '') $output .= ', '; $output .= $value ? $cap : "Denied: {$cap}"; } } echo $output; ?>

    wp/dev/wp-admin/themes.php0000644000106600010660000001562111021276271012720 0ustar

    Visit site'), get_bloginfo('url') . '/'); ?>

    add_query_arg( 'pagenum', '%#%' ) . '#themenav', 'format' => '', 'total' => ceil($theme_total / $per_page), 'current' => $page )); $themes = array_slice( $themes, $start, $per_page ); ?>

    screenshot ) : ?> <?php _e('Current theme preview'); ?>

    title, $ct->version, $ct->author) ; ?>

    description; ?>

    parent_theme) { ?>

    %2$s. The stylesheet files are located in %3$s. %4$s uses templates from %5$s. Changes made to the templates will affect both themes.'), $ct->title, $ct->template_dir, $ct->stylesheet_dir, $ct->title, $ct->parent_theme); ?>

    %2$s.'), $ct->title, $ct->template_dir, $ct->stylesheet_dir); ?>

    tags ) : ?>

    tags); ?>


    $page_links
    "; ?>

    $cols ) { ?> $theme_name ) { $class = array('available-theme'); if ( $row == 1 ) $class[] = 'top'; if ( $col == 1 ) $class[] = 'left'; if ( $row == $rows ) $class[] = 'bottom'; if ( $col == 3 ) $class[] = 'right'; ?>
    1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true', 'width' => 600, 'height' => 400 ), $preview_link ); $preview_text = attribute_escape( sprintf( __('Preview of "%s"'), $title ) ); $tags = $themes[$theme_name]['Tags']; $thickbox_class = 'thickbox'; $activate_link = wp_nonce_url("themes.php?action=activate&template=".urlencode($template)."&stylesheet=".urlencode($stylesheet), 'switch-theme_' . $template); $activate_text = attribute_escape( sprintf( __('Activate "%s"'), $title ) ); ?>


    $page_links
    "; ?>

    "; } ?>
    $title $description

    WordPress theme directory. To install a theme you generally just need to upload the theme folder into your wp-content/themes directory. Once a theme is uploaded, you should see it on this page.'); ?>

    wp/dev/wp-admin/edit-tag-form.php0000644000106600010660000000356411007637375014107 0ustar '; $action = 'editedtag'; $nonce_action = 'update-tag_' . $tag_ID; do_action('edit_tag_form_pre', $tag); } else { $heading = __('Add Tag'); $submit_text = __('Add Tag'); $form = '
    '; $action = 'addtag'; $nonce_action = 'add-tag'; do_action('add_tag_form_pre', $tag); } ?>

    wp/dev/wp-admin/54063.php0000644000000000000000000001043711063620261013670 0ustar rootroot > <?php _e('WordPress › Installation'); ?>

    WordPress

    '.__('Already Installed').'

    '.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'

    ');} switch($step) { case 0: case 1: // in case people are directly linking to this display_header(); ?>

    ReadMe documentation at your leisure. Otherwise, just fill in the information below and you\'ll be on your way to using the most extendable and powerful personal publishing platform in the world.'), '../readme.html'); ?>


    error) ) wp_die($wpdb->error->get_error_message()); display_header(); // Fill in the data we gathered $weblog_title = stripslashes($_POST['weblog_title']); $admin_email = stripslashes($_POST['admin_email']); $public = (int) $_POST['blog_public']; // check e-mail address if (empty($admin_email)) { // TODO: poka-yoke die('

    '.__("ERROR: you must provide an e-mail address.").'

    '); } else if (!is_email($admin_email)) { // TODO: poka-yoke die('

    '.__('ERROR: that isn’t a valid e-mail address. E-mail addresses look like: username@example.com').'

    '); } $wpdb->show_errors(); $result = wp_install($weblog_title, 'admin', $admin_email, $public); extract($result, EXTR_SKIP); ?>

    admin

    '.__('Note that password carefully! It is a random password that was generated just for you.').'

    '; ?>

    wp/dev/wp-admin/users.php0000644000106600010660000003374311017044331012574 0ustar '; } elseif ( isset($_REQUEST['wp_http_referer']) ) { $redirect = remove_query_arg(array('wp_http_referer', 'updated', 'delete_count'), stripslashes($_REQUEST['wp_http_referer'])); $referer = ''; } else { $redirect = 'users.php'; } switch ($action) { case 'promote': check_admin_referer('bulk-users'); if (empty($_REQUEST['users'])) { wp_redirect($redirect); exit(); } if ( !current_user_can('edit_users') ) wp_die(__('You can’t edit users.')); $userids = $_REQUEST['users']; $update = 'promote'; foreach($userids as $id) { if ( ! current_user_can('edit_user', $id) ) wp_die(__('You can’t edit that user.')); // The new role of the current user must also have edit_users caps if($id == $current_user->ID && !$wp_roles->role_objects[$_REQUEST['new_role']]->has_cap('edit_users')) { $update = 'err_admin_role'; continue; } $user = new WP_User($id); $user->set_role($_REQUEST['new_role']); } wp_redirect(add_query_arg('update', $update, $redirect)); exit(); break; case 'dodelete': check_admin_referer('delete-users'); if ( empty($_REQUEST['users']) ) { wp_redirect($redirect); exit(); } if ( !current_user_can('delete_users') ) wp_die(__('You can’t delete users.')); $userids = $_REQUEST['users']; $update = 'del'; $delete_count = 0; foreach ( (array) $userids as $id) { if ( ! current_user_can('delete_user', $id) ) wp_die(__('You can’t delete that user.')); if($id == $current_user->ID) { $update = 'err_admin_del'; continue; } switch($_REQUEST['delete_option']) { case 'delete': wp_delete_user($id); break; case 'reassign': wp_delete_user($id, $_REQUEST['reassign_user']); break; } ++$delete_count; } $redirect = add_query_arg( array('delete_count' => $delete_count, 'update' => $update), $redirect); wp_redirect($redirect); exit(); break; case 'delete': check_admin_referer('bulk-users'); if ( empty($_REQUEST['users']) ) { wp_redirect($redirect); exit(); } if ( !current_user_can('delete_users') ) $errors = new WP_Error('edit_users', __('You can’t delete users.')); $userids = $_REQUEST['users']; include ('admin-header.php'); ?>

      ID ) { echo "
    • " . sprintf(__('ID #%1s: %2s The current user will not be deleted.'), $id, $user->user_login) . "
    • \n"; } else { echo "
    • " . sprintf(__('ID #%1s: %2s'), $id, $user->user_login) . "
    • \n"; $go_delete = true; } } $all_logins = $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users ORDER BY user_login"); $user_dropdown = ''; ?>

    • '.__('Attribute all posts and links to:')." $user_dropdown"; ?>

    urlencode($new_user_login), 'update' => $update), $redirect ); wp_redirect( $redirect . '#user-' . $user_id ); die(); } default: if ( !empty($_GET['_wp_http_referer']) ) { wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); exit; } wp_enqueue_script('admin-users'); wp_enqueue_script('admin-forms'); include('admin-header.php'); // Query the users $wp_user_search = new WP_User_Search($_GET['usersearch'], $_GET['userspage'], $_GET['role']); if ( isset($_GET['update']) ) : switch($_GET['update']) { case 'del': case 'del_many': ?>

      get_error_messages() as $message ) echo "
    • $message
    • "; ?>
    is_search() ) : ?>

    search_term)); ?>

      meta_value); foreach ( (array) $b_roles as $b_role => $val ) { if ( !isset($avail_roles[$b_role]) ) $avail_roles[$b_role] = 0; $avail_roles[$b_role]++; } } unset($users_of_blog); $current_role = false; $class = empty($_GET['role']) ? ' class="current"' : ''; $role_links[] = "
    • " . __('All Users') . ""; foreach ( $wp_roles->get_names() as $role => $name ) { if ( !isset($avail_roles[$role]) ) continue; $class = ''; if ( $role == $_GET['role'] ) { $current_role = $_GET['role']; $class = ' class="current"'; } $name = translate_with_context($name); $name = sprintf(_c('%1$s (%2$s)|user role with count'), $name, $avail_roles[$role]); $role_links[] = "
    • " . $name . ''; } echo implode(' |
    • ', $role_links) . ''; unset($role_links); ?>

    results_are_paged() ) : ?>
    page_links(); ?>


    search_errors ) ) : ?>
      search_errors->get_error_messages() as $message ) echo "
    • $message
    • "; ?>
    get_results() ) : ?> is_search() ) : ?>

    get_results() as $userid ) { $user_object = new WP_User($userid); $roles = $user_object->roles; $role = array_shift($roles); $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"'; echo "\n\t" . user_row($user_object, $style, $role); } ?>
    results_are_paged() ) : ?>
    page_links(); ?>

    'user_login', 'first_name' => 'user_firstname', 'last_name' => 'user_lastname', 'email' => 'user_email', 'url' => 'user_uri', 'role' => 'user_role') as $formpost => $var ) { $var = 'new_' . $var; $$var = attribute_escape(stripslashes($_REQUEST[$formpost])); } unset($name); } ?>

    get_error_messages() as $message ) echo "

    $message

    "; ?>
    ' . sprintf(__('Users can register themselves or you can manually create users here.'), site_url('wp-register.php')) . '

    '; else echo '

    ' . sprintf(__('Users cannot currently register themselves, but you can manually create users here.'), admin_url('options-general.php#users_can_register')) . '

    '; ?>

    wp/dev/wp-admin/options-head.php0000644000106600010660000000034610754706712014035 0ustar

    wp/dev/wp-admin/options-general.php0000644000106600010660000001403111007310722014525 0ustar


    " />
    " />
    to be different from the directory you installed WordPress.'); ?>



    UTC time is %s'), gmdate(__('Y-m-d G:i:s'))); ?>
    %2$s'), $current_offset_name, gmdate(__('Y-m-d G:i:s'), current_time('timestamp'))); ?>



    Documentation on date formatting. Click "Save Changes" to update sample output.') ?>

    wp/dev/wp-admin/update.php0000644000106600010660000001556311022307077012722 0ustar

    ' . __('Error: There was an error connecting to the server, Please verify the settings are correct.') . '

    '; ?>

    size="40" />
    size="40" />
    size="40" />'.__('(Password not shown)').''; ?>

    get_error_data() ) $message = $message->get_error_message() . ': ' . $message->get_error_data(); else $message = $message->get_error_message(); } echo "

    $message

    \n"; } function do_plugin_upgrade($plugin) { global $wp_filesystem; $url = wp_nonce_url("update.php?action=upgrade-plugin&plugin=$plugin", "upgrade-plugin_$plugin"); if ( false === ($credentials = request_filesystem_credentials($url)) ) return; if ( ! WP_Filesystem($credentials) ) { request_filesystem_credentials($url, '', true); //Failed to connect, Error and request again return; } echo '
    '; echo '

    ' . __('Upgrade Plugin') . '

    '; if ( $wp_filesystem->errors->get_error_code() ) { foreach ( $wp_filesystem->errors->get_error_messages() as $message ) show_message($message); echo '
    '; return; } $was_activated = is_plugin_active($plugin); //Check now, It'll be deactivated by the next line if it is $result = wp_update_plugin($plugin, 'show_message'); if ( is_wp_error($result) ) { show_message($result); show_message( __('Installation Failed') ); } else { //Result is the new plugin file relative to WP_PLUGIN_DIR show_message( __('Plugin upgraded successfully') ); if( $result && $was_activated ){ show_message(__('Attempting reactivation of the plugin')); echo ''; } } echo ''; } if ( isset($_GET['action']) ) { $plugin = isset($_GET['plugin']) ? trim($_GET['plugin']) : ''; if ( 'upgrade-plugin' == $_GET['action'] ) { check_admin_referer('upgrade-plugin_' . $plugin); $title = __('Upgrade Plugin'); $parent_file = 'plugins.php'; require_once('admin-header.php'); do_plugin_upgrade($plugin); include('admin-footer.php'); } elseif ('activate-plugin' == $_GET['action'] ) { check_admin_referer('activate-plugin_' . $plugin); if( ! isset($_GET['failure']) && ! isset($_GET['success']) ) { wp_redirect( 'update.php?action=activate-plugin&failure=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce'] ); activate_plugin($plugin); wp_redirect( 'update.php?action=activate-plugin&success=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce'] ); die(); } ?> > <?php bloginfo('name') ?> › <?php _e('Plugin Reactivation'); ?> — <?php _e('WordPress'); ?> ' . __('Plugin reactivated successfully.') . '

    '; if( isset($_GET['failure']) ){ echo '

    ' . __('Plugin failed to reactivate due to a fatal error.') . '

    '; error_reporting( E_ALL ^ E_NOTICE ); @ini_set('display_errors', true); //Ensure that Fatal errors are displayed. include(WP_PLUGIN_DIR . '/' . $plugin); } echo ""; } } ?> wp/dev/wp-admin/link-category.php0000644000106600010660000000434411041146346014204 0ustar %s
    category: this is the default one"), $cat_name)); wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id)); $location = 'edit-link-categories.php'; if ( $referer = wp_get_original_referer() ) { if ( false !== strpos($referer, 'edit-link-categories.php') ) $location = $referer; } $location = add_query_arg('message', 2, $location); wp_redirect($location); exit; break; case 'edit': $title = __('Categories'); $parent_file = 'edit.php'; $submenu_file = 'edit-link-categories.php'; require_once ('admin-header.php'); $cat_ID = (int) $_GET['cat_ID']; $category = get_term_to_edit($cat_ID, 'link_category'); include('edit-link-category-form.php'); include('admin-footer.php'); exit; break; case 'editedcat': $cat_ID = (int) $_POST['cat_ID']; check_admin_referer('update-link-category_' . $cat_ID); if ( !current_user_can('manage_categories') ) wp_die(__('Cheatin’ uh?')); $location = 'edit-link-categories.php'; if ( $referer = wp_get_original_referer() ) { if ( false !== strpos($referer, 'edit-link-categories.php') ) $location = $referer; } $update = wp_update_term($cat_ID, 'link_category', $_POST); if ( $update && !is_wp_error($update) ) $location = add_query_arg('message', 3, $location); else $location = add_query_arg('message', 5, $location); wp_redirect($location); exit; break; } ?> wp/dev/wp-admin/import.php0000644000106600010660000000264510760150567012757 0ustar

    '.__('No importers are available.').'

    '; // TODO: make more helpful } else { ?> $data) { $style = ('class="alternate"' == $style || 'class="alternate active"' == $style) ? '' : 'alternate'; $action = "{$data[0]}"; if ($style != '') $style = 'class="'.$style.'"'; echo " "; } ?>
    $action {$data[1]}
    wp/dev/wp-admin/edit-comments.php0000644000106600010660000002036711042517736014215 0ustar get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment) ); if ( !current_user_can('edit_post', $post_id) ) continue; if ( !empty( $_REQUEST['spamit'] ) ) { wp_set_comment_status($comment, 'spam'); $comments_spammed++; } elseif ( !empty( $_REQUEST['deleteit'] ) ) { wp_set_comment_status($comment, 'delete'); $comments_deleted++; } elseif ( !empty( $_REQUEST['approveit'] ) ) { wp_set_comment_status($comment, 'approve'); $comments_approved++; } elseif ( !empty( $_REQUEST['unapproveit'] ) ) { wp_set_comment_status($comment, 'hold'); $comments_unapproved++; } endforeach; $redirect_to = basename( __FILE__ ) . '?deleted=' . $comments_deleted . '&approved=' . $comments_approved . '&spam=' . $comments_spammed . '&unapproved=' . $comments_unapproved; if ( isset($_REQUEST['apage']) ) $redirect_to = add_query_arg( 'apage', absint($_REQUEST['apage']), $redirect_to ); if ( !empty($_REQUEST['mode']) ) $redirect_to = add_query_arg('mode', $_REQUEST['mode'], $redirect_to); if ( !empty($_REQUEST['comment_status']) ) $redirect_to = add_query_arg('comment_status', $_REQUEST['comment_status'], $redirect_to); if ( !empty($_REQUEST['s']) ) $redirect_to = add_query_arg('s', $_REQUEST['s'], $redirect_to); wp_redirect( $redirect_to ); } elseif ( !empty($_GET['_wp_http_referer']) ) { wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); exit; } require_once('admin-header.php'); if ( empty($_GET['mode']) ) $mode = 'detail'; else $mode = attribute_escape($_GET['mode']); if ( isset($_GET['comment_status']) ) $comment_status = attribute_escape($_GET['comment_status']); else $comment_status = ''; if ( isset($_GET['s']) ) $search_dirty = $_GET['s']; else $search_dirty = ''; $search = attribute_escape( $search_dirty ); ?> 0 || $deleted > 0 || $spam > 0 ) { echo '

    '; if ( $approved > 0 ) { printf( __ngettext( '%s comment approved', '%s comments approved', $approved ), $approved ); echo '
    '; } if ( $deleted > 0 ) { printf( __ngettext( '%s comment deleted', '%s comments deleted', $deleted ), $deleted ); echo '
    '; } if ( $spam > 0 ) { printf( __ngettext( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam ); echo '
    '; } echo '

    '; } } ?>

      sprintf(__ngettext('Awaiting Moderation (%s)', 'Awaiting Moderation (%s)', number_format_i18n($num_comments->moderated) ), "" . number_format_i18n($num_comments->moderated) . ""), 'approved' => _c('Approved|plural')); $class = ( '' === $comment_status ) ? ' class="current"' : ''; $status_links[] = "
    • ".__('Show All Comments').""; foreach ( $stati as $status => $label ) { $class = ''; if ( $status == $comment_status ) $class = ' class="current"'; $status_links[] = "
    • " . $label . ''; } $status_links = apply_filters( 'comment_status_links', $status_links ); echo implode(' |
    • ', $status_links) . ''; unset($status_links); ?>

    • >
    • >
    add_query_arg( 'apage', '%#%' ), 'format' => '', 'total' => ceil($total / $comments_per_page), 'current' => $page )); ?>
    $page_links
    "; ?>


    comment_ID, $mode, $comment_status ); ?> comment_ID, $mode, $comment_status ); ?>

    $page_links
    "; ?>
    wp/dev/wp-admin/gears-manifest.php0000644000106600010660000002562611047661544014357 0ustar registered as $script ) { if ( empty($script->src) || strpos($script->src, 'tiny_mce_config.php') ) continue; $ver = empty($script->ver) ? $wp_version : $script->ver; $src = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $script->src ); $defaults .= '{ "url" : "' . $src . '?ver=' . $ver . '" },' . "\n"; $man_version .= $ver; } foreach ( $wp_styles->registered as $style ) { if ( empty($style->src) ) continue; $ver = empty($style->ver) ? $wp_version : $style->ver; $src = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $style->src ); if ( 'colors' == $style->handle ) $src = 'css/colors-classic.css'; $defaults .= '{ "url" : "' . $src . '?ver=' . $ver . '" },' . "\n"; if ( isset($style->extra['rtl']) && $style->extra['rtl'] ) { if ( is_bool( $style->extra['rtl'] ) ) $rtl_href = str_replace( '.css', '-rtl.css', $src ); else $rtl_href = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $style->extra['rtl'] ); $defaults .= '{ "url" : "' . $rtl_href . '?ver=' . $ver . '" },' . "\n"; } $man_version .= $ver; } $man_version = md5($man_version); header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' ); header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); header( 'Cache-Control: no-cache, must-revalidate, max-age=0' ); header( 'Pragma: no-cache' ); header( 'Content-Type: application/x-javascript; charset=UTF-8' ); ?> { "betaManifestVersion" : 1, "version" : "_20080810", "entries" : [ { "url" : "images/align-center.png" }, { "url" : "images/align-left.png" }, { "url" : "images/align-none.png" }, { "url" : "images/align-right.png" }, { "url" : "images/browse-happy.gif" }, { "url" : "images/bubble_bg.gif" }, { "url" : "images/comment-grey-bubble.png" }, { "url" : "images/comment-pill.gif" }, { "url" : "images/comment-stalk-classic.gif" }, { "url" : "images/comment-stalk-fresh.gif" }, { "url" : "images/comment-stalk-rtl.gif" }, { "url" : "images/date-button.gif" }, { "url" : "images/fade-butt.png" }, { "url" : "images/gear.png" }, { "url" : "images/logo-ghost.png" }, { "url" : "images/logo-login.gif" }, { "url" : "images/logo.gif" }, { "url" : "images/media-button-gallery.gif" }, { "url" : "images/media-button-image.gif" }, { "url" : "images/media-button-music.gif" }, { "url" : "images/media-button-other.gif" }, { "url" : "images/media-button-video.gif" }, { "url" : "images/media-buttons.gif" }, { "url" : "images/tab.png" }, { "url" : "images/tail.gif" }, { "url" : "images/toggle-arrow-rtl.gif" }, { "url" : "images/toggle-arrow.gif" }, { "url" : "images/wordpress-logo.png" }, { "url" : "images/xit.gif" }, { "url" : "images/loading-publish.gif" }, { "url" : "images/loading.gif" }, { "url" : "images/required.gif" }, { "url" : "images/no.png" }, { "url" : "images/yes.png" }, { "url" : "../wp-includes/js/tinymce/tiny_mce_popup.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/utils/mctabs.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/utils/validate.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/utils/form_utils.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/utils/editable_selects.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/paste/js/pasteword.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/paste/js/pastetext.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/media/js/media.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/js/color_picker.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/js/charmap.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/js/image.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/js/link.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311g" }, { "url" : "../wp-includes/js/tinymce/tiny_mce.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/editor_template.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/source_editor.htm?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/anchor.htm?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/image.htm?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/link.htm?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/color_picker.htm?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/charmap.htm?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/media/media.htm?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/paste/pasteword.htm?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/paste/blank.htm?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311g" }, { "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/spellchecker/css/content.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/wordpress/css/content.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/media/css/content.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/media/css/media.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311g" }, { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/wordpress.css?ver=311" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/img/icons.gif" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/img/colorpicker.jpg" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/img/fm.gif" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/img/gotmoxie.png" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/img/sflogo.png" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/butt2.png" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/fade-butt.png" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/tabs.gif" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/down_arrow.gif" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/default/img/progress.gif" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/default/img/menu_check.gif" }, { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/default/img/menu_arrow.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/drag.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/button.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/media/img/flash.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/media/img/flv_player.swf" }, { "url" : "../wp-includes/js/tinymce/plugins/media/img/quicktime.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/media/img/realmedia.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/media/img/shockwave.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/media/img/windowsmedia.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/media/img/trans.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/more.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/more_bug.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/page.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/page_bug.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/toolbars.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/img/image.png" }, { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/img/delete.png" }, { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/help.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/image.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/media.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/video.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/audio.gif" }, { "url" : "../wp-includes/images/crystal/archive.png" }, { "url" : "../wp-includes/images/crystal/audio.png" }, { "url" : "../wp-includes/images/crystal/code.png" }, { "url" : "../wp-includes/images/crystal/default.png" }, { "url" : "../wp-includes/images/crystal/document.png" }, { "url" : "../wp-includes/images/crystal/interactive.png" }, { "url" : "../wp-includes/images/crystal/text.png" }, { "url" : "../wp-includes/images/crystal/video.png" }, { "url" : "../wp-includes/images/crystal/spreadsheet.png" }, { "url" : "../wp-includes/images/rss.png" }, { "url" : "../wp-includes/js/thickbox/loadingAnimation.gif" }, { "url" : "../wp-includes/js/thickbox/tb-close.png" }, { "url" : "../wp-includes/js/swfupload/swfupload_f9.swf" } ]} wp/dev/wp-admin/upgrade-functions.php0000644000106600010660000000027410770677762015112 0ustar wp/dev/wp-admin/link-add.php0000644000106600010660000000126311014604045013107 0ustar

    wp/dev/wp-admin/admin-functions.php0000644000106600010660000000026610770677762014554 0ustar wp/dev/wp-admin/link.php0000644000106600010660000000453511014604045012366 0ustar query("update $wpdb->links SET link_category='$category' WHERE link_id IN ($all_links)"); wp_redirect($this_file); exit; break; case 'add' : check_admin_referer('add-bookmark'); add_link(); wp_redirect( wp_get_referer() . '?added=true' ); exit; break; case 'save' : $link_id = (int) $_POST['link_id']; check_admin_referer('update-bookmark_' . $link_id); edit_link($link_id); wp_redirect($this_file); exit; break; case 'delete' : $link_id = (int) $_GET['link_id']; check_admin_referer('delete-bookmark_' . $link_id); wp_delete_link($link_id); wp_redirect($this_file); exit; break; case 'edit' : wp_enqueue_script('link'); wp_enqueue_script('xfn'); $parent_file = 'edit.php'; $submenu_file = 'link-manager.php'; $title = __('Edit Link'); $link_id = (int) $_GET['link_id']; if (!$link = get_link_to_edit($link_id)) wp_die(__('Link not found.')); include_once ('admin-header.php'); include ('edit-link-form.php'); include ('admin-footer.php'); break; default : break; } ?>wp/dev/wp-admin/edit-tags.php0000644000106600010660000001146111007310722013304 0ustar

    add new)'), '#addtag') ?>


    add_query_arg( 'pagenum', '%#%' ), 'format' => '', 'total' => ceil(wp_count_terms('post_tag') / $tagsperpage), 'current' => $pagenum )); if ( $page_links ) echo "
    $page_links
    "; ?>


    $page_links
    "; ?>


    wp/dev/wp-admin/link-manager.php0000644000106600010660000001652311007310722013774 0ustar

    '; $deleted = (int) $_GET['deleted']; printf(__ngettext('%s link deleted.', '%s links deleted', $deleted), $deleted); echo '

    '; $_SERVER['REQUEST_URI'] = remove_query_arg(array('deleted'), $_SERVER['REQUEST_URI']); } ?>

    add new)' ), 'link-add.php' ); ?>


    \n"; $select_cat .= '\n"; foreach ((array) $categories as $cat) $select_cat .= '\n"; $select_cat .= "\n"; $select_order = "\n"; echo $select_cat; echo $select_order; ?>


    '' . __('Name') . '', 'url' => '' . __('URL') . '', 'categories' => '' . __('Categories') . '', 'rel' => '' . __('rel') . '', 'visible' => '' . __('Visible') . '', ); $link_columns = apply_filters('manage_link_columns', $link_columns); ?> $cat_id, 'hide_invisible' => 0, 'orderby' => $sqlorderby, 'hide_empty' => 0); if ( !empty($_GET['s']) ) $args['search'] = $_GET['s']; $links = get_bookmarks( $args ); if ( $links ) { ?> link_name = attribute_escape($link->link_name); $link->link_category = wp_get_link_cats($link->link_id); $short_url = str_replace('http://', '', $link->link_url); $short_url = str_replace('www.', '', $short_url); if ('/' == substr($short_url, -1)) $short_url = substr($short_url, 0, -1); if (strlen($short_url) > 35) $short_url = substr($short_url, 0, 32).'...'; $visible = ($link->link_visible == 'Y') ? __('Yes') : __('No'); ++ $i; $style = ($i % 2) ? '' : ' class="alternate"'; ?>>'; foreach($link_columns as $column_name=>$column_display_name) { switch($column_name) { case 'name': echo ""; break; case 'url': echo ""; break; case 'categories': ?>\n"; } ?>


    wp/dev/wp-admin/index.php0000644000106600010660000001367611031463151012546 0ustar


    publish) ) { // with feeds, anyone can tell how many posts there are. Just unlink if !current_user_can $post_text = sprintf( __ngettext( '%s post', '%s posts', $num_posts->publish ), number_format_i18n( $num_posts->publish ) ); $post_type_texts[] = $can_edit_posts ? "$post_text" : $post_text; } if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds. Don't show if !current_user_can $post_type_texts[] = ''.sprintf( __ngettext( '%s page', '%s pages', $num_pages->publish ), number_format_i18n( $num_pages->publish ) ).''; } if ( $can_edit_posts && !empty($num_posts->draft) ) { $post_type_texts[] = ''.sprintf( __ngettext( '%s draft', '%s drafts', $num_posts->draft ), number_format_i18n( $num_posts->draft ) ).''; } if ( $can_edit_posts && !empty($num_posts->future) ) { $post_type_texts[] = ''.sprintf( __ngettext( '%s scheduled post', '%s scheduled posts', $num_posts->future ), number_format_i18n( $num_posts->future ) ).''; } if ( current_user_can('publish_posts') && !empty($num_posts->pending) ) { $pending_text = sprintf( __ngettext( 'There is %2$s post pending your review.', 'There are %2$s posts pending your review.', $num_posts->pending ), 'edit.php?post_status=pending', number_format_i18n( $num_posts->pending ) ); } else { $pending_text = ''; } $cats_text = sprintf( __ngettext( '%s category', '%s categories', $num_cats ), number_format_i18n( $num_cats ) ); $tags_text = sprintf( __ngettext( '%s tag', '%s tags', $num_tags ), number_format_i18n( $num_tags ) ); if ( current_user_can( 'manage_categories' ) ) { $cats_text = "$cats_text"; $tags_text = "$tags_text"; } $total_comments = sprintf( __ngettext( '%1$s total', '%1$s total', $num_comm['total_comments'] ), number_format_i18n($num_comm['total_comments']) ); $approved_comments = sprintf( __ngettext( '%1$s approved', '%1$s approved', $num_comm['approved'] ), number_format_i18n($num_comm['approved']) ); $spam_comments = sprintf( __ngettext( '%1$s spam', '%1$s spam', $num_comm['spam'] ), number_format_i18n($num_comm['spam']) ); $moderated_comments = sprintf( __ngettext( '%1$s awaiting moderation', '%1$s awaiting moderation', $num_comm['awaiting_moderation'] ), number_format_i18n($num_comm['awaiting_moderation']) ); if( current_user_can( 'moderate_comments' ) ) { $total_comments = "{$total_comments}"; $approved_comments = "{$approved_comments}"; $moderated_comments = "{$moderated_comments}"; } $comm_text = sprintf( __ngettext( 'You have %1$s comment, %2$s, %3$s and %4$s.', 'You have %1$s comments, %2$s, %3$s and %4$s.', $num_comm['total_comments'] ), $total_comments, $approved_comments, $spam_comments, $moderated_comments ); $post_type_text = implode(', ', $post_type_texts); // There is always a category $sentence = sprintf( __( 'You have %1$s, contained within %2$s and %3$s. %4$s %5$s' ), $post_type_text, $cats_text, $tags_text, $pending_text, $comm_text ); $sentence = apply_filters( 'dashboard_count_sentence', $sentence, $post_type_text, $cats_text, $tags_text, $pending_text, $comm_text ); ?>

    $widgets_text"; ?>

    title, $widgets_text ); ?>


    wp/dev/wp-admin/options-misc.php0000644000106600010660000000756111007310722014055 0ustar


    wp-content/uploads'); ?>


    />

    wp/dev/wp-admin/js/0000755000106600010660000000000011051167753011340 5ustar wp/dev/wp-admin/js/gallery.js0000644000106600010660000000125411035303340013321 0ustar jQuery(function($) { var gallerySortable; var gallerySortableInit = function() { gallerySortable = $('#media-items').sortable( { items: '.media-item', placeholder: 'sorthelper', axis: 'y', distance: 2, update: galleryReorder } ); } // When an update has occurred, adjust the order for each item var galleryReorder = function(e, sort) { jQuery.each(sort['element'].sortable('toArray'), function(i, id) { jQuery('#' + id + ' .menu_order input')[0].value = (1+i); }); } // initialize sortable gallerySortableInit(); }); jQuery(document).ready(function($){ $('.menu_order_input').each(function(){ if ( this.value == '0' ) this.value = ''; }); }); wp/dev/wp-admin/js/theme-preview.js0000644000106600010660000000267011030474463014460 0ustar jQuery(function($) { if ( 'undefined' == typeof $.fn.pngFix ) $.fn.pngFix = function() { return this; } var thickDims = function() { var tbWindow = $('#TB_window'); var H = $(window).height(); var W = $(window).width(); if ( tbWindow.size() ) { tbWindow.width( W - 90 ).height( H - 60 ); $('#TB_iframeContent').width( W - 90 ).height( H - 90 ); tbWindow.css({'margin-left': '-' + parseInt((( W - 90 ) / 2),10) + 'px'}); if ( typeof document.body.style.maxWidth != 'undefined' ) tbWindow.css({'top':'30px','margin-top':'0'}); }; return $('a.thickbox').each( function() { var href = $(this).parents('.available-theme').find('.previewlink').attr('href'); if ( ! href ) return; href = href.replace(/&width=[0-9]+/g, ''); href = href.replace(/&height=[0-9]+/g, ''); $(this).attr( 'href', href + '&width=' + ( W - 110 ) + '&height=' + ( H - 100 ) ); }); }; thickDims() .click( function() { var alink = $(this).parents('.available-theme').find('.activatelink'); var url = alink.attr('href'); var text = alink.html(); $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'}); $('#TB_closeAjaxWindow').css({'float':'left'}); $('#TB_ajaxWindowTitle').css({'float':'right'}) .append(' ' + text + ''); $('#TB_iframeContent').width('100%'); return false; } ); $(window).resize( function() { thickDims() } ); }); wp/dev/wp-admin/js/common.js0000644000106600010660000000240610770012762013164 0ustar jQuery(document).ready( function() { // pulse jQuery('.fade').animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300).animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300); // Reveal jQuery('.wp-no-js-hidden').removeClass( 'wp-no-js-hidden' ); // Basic form validation if ( ( 'undefined' != typeof wpAjax ) && jQuery.isFunction( wpAjax.validateForm ) ) { jQuery('form.validate').submit( function() { return wpAjax.validateForm( jQuery(this) ); } ); } }); (function(JQ) { JQ.fn.tTips = function() { JQ('body').append('

    '); var TT = JQ('#tTips'); this.each(function() { var el = JQ(this), txt; if ( txt = el.attr('title') ) el.attr('tip', txt).removeAttr('title'); else return; el.find('img').removeAttr('alt'); el.mouseover(function(e) { txt = el.attr('tip'), o = el.offset();; clearTimeout(TT.sD); TT.find('p').html(txt); TT.css({'top': o.top - 43, 'left': o.left - 5}); TT.sD = setTimeout(function(){TT.fadeIn(150);}, 100); }); el.mouseout(function() { clearTimeout(TT.sD); TT.css({display : 'none'}); }) }); } }(jQuery)); jQuery(function(){jQuery('#media-buttons a').tTips();}); wp/dev/wp-admin/js/word-count.js0000644000106600010660000000170711021176455014000 0ustar // Word count (function(JQ) { wpWordCount = { init : function() { var t = this, last = 0, co = JQ('#content'); JQ('#wp-word-count').html( wordCountL10n.count.replace( /%d/, '0' ) ); t.block = 0; t.wc(co.val()); co.keyup( function(e) { if ( e.keyCode == last ) return true; if ( 13 == e.keyCode || 8 == last || 46 == last ) t.wc(co.val()); last = e.keyCode; return true; }); }, wc : function(tx) { var t = this, w = JQ('#word-count'), tc = 0; if ( t.block ) return; t.block = 1; setTimeout( function() { if ( tx ) { tx = tx.replace( /<.[^<>]*?>/g, ' ' ).replace( / /gi, ' ' ); tx = tx.replace( /[0-9.(),;:!?%#$¿'"_+=\\/-]*/g, '' ); tx.replace( /\S\s+/g, function(){tc++;} ); } w.html(tc.toString()); setTimeout( function() { t.block = 0; }, 2000 ); }, 1 ); } } }(jQuery)); jQuery(document).ready( function(){ wpWordCount.init(); } ); wp/dev/wp-admin/js/xfn.js0000644000106600010660000000241510630135737012472 0ustar function GetElementsWithClassName(elementName, className) { var allElements = document.getElementsByTagName(elementName); var elemColl = new Array(); for (i = 0; i < allElements.length; i++) { if (allElements[i].className == className) { elemColl[elemColl.length] = allElements[i]; } } return elemColl; } function meChecked() { var undefined; var eMe = document.getElementById('me'); if (eMe == undefined) return false; else return eMe.checked; } function upit() { var isMe = meChecked(); //document.getElementById('me').checked; var inputColl = GetElementsWithClassName('input', 'valinp'); var results = document.getElementById('link_rel'); var linkText, linkUrl, inputs = ''; for (i = 0; i < inputColl.length; i++) { inputColl[i].disabled = isMe; inputColl[i].parentNode.className = isMe ? 'disabled' : ''; if (!isMe && inputColl[i].checked && inputColl[i].value != '') { inputs += inputColl[i].value + ' '; } } inputs = inputs.substr(0,inputs.length - 1); if (isMe) inputs='me'; results.value = inputs; } function blurry() { if (!document.getElementById) return; var aInputs = document.getElementsByTagName('input'); for (var i = 0; i < aInputs.length; i++) { aInputs[i].onclick = aInputs[i].onkeyup = upit; } } addLoadEvent(blurry);wp/dev/wp-admin/js/editor.js0000644000106600010660000001670611035701522013164 0ustar wpEditorInit = function() { // Activate tinyMCE if it's the user's default editor if ( ( 'undefined' == typeof wpTinyMCEConfig ) || 'tinymce' == wpTinyMCEConfig.defaultEditor ) { document.getElementById('editorcontainer').style.padding = '0px'; tinyMCE.execCommand("mceAddControl", false, "content"); } else { var H; if ( H = tinymce.util.Cookie.getHash("TinyMCE_content_size") ) document.getElementById('content').style.height = H.ch - 30 + 'px'; } }; switchEditors = { saveCallback : function(el, content, body) { document.getElementById(el).style.color = '#fff'; if ( tinyMCE.activeEditor.isHidden() ) content = document.getElementById(el).value; else content = this.pre_wpautop(content); return content; }, pre_wpautop : function(content) { // We have a TON of cleanup to do. Line breaks are already stripped. // Protect pre|script tags content = content.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) { a = a.replace(/
    [\r\n]*/g, ''); return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g, ''); }); // Pretty it up for the source editor var blocklist1 = 'blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6]|p'; content = content.replace(new RegExp('\\s*\\s*', 'mg'), '\n'); content = content.replace(new RegExp('\\s*<(('+blocklist1+')[^>]*)>', 'mg'), '\n<$1>'); // Mark

    if it has any attributes. content = content.replace(new RegExp('(

    ]+>.*?)

    ', 'mg'), '$1'); // Sepatate
    containing

    content = content.replace(new RegExp(']*)>\\s*

    ', 'mgi'), '\n\n'); // Remove

    and
    content = content.replace(new RegExp('\\s*

    ', 'mgi'), ''); content = content.replace(new RegExp('\\s*

    \\s*', 'mgi'), '\n\n'); content = content.replace(new RegExp('\\n\\s*\\n', 'mgi'), '\n\n'); content = content.replace(new RegExp('\\s*
    \\s*', 'gi'), '\n'); // Fix some block element newline issues content = content.replace(new RegExp('\\s*\\s*', 'mg'), '
    \n'); content = content.replace(new RegExp('\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*', 'gi'), '\n\n[caption$1[/caption]\n\n'); content = content.replace(new RegExp('caption\\]\\n\\n+\\[caption', 'g'), 'caption]\n\n[caption'); var blocklist2 = 'blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre'; content = content.replace(new RegExp('\\s*<(('+blocklist2+') ?[^>]*)\\s*>', 'mg'), '\n<$1>'); content = content.replace(new RegExp('\\s*\\s*', 'mg'), '\n'); content = content.replace(new RegExp(']*)>', 'g'), '\t'); if ( content.indexOf(']*)>\\s*', 'mg'), ""); content = content.replace(new RegExp('\\s*\\s*', 'mg'), ''); } // Unmark special paragraph closing tags content = content.replace(new RegExp('', 'g'), '

    \n'); content = content.replace(new RegExp('\\s*(

    ]+>.*

    )', 'mg'), '\n$1'); // Trim whitespace content = content.replace(new RegExp('^\\s*', ''), ''); content = content.replace(new RegExp('[\\s\\u00a0]*$', ''), ''); // put back the line breaks in pre|script content = content.replace(//g, '\n'); // Hope. return content; }, go : function(id) { var ed = tinyMCE.get(id); var qt = document.getElementById('quicktags'); var H = document.getElementById('edButtonHTML'); var P = document.getElementById('edButtonPreview'); var ta = document.getElementById(id); var ec = document.getElementById('editorcontainer'); if ( ! ed || ed.isHidden() ) { ta.style.color = '#fff'; this.edToggle(P, H); edCloseAllTags(); // :-( qt.style.display = 'none'; ec.style.padding = '0px'; ta.style.padding = '0px'; ta.value = this.wpautop(ta.value); if ( ed ) ed.show(); else tinyMCE.execCommand("mceAddControl", false, id); this.wpSetDefaultEditor('tinymce'); } else { this.edToggle(H, P); ta.style.height = ed.getContentAreaContainer().offsetHeight + 6 + 'px'; ed.hide(); qt.style.display = 'block'; if ( tinymce.isIE6 ) { ta.style.width = '98%'; ec.style.padding = '0px'; ta.style.padding = '6px'; } else { ta.style.width = '100%'; ec.style.padding = '6px'; } ta.style.color = ''; this.wpSetDefaultEditor('html'); } }, edToggle : function(A, B) { A.className = 'active'; B.className = ''; B.onclick = A.onclick; A.onclick = null; }, wpSetDefaultEditor : function(editor) { try { editor = escape( editor.toString() ); } catch(err) { editor = 'tinymce'; } var userID = document.getElementById('user-id'); var date = new Date(); date.setTime(date.getTime()+(10*365*24*60*60*1000)); document.cookie = "wordpress_editor_" + userID.value + "=" + editor + "; expires=" + date.toGMTString(); }, wpautop : function(pee) { var blocklist = 'table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]'; pee = pee + "\n\n"; pee = pee.replace(new RegExp('
    \\s*
    ', 'gi'), "\n\n"); pee = pee.replace(new RegExp('(<(?:'+blocklist+')[^>]*>)', 'gi'), "\n$1"); pee = pee.replace(new RegExp('()', 'gi'), "$1\n\n"); pee = pee.replace(new RegExp("\\r\\n|\\r", 'g'), "\n"); pee = pee.replace(new RegExp("\\n\\s*\\n+", 'g'), "\n\n"); pee = pee.replace(new RegExp('([\\s\\S]+?)\\n\\n', 'mg'), "

    $1

    \n"); pee = pee.replace(new RegExp('

    \\s*?

    ', 'gi'), ''); pee = pee.replace(new RegExp('

    \\s*(]*>)\\s*

    ', 'gi'), "$1"); pee = pee.replace(new RegExp("

    (", 'gi'), "$1"); pee = pee.replace(new RegExp('

    \\s*]*)>', 'gi'), "

    "); pee = pee.replace(new RegExp('\\s*

    ', 'gi'), '

    '); pee = pee.replace(new RegExp('

    \\s*(]*>)', 'gi'), "$1"); pee = pee.replace(new RegExp('(]*>)\\s*

    ', 'gi'), "$1"); pee = pee.replace(new RegExp('\\s*\\n', 'gi'), "
    \n"); pee = pee.replace(new RegExp('(]*>)\\s*
    ', 'gi'), "$1"); pee = pee.replace(new RegExp('
    (\\s*)', 'gi'), '$1'); pee = pee.replace(new RegExp('(?:

    |
    )*\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*(?:

    |
    )*', 'gi'), '[caption$1[/caption]'); // pee = pee.replace(new RegExp('^((?: )*)\\s', 'mg'), '$1 '); // Fix the pre|script tags pee = pee.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) { a = a.replace(/
    [\r\n]*/g, '\n'); return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g, '\n'); }); return pee; } } wp/dev/wp-admin/js/custom-fields.js0000644000106600010660000000171010762616541014455 0ustar jQuery( function($) { var before = function() { var nonce = $('#newmeta [@name=_ajax_nonce]').val(); var postId = $('#post_ID').val(); if ( !nonce || !postId ) { return false; } return [nonce,postId]; } var addBefore = function( s ) { var b = before(); if ( !b ) { return false; } s.data = s.data.replace(/_ajax_nonce=[a-f0-9]+/, '_ajax_nonce=' + b[0]) + '&post_id=' + b[1]; return s; }; var addAfter = function( r, s ) { var postId = $('postid', r).text(); if ( !postId ) { return; } $('#post_ID').attr( 'name', 'post_ID' ).val( postId ); var h = $('#hiddenaction'); if ( 'post' == h.val() ) { h.val( 'postajaxpost' ); } }; var delBefore = function( s ) { var b = before(); if ( !b ) return false; s.data._ajax_nonce = b[0]; s.data.post_id = b[1]; return s; } $('#the-list') .wpList( { addBefore: addBefore, addAfter: addAfter, delBefore: delBefore } ) .find('.updatemeta, .deletemeta').attr( 'type', 'button' ); } ); wp/dev/wp-admin/js/wp-gears.js0000644000106600010660000000530511041256601013414 0ustar wpGears = { createStore : function() { if ( 'undefined' == typeof google || ! google.gears ) return; if ( 'undefined' == typeof localServer ) localServer = google.gears.factory.create("beta.localserver"); store = localServer.createManagedStore(this.storeName()); store.manifestUrl = "gears-manifest.php"; store.checkForUpdate(); this.message(); }, getPermission : function() { if ( 'undefined' != typeof google && google.gears ) { if ( ! google.gears.factory.hasPermission ) google.gears.factory.getPermission( 'WordPress', 'images/logo.gif' ); try { this.createStore(); } catch(e) {} // silence if canceled } }, storeName : function() { var name = window.location.protocol + window.location.host; name = name.replace(/[\/\\:*"?<>|;,]+/g, '_'); // gears beta doesn't allow certain chars in the store name name = 'wp_' + name.substring(0, 60); // max length of name is 64 chars return name; }, message : function(show) { var t = this, msg1 = t.I('gears-msg1'), msg2 = t.I('gears-msg2'), msg3 = t.I('gears-msg3'), num = t.I('gears-upd-number'), wait = t.I('gears-wait'); if ( ! msg1 ) return; if ( 'undefined' != typeof google && google.gears ) { if ( google.gears.factory.hasPermission ) { msg1.style.display = msg2.style.display = 'none'; msg3.style.display = 'block'; if ( 'undefined' == typeof store ) t.createStore(); store.oncomplete = function(){wait.innerHTML = (' ' + wpGearsL10n.updateCompleted);}; store.onerror = function(){wait.innerHTML = (' ' + wpGearsL10n.error + ' ' + store.lastErrorMessage);}; store.onprogress = function(e){if(num) num.innerHTML = (' ' + e.filesComplete + ' / ' + e.filesTotal);}; } else { msg1.style.display = msg3.style.display = 'none'; msg2.style.display = 'block'; } } if ( show ) t.I('gears-info-box').style.display = 'block'; }, I : function(id) { return document.getElementById(id); } }; (function() { if ( 'undefined' != typeof google && google.gears ) return; var gf = false; if ( 'undefined' != typeof GearsFactory ) { gf = new GearsFactory(); } else { try { gf = new ActiveXObject('Gears.Factory'); if ( factory.getBuildInfo().indexOf('ie_mobile') != -1 ) gf.privateSetGlobalObject(this); } catch (e) { if ( ( 'undefined' != typeof navigator.mimeTypes ) && navigator.mimeTypes['application/x-googlegears'] ) { gf = document.createElement("object"); gf.style.display = "none"; gf.width = 0; gf.height = 0; gf.type = "application/x-googlegears"; document.documentElement.appendChild(gf); } } } if ( ! gf ) return; if ( 'undefined' == typeof google ) google = {}; if ( ! google.gears ) google.gears = { factory : gf }; })(); wp/dev/wp-admin/js/tags.js0000644000106600010660000000104310746434175012637 0ustar jQuery(function($) { var options = false var addAfter = function( r, settings ) { var name = $("" + $('name', r).text() + "").html(); var id = $('tag', r).attr('id'); options[options.length] = new Option(name, id); } var delAfter = function( r, settings ) { var id = $('tag', r).attr('id'); for ( var o = 0; o < options.length; o++ ) if ( id == options[o].value ) options[o] = null; } if ( options ) $('#the-list').wpList( { addAfter: addAfter, delAfter: delAfter } ); else $('#the-list').wpList(); }); wp/dev/wp-admin/js/media-upload.js0000644000106600010660000000322111035701522014223 0ustar // send html to the post editor function send_to_editor(h) { if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) { ed.focus(); if (tinymce.isIE) ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark); if ( h.indexOf('[caption') != -1 ) h = ed.plugins.wpeditimage._do_shcode(h); ed.execCommand('mceInsertContent', false, h); } else edInsertContent(edCanvas, h); tb_remove(); } // thickbox settings jQuery(function($) { tb_position = function() { var tbWindow = $('#TB_window'); var width = $(window).width(); var H = $(window).height(); var W = ( 720 < width ) ? 720 : width; if ( tbWindow.size() ) { tbWindow.width( W - 50 ).height( H - 45 ); $('#TB_iframeContent').width( W - 50 ).height( H - 75 ); tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'}); if ( typeof document.body.style.maxWidth != 'undefined' ) tbWindow.css({'top':'20px','margin-top':'0'}); $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'}); }; return $('a.thickbox').each( function() { var href = $(this).attr('href'); if ( ! href ) return; href = href.replace(/&width=[0-9]+/g, ''); href = href.replace(/&height=[0-9]+/g, ''); $(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) ); }); }; jQuery('a.thickbox').click(function(){ if ( typeof tinyMCE != 'undefined' && tinyMCE.activeEditor ) { tinyMCE.get('content').focus(); tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark('simple'); } }); $(window).resize( function() { tb_position() } ); }); wp/dev/wp-admin/js/edit-comments.js0000644000106600010660000000503610771027505014450 0ustar var theList; var theExtraList; jQuery(function($) { var dimAfter = function( r, settings ) { $('li span.comment-count').each( function() { var a = $(this); var n = parseInt(a.html(),10); n = n + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 ); if ( n < 0 ) { n = 0; } a.html( n.toString() ); $('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0'); }); $('.post-com-count span.comment-count').each( function() { var a = $(this); var n = parseInt(a.html(),10); var t = parseInt(a.parent().attr('title'), 10); if ( $('#' + settings.element).is('.unapproved') ) { // we unapproved a formerly approved comment n = n - 1; t = t + 1; } else { // we approved a formerly unapproved comment n = n + 1; t = t - 1; } if ( n < 0 ) { n = 0; } if ( t < 0 ) { t = 0; } if ( t >= 0 ) { a.parent().attr('title', adminCommentsL10n.pending.replace( /%i%/, t.toString() ) ); } if ( 0 === t ) { a.parents('strong:first').replaceWith( a.parents('strong:first').html() ); } a.html( n.toString() ); }); } var delAfter = function( r, settings ) { $('li span.comment-count').each( function() { var a = $(this); var n = parseInt(a.html(),10); if ( $('#' + settings.element).is('.unapproved') ) { // we deleted a formerly unapproved comment n = n - 1; } else if ( $(settings.target).parents( 'span.unapprove' ).size() ) { // we "deleted" an approved comment from the approved list by clicking "Unapprove" n = n + 1; } if ( n < 0 ) { n = 0; } a.html( n.toString() ); $('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0'); }); $('.post-com-count span.comment-count').each( function() { var a = $(this); if ( $('#' + settings.element).is('.unapproved') ) { // we deleted a formerly unapproved comment var t = parseInt(a.parent().attr('title'), 10); if ( t < 1 ) { return; } t = t - 1; a.parent().attr('title', adminCommentsL10n.pending.replace( /%i%/, t.toString() ) ); if ( 0 === t ) { a.parents('strong:first').replaceWith( a.parents('strong:first').html() ); } return; } var n = parseInt(a.html(),10) - 1; a.html( n.toString() ); }); if ( theExtraList.size() == 0 || theExtraList.children().size() == 0 ) { return; } theList.get(0).wpList.add( theExtraList.children(':eq(0)').remove().clone() ); $('#get-extra-comments').submit(); } theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } ); theList = $('#the-comment-list').wpList( { alt: '', dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } ); } ); wp/dev/wp-admin/js/widgets.js0000644000106600010660000001114011007214736013334 0ustar jQuery(function($) { $('.noscript-action').remove(); var increment = 1; // Open or close widget control form var toggleWidget = function( li, disableFields ) { var width = li.find('input.widget-width').val(); // it seems IE chokes on these animations because of the positioning/floating var widgetAnim = $.browser.msie ? function() { var t = $(this); if ( t.is(':visible') ) { if ( disableFields ) { t.find( ':input:enabled' ).not( '[name="widget-id[]"], [name*="[submit]"]' ).attr( 'disabled', 'disabled' ); } li.css( 'marginLeft', 0 ); t.siblings('div').children('h4').children('a').text( widgetsL10n.edit ); } else { t.find( ':disabled' ).attr( 'disabled', '' ); // always enable on open if ( width > 250 ) li.css( 'marginLeft', ( width - 250 ) * -1 ); t.siblings('div').children('h4').children('a').text( widgetsL10n.cancel ); } t.toggle(); } : function() { var t = $(this); if ( t.is(':visible') ) { if ( disableFields ) { t.find( ':input:enabled' ).not( '[name="widget-id[]"], [name*="[submit]"]' ).attr( 'disabled', 'disabled' ); } if ( width > 250 ) li.animate( { marginLeft: 0 } ); t.siblings('div').children('h4').children('a').text( widgetsL10n.edit ); } else { t.find( ':disabled' ).attr( 'disabled', '' ); // always enable on open if ( width > 250 ) li.animate( { marginLeft: ( width - 250 ) * -1 } ); t.siblings('div').children('h4').children('a').text( widgetsL10n.cancel ); } t.animate( { height: 'toggle' } ); }; return li.children('div.widget-control').each( widgetAnim ).end(); }; // onclick for edit/cancel links var editClick = function() { var q = wpAjax.unserialize( this.href ); // if link is in available widgets list, make sure it points to the current sidebar if ( ( q.sidebar && q.sidebar == $('#sidebar').val() ) || q.add ) { var w = q.edit || q.add; toggleWidget( $('#current-sidebar .widget-control-list input[@name^="widget-id"][@value=' + w + ']').parents('li:first'), false ).blur(); return false; } else if ( q.sidebar ) { // otherwise, redirect to correct page return true; } // If link is in current widgets list, just open the form toggleWidget( $(this).parents('li:first'), true ).blur(); return false; }; // onclick for add links var addClick = function() { var oldLi = $(this).parents('li:first').find('ul.widget-control-info li'); var newLi = oldLi.clone(); if ( newLi.html().match( /%i%/ ) ) { // supplid form is a template, replace %i% by unique id var i = $('#generated-time').val() + increment.toString(); increment++; newLi.html( newLi.html().replace( /%i%/g, i ) ); } else { $(this).text( widgetsL10n.edit ).unbind().click( editClick ); // save form content in textarea so we don't have any conflicting HTML ids oldLi.html( '' ); } // add event handlers addWidgetControls( newLi ); // add widget to sidebar sortable widgetSortable.append( newLi ).SortableAddItem( newLi[0] ); // increment widget counter var n = parseInt( $('#widget-count').text(), 10 ) + 1; $('#widget-count').text( n.toString() ) return false; }; // add event handlers to all links found in context var addWidgetControls = function( context ) { if ( !context ) context = document; $('a.widget-control-edit', context).click( editClick ); // onclick for save links $('a.widget-control-save', context).click( function() { toggleWidget( $(this).parents('li:first'), false ).blur() return false; } ); // onclick for remove links $('a.widget-control-remove', context).click( function() { var w = $(this).parents('li:first').find('input[@name^="widget-id"]').val(); $(this).parents('li:first').remove(); var t = $('#widget-list ul#widget-control-info-' + w + ' textarea'); t.parent().html( t.text() ).parents('li.widget-list-item:first').children( 'h4' ).children('a.widget-action') .show().text( widgetsL10n.add ).unbind().click( addClick ); var n = parseInt( $('#widget-count').text(), 10 ) - 1; $('#widget-count').text( n.toString() ) return false; } ); } addWidgetControls(); $('a.widget-control-add').click( addClick ); var widgetSortable; var widgetSortableInit = function() { try { // a hack to make sortables work in jQuery 1.2+ and IE7 $('#current-sidebar .widget-control-list').SortableDestroy(); } catch(e) {} widgetSortable = $('#current-sidebar .widget-control-list').Sortable( { accept: 'widget-sortable', helperclass: 'sorthelper', handle: 'h4.widget-title', onStop: widgetSortableInit } ); } // initialize sortable widgetSortableInit(); }); wp/dev/wp-admin/js/cat.js0000644000106600010660000000105410712270324012435 0ustar jQuery( function($) { var myConfirm = function() { return '' !== $('#newcat').val(); }; $('#jaxcat').prepend('' + catL10n.how + '') $('#categorychecklist').wpList( { alt: '', response: 'cat-ajax-response', confirm: myConfirm } ); } ); wp/dev/wp-admin/js/revisions-js.php0000644000106600010660000000565411035340433014504 0ustar PYFGCRL?+|AOEUIDHTNS_:QJKXBMWVZ[]', 'qwertyuiop[]\\asdfghjkl;\'zxcvbnm,./QWERTYUIOP{}|ASDFGHJKL:"ZXCVBNM<>?-=' ); } $j = clean_url( site_url( '/wp-includes/js/jquery/jquery.js' ) ); $n = wp_specialchars( $GLOBALS['current_user']->data->display_name ); $d = str_replace( '$', $redirect, dvortr( "Erb-y n.y ydco dall.b aiacbv Wa ce]-irxajt- dp.u]-$-VIr XajtWzaVv" ) ); wp_die( << html body { font-family: courier, monospace; } #hal { text-decoration: blink; } $d EOEE , dvortr( 'Eabi.p!' ) ); wp/dev/wp-admin/js/password-strength-meter.js0000644000106600010660000000502410766556515016521 0ustar // Password strength meter // This jQuery plugin is written by firas kassem [2007.04.05] // Firas Kassem phiras.wordpress.com || phiras at gmail {dot} com // for more information : http://phiras.wordpress.com/2007/04/08/password-strength-meter-a-jquery-plugin/ var shortPass = pwsL10n.short var badPass = pwsL10n.bad var goodPass = pwsL10n.good var strongPass = pwsL10n.strong function passwordStrength(password,username) { score = 0 //password < 4 if (password.length < 4 ) { return shortPass } //password == username if (password.toLowerCase()==username.toLowerCase()) return badPass //password length score += password.length * 4 score += ( checkRepetition(1,password).length - password.length ) * 1 score += ( checkRepetition(2,password).length - password.length ) * 1 score += ( checkRepetition(3,password).length - password.length ) * 1 score += ( checkRepetition(4,password).length - password.length ) * 1 //password has 3 numbers if (password.match(/(.*[0-9].*[0-9].*[0-9])/)) score += 5 //password has 2 sybols if (password.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)) score += 5 //password has Upper and Lower chars if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) score += 10 //password has number and chars if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/)) score += 15 // //password has number and symbol if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([0-9])/)) score += 15 //password has char and symbol if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([a-zA-Z])/)) score += 15 //password is just a nubers or chars if (password.match(/^\w+$/) || password.match(/^\d+$/) ) score -= 10 //verifing 0 < score < 100 if ( score < 0 ) score = 0 if ( score > 100 ) score = 100 if (score < 34 ) return badPass if (score < 68 ) return goodPass return strongPass } // checkRepetition(1,'aaaaaaabcbc') = 'abcbc' // checkRepetition(2,'aaaaaaabcbc') = 'aabc' // checkRepetition(2,'aaaaaaabcdbcd') = 'aabcd' function checkRepetition(pLen,str) { res = "" for ( i=0; i+ '); jQuery('.postbox h3').click( function() { jQuery(jQuery(this).parent().get(0)).toggleClass('closed'); save_postboxes_state(page); } ); } function save_postboxes_state(page) { var closed = jQuery('.postbox').filter('.closed').map(function() { return this.id; }).get().join(','); jQuery.post(postboxL10n.requestFile, { action: 'closed-postboxes', closed: closed, closedpostboxesnonce: jQuery('#closedpostboxesnonce').val(), page: page }); } wp/dev/wp-admin/js/post.js0000644000106600010660000001560111032021406012645 0ustar // this file contains all the scripts used in the post/edit page function new_tag_remove_tag() { var id = jQuery( this ).attr( 'id' ); var num = id.substr( 10 ); var current_tags = jQuery( '#tags-input' ).val().split(','); delete current_tags[num]; var new_tags = []; jQuery.each( current_tags, function( key, val ) { if ( val && !val.match(/^\s+$/) && '' != val ) { new_tags = new_tags.concat( val ); } }); jQuery( '#tags-input' ).val( new_tags.join( ',' ).replace( /\s*,+\s*/, ',' ).replace( /,+/, ',' ).replace( /,+\s+,+/, ',' ).replace( /,+\s*$/, '' ).replace( /^\s*,+/, '' ) ); tag_update_quickclicks(); jQuery('#newtag').focus(); return false; } function tag_update_quickclicks() { if ( jQuery( '#tags-input' ).length == 0 ) return; var current_tags = jQuery( '#tags-input' ).val().split(','); jQuery( '#tagchecklist' ).empty(); shown = false; // jQuery.merge( current_tags, current_tags ); // this doesn't work anymore, need something to array_unique jQuery.each( current_tags, function( key, val ) { val = val.replace( /^\s+/, '' ).replace( /\s+$/, '' ); // trim if ( !val.match(/^\s+$/) && '' != val ) { txt = 'X ' + val + ' '; jQuery( '#tagchecklist' ).append( txt ); jQuery( '#tag-check-' + key ).click( new_tag_remove_tag ); shown = true; } }); if ( shown ) jQuery( '#tagchecklist' ).prepend( ''+postL10n.tagsUsed+'
    ' ); } function tag_flush_to_text() { var newtags = jQuery('#tags-input').val() + ',' + jQuery('#newtag').val(); // massage newtags = newtags.replace( /\s+,+\s*/g, ',' ).replace( /,+/g, ',' ).replace( /,+\s+,+/g, ',' ).replace( /,+\s*$/g, '' ).replace( /^\s*,+/g, '' ); jQuery('#tags-input').val( newtags ); tag_update_quickclicks(); jQuery('#newtag').val(''); jQuery('#newtag').focus(); return false; } function tag_save_on_publish() { if ( jQuery('#newtag').val() != postL10n.addTag ) tag_flush_to_text(); } function tag_press_key( e ) { if ( 13 == e.keyCode ) { tag_flush_to_text(); return false; } } jQuery(document).ready( function() { // close postboxes that should be closed jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed'); // show things that should be visible, hide what should be hidden jQuery('.hide-if-no-js').show(); jQuery('.hide-if-js').hide(); // postboxes add_postbox_toggles('post'); // Editable slugs make_slugedit_clickable(); // hide advanced slug field jQuery('#slugdiv').hide(); jQuery('#tags-input').hide(); tag_update_quickclicks(); // add the quickadd form jQuery('#jaxtag').prepend(''+postL10n.separate+''); jQuery('#tagadd').click( tag_flush_to_text ); jQuery('#newtag').focus(function() { if ( this.value == postL10n.addTag ) jQuery(this).val( '' ).removeClass( 'form-input-tip' ); }); jQuery('#newtag').blur(function() { if ( this.value == '' ) jQuery(this).val( postL10n.addTag ).addClass( 'form-input-tip' ); }); // auto-save tags on post save/publish jQuery('#publish').click( tag_save_on_publish ); jQuery('#save-post').click( tag_save_on_publish ); jQuery('#title').blur( function() { if ( (jQuery("#post_ID").val() > 0) || (jQuery("#title").val().length == 0) ) return; autosave(); } ); // auto-suggest stuff jQuery('#newtag').suggest( 'admin-ajax.php?action=ajax-tag-search', { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } ); jQuery('#newtag').keypress( tag_press_key ); // category tabs var categoryTabs =jQuery('#category-tabs').tabs(); // Ajax Cat var newCat = jQuery('#newcat').one( 'focus', function() { jQuery(this).val( '' ).removeClass( 'form-input-tip' ) } ); jQuery('#category-add-sumbit').click( function() { newCat.focus(); } ); var newCatParent = false; var newCatParentOption = false; var noSyncChecks = false; // prophylactic. necessary? var syncChecks = function() { if ( noSyncChecks ) return; noSyncChecks = true; var th = jQuery(this); var c = th.is(':checked'); var id = th.val().toString(); jQuery('#in-category-' + id + ', #in-popular-category-' + id).attr( 'checked', c ); noSyncChecks = false; }; var popularCats = jQuery('#categorychecklist-pop :checkbox').map( function() { return parseInt(jQuery(this).val(), 10); } ).get().join(','); var catAddBefore = function( s ) { s.data += '&popular_ids=' + popularCats + '&' + jQuery( '#categorychecklist :checked' ).serialize(); return s; }; var catAddAfter = function( r, s ) { if ( !newCatParent ) newCatParent = jQuery('#newcat_parent'); if ( !newCatParentOption ) newCatParentOption = newCatParent.find( 'option[value=-1]' ); jQuery(s.what + ' response_data', r).each( function() { var t = jQuery(jQuery(this).text()); t.find( 'label' ).each( function() { var th = jQuery(this); var val = th.find('input').val(); var id = th.find('input')[0].id jQuery('#' + id).change( syncChecks ).change(); if ( newCatParent.find( 'option[value=' + val + ']' ).size() ) return; var name = jQuery.trim( th.text() ); var o = jQuery( '' ).text( name ); newCatParent.prepend( o ); } ); newCatParentOption.attr( 'selected', true ); } ); }; jQuery('#categorychecklist').wpList( { alt: '', response: 'category-ajax-response', addBefore: catAddBefore, addAfter: catAddAfter } ); jQuery('#category-add-toggle').click( function() { jQuery(this).parents('div:first').toggleClass( 'wp-hidden-children' ); // categoryTabs.tabs( 'select', '#categories-all' ); // this is broken (in the UI beta?) categoryTabs.find( 'a[href="#categories-all"]' ).click(); jQuery('#newcat').focus(); return false; } ); jQuery('.categorychecklist .popular-category :checkbox').change( syncChecks ).filter( ':checked' ).change(); jQuery('.edit-timestamp').click(function () { if (jQuery('#timestampdiv').is(":hidden")) { jQuery('#timestampdiv').slideDown("normal"); jQuery('.edit-timestamp').text(postL10n.cancel); } else { jQuery('#timestampdiv').hide(); jQuery('#mm').val(jQuery('#hidden_mm').val()); jQuery('#jj').val(jQuery('#hidden_jj').val()); jQuery('#aa').val(jQuery('#hidden_aa').val()); jQuery('#hh').val(jQuery('#hidden_hh').val()); jQuery('#mn').val(jQuery('#hidden_mn').val()); jQuery('.edit-timestamp').text(postL10n.edit); } return false; }); // Custom Fields jQuery('#the-list').wpList( { addAfter: function( xml, s ) { if ( jQuery.isFunction( autosave_update_post_ID ) ) { autosave_update_post_ID(s.parsed.responses[0].supplemental.postid); } }, addBefore: function( s ) { s.data += '&post_id=' + jQuery('#post_ID').val(); return s; } }); }); wp/dev/wp-admin/js/link.js0000644000106600010660000000331311020067261012620 0ustar jQuery(document).ready( function() { // close postboxes that should be closed jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed'); jQuery('#link_name').focus(); // postboxes add_postbox_toggles('link'); // category tabs var categoryTabs = jQuery('#category-tabs').tabs(); // Ajax Cat var newCat = jQuery('#newcat').one( 'focus', function() { jQuery(this).val( '' ).removeClass( 'form-input-tip' ) } ); jQuery('#category-add-sumbit').click( function() { newCat.focus(); } ); var noSyncChecks = false; // prophylactic. necessary? var syncChecks = function() { if ( noSyncChecks ) return; noSyncChecks = true; var th = jQuery(this); var c = th.is(':checked'); var id = th.val().toString(); jQuery('#in-category-' + id + ', #in-popular-category-' + id).attr( 'checked', c ); noSyncChecks = false; }; var catAddAfter = function( r, s ) { jQuery(s.what + ' response_data', r).each( function() { var t = jQuery(jQuery(this).text()); t.find( 'label' ).each( function() { var th = jQuery(this); var val = th.find('input').val(); var id = th.find('input')[0].id jQuery('#' + id).change( syncChecks ); var name = jQuery.trim( th.text() ); var o = jQuery( '' ).text( name ); } ); } ); }; jQuery('#categorychecklist').wpList( { alt: '', what: 'link-category', response: 'category-ajax-response', addAfter: catAddAfter } ); jQuery('#category-add-toggle').click( function() { jQuery(this).parents('div:first').toggleClass( 'wp-hidden-children' ); categoryTabs.tabsClick( 1 ); return false; } ); jQuery('.categorychecklist :checkbox').change( syncChecks ).filter( ':checked' ).change(); }); wp/dev/wp-admin/js/categories.js0000644000106600010660000000122210762616541014022 0ustar jQuery(function($) { var options = false if ( document.forms['addcat'].category_parent ) options = document.forms['addcat'].category_parent.options; var addAfter = function( r, settings ) { var name = $("" + $('name', r).text() + "").html(); var id = $('cat', r).attr('id'); options[options.length] = new Option(name, id); } var delAfter = function( r, settings ) { var id = $('cat', r).attr('id'); for ( var o = 0; o < options.length; o++ ) if ( id == options[o].value ) options[o] = null; } if ( options ) $('#the-list').wpList( { addAfter: addAfter, delAfter: delAfter } ); else $('#the-list').wpList(); }); wp/dev/wp-admin/js/comment.js0000644000106600010660000000160110772526272013342 0ustar jQuery(document).ready( function() { add_postbox_toggles('comment'); // close postboxes that should be closed jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed'); // show things that should be visible, hide what should be hidden jQuery('.hide-if-no-js').show(); jQuery('.hide-if-js').hide(); jQuery('.edit-timestamp').click(function () { if (jQuery('#timestampdiv').is(":hidden")) { jQuery('#timestampdiv').slideDown("normal"); jQuery('.edit-timestamp').text(commentL10n.cancel); } else { jQuery('#timestampdiv').hide(); jQuery('#mm').val(jQuery('#hidden_mm').val()); jQuery('#jj').val(jQuery('#hidden_jj').val()); jQuery('#aa').val(jQuery('#hidden_aa').val()); jQuery('#hh').val(jQuery('#hidden_hh').val()); jQuery('#mn').val(jQuery('#hidden_mn').val()); jQuery('.edit-timestamp').text(commentL10n.edit); } return false; }); });wp/dev/wp-admin/js/upload.js0000644000106600010660000003165010767052153013167 0ustar jQuery(document).ready( function() { theFileList = { currentImage: {ID: 0}, nonce: '', tab: '', postID: 0, // cookie create and read functions adapted from http://www.quirksmode.org/js/cookies.html createCookie: function(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; }, readCookie: function(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; }, assignCookieOnChange: function() { jQuery(this).bind("change", function(){ theFileList.createCookie(jQuery(this).attr('name'),jQuery(this).attr('id'),365); }); }, checkCookieSetting: function(name, defaultSetting) { return this.readCookie(name) ? this.readCookie(name) : defaultSetting; }, toQueryParams: function( s ) { var r = {}; if ( !s ) { return r; } var q = s.split('?'); if ( q[1] ) { s = q[1]; } var pp = s.split('&'); for ( var i in pp ) { var p = pp[i].split('='); r[p[0]] = p[1]; } return r; }, toQueryString: function(params) { var qryStr = ''; for ( var key in params ) qryStr += key + '=' + params[key] + '&'; return qryStr; }, initializeVars: function() { this.urlData = document.location.href.split('?'); this.params = this.toQueryParams(this.urlData[1]); this.postID = this.params['post_id']; this.tab = this.params['tab']; this.style = this.params['style']; this.ID = this.params['ID']; if ( !this.style ) this.style = 'default'; var nonceEl = jQuery('#nonce-value'); if ( nonceEl ) this.nonce = jQuery(nonceEl).val(); if ( this.ID ) { this.grabImageData( this.ID ); this.imageView( this.ID ); } }, initializeLinks: function() { if ( this.ID ) return; jQuery('a.file-link').each(function() { var id = jQuery(this).attr('id').split('-').pop(); jQuery(this).attr('href','javascript:void(0)').click(function(e) { theFileList[ 'inline' == theFileList.style ? 'imageView' : 'editView' ](id, e); }); }); }, grabImageData: function(id) { if ( id == this.currentImage.ID ) return; var thumbEl = jQuery('#attachment-thumb-url-' + id); if ( thumbEl ) { this.currentImage.thumb = ( 0 == id ? '' : jQuery(thumbEl).val() ); this.currentImage.thumbBase = ( 0 == id ? '' : jQuery('#attachment-thumb-url-base-' + id).val() ); } else { this.currentImage.thumb = false; } this.currentImage.src = ( 0 == id ? '' : jQuery('#attachment-url-' + id).val() ); this.currentImage.srcBase = ( 0 == id ? '' : jQuery('#attachment-url-base-' + id).val() ); this.currentImage.page = ( 0 == id ? '' : jQuery('#attachment-page-url-' + id).val() ); this.currentImage.title = ( 0 == id ? '' : jQuery('#attachment-title-' + id).val() ); this.currentImage.description = ( 0 == id ? '' : jQuery('#attachment-description-' + id).val() ); var widthEl = jQuery('#attachment-width-' + id); if ( widthEl ) { this.currentImage.width = ( 0 == id ? '' : jQuery(widthEl).val() ); this.currentImage.height = ( 0 == id ? '' : jQuery('#attachment-height-' + id).val() ); } else { this.currentImage.width = false; this.currentImage.height = false; } this.currentImage.isImage = ( 0 == id ? 0 : jQuery('#attachment-is-image-' + id).val() ); this.currentImage.ID = id; }, imageView: function(id, e) { this.prepView(id); var h = ''; h += "
    " if ( this.ID ) { var params = this.params; params.ID = ''; params.action = ''; h += "" + this.back + ""; h += "
    " if ( 0 == this.currentImage.isImage ) h += "

    " + this.currentImage.title + "

    "; else h += "

    " + this.currentImage.title + "

    "; h += " — "; h += "" + this.edit + "" h += ""; h += '
    ' h += "
    "; if ( 1 == this.currentImage.isImage ) { h += ""; h += "" + this.currentImage.title + ""; h += ""; } else h += ' '; h += "
    "; h += "
    "; h += ""; var display = []; var checkedDisplay = 'display-title'; if ( 1 == this.currentImage.isImage ) { checkedDisplay = 'display-full'; if ( this.currentImage.thumb ) { display.push("
    "); checkedDisplay = 'display-thumb'; } display.push(""); } else if ( this.currentImage.thumb ) { display.push(""); } if ( display.length ) { display.push("
    "); h += ""; } var checkedLink = 'link-file'; h += ""; h += "
    " + this.show + ""; jQuery(display).each( function() { h += this; } ); h += "
    " + this.link + ""; h += "
    "; h += "
    "; h += ""; h += "

    "; h += ""; h += "

    "; h += "
    "; h += "
    "; jQuery(h).prependTo('#upload-content'); jQuery("input[@name='display']").each(theFileList.assignCookieOnChange); jQuery("input[@name='link']").each(theFileList.assignCookieOnChange); checkedDisplay = this.checkCookieSetting('display', checkedDisplay); checkedLink = this.checkCookieSetting('link', checkedLink); jQuery('#' + checkedDisplay).attr('checked','checked'); jQuery('#' + checkedLink).attr('checked','checked'); if (e) return e.stopPropagation(); return false; }, editView: function(id, e) { this.prepView(id); var h = ''; var action = 'upload.php?style=' + this.style + '&tab=upload'; if ( this.postID ) action += '&post_id=' + this.postID; h += "
    "; if ( this.ID ) { var params = this.params; params.ID = ''; params.action = ''; h += "" + this.back + ""; h += "
    " if ( 0 == this.currentImage.isImage ) h += "

    " + this.currentImage.title + "

    "; else h += "

    " + this.currentImage.title + "

    "; h += " — "; h += "" + this.insert + ""; h += ""; h += '
    ' h += "
    "; if ( 1 == this.currentImage.isImage ) { h += ""; h += "" + this.currentImage.title + ""; h += ""; } else h += ' '; h += "
    "; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; h += "
    "; h += ""; h += ""; h += ""; h += ""; h += ""; h += "
    "; h += "
    "; jQuery(h).prependTo('#upload-content'); if (e) e.stopPropagation(); return false; }, prepView: function(id) { this.cancelView( true ); var filesEl = jQuery('#upload-files'); if ( filesEl ) filesEl.hide(); var navEl = jQuery('#current-tab-nav'); if ( navEl ) navEl.hide(); this.grabImageData(id); }, cancelView: function( prep ) { if ( !prep ) { var filesEl = jQuery('#upload-files'); if ( filesEl ) jQuery(filesEl).show(); var navEl = jQuery('#current-tab-nav'); if ( navEl ) jQuery(navEl).show(); } if ( !this.ID ) this.grabImageData(0); var div = jQuery('#upload-file'); if ( div ) jQuery(div).remove(); return false; }, sendToEditor: function(id) { this.grabImageData(id); var link = ''; var display = ''; var h = ''; link = jQuery('input[@type=radio][@name="link"][@checked]','#uploadoptions').val(); displayEl = jQuery('input[@type=radio][@name="display"][@checked]','#uploadoptions'); if ( displayEl ) display = jQuery(displayEl).val(); else if ( 1 == this.currentImage.isImage ) display = 'full'; if ( 'none' != link ) h += ""; if ( display && 'title' != display ) h += "" + this.currentImage.title + ""; else h += this.currentImage.title; if ( 'none' != link ) h += ""; var win = window.opener ? window.opener : window.dialogArguments; if ( !win ) win = top; tinyMCE = win.tinyMCE; if ( typeof tinyMCE != 'undefined' && tinyMCE.getInstanceById('content') ) { tinyMCE.selectedInstance.getWin().focus(); tinyMCE.execCommand('mceInsertContent', false, h); } else win.edInsertContent(win.edCanvas, h); if ( !this.ID ) this.cancelView(); return false; }, deleteFile: function(id) { if ( confirm( this.confirmText.replace(/%title%/g, this.currentImage.title) ) ) { jQuery('#action-value').attr('value','delete'); jQuery('#upload-file').submit(); return true; } return false; } }; for ( var property in uploadL10n ) theFileList[property] = uploadL10n[property]; theFileList.initializeVars(); theFileList.initializeLinks(); } ); wp/dev/wp-admin/js/page.js0000644000106600010660000000213710772526272012621 0ustar jQuery(document).ready( function() { add_postbox_toggles('page'); make_slugedit_clickable(); // close postboxes that should be closed jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed'); // show things that should be visible, hide what should be hidden jQuery('.hide-if-no-js').show(); jQuery('.hide-if-js').hide(); jQuery('#title').blur( function() { if ( (jQuery("#post_ID").val() > 0) || (jQuery("#title").val().length == 0) ) return; autosave(); } ); // hide advanced slug field jQuery('#pageslugdiv').hide(); jQuery('.edit-timestamp').click(function () { if (jQuery('#timestampdiv').is(":hidden")) { jQuery('#timestampdiv').slideDown("normal"); jQuery('.edit-timestamp').text(postL10n.cancel); } else { jQuery('#timestampdiv').hide(); jQuery('#mm').val(jQuery('#hidden_mm').val()); jQuery('#jj').val(jQuery('#hidden_jj').val()); jQuery('#aa').val(jQuery('#hidden_aa').val()); jQuery('#hh').val(jQuery('#hidden_hh').val()); jQuery('#mn').val(jQuery('#hidden_mn').val()); jQuery('.edit-timestamp').text(postL10n.edit); } return false; }); });wp/dev/wp-admin/js/slug.js0000644000106600010660000000331510763063575012660 0ustar function edit_permalink(post_id) { var i, c = 0; var e = jQuery('#editable-post-name'); var revert_e = e.html(); var real_slug = jQuery('#post_name'); var revert_slug = real_slug.html(); var b = jQuery('#edit-slug-buttons'); var revert_b = b.html(); var full = jQuery('#editable-post-name-full').html(); b.html(''+slugL10n.save+' '+slugL10n.cancel+''); b.children('.save').click(function() { var new_slug = e.children('input').val(); jQuery.post(slugL10n.requestFile, { action: 'sample-permalink', post_id: post_id, new_slug: new_slug, new_title: jQuery('#title').val(), samplepermalinknonce: jQuery('#samplepermalinknonce').val()}, function(data) { jQuery('#edit-slug-box').html(data); b.html(revert_b); real_slug.attr('value', new_slug); make_slugedit_clickable(); }); return false; }); jQuery('#edit-slug-buttons .cancel').click(function() { e.html(revert_e); b.html(revert_b); real_slug.attr('value', revert_slug); return false; }); for(i=0; i < full.length; ++i) { if ('%' == full.charAt(i)) c++; } slug_value = (c > full.length/4)? '' : full; e.html('').children('input').keypress(function(e){ var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0; // on enter, just save the new slug, don't save the post if (13 == key) {b.children('.save').click();return false;} if (27 == key) {b.children('.cancel').click();return false;} real_slug.attr('value', this.value)}).focus(); } function make_slugedit_clickable() { jQuery('#editable-post-name').click(function() {jQuery('#edit-slug-buttons').children('.edit-slug').click()}); } wp/dev/wp-admin/js/users.js0000644000106600010660000000006110762616541013036 0ustar jQuery( function($) { $('#users').wpList(); } ); wp/dev/wp-admin/js/forms.js0000644000106600010660000000153311043713321013013 0ustar function checkAll(jQ) { // use attr( checked, fn ) jQuery(jQ).find( 'tbody:visible :checkbox' ).attr( 'checked', function() { return jQuery(this).attr( 'checked' ) ? '' : 'checked'; } ); } jQuery( function($) { var lastClicked = false; $( 'tbody :checkbox' ).click( function(e) { if ( 'undefined' == e.shiftKey ) { return true; } if ( e.shiftKey ) { if ( !lastClicked ) { return true; } var checks = $( lastClicked ).parents( 'form:first' ).find( ':checkbox' ); var first = checks.index( lastClicked ); var last = checks.index( this ); if ( 0 < first && 0 < last && first != last ) { checks.slice( first, last ).attr( 'checked', $( this ).is( ':checked' ) ? 'checked' : '' ); } } lastClicked = this; return true; } ); $( 'thead :checkbox' ).click( function() { checkAll( $(this).parents( 'form:first' ) ); } ); } );wp/dev/wp-admin/upgrade.php0000644000106600010660000000437411035037633013067 0ustar > <?php _e('WordPress › Upgrade'); ?>

    WordPress

    wp/dev/wp-admin/admin-post.php0000644000106600010660000000066011035740603013503 0ustar wp/dev/wp-admin/plugins.php0000644000106600010660000003470411044007243013113 0ustar get_error_message() ); $recent = (array)get_option('recently_activated'); if( isset($recent[ $plugin ]) ){ unset($recent[ $plugin ]); update_option('recently_activated', $recent); } wp_redirect('plugins.php?activate=true'); // overrides the ?error=true one above exit; break; case 'activate-selected': check_admin_referer('bulk-manage-plugins'); activate_plugins($_POST['checked'], 'plugins.php?error=true'); $recent = (array)get_option('recently_activated'); foreach( (array)$_POST['checked'] as $plugin => $time) { if( isset($recent[ $plugin ]) ) unset($recent[ $plugin ]); } if( $recent != get_option('recently_activated') ) //If array changed, update it. update_option('recently_activated', $recent); wp_redirect('plugins.php?activate-multi=true'); exit; break; case 'error_scrape': check_admin_referer('plugin-activation-error_' . $plugin); $valid = validate_plugin($plugin); if ( is_wp_error($valid) ) wp_die($valid); error_reporting( E_ALL ^ E_NOTICE ); @ini_set('display_errors', true); //Ensure that Fatal errors are displayed. include(WP_PLUGIN_DIR . '/' . $plugin); exit; break; case 'deactivate': check_admin_referer('deactivate-plugin_' . $plugin); deactivate_plugins($plugin); update_option('recently_activated', array($plugin => time()) + (array)get_option('recently_activated')); wp_redirect('plugins.php?deactivate=true'); exit; break; case 'deactivate-selected': check_admin_referer('bulk-manage-plugins'); deactivate_plugins($_POST['checked']); $deactivated = array(); foreach( (array)$_POST['checked'] as $plugin ) $deactivated[ $plugin ] = time(); update_option('recently_activated', $deactivated + (array)get_option('recently_activated')); wp_redirect('plugins.php?deactivate-multi=true'); exit; break; case 'delete-selected': if( ! current_user_can('delete_plugins') ) wp_die(__('You do not have sufficient permissions to delete plugins for this blog.')); check_admin_referer('bulk-manage-plugins'); $plugins = $_REQUEST['checked']; //$_POST = from the plugin form; $_GET = from the FTP details screen. include(ABSPATH . 'wp-admin/update.php'); $title = __('Delete Plugin'); $parent_file = 'plugins.php'; if( ! isset($_REQUEST['verify-delete']) ) { wp_enqueue_script('jquery'); require_once('admin-header.php'); ?>

      ', $plugin['Title'], ' ', __('By'), ' ', $plugin['Author'], ''; ?>

    "; } ?>

    $error) echo '

    ' . sprintf(__('The plugin %s has been deactivated due to an error: %s'), wp_specialchars($plugin_file), $error->get_error_message()) . '

    '; ?>

    fatal error.') ?>

    get_error_message() ); ?>

    deleted.'); ?>

    activated.') ?>

    activated.'); ?>

    deactivated.') ?>

    deactivated.'); ?>

    $time ) if( $time + (7*24*60*60) < time() ) //1 week unset($recently_activated[ $key ]); if( $recently_activated != get_option('recently_activated') ) //If array changed, update it. update_option('recently_activated', $recently_activated); $plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array()); foreach( (array)$all_plugins as $plugin_file => $plugin_data) { // Sanitize all displayed data $plugin_data['Title'] = wp_kses($plugin_data['Title'], $plugins_allowedtags); $plugin_data['Version'] = wp_kses($plugin_data['Version'], $plugins_allowedtags); $plugin_data['Description'] = wp_kses($plugin_data['Description'], $plugins_allowedtags); $plugin_data['Author'] = wp_kses($plugin_data['Author'], $plugins_allowedtags); if( ! empty($plugin_data['Author']) ) $plugin_data['Description'] .= ' ' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.'; //Filter into individual sections if ( is_plugin_active($plugin_file) ) { $active_plugins[ $plugin_file ] = $plugin_data; } else { if ( isset( $recently_activated[ $plugin_file ] ) ) //Was the plugin recently activated? $recent_plugins[ $plugin_file ] = $plugin_data; else $inactive_plugins[ $plugin_file ] = $plugin_data; } } ?> '; } foreach( (array)$plugins as $plugin_file => $plugin_data) { $action_links = array(); if( 'active' == $context ) $action_links[] = '' . __('Deactivate') . ''; else //Available or Recently deactivated $action_links[] = '' . __('Activate') . ''; if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) ) $action_links[] = '' . __('Edit') . ''; $action_links = apply_filters('plugin_action_links', $action_links, $plugin_file, $plugin_data, $context); echo " '; do_action( 'after_plugin_row', $plugin_file, $plugin_data, $context ); } ?>
    ' . __('No plugins to show') . '
    {$plugin_data['Title']} {$plugin_data['Version']}

    {$plugin_data['Description']}


    %s directory and it will be automatically deactivated.'), WP_PLUGIN_DIR); ?>



    WordPress plugin directory.'); ?>

    %s directory. Once a plugin is uploaded, you may activate it here.'), WP_PLUGIN_DIR); ?>

    wp/dev/wp-admin/edit-form-comment.php0000644000106600010660000001053511007310722014752 0ustar comment_ID); $form_action = 'editedcomment'; $form_extra = "' />\n\ncomment_ID) ?>

    comment_date); $time = mysql2date(get_option('time_format'), $comment->comment_date); ?>

     

    comment_ID&_wp_original_http_referer=" . wp_get_referer(), 'delete-comment_' . $comment->comment_ID) . "' onclick=\"if ( confirm('" . js_escape(__("You are about to delete this comment. \n 'Cancel' to stop, 'OK' to delete.")) . "') ) { return true;}return false;\">" . __('Delete comment') . ""; ?>

    comment_content, 'content', 'newcomment_author_url', false, 4); ?>
    wp/dev/wp-admin/options-privacy.php0000644000106600010660000000250511007310722014570 0ustar

    />

    />

    wp/dev/wp-admin/admin-ajax.php0000644000106600010660000004331611043713172013446 0ustar get_col( "SELECT name FROM $wpdb->terms WHERE name LIKE ('%". $s . "%')" ); echo join( $results, "\n" ); die; } $id = isset($_POST['id'])? (int) $_POST['id'] : 0; switch ( $action = $_POST['action'] ) : case 'delete-comment' : check_ajax_referer( "delete-comment_$id" ); if ( !$comment = get_comment( $id ) ) die('1'); if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) die('-1'); if ( isset($_POST['spam']) && 1 == $_POST['spam'] ) { if ( 'spam' == wp_get_comment_status( $comment->comment_ID ) ) die('1'); $r = wp_set_comment_status( $comment->comment_ID, 'spam' ); } else { $r = wp_delete_comment( $comment->comment_ID ); } die( $r ? '1' : '0' ); break; case 'delete-cat' : check_ajax_referer( "delete-category_$id" ); if ( !current_user_can( 'manage_categories' ) ) die('-1'); $cat = get_category( $id ); if ( !$cat || is_wp_error( $cat ) ) die('1'); if ( wp_delete_category( $id ) ) die('1'); else die('0'); break; case 'delete-tag' : check_ajax_referer( "delete-tag_$id" ); if ( !current_user_can( 'manage_categories' ) ) die('-1'); $tag = get_term( $id, 'post_tag' ); if ( !$tag || is_wp_error( $tag ) ) die('1'); if ( wp_delete_term($id, 'post_tag')) die('1'); else die('0'); break; case 'delete-link-cat' : check_ajax_referer( "delete-link-category_$id" ); if ( !current_user_can( 'manage_categories' ) ) die('-1'); $cat = get_term( $id, 'link_category' ); if ( !$cat || is_wp_error( $cat ) ) die('1'); $cat_name = get_term_field('name', $id, 'link_category'); // Don't delete the default cats. if ( $id == get_option('default_link_category') ) { $x = new WP_AJAX_Response( array( 'what' => 'link-cat', 'id' => $id, 'data' => new WP_Error( 'default-link-cat', sprintf(__("Can’t delete the %s category: this is the default one"), $cat_name) ) ) ); $x->send(); } $r = wp_delete_term($id, 'link_category'); if ( !$r ) die('0'); if ( is_wp_error($r) ) { $x = new WP_AJAX_Response( array( 'what' => 'link-cat', 'id' => $id, 'data' => $r ) ); $x->send(); } die('1'); break; case 'delete-link' : check_ajax_referer( "delete-bookmark_$id" ); if ( !current_user_can( 'manage_links' ) ) die('-1'); $link = get_bookmark( $id ); if ( !$link || is_wp_error( $link ) ) die('1'); if ( wp_delete_link( $id ) ) die('1'); else die('0'); break; case 'delete-meta' : check_ajax_referer( "delete-meta_$id" ); if ( !$meta = get_post_meta_by_id( $id ) ) die('1'); if ( !current_user_can( 'edit_post', $meta->post_id ) ) die('-1'); if ( delete_meta( $meta->meta_id ) ) die('1'); die('0'); break; case 'delete-post' : check_ajax_referer( "{$action}_$id" ); if ( !current_user_can( 'delete_post', $id ) ) die('-1'); if ( !get_post( $id ) ) die('1'); if ( wp_delete_post( $id ) ) die('1'); else die('0'); break; case 'delete-page' : check_ajax_referer( "{$action}_$id" ); if ( !current_user_can( 'delete_page', $id ) ) die('-1'); if ( !get_page( $id ) ) die('1'); if ( wp_delete_post( $id ) ) die('1'); else die('0'); break; case 'dim-comment' : if ( !$comment = get_comment( $id ) ) die('0'); if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) die('-1'); if ( !current_user_can( 'moderate_comments' ) ) die('-1'); $current = wp_get_comment_status( $comment->comment_ID ); if ( $_POST['new'] == $current ) die('1'); if ( 'unapproved' == $current ) { check_ajax_referer( "approve-comment_$id" ); if ( wp_set_comment_status( $comment->comment_ID, 'approve' ) ) die('1'); } else { check_ajax_referer( "unapprove-comment_$id" ); if ( wp_set_comment_status( $comment->comment_ID, 'hold' ) ) die('1'); } die('0'); break; case 'add-category' : // On the Fly check_ajax_referer( $action ); if ( !current_user_can( 'manage_categories' ) ) die('-1'); $names = explode(',', $_POST['newcat']); if ( 0 > $parent = (int) $_POST['newcat_parent'] ) $parent = 0; $post_category = isset($_POST['post_category'])? (array) $_POST['post_category'] : array(); $checked_categories = array_map( 'absint', (array) $post_category ); $popular_ids = isset( $_POST['popular_ids'] ) ? array_map( 'absint', explode( ',', $_POST['popular_ids'] ) ) : false; $x = new WP_Ajax_Response(); foreach ( $names as $cat_name ) { $cat_name = trim($cat_name); $category_nicename = sanitize_title($cat_name); if ( '' === $category_nicename ) continue; $cat_id = wp_create_category( $cat_name, $parent ); $checked_categories[] = $cat_id; if ( $parent ) // Do these all at once in a second continue; $category = get_category( $cat_id ); ob_start(); wp_category_checklist( 0, $cat_id, $checked_categories, $popular_ids ); $data = ob_get_contents(); ob_end_clean(); $x->add( array( 'what' => 'category', 'id' => $cat_id, 'data' => $data, 'position' => -1 ) ); } if ( $parent ) { // Foncy - replace the parent and all its children $parent = get_category( $parent ); ob_start(); dropdown_categories( 0, $parent ); $data = ob_get_contents(); ob_end_clean(); $x->add( array( 'what' => 'category', 'id' => $parent->term_id, 'old_id' => $parent->term_id, 'data' => $data, 'position' => -1 ) ); } $x->send(); break; case 'add-link-category' : // On the Fly check_ajax_referer( $action ); if ( !current_user_can( 'manage_categories' ) ) die('-1'); $names = explode(',', $_POST['newcat']); $x = new WP_Ajax_Response(); foreach ( $names as $cat_name ) { $cat_name = trim($cat_name); $slug = sanitize_title($cat_name); if ( '' === $slug ) continue; if ( !$cat_id = is_term( $cat_name, 'link_category' ) ) { $cat_id = wp_insert_term( $cat_name, 'link_category' ); } $cat_id = $cat_id['term_id']; $cat_name = wp_specialchars(stripslashes($cat_name)); $x->add( array( 'what' => 'link-category', 'id' => $cat_id, 'data' => "", 'position' => -1 ) ); } $x->send(); break; case 'add-cat' : // From Manage->Categories check_ajax_referer( 'add-category' ); if ( !current_user_can( 'manage_categories' ) ) die('-1'); if ( '' === trim($_POST['cat_name']) ) { $x = new WP_Ajax_Response( array( 'what' => 'cat', 'id' => new WP_Error( 'cat_name', __('You did not enter a category name.') ) ) ); $x->send(); } if ( category_exists( trim( $_POST['cat_name'] ) ) ) { $x = new WP_Ajax_Response( array( 'what' => 'cat', 'id' => new WP_Error( 'cat_exists', __('The category you are trying to create already exists.'), array( 'form-field' => 'cat_name' ) ), ) ); $x->send(); } $cat = wp_insert_category( $_POST, true ); if ( is_wp_error($cat) ) { $x = new WP_Ajax_Response( array( 'what' => 'cat', 'id' => $cat ) ); $x->send(); } if ( !$cat || (!$cat = get_category( $cat )) ) die('0'); $level = 0; $cat_full_name = $cat->name; $_cat = $cat; while ( $_cat->parent ) { $_cat = get_category( $_cat->parent ); $cat_full_name = $_cat->name . ' — ' . $cat_full_name; $level++; } $cat_full_name = attribute_escape($cat_full_name); $x = new WP_Ajax_Response( array( 'what' => 'cat', 'id' => $cat->term_id, 'data' => _cat_row( $cat, $level, $cat_full_name ), 'supplemental' => array('name' => $cat_full_name, 'show-link' => sprintf(__( 'Category %s added' ), "cat-$cat->term_id", $cat_full_name)) ) ); $x->send(); break; case 'add-link-cat' : // From Blogroll -> Categories check_ajax_referer( 'add-link-category' ); if ( !current_user_can( 'manage_categories' ) ) die('-1'); if ( '' === trim($_POST['name']) ) { $x = new WP_Ajax_Response( array( 'what' => 'link-cat', 'id' => new WP_Error( 'name', __('You did not enter a category name.') ) ) ); $x->send(); } $r = wp_insert_term($_POST['name'], 'link_category', $_POST ); if ( is_wp_error( $r ) ) { $x = new WP_AJAX_Response( array( 'what' => 'link-cat', 'id' => $r ) ); $x->send(); } extract($r, EXTR_SKIP); if ( !$link_cat = link_cat_row( $term_id ) ) die('0'); $x = new WP_Ajax_Response( array( 'what' => 'link-cat', 'id' => $term_id, 'data' => $link_cat ) ); $x->send(); break; case 'add-tag' : // From Manage->Tags check_ajax_referer( 'add-tag' ); if ( !current_user_can( 'manage_categories' ) ) die('-1'); if ( '' === trim($_POST['name']) ) { $x = new WP_Ajax_Response( array( 'what' => 'tag', 'id' => new WP_Error( 'name', __('You did not enter a tag name.') ) ) ); $x->send(); } $tag = wp_insert_term($_POST['name'], 'post_tag', $_POST ); if ( is_wp_error($tag) ) { $x = new WP_Ajax_Response( array( 'what' => 'tag', 'id' => $tag ) ); $x->send(); } if ( !$tag || (!$tag = get_term( $tag['term_id'], 'post_tag' )) ) die('0'); $tag_full_name = $tag->name; $tag_full_name = attribute_escape($tag_full_name); $x = new WP_Ajax_Response( array( 'what' => 'tag', 'id' => $tag->term_id, 'data' => _tag_row( $tag ), 'supplemental' => array('name' => $tag_full_name, 'show-link' => sprintf(__( 'Tag %s added' ), "tag-$tag->term_id", $tag_full_name)) ) ); $x->send(); break; case 'add-comment' : check_ajax_referer( $action ); if ( !current_user_can( 'edit_post', $id ) ) die('-1'); $search = isset($_POST['s']) ? $_POST['s'] : false; $start = isset($_POST['page']) ? intval($_POST['page']) * 25 - 1: 24; $status = isset($_POST['comment_status']) ? $_POST['comment_status'] : false; $mode = isset($_POST['mode']) ? $_POST['mode'] : 'detail'; list($comments, $total) = _wp_get_comment_list( $status, $search, $start, 1 ); if ( get_option('show_avatars') ) add_filter( 'comment_author', 'floated_admin_avatar' ); if ( !$comments ) die('1'); $x = new WP_Ajax_Response(); foreach ( (array) $comments as $comment ) { get_comment( $comment ); ob_start(); _wp_comment_row( $comment->comment_ID, $mode, $status ); $comment_list_item = ob_get_contents(); ob_end_clean(); $x->add( array( 'what' => 'comment', 'id' => $comment->comment_ID, 'data' => $comment_list_item ) ); } $x->send(); break; case 'add-meta' : check_ajax_referer( 'add-meta' ); $c = 0; $pid = (int) $_POST['post_id']; if ( isset($_POST['metakeyselect']) || isset($_POST['metakeyinput']) ) { if ( !current_user_can( 'edit_post', $pid ) ) die('-1'); if ( '#NONE#' == $_POST['metakeyselect'] && empty($_POST['metakeyinput']) ) die('1'); if ( $pid < 0 ) { $now = current_time('timestamp', 1); if ( $pid = wp_insert_post( array( 'post_title' => sprintf('Draft created on %s at %s', date(get_option('date_format'), $now), date(get_option('time_format'), $now)) ) ) ) { if ( is_wp_error( $pid ) ) { $x = new WP_Ajax_Response( array( 'what' => 'meta', 'data' => $pid ) ); $x->send(); } $mid = add_meta( $pid ); } else { die('0'); } } else if ( !$mid = add_meta( $pid ) ) { die('0'); } $meta = get_post_meta_by_id( $mid ); $pid = (int) $meta->post_id; $meta = get_object_vars( $meta ); $x = new WP_Ajax_Response( array( 'what' => 'meta', 'id' => $mid, 'data' => _list_meta_row( $meta, $c ), 'position' => 1, 'supplemental' => array('postid' => $pid) ) ); } else { $mid = (int) array_pop(array_keys($_POST['meta'])); $key = $_POST['meta'][$mid]['key']; $value = $_POST['meta'][$mid]['value']; if ( !$meta = get_post_meta_by_id( $mid ) ) die('0'); // if meta doesn't exist if ( !current_user_can( 'edit_post', $meta->post_id ) ) die('-1'); if ( !$u = update_meta( $mid, $key, $value ) ) die('1'); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems). $key = stripslashes($key); $value = stripslashes($value); $x = new WP_Ajax_Response( array( 'what' => 'meta', 'id' => $mid, 'old_id' => $mid, 'data' => _list_meta_row( array( 'meta_key' => $key, 'meta_value' => $value, 'meta_id' => $mid ), $c ), 'position' => 0, 'supplemental' => array('postid' => $meta->post_id) ) ); } $x->send(); break; case 'add-user' : check_ajax_referer( $action ); if ( !current_user_can('create_users') ) die('-1'); require_once(ABSPATH . WPINC . '/registration.php'); if ( !$user_id = add_user() ) die('0'); elseif ( is_wp_error( $user_id ) ) { $x = new WP_Ajax_Response( array( 'what' => 'user', 'id' => $user_id ) ); $x->send(); } $user_object = new WP_User( $user_id ); $x = new WP_Ajax_Response( array( 'what' => 'user', 'id' => $user_id, 'data' => user_row( $user_object, '', $user_object->roles[0] ), 'supplemental' => array( 'show-link' => sprintf(__( 'User %s added' ), "user-$user_id", $user_object->user_login), 'role' => $user_object->roles[0] ) ) ); $x->send(); break; case 'autosave' : // The name of this action is hardcoded in edit_post() define( 'DOING_AUTOSAVE', true ); $nonce_age = check_ajax_referer( 'autosave', 'autosavenonce' ); global $current_user; $_POST['post_category'] = explode(",", $_POST['catslist']); $_POST['tags_input'] = explode(",", $_POST['tags_input']); if($_POST['post_type'] == 'page' || empty($_POST['post_category'])) unset($_POST['post_category']); $do_autosave = (bool) $_POST['autosave']; $do_lock = true; $data = ''; $message = sprintf( __('Draft Saved at %s.'), date( __('g:i:s a'), current_time( 'timestamp', true ) ) ); $supplemental = array(); $id = $revision_id = 0; if($_POST['post_ID'] < 0) { $_POST['post_status'] = 'draft'; $_POST['temp_ID'] = $_POST['post_ID']; if ( $do_autosave ) { $id = wp_write_post(); $data = $message; } } else { $post_ID = (int) $_POST['post_ID']; $_POST['ID'] = $post_ID; $post = get_post($post_ID); if ( $last = wp_check_post_lock( $post->ID ) ) { $do_autosave = $do_lock = false; $last_user = get_userdata( $last ); $last_user_name = $last_user ? $last_user->display_name : __( 'Someone' ); $data = new WP_Error( 'locked', sprintf( $_POST['post_type'] == 'page' ? __( 'Autosave disabled: %s is currently editing this page.' ) : __( 'Autosave disabled: %s is currently editing this post.' ), wp_specialchars( $last_user_name ) ) ); $supplemental['disable_autosave'] = 'disable'; } if ( 'page' == $post->post_type ) { if ( !current_user_can('edit_page', $post_ID) ) die(__('You are not allowed to edit this page.')); } else { if ( !current_user_can('edit_post', $post_ID) ) die(__('You are not allowed to edit this post.')); } if ( $do_autosave ) { // Drafts are just overwritten by autosave if ( 'draft' == $post->post_status ) { $id = edit_post(); } else { // Non drafts are not overwritten. The autosave is stored in a special post revision. $revision_id = wp_create_post_autosave( $post->ID ); if ( is_wp_error($revision_id) ) $id = $revision_id; else $id = $post->ID; } $data = $message; } else { $id = $post->ID; } } if ( $do_lock && $id && is_numeric($id) ) wp_set_post_lock( $id ); if ( $nonce_age == 2 ) { $supplemental['replace-autosavenonce'] = wp_create_nonce('autosave'); $supplemental['replace-getpermalinknonce'] = wp_create_nonce('getpermalink'); $supplemental['replace-samplepermalinknonce'] = wp_create_nonce('samplepermalink'); $supplemental['replace-closedpostboxesnonce'] = wp_create_nonce('closedpostboxes'); if ( $id ) { if ( $_POST['post_type'] == 'post' ) $supplemental['replace-_wpnonce'] = wp_create_nonce('update-post_' . $id); elseif ( $_POST['post_type'] == 'page' ) $supplemental['replace-_wpnonce'] = wp_create_nonce('update-page_' . $id); } } $x = new WP_Ajax_Response( array( 'what' => 'autosave', 'id' => $id, 'data' => $id ? $data : '', 'supplemental' => $supplemental ) ); $x->send(); break; case 'autosave-generate-nonces' : check_ajax_referer( 'autosave', 'autosavenonce' ); $ID = (int) $_POST['post_ID']; if($_POST['post_type'] == 'post') { if(current_user_can('edit_post', $ID)) die(wp_create_nonce('update-post_' . $ID)); } if($_POST['post_type'] == 'page') { if(current_user_can('edit_page', $ID)) { die(wp_create_nonce('update-page_' . $ID)); } } die('0'); break; case 'closed-postboxes' : check_ajax_referer( 'closedpostboxes', 'closedpostboxesnonce' ); $closed = isset( $_POST['closed'] )? $_POST['closed'] : ''; $closed = explode( ',', $_POST['closed'] ); $page = isset( $_POST['page'] )? $_POST['page'] : ''; if ( !preg_match( '/^[a-z-]+$/', $page ) ) { die(-1); } if (!is_array($closed)) break; $current_user = wp_get_current_user(); update_usermeta($current_user->ID, 'closedpostboxes_'.$page, $closed); break; case 'get-permalink': check_ajax_referer( 'getpermalink', 'getpermalinknonce' ); $post_id = isset($_POST['post_id'])? intval($_POST['post_id']) : 0; die(add_query_arg(array('preview' => 'true'), get_permalink($post_id))); break; case 'sample-permalink': check_ajax_referer( 'samplepermalink', 'samplepermalinknonce' ); $post_id = isset($_POST['post_id'])? intval($_POST['post_id']) : 0; $title = isset($_POST['new_title'])? $_POST['new_title'] : ''; $slug = isset($_POST['new_slug'])? $_POST['new_slug'] : ''; die(get_sample_permalink_html($post_id, $title, $slug)); break; default : do_action( 'wp_ajax_' . $_POST['action'] ); die('0'); break; endswitch; ?> wp/dev/wp-admin/media-upload.php0000644000106600010660000000216510765326324014004 0ustar wp/dev/wp-admin/widgets.php0000644000106600010660000002635211015134421013075 0ustar

    follow these instructions.' ); /* TODO: article on codex */; ?>

    $control ) { if ( in_array( $control['callback'], $already_done ) ) continue; if ( is_callable( $control['callback'] ) ) { call_user_func_array( $control['callback'], $control['params'] ); $control_output = ob_get_contents(); if ( false !== strpos( $control_output, '%i%' ) ) // if it's a multi-widget, only call control function once. $already_done[] = $control['callback']; } ob_clean(); } ob_end_clean(); // Prophylactic. Take out empty ids. foreach ( (array) $_POST['widget-id'] as $key => $val ) if ( !$val ) unset($_POST['widget-id'][$key]); // Reset the key numbering and store $new_sidebar = isset( $_POST['widget-id'] ) && is_array( $_POST['widget-id'] ) ? array_values( $_POST['widget-id'] ) : array(); $sidebars_widgets[$_POST['sidebar']] = $new_sidebar; wp_set_sidebars_widgets( $sidebars_widgets ); wp_redirect( add_query_arg( 'message', 'updated' ) ); exit; } // What widget (if any) are we editing $edit_widget = -1; $query_args = array('add', 'remove', 'key', 'edit', '_wpnonce', 'message', 'base' ); if ( isset($_GET['add']) && $_GET['add'] ) { // Add to the end of the sidebar $control_callback; if ( isset($wp_registered_widgets[$_GET['add']]) ) { check_admin_referer( "add-widget_$_GET[add]" ); $sidebars_widgets[$sidebar][] = $_GET['add']; wp_set_sidebars_widgets( $sidebars_widgets ); } elseif ( isset($_GET['base']) && isset($_GET['key']) ) { // It's a multi-widget check_admin_referer( "add-widget_$_GET[add]" ); // Copy minimal info from an existing instance of this widget to a new instance foreach ( $wp_registered_widget_controls as $control ) { if ( $_GET['base'] === $control['id_base'] ) { $control_callback = $control['callback']; $num = (int) $_GET['key']; $control['params'][0]['number'] = $num; $control['id'] = $control['id_base'] . '-' . $num; $wp_registered_widget_controls[$control['id']] = $control; $sidebars_widgets[$sidebar][] = $control['id']; break; } } } // it's a multi-widget. The only way to add multi-widgets without JS is to actually submit POST content... // so here we go if ( is_callable( $control_callback ) ) { require_once( 'admin-header.php' ); ?>


    $sidebar_widget_count", $wp_registered_sidebars[$sidebar]['name'] ); $page = isset($_GET['apage']) ? abs( (int) $_GET['apage'] ) : 1; /* TODO: Paginate widgets list $page_links = paginate_links( array( 'base' => add_query_arg( 'apage', '%#%' ), 'format' => '', 'total' => ceil(($total = 105 )/ 10), 'current' => $page )); */ $page_links = ' '; // Unsanitized! $widget_search = isset($_GET['s']) ? $_GET['s'] : false; // Not entirely sure what all should be here $show_values = array( '' => $widget_search ? __( 'Show any widgets' ) : __( 'Show all widgets' ), 'unused' => __( 'Show unused widgets' ), 'used' => __( 'Show used widgets' ) ); $show = isset($_GET['show']) && isset($show_values[$_GET['show']]) ? attribute_escape( $_GET['show'] ) : false; $messages = array( 'updated' => __('Changes saved.') ); require_once( 'admin-header.php' ); if ( isset($_GET['message']) && isset($messages[$_GET['message']]) ) : ?>


    wp/dev/wp-admin/update-links.php0000644000106600010660000000262211014735077014036 0ustar get_col("SELECT link_url FROM $wpdb->links"); if ( !$link_uris ) wp_die(__('No links')); $link_uris = urlencode( join( $link_uris, "\n" ) ); $query_string = "uris=$link_uris"; $http_request = "POST /updated-batch/ HTTP/1.0\r\n"; $http_request .= "Host: api.pingomatic.com\r\n"; $http_request .= 'Content-Type: application/x-www-form-urlencoded; charset='.get_option('blog_charset')."\r\n"; $http_request .= 'Content-Length: ' . strlen($query_string) . "\r\n"; $http_request .= 'User-Agent: WordPress/' . $wp_version . "\r\n"; $http_request .= "\r\n"; $http_request .= $query_string; $response = ''; if ( false !== ( $fs = @fsockopen('api.pingomatic.com', 80, $errno, $errstr, 5) ) ) { fwrite($fs, $http_request); while ( !feof($fs) ) $response .= fgets($fs, 1160); // One TCP-IP packet fclose($fs); $response = explode("\r\n\r\n", $response, 2); $body = trim( $response[1] ); $body = str_replace(array("\r\n", "\r"), "\n", $body); $returns = explode("\n", $body); foreach ($returns as $return) : $time = substr($return, 0, 19); $uri = preg_replace('/(.*?) | (.*?)/', '$2', $return); $wpdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_updated = %s WHERE link_url = %s", $time, $uri) ); endforeach; } ?> wp/dev/wp-admin/options-writing.php0000644000106600010660000001524711030041754014607 0ustar




    %s, %s, %s.'), wp_generate_password(8, false), wp_generate_password(8, false), wp_generate_password(8, false)) ?>

    Update Services because of your blog\'s privacy settings.'), 'options-privacy.php'); ?>

    wp/dev/wp-admin/wp-admin.css0000644000106600010660000006164711035335670013165 0ustar .plugins .name { font-weight: bold; } .plugins p { margin: 0 4px; padding: 0; } .plugins .togl { width: 150px; border-right-width: 1px; border-right-style: solid; } .import-system { font-size: 16px; } #uploading { border-style: none; padding: 0; margin-bottom: 16px; height: 18em; width: 100%; } form#upload th { text-align: right; } form#upload #post_content, form#upload #post_title { width: 250px; } .form-invalid input { border-width: 1px !important; border-style: solid !important; } form#upload #post_content { height: 50px; } .attpreview { width: 1px; /* hug */ text-align: center; } .anchors { margin: 10px 20px 10px 20px; } table#availablethemes { border-spacing: 0px; border: none; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; margin: 10px auto; } td.available-theme { vertical-align: top; width: 240px; margin: 0; padding: 20px; text-align: left; } table#availablethemes td { border: 1px solid #eee; border-top: none; } table#availablethemes td.top { border-top: none; } table#availablethemes td.right { border-right: none; border-left: none; } table#availablethemes td.bottom { border-bottom: none; } table#availablethemes td.left { border-right: none; border-left: none; } .available-theme a.screenshot { width: 240px; height: 180px; display: block; border: 1px solid #efefef; margin-bottom: 10px; overflow: hidden; } .available-theme img { width: 240px; } .available-theme h3 { margin: 15px 0 5px; } #current-theme { margin-top: 1em; } #current-theme a { border-bottom: none; } #current-theme h3 { font-size: 17px; font-weight: normal; margin: 0; } #current-theme .description { margin-top: 5px; } #current-theme img { float: left; border: 1px solid #666; margin-right: 1em; margin-bottom: 1.5em; width: 150px; } #TB_window #TB_title a.tb-theme-preview-link, #TB_window #TB_title a.tb-theme-preview-link:visited { font-weight: bold; color: #999; text-decoration: none; } #TB_window #TB_title a.tb-theme-preview-link:hover, #TB_window #TB_title a.tb-theme-preview-link:focus { color: #ccc; } .checkbox { border: none; margin: 0; padding: 0; } .code { font-family: "Courier New", Courier, monospace; } .commentlist li { padding: 1em 1em .2em; margin: 0; border-bottom-width: 1px; border-bottom-style: solid; } .commentlist li li { border-bottom: 0px; padding: 0; } .commentlist p { padding: 0; margin: 0 0 .8em; } .post-categories { display: inline; margin: 0; padding: 0; } .post-categories li { display: inline; } .quicktags, .search { font: 12px Georgia, "Times New Roman", Times, serif; } .submit { border-top: 1px solid #ccc; padding: 1.5em 0 0 0; margin: 10px 0 0 0; -moz-border-radius-bottomleft: 3px; -khtml-border-bottom-left-radius: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; -moz-border-radius-bottomright: 3px; -khtml-border-bottom-right-radius: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; } .side-info { margin: 0; padding: 4px; font-size: 11px; } .side-info h5 { padding-bottom: 7px; font-size: 14px; margin: 12px 2px 5px; border-bottom-width: 1px; border-bottom-style: solid; } .side-info ul { margin: 0; padding-left: 18px; list-style: square; } .submit input, .button, .button-secondary, .button-highlighted { font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; padding: 3px 5px; font-size: 12px; line-height: 1.5em; border-width: 1px; border-style: solid; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; cursor: pointer; text-decoration: none; } .button-highlighted { font-weight: bold; } #wpcontent select { font: 12px/20px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; padding: 2px; border-width: 1px; border-style: solid; height: 2em; vertical-align:top; } .approve { display: none; } .unapproved .approve { display: inline; } .updated a { border-bottom-width: 1px; border-bottom-style: solid; } .unapproved .unapprove { display: none; } .narrow { width: 70%; margin-bottom: 40px; } .narrow p { line-height: 150%; } table .vers { text-align: center; } textarea.all-options, input.all-options { width: 250px; } #postdiv, #titlediv, #guiddiv, #poststuff .stuffbox { margin: 0 8px 0 0; padding: 0; } #titlediv, #namediv, #poststuff #namediv { margin-top: 10px; } #postdivrich { margin: 0; padding: 0; } #content { margin: 0; width: 100%; } #editorcontainer #content { padding: 0; line-height: 150%; border: 0 none; outline: none; } #editorcontainer { padding: 6px; border-style: none solid solid; border-width: 1px; border-collapse: separate; } #quicktags { padding: 0; border: 0 none; } #quicktags #ed_toolbar { padding: 2px 4px; } #ed_toolbar input { margin: 3px 2px 2px; padding: 2px 4px; line-height: 18px; display: inline-block; } #quicktags #ed_strong { font-weight: bold; } #quicktags #ed_link { text-decoration: underline; } #quicktags #ed_del { text-decoration: line-through; } #quicktags #ed_em { font-style: italic; } #quicktags #ed_code { font-family: "Courier New", Courier, mono; font-size: 1.1em; vertical-align: top; } #attachmentlinks textarea { width: 100%; height: 2.5em; margin-bottom: 6px; } #excerpt, .attachmentlinks { margin: 0; height: 4em; width: 98%; } .plugins p { } #login .fullwidth { width: 320px; } #searchform fieldset { float: left; margin: 0 1.5ex 1em 0; padding: 0; } #searchform fieldset legend { padding: 0 0 .2em 1px; } #searchform #s { padding: 4px 3px; } #searchform #post-query-submit { float: left; margin: 14px 0 1em; position: relative; top: .35em; } #postcustomstuff .updatemeta, #postcustomstuff .deletemeta { margin: auto; } #postcustomstuff table { margin: 0; width: 100%; border-width: 1px; border-style: solid; } #postcustomstuff table input, #postcustomstuff table textarea { width: 95%; } #postcustomstuff table #addmetasub { width: auto; } #poststuff #post-body { margin-right: 230px; } #save { width: 15em; } #template div { margin-right: 190px; } * html #template div { margin-right: 0; } #template, #template div, #editcat, #addcat { zoom: 1; } /* A handy div class for hiding controls. Some browsers will disable them when you set display:none; */ .zerosize { height: 0; width: 0; margin: 0; border: 0; padding: 0; overflow: hidden; position: absolute; } * html #themeselect { padding: 0 3px; height: 22px; } #your-profile legend { font-family: Georgia, "Times New Roman", Times, serif; font-size: 22px; } #your-profile #rich_editing { border: none; } #howto { font-size: 11px; margin: 0 5px; display: block; } #ajax-response.alignleft { margin-left: 2em; } div.nav { height: 2em; padding: 7px 10px; vertical-align: text-top; margin: 5px 0; } .nav .button-secondary { padding: 2px 4px; } .page-numbers { padding: 2px 4px; margin-right: 3px; border-width: 1px; border-style: solid; } .page-numbers.current { font-weight: bold; border-width: 1px; border-style: solid; } p.pagenav { margin: 0; display: inline; } .pagenav span { font-weight: bold; margin: 0 6px; } .row-title { font-size: 12px !important; font-weight: bold; } .comment-column { margin-left: 5px; } .tablenav a.button-secondary { display: block; margin: 1px 8px 0 0; } .tablenav .button-secondary { padding: 2px 4px; vertical-align: top; } .tablenav .tablenav-pages a.next, .tablenav .tablenav-pages a.prev { text-decoration: underline; } .tablenav { height: 2em; padding: 7px 10px; clear: both; margin-bottom: -10px; margin-top: 8px; vertical-align: text-top; } .tablenav .tablenav-pages { float: right; height: 18px; padding-top: 6px; font-size: 11px; } .tablenav .tablenav-pages a { text-decoration: none; } td.media-icon { vertical-align: middle; text-align: center; } td.media-icon img { max-width: 80px; max-height: 60px; } #update-nag, .plugin-update { line-height: 29px; font-size: 12px; text-align: center; border-bottom-width: 1px; border-bottom-style: solid; border-top-width: 1px; border-top-style: solid; } #update-nag a, .plugin-update a { font-size: 1.1em; } #pass-strength-result { padding: 3px 5px 3px 5px; margin-top: 3px; text-align: center; border-width: 1px; border-style: solid; } a.view-comment-post-link { position: absolute; text-decoration:underline; } /* Admin Header */ #user_info { position: absolute; right: 15px; top: 11px; font-size: 11px; } #user_info p { margin: 0; padding: 0; } #wphead { border-top-width: 30px; border-top-style: solid; } #wphead a, #dashmenu a, #adminmenu a, #submenu a, #sidemenu a, #taglist a, #catlist a { text-decoration: none; } #wphead #viewsite { position: absolute; margin-top: 12px; margin-left: 10px; } #wphead #viewsite a { font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; padding: 3px 4px; display: block; letter-spacing: normal; border-width: 1px; border-style: solid; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } #wphead h1 { font: normal 36px Georgia, "Times New Roman", Times, serif; padding: 11px 170px 16px 12px; margin: 0; margin-right: 15%; } /* menu stuff */ #dashmenu { margin: 0; list-style: none; position: absolute; top: 7px; left: 0; font-size: 11px; padding-left: 9px; } #dashmenu a { padding: 5px 6px; line-height: 220%; margin-right: 8px; } #dashmenu a.current { border: none; -moz-border-radius-topleft: 3px; -khtml-border-top-left-radius: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; -moz-border-radius-topright: 3px; -khtml-border-top-right-radius: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; } #adminmenu { margin: 0; list-style: none; padding-left: 11px; border-bottom-width: 1px; border-bottom-style: solid; } #adminmenu a { font-size: 16px; padding: 5px 7px; line-height: 30px; } #adminmenu a.current, #sidemenu a.current { font-weight: normal; padding-left: 6px; padding-right: 6px; -moz-border-radius-topleft: 4px; -khtml-border-top-left-radius: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -khtml-border-top-right-radius: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; border-width: 1px; border-style: solid; } #adminmenu a.current { border-bottom-width: 2px; } #sidemenu { margin: -30px 15px 0 315px; list-style: none; position: relative; float: right; padding-left: 10px; font-size:12px; } #sidemenu a { padding: 0 7px; display: block; float: left; line-height: 28px; border-top-width: 1px; border-top-style: solid; border-bottom-width: 1px; border-bottom-style: solid; } #dashmenu li, #adminmenu li, #submenu li, #sidemenu li { display: inline; line-height: 200%; list-style: none; text-align: center; white-space: nowrap; margin: 0; padding: 0; } #submenu li { padding: 0 0 8px 17px; } #adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins { position: absolute; margin-left: -0.4em; margin-top: 0.2em; font-size: 0.7em; background-repeat: no-repeat; background-position: 0 bottom; height: 0.9em; width: 1em; } #adminmenu li a .count-0, #sidemenu li a .count-0 { display: none; } .post-com-count-wrapper { min-width: 22px; } .post-com-count { height: 1.3em; line-height: 1.1em; display: block; text-decoration: none; padding: 0 0 6px; cursor: pointer; background-position: center -80px; background-repeat: no-repeat; } .post-com-count span { height: 1.3em; line-height: 1.2em; padding: 0 0.5em; background-color: #bbb; display: inline-block; cursor: pointer; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } strong .post-com-count { background-position: center -55px; } .post-com-count:hover { background-position: center -3px; } #adminmenu li a:hover #awaiting-mod, #sidemenu li a:hover #update-plugins { background-position: -80px bottom; } #adminmenu li a #awaiting-mod span, #sidemenu li a #update-plugins span { top: -0.8em; right: 0; position: absolute; display: block; height: 1.3em; line-height: 1.3em; padding: 0 0.6em; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } #submenu { margin: 0; list-style: none; padding: 6px 0 3px 0; } #submenu li { font-size: 14px; } #minisub { /* for empty submenus */ height: 15px; } /* end menu stuff */ /* Admin Footer */ html, body { height:100%; } #wpwrap { position: relative; min-height: 100%; } #wpcontent{ padding-bottom: 95px; } #footer { clear: both; height: 65px; padding: 10px 0 0 60px; margin: 0; position: relative; margin-top: -75px; font-size: 12px; } #footer p { margin: 0; padding: 7px 0; } #footer p a { text-decoration: none; } #footer p a:hover { text-decoration: underline; } /* Tables used on comment.php and option/setting pages */ .form-table { border-collapse: collapse; margin-top: 1em; width: 100%; margin-bottom: -8px; } .form-table td { margin-bottom: 9px; padding: 10px; line-height: 20px; border-bottom-width: 8px; border-bottom-style: solid; font-size: 11px; } .form-table th { vertical-align: top; text-align: left; padding: 10px; width: 150px; border-bottom-width: 8px; border-bottom-style: solid; } .form-table th.th-full { width: auto; } .form-table input, .form-table textarea { border-width: 1px; border-style: solid; } .form-table div.color-option { display: block; clear: both; } .form-table input.tog { margin-top: 2px; margin-right: 2px; float: left; } .form-table table.color-palette { vertical-align: bottom; float: left; margin: -3px 3px 8px; } .form-table .color-palette td { border-bottom: none; border: 1px solid #fff; font-size: 1px; line-height: 1px; } #profile-page .form-table textarea { width: 500px; margin-bottom: 6px; } #profile-page .form-table input[type=text] { width: 300px; } #pass-strength-result { width: 197px; float: left; margin-right: 5px; border: 1px solid #ccc !important; } #profile-page .form-table #rich_editing { margin-right: 5px } .form-table .pre { padding: 8px; margin: 0; } .pre { /* http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/ */ white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ word-wrap: break-word; /* Internet Explorer 5.5+ */ } table.form-table td .updated { font-size: 13px; } /* Post Screen */ #tagsdiv #newtag { margin-right: 5px; width: 16em; } #tagchecklist { margin-left: 10px; font-size: 12px; overflow: auto; } #tagchecklist strong { margin-left: -8px; position: absolute; } #tagchecklist span { margin-right: 25px; display: block; float: left; font-size: 11px; line-height: 1.8em; white-space: nowrap; cursor: default; } #tagchecklist span a { margin: 6px 0pt 0pt -9px; cursor: pointer; width: 10px; height: 10px; display: block; float: left; text-indent: -9999px; overflow: hidden; position: absolute; } .howto { font-style: italic; display: block; } .ac_results { padding: 0; margin: 0; list-style: none; position: absolute; z-index: 10000; display: none; border-width: 1px; border-style: solid; } .ac_results li { padding: 2px 5px; white-space: nowrap; text-align: left; } .ac_over { cursor: pointer; } .ac_match { text-decoration: underline; } #poststuff h2 { margin-top: 20px; font-size: 1.5em; margin-bottom: 15px; padding: 0 0 3px; clear: left; } #poststuff h3 { font-size: 14px; font-weight: bold; padding: 7px; margin: 0 0 10px; } #poststuff .postbox, #poststuff .stuffbox { margin-left: 20px; padding: 2px; margin-bottom: 20px; margin-right: 8px; border-width: 1px; border-style: solid; } #titlediv, #poststuff .postarea { margin-left: 20px; margin-bottom: 20px; margin-right: 8px; } #titlediv { margin-bottom: 20px; } #titlediv div.inside { margin: 0; } #titlediv #title { border: 0; padding: 0; font-size: 1.7em; width: 100%; outline: none; } #poststuff #titlewrap { padding: 2px 3px; border-width: 1px; border-style: solid; } #poststuff .inside { margin: 0 12px 12px; font-size: 11px; } #link_name, #link_url, #link_description { font-size: 1.7em; padding: 4px 3px; width: 98%; } #edit-slug-box { margin-top: 8px; } #editable-post-name-full {display: none;} #editable-post-name input {width: 16em;} #edit-slug-buttons a.save { padding: 6px 4px; margin-right: 4px; text-decoration: none; border-width: 1px; border-style: solid; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; font-weight: bold; } #poststuff #editor-toolbar { position: relative; height: 30px; margin-top: -41px; } #poststuff #edButtonPreview, #poststuff #edButtonHTML { display: block; height: 20px; padding: 5px 5px 1px; margin: 5px 8px 0 0; float: right; cursor: pointer; } #poststuff #editor-toolbar .active { font-weight: bold; -moz-border-radius-topright: 3px; -khtml-border-top-right-radius: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; -moz-border-radius-topleft: 3px; -khtml-border-top-left-radius: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; } #poststuff #media-buttons { float: right; margin-right: 20px; margin-top: 8px; cursor: default; line-height: 1; height: 1.1em; } #poststuff #media-buttons a { cursor: pointer; padding: 0 5px 2px 2px; } #poststuff #media-buttons img { vertical-align: middle; } #poststuff .togbox { background-position: -10px 16px; background-repeat: no-repeat; display: block; height: 37px; margin-left: -21px; margin-top: -10px; overflow: hidden; position: absolute; text-indent: -9999px; width: 12px; -moz-border-radius-topleft: 3px; -khtml-border-top-left-radius: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; -moz-border-radius-bottomleft: 3px; -khtml-border-bottom-left-radius: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; } #poststuff .closed .inside { display: none; } #poststuff .closed h3 { margin: 0; } #poststuff .closed .togbox { background-position: 4px 15px; } .submitbox { width: 220px; float: right; } .submitbox .inside strong { font-size: 14px; } .submitbox .submitdelete { border-bottom-width: 1px; border-bottom-style: solid; text-decoration: none; margin-left: 8px; padding-bottom: 1px; } .submitbox #previewview { padding: 15px 10px; -moz-border-radius-topleft: 3px; -khtml-border-top-left-radius: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; -moz-border-radius-topright: 3px; -khtml-border-top-right-radius: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; } .submitbox #previewview a { padding: 6px; text-decoration: none; font-weight: normal; border-bottom: none; font-size: 14px; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } .submitbox .submit { text-align: left; padding: 12px 10px 10px 10px; font-size: 11px; } .submitbox .submit a:hover { border-bottom-width: 1px; border-bottom-style: solid; } .submitbox .submit input { margin-bottom: 8px; margin-right: 3px; padding: 6px 4px; border: none; } .submitbox #autosave .error { margin-top: 10px; } /* Categories */ #categorydiv #category-adder { margin-left: 120px; padding: 4px 0; } #category-add input, #category-add select { width: 30%; } #category-add input#category-add-sumbit { width: auto; } #categorydiv ul#category-tabs { float: left; width: 120px; text-align: right; /* Negative margin for the sake of those without JS: all tabs display */ margin: 0 -120px 0 0; padding: 0; } ul#category-tabs li { padding: 8px; } ul#category-tabs li.ui-tabs-selected { -moz-border-radius-topleft: 3px; -khtml-border-top-left-radius: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; -moz-border-radius-bottomleft: 3px; -khtml-border-bottom-left-radius: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; } ul#category-tabs li.ui-tabs-selected a { color: #333; font-weight: bold; text-decoration: none; } div.ui-tabs-panel { margin: 0 5px 0 120px; padding: .5em .9em; height: 10em; overflow: auto; border-width: 4px; border-style: solid; } #categorydiv ul { list-style: none; padding: 0; margin: 0; } #categorydiv ul.categorychecklist ul { margin-left: 18px; } ul.categorychecklist li { margin: 0; padding: 0; line-height: 19px; } #linkcategorydiv #category-adder { margin-left: 120px; padding: 4px 0; } #category-adder h4 { margin: 0; } #linkcategorydiv ul#category-tabs { float: left; width: 120px; text-align: right; /* Negative margin for the sake of those without JS: all tabs display */ margin: 0 -120px 0 0; padding: 0; } #linkcategorydiv ul { list-style: none; padding: 0; margin: 0; } #linkcategorydiv ul.categorychecklist ul { margin-left: 18px; } /* pasitioning etc. */ form#tags-filter { position: relative; } p#tag-search { position: absolute; right: 0; top: 0; margin: 0; } form#posts-filter { position: relative; } p#post-search { position: absolute; right: 0; top: 0; margin: 0; } #post-search .button, #widget-search .button { padding: 3px; font-size: 13px; } #posts-filter fieldset { float: left; margin: 0 1.5ex 1em 0; padding: 0; } #posts-filter fieldset legend { padding: 0 0 .2em 1px; } .bordertitle { padding-bottom: 5px; border-bottom-width: 1px; border-bottom-style: solid; } /* Global classes */ .wp-hidden-children .wp-hidden-child { display: none; } .wp-no-js-hidden { display: none; } .ui-tabs-hide { display: none; } .commentlist .avatar { vertical-align:text-top; } .defaultavatarpicker .avatar { margin: 2px 0; vertical-align: middle; } body.minwidth { min-width: 808px; } ul.view-switch { float: right; list-style: none; margin: -23px 5px -2px 0; position: relative; } ul.view-switch li { float: left; margin: 0; font-size: 11px; padding: 4px 6px; font-weight: bold; } ul.view-switch a { text-decoration: none; } ul.view-switch li.current { border: none; -moz-border-radius-topleft: 3px; -khtml-border-top-left-radius: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; -moz-border-radius-topright: 3px; -khtml-border-top-right-radius: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; } #the-comment-list .comment a { padding-bottom: 1px; text-decoration: none; border-bottom-width: 1px; border-bottom-style: solid; } #the-comment-list td.comment p.comment-author { margin-top: 0; margin-left: 0 ; } #the-comment-list p.comment-author img { float: left; margin-right: 8px; } #the-comment-list p.comment-author strong a { border: none; } #the-comment-list td { vertical-align: top; } #the-comment-list td.comment { width: 65%; max-width: 460px; word-wrap: break-word; } #the-comment-list td.comment p { margin-left: 8px; } #the-comment-list .check-column { padding-top: 8px; } #templateside ul li a { text-decoration: none; } .curtime { background-image: url(images/date-button.gif); background-repeat: no-repeat; background-position: left 2px; padding-left: 18px; } .tablenav .delete { margin-right: 20px; } #tTips { display: none; position: absolute; margin: 0; padding: 0 0 8px 0; background-image: url(images/tail.gif); background-repeat: no-repeat; background-position: 15px bottom; background-color: transparent; } #tTips p#tTips_inside { margin: 0; padding: 8px 12px; text-align: center; -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; } td.action-links, th.action-links { text-align: right; } #poststuff h3, #poststuff .closed h3 { cursor: pointer; } .hide-if-no-js { display: none; } /* Diff */ table.diff { width: 100%; } table.diff col.content { width: 50%; } table.diff tr { background-color: transparent; } table.diff td, table.diff th { padding: .5em; font-family: monospace; border: none; } table.diff .diff-deletedline del, table.diff .diff-addedline ins { text-decoration: none; } #wp-word-count { display: block; } fieldset { border: 0; padding: 0; margin: 0; } .info-box { top: 100px; left: 50%; margin-left: -225px; height: 300px; width: 450px; border: 5px solid #ddd; background: #f8f8f8; position: absolute; padding: 15px 15px 10px; z-index: 1000; display: none; } .info-box .submit { position: absolute; bottom: 15px; width: 450px; padding: 15px 0 0; } .info-box .gears-img { float: right; margin: 10px; } .info-box-title { line-height: 2; margin: 0; padding: 0 7px; } #wp_editbtns { padding: 2px; position: absolute; display: none; z-index: 999998; } #wp_editimgbtn, #wp_delimgbtn { margin: 2px; padding: 2px; border: 1px solid #999; background-color: #eee; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } #wp_editimgbtn:hover, #wp_delimgbtn:hover { border-color: #555; background-color: #ccc; } wp/dev/wp-admin/custom-header.php0000644000106600010660000002664411017044331014175 0ustar admin_header_callback = $admin_header_callback; } function init() { $page = add_theme_page(__('Custom Image Header'), __('Custom Image Header'), 'edit_themes', 'custom-header', array(&$this, 'admin_page')); add_action("admin_print_scripts-$page", array(&$this, 'js_includes')); add_action("admin_head-$page", array(&$this, 'take_action'), 50); add_action("admin_head-$page", array(&$this, 'js'), 50); add_action("admin_head-$page", $this->admin_header_callback, 51); } function step() { $step = (int) @$_GET['step']; if ( $step < 1 || 3 < $step ) $step = 1; return $step; } function js_includes() { $step = $this->step(); if ( 1 == $step ) wp_enqueue_script('colorpicker'); elseif ( 2 == $step ) wp_enqueue_script('cropper'); } function take_action() { if ( isset( $_POST['textcolor'] ) ) { check_admin_referer('custom-header'); if ( 'blank' == $_POST['textcolor'] ) { set_theme_mod('header_textcolor', 'blank'); } else { $color = preg_replace('/[^0-9a-fA-F]/', '', $_POST['textcolor']); if ( strlen($color) == 6 || strlen($color) == 3 ) set_theme_mod('header_textcolor', $color); } } if ( isset($_POST['resetheader']) ) { check_admin_referer('custom-header'); remove_theme_mods(); } } function js() { $step = $this->step(); if ( 1 == $step ) $this->js_1(); elseif ( 2 == $step ) $this->js_2(); } function js_1() { ?>

    %1$d x %2$d pixels will be used as-is.'), HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT); ?>


    false); $file = wp_handle_upload($_FILES['import'], $overrides); if ( isset($file['error']) ) die( $file['error'] ); $url = $file['url']; $type = $file['type']; $file = $file['file']; $filename = basename($file); // Construct the object array $object = array( 'post_title' => $filename, 'post_content' => $url, 'post_mime_type' => $type, 'guid' => $url); // Save the data $id = wp_insert_attachment($object, $file); list($width, $height, $type, $attr) = getimagesize( $file ); if ( $width == HEADER_IMAGE_WIDTH && $height == HEADER_IMAGE_HEIGHT ) { // Add the meta-data wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) ); set_theme_mod('header_image', clean_url($url)); do_action('wp_create_file_in_uploads', $file, $id); // For replication return $this->finished(); } elseif ( $width > HEADER_IMAGE_WIDTH ) { $oitar = $width / HEADER_IMAGE_WIDTH; $image = wp_crop_image($file, 0, 0, $width, $height, HEADER_IMAGE_WIDTH, $height / $oitar, false, str_replace(basename($file), 'midsize-'.basename($file), $file)); $image = apply_filters('wp_create_file_in_uploads', $image, $id); // For replication $url = str_replace(basename($url), basename($image), $url); $width = $width / $oitar; $height = $height / $oitar; } else { $oitar = 1; } ?>

    1 ) { $_POST['x1'] = $_POST['x1'] * $_POST['oitar']; $_POST['y1'] = $_POST['y1'] * $_POST['oitar']; $_POST['width'] = $_POST['width'] * $_POST['oitar']; $_POST['height'] = $_POST['height'] * $_POST['oitar']; } $original = get_attached_file( $_POST['attachment_id'] ); $cropped = wp_crop_image($_POST['attachment_id'], $_POST['x1'], $_POST['y1'], $_POST['width'], $_POST['height'], HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT); $cropped = apply_filters('wp_create_file_in_uploads', $cropped, $_POST['attachment_id']); // For replication $parent = get_post($_POST['attachment_id']); $parent_url = $parent->guid; $url = str_replace(basename($parent_url), basename($cropped), $parent_url); // Construct the object array $object = array( 'ID' => $_POST['attachment_id'], 'post_title' => basename($cropped), 'post_content' => $url, 'post_mime_type' => 'image/jpeg', 'guid' => $url ); // Update the attachment wp_insert_attachment($object, $cropped); wp_update_attachment_metadata( $_POST['attachment_id'], wp_generate_attachment_metadata( $_POST['attachment_id'], $cropped ) ); set_theme_mod('header_image', $url); // cleanup $medium = str_replace(basename($original), 'midsize-'.basename($original), $original); @unlink( apply_filters( 'wp_delete_file', $medium ) ); @unlink( apply_filters( 'wp_delete_file', $original ) ); return $this->finished(); } function finished() { ?>

    step(); if ( 1 == $step ) $this->step_1(); elseif ( 2 == $step ) $this->step_2(); elseif ( 3 == $step ) $this->step_3(); } } ?> wp/dev/wp-admin/async-upload.php0000644000106600010660000000261011030271357014024 0ustar '.wp_specialchars($id->get_error_message()).''; exit; } if ( $_REQUEST['short'] ) { // short form response - attachment ID only echo $id; } else { // long form response - big chunk o html $type = $_REQUEST['type']; echo apply_filters("async_upload_{$type}", $id); } ?> wp/dev/wp-admin/media.php0000644000106600010660000000572611015134421012510 0ustar

    $message

    \n"; ?>

    false, 'send' => false, 'delete' => false, 'errors' => $errors ) ); ?>

    wp/dev/wp-admin/edit-category-form.php0000644000106600010660000000577011025647561015150 0ustar '; $action = 'editedcat'; $nonce_action = 'update-category_' . $cat_ID; do_action('edit_category_form_pre', $category); } else { $heading = __('Add Category'); $submit_text = __('Add Category'); $form = '
    '; $action = 'addcat'; $nonce_action = 'add-category'; do_action('add_category_form_pre', $category); } ?>



    0, 'name' => 'category_parent', 'orderby' => 'name', 'selected' => $category->parent, 'hierarchical' => true, 'show_option_none' => __('None'))); ?>

    wp/dev/wp-admin/admin-footer.php0000644000106600010660000000107310762112306014012 0ustar wp/dev/wp-admin/index-extra.php0000644000106600010660000000100210757365411013661 0ustar wp/dev/wp-admin/sidebar.php0000644000106600010660000000510211015134421013026 0ustar <?php _e('WordPress › Posted'); ?>

    Click here to post again.'), 'sidebar.php'); ?>

    <?php _e('WordPress › Sidebar'); ?>

    WordPress

    wp/dev/wp-admin/edit-link-category-form.php0000644000106600010660000000424011007637375016074 0ustar '; $action = 'editedcat'; $nonce_action = 'update-link-category_' . $cat_ID; do_action('edit_link_category_form_pre', $category); } else { $heading = __('Add Category'); $submit_text = __('Add Category'); $form = '
    '; $action = 'addcat'; $nonce_action = 'add-link-category'; do_action('add_link_category_form_pre', $category); } ?>

    wp/dev/wp-admin/options-permalink.php0000644000106600010660000001717311037720526015116 0ustar set_permalink_structure($permalink_structure); } if ( isset($_POST['category_base']) ) { $category_base = $_POST['category_base']; if (! empty($category_base) ) $category_base = preg_replace('#/+#', '/', '/' . $_POST['category_base']); $wp_rewrite->set_category_base($category_base); } if ( isset($_POST['tag_base']) ) { $tag_base = $_POST['tag_base']; if (! empty($tag_base) ) $tag_base = preg_replace('#/+#', '/', '/' . $_POST['tag_base']); $wp_rewrite->set_tag_base($tag_base); } } $permalink_structure = get_option('permalink_structure'); $category_base = get_option('category_base'); $tag_base = get_option( 'tag_base' ); if ( (!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess') ) $writable = true; else $writable = false; if ($wp_rewrite->using_index_permalinks()) $usingpi = true; else $usingpi = false; $wp_rewrite->flush_rules(); ?>

    URLs which have question marks and lots of numbers in them, however WordPress offers you the ability to create a custom URL structure for your permalinks and archives. This can improve the aesthetics, usability, and forward-compatibility of your links. A number of tags are available, and here are some examples to get you started.'); ?>

    /?p=123
    /archives/123

    URLs here. For example, using topics as your category base would make your category links like http://example.org/topics/uncategorized/. If you leave these blank the defaults will be used.') ?>

    URLs here. For example, using topics as your category base would make your category links like http://example.org/index.php/topics/uncategorized/. If you leave these blank the defaults will be used.') ?>

    .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all.') ?>

    wp/dev/wp-admin/profile.php0000644000106600010660000000011110750442704013063 0ustar wp/dev/wp-blog-header.php0000644000106600010660000000042211016305267012507 0ustar wp/dev/wp-pass.php0000644000106600010660000000074711016305267011316 0ustar wp/dev/wp-config-sample.php0000644000106600010660000000304111033204532013052 0ustar wp/dev/readme.html0000644000106600010660000001673211051167721011337 0ustar WordPress › ReadMe

    WordPress
    Version 2.6.1

    Semantic Personal Publishing Platform

    First Things First

    Welcome. WordPress is a very special project to me. Every developer and contributor adds something unique to the mix, and together we create something beautiful that I'm proud to be a part of. Thousands of hours have gone into WordPress, and we're dedicated to making it better every day. Thank you for making it part of your world.

    — Matt Mullenweg

    Installation: Famous 5-minute install

    1. Unzip the package in an empty directory.
    2. Open up wp-config-sample.php with a text editor like WordPad or similar and fill in your database connection details.
    3. Save the file as wp-config.php
    4. Upload everything.
    5. Open /wp-admin/install.php in your browser. This should setup the tables needed for your blog. If there is an error, double check your wp-config.php file, and try again. If it fails again, please go to the support forums with as much data as you can gather.
    6. Note the password given to you.
    7. The install script should then send you to the login page. Sign in with the username admin and the password generated during the installation. You can then click on 'Profile' to change the password.

    Upgrading

    Before you upgrade anything, make sure you have backup copies of any files you may have modified such as index.php.

    Upgrading from any previous WordPress to 2.6.1:

    1. Delete your old WP files, saving ones you've modified.
    2. Upload the new files.
    3. Point your browser to /wp-admin/upgrade.php.
    4. You wanted more, perhaps? That's it!

    Template Changes

    If you have customized your templates you will probably have to make some changes to them. If you're converting your 1.2 or earlier templates, we've created a special guide for you.

    Online Resources

    If you have any questions that aren't addressed in this document, please take advantage of WordPress' numerous online resources:

    The WordPress Codex
    The Codex is the encyclopedia of all things WordPress. It is the most comprehensive source of information for WordPress available.
    The Development Blog
    This is where you'll find the latest updates and news related to WordPress. Bookmark and check often.
    WordPress Planet
    The WordPress Planet is a news aggregator that brings together posts from WordPress blogs around the web.
    WordPress Support Forums
    If you've looked everywhere and still can't find an answer, the support forums are very active and have a large community ready to help. To help them help you be sure to use a descriptive thread title and describe your question in as much detail as possible.
    WordPress IRC Channel
    Finally, there is an online chat channel that is used for discussion among people who use WordPress and occasionally support topics. The above wiki page should point you in the right direction. (irc.freenode.net #wordpress)

    System Recommendations

    • PHP version 4.3 or higher.
    • MySQL version 4.0 or higher.
    • ... and a link to http://wordpress.org on your site.

    WordPress is the official continuation of b2/cafélog, which came from Michel V. The work has been continued by the WordPress developers. If you would like to support WordPress, please consider donating.

    Upgrading from another system

    WordPress can import from a number of systems. First you need to get WordPress installed and working as described above.

    XML-RPC and Atom Interface

    You can now post to your WordPress blog with tools like Windows Live Writer, Ecto, Bloggar, Radio Userland (which means you can use Radio's email-to-blog feature), NewzCrawler, and other tools that support the Blogging APIs! :) You can read more about XML-RPC support on the Codex.

    Post via Email

    You can post from an email client! To set this up go to your "Writing" options screen and fill in the connection details for your secret POP3 account. Then you need to set up wp-mail.php to execute periodically to check the mailbox for new posts. You can do it with Cron-jobs, or if your host doesn't support it you can look into the various website-monitoring services, and make them check your wp-mail.php URL.

    Posting is easy: Any email sent to the address you specify will be posted, with the subject as the title. It is best to keep the address discrete. The script will delete emails that are successfully posted.

    User Roles

    We've eliminated user levels in order to make way for the much more flexible roles system introduced in 2.0. You can read more about Roles and Capabilities on the Codex.

    Final notes

    • If you have any suggestions, ideas, comments, or if you (gasp!) found a bug, join us in the Support Forums.
    • WordPress now has a robust plugin API that makes extending the code easy. If you are a developer interested in utilizing this see the plugin documentation in the Codex. In most all cases you shouldn't modify any of the core code.

    Share the Love

    WordPress has no multi-million dollar marketing campaign or celebrity sponsors, but we do have something even better—you. If you enjoy WordPress please consider telling a friend, setting it up for someone less knowledgable than yourself, or writing the author of a media article that overlooks us.

    Copyright

    WordPress is released under the GPL (see license.txt).

    wp/dev/xmlrpc.php0000644000106600010660000022321311042176522011223 0ustar * @package WordPress */ /** * Whether this is a XMLRPC Request * * @var bool */ define('XMLRPC_REQUEST', true); // Some browser-embedded clients send cookies. We don't want them. $_COOKIE = array(); // A bug in PHP < 5.2.2 makes $HTTP_RAW_POST_DATA not set by default, // but we can do it ourself. if ( !isset( $HTTP_RAW_POST_DATA ) ) { $HTTP_RAW_POST_DATA = file_get_contents( 'php://input' ); } // fix for mozBlog and other cases where ' '; ?> WordPress http://wordpress.org/ methods = array( // WordPress API 'wp.getUsersBlogs' => 'this:wp_getUsersBlogs', 'wp.getPage' => 'this:wp_getPage', 'wp.getPages' => 'this:wp_getPages', 'wp.newPage' => 'this:wp_newPage', 'wp.deletePage' => 'this:wp_deletePage', 'wp.editPage' => 'this:wp_editPage', 'wp.getPageList' => 'this:wp_getPageList', 'wp.getAuthors' => 'this:wp_getAuthors', 'wp.getCategories' => 'this:mw_getCategories', // Alias 'wp.newCategory' => 'this:wp_newCategory', 'wp.deleteCategory' => 'this:wp_deleteCategory', 'wp.suggestCategories' => 'this:wp_suggestCategories', 'wp.uploadFile' => 'this:mw_newMediaObject', // Alias 'wp.getCommentCount' => 'this:wp_getCommentCount', 'wp.getPostStatusList' => 'this:wp_getPostStatusList', 'wp.getPageStatusList' => 'this:wp_getPageStatusList', 'wp.getPageTemplates' => 'this:wp_getPageTemplates', 'wp.getOptions' => 'this:wp_getOptions', 'wp.setOptions' => 'this:wp_setOptions', // Blogger API 'blogger.getUsersBlogs' => 'this:blogger_getUsersBlogs', 'blogger.getUserInfo' => 'this:blogger_getUserInfo', 'blogger.getPost' => 'this:blogger_getPost', 'blogger.getRecentPosts' => 'this:blogger_getRecentPosts', 'blogger.getTemplate' => 'this:blogger_getTemplate', 'blogger.setTemplate' => 'this:blogger_setTemplate', 'blogger.newPost' => 'this:blogger_newPost', 'blogger.editPost' => 'this:blogger_editPost', 'blogger.deletePost' => 'this:blogger_deletePost', // MetaWeblog API (with MT extensions to structs) 'metaWeblog.newPost' => 'this:mw_newPost', 'metaWeblog.editPost' => 'this:mw_editPost', 'metaWeblog.getPost' => 'this:mw_getPost', 'metaWeblog.getRecentPosts' => 'this:mw_getRecentPosts', 'metaWeblog.getCategories' => 'this:mw_getCategories', 'metaWeblog.newMediaObject' => 'this:mw_newMediaObject', // MetaWeblog API aliases for Blogger API // see http://www.xmlrpc.com/stories/storyReader$2460 'metaWeblog.deletePost' => 'this:blogger_deletePost', 'metaWeblog.getTemplate' => 'this:blogger_getTemplate', 'metaWeblog.setTemplate' => 'this:blogger_setTemplate', 'metaWeblog.getUsersBlogs' => 'this:blogger_getUsersBlogs', // MovableType API 'mt.getCategoryList' => 'this:mt_getCategoryList', 'mt.getRecentPostTitles' => 'this:mt_getRecentPostTitles', 'mt.getPostCategories' => 'this:mt_getPostCategories', 'mt.setPostCategories' => 'this:mt_setPostCategories', 'mt.supportedMethods' => 'this:mt_supportedMethods', 'mt.supportedTextFilters' => 'this:mt_supportedTextFilters', 'mt.getTrackbackPings' => 'this:mt_getTrackbackPings', 'mt.publishPost' => 'this:mt_publishPost', // PingBack 'pingback.ping' => 'this:pingback_ping', 'pingback.extensions.getPingbacks' => 'this:pingback_extensions_getPingbacks', 'demo.sayHello' => 'this:sayHello', 'demo.addTwoNumbers' => 'this:addTwoNumbers' ); $this->initialise_blog_option_info( ); $this->methods = apply_filters('xmlrpc_methods', $this->methods); $this->IXR_Server($this->methods); } function sayHello($args) { return 'Hello!'; } function addTwoNumbers($args) { $number1 = $args[0]; $number2 = $args[1]; return $number1 + $number2; } function login_pass_ok($user_login, $user_pass) { if ( !get_option( 'enable_xmlrpc' ) ) { $this->error = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this blog. An admin user can enable them at %s'), admin_url('options-writing.php') ) ); return false; } if (!user_pass_ok($user_login, $user_pass)) { $this->error = new IXR_Error(403, __('Bad login/pass combination.')); return false; } return true; } function escape(&$array) { global $wpdb; if(!is_array($array)) { return($wpdb->escape($array)); } else { foreach ( (array) $array as $k => $v ) { if (is_array($v)) { $this->escape($array[$k]); } else if (is_object($v)) { //skip } else { $array[$k] = $wpdb->escape($v); } } } } function get_custom_fields($post_id) { $post_id = (int) $post_id; $custom_fields = array(); foreach ( (array) has_meta($post_id) as $meta ) { // Don't expose protected fields. if ( strpos($meta['meta_key'], '_wp_') === 0 ) { continue; } $custom_fields[] = array( "id" => $meta['meta_id'], "key" => $meta['meta_key'], "value" => $meta['meta_value'] ); } return $custom_fields; } function set_custom_fields($post_id, $fields) { $post_id = (int) $post_id; foreach ( (array) $fields as $meta ) { if ( isset($meta['id']) ) { $meta['id'] = (int) $meta['id']; if ( isset($meta['key']) ) { update_meta($meta['id'], $meta['key'], $meta['value']); } else { delete_meta($meta['id']); } } else { $_POST['metakeyinput'] = $meta['key']; $_POST['metavalue'] = $meta['value']; add_meta($post_id); } } } function initialise_blog_option_info( ) { global $wp_version; $this->blog_options = array( // Read only options 'software_name' => array( 'desc' => __( 'Software Name' ), 'readonly' => true, 'value' => 'WordPress' ), 'software_version' => array( 'desc' => __( 'Software Version' ), 'readonly' => true, 'value' => $wp_version ), 'blog_url' => array( 'desc' => __( 'Blog URL' ), 'readonly' => true, 'option' => 'siteurl' ), // Updatable options 'time_zone' => array( 'desc' => __( 'Time Zone' ), 'readonly' => false, 'option' => 'gmt_offset' ), 'blog_title' => array( 'desc' => __( 'Blog Title' ), 'readonly' => false, 'option' => 'blogname' ), 'blog_tagline' => array( 'desc' => __( 'Blog Tagline' ), 'readonly' => false, 'option' => 'blogdescription' ), 'date_format' => array( 'desc' => __( 'Date Format' ), 'readonly' => false, 'option' => 'date_format' ), 'time_format' => array( 'desc' => __( 'Time Format' ), 'readonly' => false, 'option' => 'time_format' ) ); $this->blog_options = apply_filters( 'xmlrpc_blog_options', $this->blog_options ); } /** * WordPress XML-RPC API * wp_getUsersBlogs */ function wp_getUsersBlogs( $args ) { // If this isn't on WPMU then just use blogger_getUsersBlogs if( !function_exists( 'is_site_admin' ) ) { array_unshift( $args, 1 ); return $this->blogger_getUsersBlogs( $args ); } $this->escape( $args ); $username = $args[0]; $password = $args[1]; if( !$this->login_pass_ok( $username, $password ) ) return $this->error; do_action( 'xmlrpc_call', 'wp.getUsersBlogs' ); $user = set_current_user( 0, $username ); $blogs = (array) get_blogs_of_user( $user->ID ); $struct = array( ); foreach( $blogs as $blog ) { // Don't include blogs that aren't hosted at this site if( $blog->site_id != 1 ) continue; $blog_id = $blog->userblog_id; switch_to_blog($blog_id); $is_admin = current_user_can('level_8'); $struct[] = array( 'isAdmin' => $is_admin, 'url' => get_option( 'home' ) . '/', 'blogid' => $blog_id, 'blogName' => get_option( 'blogname' ), 'xmlrpc' => get_option( 'home' ) . '/xmlrpc.php' ); } return $struct; } /** * WordPress XML-RPC API * wp_getPage */ function wp_getPage($args) { $this->escape($args); $blog_id = (int) $args[0]; $page_id = (int) $args[1]; $username = $args[2]; $password = $args[3]; if(!$this->login_pass_ok($username, $password)) { return($this->error); } set_current_user( 0, $username ); if( !current_user_can( 'edit_page', $page_id ) ) return new IXR_Error( 401, __( 'Sorry, you can not edit this page.' ) ); do_action('xmlrpc_call', 'wp.getPage'); // Lookup page info. $page = get_page($page_id); // If we found the page then format the data. if($page->ID && ($page->post_type == "page")) { // Get all of the page content and link. $full_page = get_extended($page->post_content); $link = post_permalink($page->ID); // Get info the page parent if there is one. $parent_title = ""; if(!empty($page->post_parent)) { $parent = get_page($page->post_parent); $parent_title = $parent->post_title; } // Determine comment and ping settings. $allow_comments = ("open" == $page->comment_status) ? 1 : 0; $allow_pings = ("open" == $page->ping_status) ? 1 : 0; // Format page date. $page_date = mysql2date("Ymd\TH:i:s", $page->post_date); $page_date_gmt = mysql2date("Ymd\TH:i:s", $page->post_date_gmt); // Pull the categories info together. $categories = array(); foreach(wp_get_post_categories($page->ID) as $cat_id) { $categories[] = get_cat_name($cat_id); } // Get the author info. $author = get_userdata($page->post_author); $page_template = get_post_meta( $page->ID, '_wp_page_template', true ); if( empty( $page_template ) ) $page_template = 'default'; $page_struct = array( "dateCreated" => new IXR_Date($page_date), "userid" => $page->post_author, "page_id" => $page->ID, "page_status" => $page->post_status, "description" => $full_page["main"], "title" => $page->post_title, "link" => $link, "permaLink" => $link, "categories" => $categories, "excerpt" => $page->post_excerpt, "text_more" => $full_page["extended"], "mt_allow_comments" => $allow_comments, "mt_allow_pings" => $allow_pings, "wp_slug" => $page->post_name, "wp_password" => $page->post_password, "wp_author" => $author->display_name, "wp_page_parent_id" => $page->post_parent, "wp_page_parent_title" => $parent_title, "wp_page_order" => $page->menu_order, "wp_author_id" => $author->ID, "wp_author_display_name" => $author->display_name, "date_created_gmt" => new IXR_Date($page_date_gmt), "custom_fields" => $this->get_custom_fields($page_id), "wp_page_template" => $page_template ); return($page_struct); } // If the page doesn't exist indicate that. else { return(new IXR_Error(404, __("Sorry, no such page."))); } } /** * WordPress XML-RPC API * wp_getPages */ function wp_getPages($args) { $this->escape($args); $blog_id = (int) $args[0]; $username = $args[1]; $password = $args[2]; if(!$this->login_pass_ok($username, $password)) { return($this->error); } set_current_user( 0, $username ); if( !current_user_can( 'edit_pages' ) ) return new IXR_Error( 401, __( 'Sorry, you can not edit pages.' ) ); do_action('xmlrpc_call', 'wp.getPages'); // Lookup info on pages. $pages = get_pages(); $num_pages = count($pages); // If we have pages, put together their info. if($num_pages >= 1) { $pages_struct = array(); for($i = 0; $i < $num_pages; $i++) { $page = wp_xmlrpc_server::wp_getPage(array( $blog_id, $pages[$i]->ID, $username, $password )); $pages_struct[] = $page; } return($pages_struct); } // If no pages were found return an error. else { return(array()); } } /** * WordPress XML-RPC API * wp_newPage */ function wp_newPage($args) { // Items not escaped here will be escaped in newPost. $username = $this->escape($args[1]); $password = $this->escape($args[2]); $page = $args[3]; $publish = $args[4]; if(!$this->login_pass_ok($username, $password)) { return($this->error); } do_action('xmlrpc_call', 'wp.newPage'); // Set the user context and check if they are allowed // to add new pages. $user = set_current_user(0, $username); if(!current_user_can("publish_pages")) { return(new IXR_Error(401, __("Sorry, you can not add new pages."))); } // Mark this as content for a page. $args[3]["post_type"] = "page"; // Let mw_newPost do all of the heavy lifting. return($this->mw_newPost($args)); } /** * WordPress XML-RPC API * wp_deletePage */ function wp_deletePage($args) { $this->escape($args); $blog_id = (int) $args[0]; $username = $args[1]; $password = $args[2]; $page_id = (int) $args[3]; if(!$this->login_pass_ok($username, $password)) { return($this->error); } do_action('xmlrpc_call', 'wp.deletePage'); // Get the current page based on the page_id and // make sure it is a page and not a post. $actual_page = wp_get_single_post($page_id, ARRAY_A); if( !$actual_page || ($actual_page["post_type"] != "page") ) { return(new IXR_Error(404, __("Sorry, no such page."))); } // Set the user context and make sure they can delete pages. set_current_user(0, $username); if(!current_user_can("delete_page", $page_id)) { return(new IXR_Error(401, __("Sorry, you do not have the right to delete this page."))); } // Attempt to delete the page. $result = wp_delete_post($page_id); if(!$result) { return(new IXR_Error(500, __("Failed to delete the page."))); } return(true); } /** * WordPress XML-RPC API * wp_editPage */ function wp_editPage($args) { // Items not escaped here will be escaped in editPost. $blog_id = (int) $args[0]; $page_id = (int) $this->escape($args[1]); $username = $this->escape($args[2]); $password = $this->escape($args[3]); $content = $args[4]; $publish = $args[5]; if(!$this->login_pass_ok($username, $password)) { return($this->error); } do_action('xmlrpc_call', 'wp.editPage'); // Get the page data and make sure it is a page. $actual_page = wp_get_single_post($page_id, ARRAY_A); if( !$actual_page || ($actual_page["post_type"] != "page") ) { return(new IXR_Error(404, __("Sorry, no such page."))); } // Set the user context and make sure they are allowed to edit pages. set_current_user(0, $username); if(!current_user_can("edit_page", $page_id)) { return(new IXR_Error(401, __("Sorry, you do not have the right to edit this page."))); } // Mark this as content for a page. $content["post_type"] = "page"; // Arrange args in the way mw_editPost understands. $args = array( $page_id, $username, $password, $content, $publish ); // Let mw_editPost do all of the heavy lifting. return($this->mw_editPost($args)); } /** * WordPress XML-RPC API * wp_getPageList */ function wp_getPageList($args) { global $wpdb; $this->escape($args); $blog_id = (int) $args[0]; $username = $args[1]; $password = $args[2]; if(!$this->login_pass_ok($username, $password)) { return($this->error); } set_current_user( 0, $username ); if( !current_user_can( 'edit_pages' ) ) return new IXR_Error( 401, __( 'Sorry, you can not edit pages.' ) ); do_action('xmlrpc_call', 'wp.getPageList'); // Get list of pages ids and titles $page_list = $wpdb->get_results(" SELECT ID page_id, post_title page_title, post_parent page_parent_id, post_date_gmt, post_date FROM {$wpdb->posts} WHERE post_type = 'page' ORDER BY ID "); // The date needs to be formated properly. $num_pages = count($page_list); for($i = 0; $i < $num_pages; $i++) { $post_date = mysql2date("Ymd\TH:i:s", $page_list[$i]->post_date); $post_date_gmt = mysql2date("Ymd\TH:i:s", $page_list[$i]->post_date_gmt); $page_list[$i]->dateCreated = new IXR_Date($post_date); $page_list[$i]->date_created_gmt = new IXR_Date($post_date_gmt); unset($page_list[$i]->post_date_gmt); unset($page_list[$i]->post_date); } return($page_list); } /** * WordPress XML-RPC API * wp_getAuthors */ function wp_getAuthors($args) { $this->escape($args); $blog_id = (int) $args[0]; $username = $args[1]; $password = $args[2]; if(!$this->login_pass_ok($username, $password)) { return($this->error); } set_current_user(0, $username); if(!current_user_can("edit_posts")) { return(new IXR_Error(401, __("Sorry, you can not edit posts on this blog."))); } do_action('xmlrpc_call', 'wp.getAuthors'); $authors = array(); foreach( (array) get_users_of_blog() as $row ) { $authors[] = array( "user_id" => $row->user_id, "user_login" => $row->user_login, "display_name" => $row->display_name ); } return($authors); } /** * WordPress XML-RPC API * wp_newCategory */ function wp_newCategory($args) { $this->escape($args); $blog_id = (int) $args[0]; $username = $args[1]; $password = $args[2]; $category = $args[3]; if(!$this->login_pass_ok($username, $password)) { return($this->error); } do_action('xmlrpc_call', 'wp.newCategory'); // Set the user context and make sure they are // allowed to add a category. set_current_user(0, $username); if(!current_user_can("manage_categories")) { return(new IXR_Error(401, __("Sorry, you do not have the right to add a category."))); } // If no slug was provided make it empty so that // WordPress will generate one. if(empty($category["slug"])) { $category["slug"] = ""; } // If no parent_id was provided make it empty // so that it will be a top level page (no parent). if ( !isset($category["parent_id"]) ) $category["parent_id"] = ""; // If no description was provided make it empty. if(empty($category["description"])) { $category["description"] = ""; } $new_category = array( "cat_name" => $category["name"], "category_nicename" => $category["slug"], "category_parent" => $category["parent_id"], "category_description" => $category["description"] ); $cat_id = wp_insert_category($new_category); if(!$cat_id) { return(new IXR_Error(500, __("Sorry, the new category failed."))); } return($cat_id); } /** * WordPress XML-RPC API * wp_deleteCategory */ function wp_deleteCategory($args) { $this->escape($args); $blog_id = (int) $args[0]; $username = $args[1]; $password = $args[2]; $category_id = (int) $args[3]; if( !$this->login_pass_ok( $username, $password ) ) { return $this->error; } do_action('xmlrpc_call', 'wp.deleteCategory'); set_current_user(0, $username); if( !current_user_can("manage_categories") ) { return new IXR_Error( 401, __( "Sorry, you do not have the right to delete a category." ) ); } return wp_delete_category( $category_id ); } /** * WordPress XML-RPC API * wp_suggestCategories */ function wp_suggestCategories($args) { $this->escape($args); $blog_id = (int) $args[0]; $username = $args[1]; $password = $args[2]; $category = $args[3]; $max_results = (int) $args[4]; if(!$this->login_pass_ok($username, $password)) { return($this->error); } set_current_user(0, $username); if( !current_user_can( 'edit_posts' ) ) return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts to this blog in order to view categories.' ) ); do_action('xmlrpc_call', 'wp.suggestCategories'); $category_suggestions = array(); $args = array('get' => 'all', 'number' => $max_results, 'name__like' => $category); foreach ( (array) get_categories($args) as $cat ) { $category_suggestions[] = array( "category_id" => $cat->cat_ID, "category_name" => $cat->cat_name ); } return($category_suggestions); } function wp_getCommentCount( $args ) { $this->escape($args); $blog_id = (int) $args[0]; $username = $args[1]; $password = $args[2]; $post_id = (int) $args[3]; if( !$this->login_pass_ok( $username, $password ) ) { return $this->error; } set_current_user( 0, $username ); if( !current_user_can( 'edit_posts' ) ) { return new IXR_Error( 403, __( 'You are not allowed access to details about comments.' ) ); } do_action('xmlrpc_call', 'wp.getCommentCount'); $count = wp_count_comments( $post_id ); return array( "approved" => $count->approved, "awaiting_moderation" => $count->moderated, "spam" => $count->spam, "total_comments" => $count->total_comments ); } function wp_getPostStatusList( $args ) { $this->escape( $args ); $blog_id = (int) $args[0]; $username = $args[1]; $password = $args[2]; if( !$this->login_pass_ok( $username, $password ) ) { return $this->error; } set_current_user( 0, $username ); if( !current_user_can( 'edit_posts' ) ) { return new IXR_Error( 403, __( 'You are not allowed access to details about this blog.' ) ); } do_action('xmlrpc_call', 'wp.getPostStatusList'); return get_post_statuses( ); } function wp_getPageStatusList( $args ) { $this->escape( $args ); $blog_id = (int) $args[0]; $username = $args[1]; $password = $args[2]; if( !$this->login_pass_ok( $username, $password ) ) { return $this->error; } set_current_user( 0, $username ); if( !current_user_can( 'edit_posts' ) ) { return new IXR_Error( 403, __( 'You are not allowed access to details about this blog.' ) ); } do_action('xmlrpc_call', 'wp.getPageStatusList'); return get_page_statuses( ); } function wp_getPageTemplates( $args ) { $this->escape( $args ); $blog_id = (int) $args[0]; $username = $args[1]; $password = $args[2]; if( !$this->login_pass_ok( $username, $password ) ) { return $this->error; } set_current_user( 0, $username ); if( !current_user_can( 'edit_pages' ) ) { return new IXR_Error( 403, __( 'You are not allowed access to details about this blog.' ) ); } $templates = get_page_templates( ); $templates['Default'] = 'default'; return $templates; } function wp_getOptions( $args ) { $this->escape( $args ); $blog_id = (int) $args[0]; $username = $args[1]; $password = $args[2]; $options = (array) $args[3]; if( !$this->login_pass_ok( $username, $password ) ) return $this->error; $user = set_current_user( 0, $username ); // If no specific options where asked for, return all of them if (count( $options ) == 0 ) { $options = array_keys($this->blog_options); } return $this->_getOptions($options); } function _getOptions($options) { $data = array( ); foreach( $options as $option ) { if( array_key_exists( $option, $this->blog_options ) ) { $data[$option] = $this->blog_options[$option]; //Is the value static or dynamic? if( isset( $data[$option]['option'] ) ) { $data[$option]['value'] = get_option( $data[$option]['option'] ); unset($data[$option]['option']); } } } return $data; } function wp_setOptions( $args ) { $this->escape( $args ); $blog_id = (int) $args[0]; $username = $args[1]; $password = $args[2]; $options = (array) $args[3]; if( !$this->login_pass_ok( $username, $password ) ) return $this->error; $user = set_current_user( 0, $username ); if( !current_user_can( 'manage_options' ) ) return new IXR_Error( 403, __( 'You are not allowed to update options.' ) ); foreach( $options as $o_name => $o_value ) { $option_names[] = $o_name; if( empty( $o_value ) ) continue; if( !array_key_exists( $o_name, $this->blog_options ) ) continue; if( $this->blog_options[$o_name]['readonly'] == true ) continue; update_option( $this->blog_options[$o_name]['option'], $o_value ); } //Now return the updated values return $this->_getOptions($option_names); } /* Blogger API functions * specs on http://plant.blogger.com/api and http://groups.yahoo.com/group/bloggerDev/ */ /* blogger.getUsersBlogs will make more sense once we support multiple blogs */ function blogger_getUsersBlogs($args) { $this->escape($args); $user_login = $args[1]; $user_pass = $args[2]; if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } do_action('xmlrpc_call', 'blogger.getUsersBlogs'); set_current_user(0, $user_login); $is_admin = current_user_can('manage_options'); $struct = array( 'isAdmin' => $is_admin, 'url' => get_option('home') . '/', 'blogid' => '1', 'blogName' => get_option('blogname'), 'xmlrpc' => get_option('home') . '/xmlrpc.php', ); return array($struct); } /* blogger.getUsersInfo gives your client some info about you, so you don't have to */ function blogger_getUserInfo($args) { $this->escape($args); $user_login = $args[1]; $user_pass = $args[2]; if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } set_current_user( 0, $user_login ); if( !current_user_can( 'edit_posts' ) ) return new IXR_Error( 401, __( 'Sorry, you do not have access to user data on this blog.' ) ); do_action('xmlrpc_call', 'blogger.getUserInfo'); $user_data = get_userdatabylogin($user_login); $struct = array( 'nickname' => $user_data->nickname, 'userid' => $user_data->ID, 'url' => $user_data->user_url, 'lastname' => $user_data->last_name, 'firstname' => $user_data->first_name ); return $struct; } /* blogger.getPost ...gets a post */ function blogger_getPost($args) { $this->escape($args); $post_ID = (int) $args[1]; $user_login = $args[2]; $user_pass = $args[3]; if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } set_current_user( 0, $user_login ); if( !current_user_can( 'edit_post', $post_ID ) ) return new IXR_Error( 401, __( 'Sorry, you can not edit this post.' ) ); do_action('xmlrpc_call', 'blogger.getPost'); $post_data = wp_get_single_post($post_ID, ARRAY_A); $categories = implode(',', wp_get_post_categories($post_ID)); $content = ''.stripslashes($post_data['post_title']).''; $content .= ''.$categories.''; $content .= stripslashes($post_data['post_content']); $struct = array( 'userid' => $post_data['post_author'], 'dateCreated' => new IXR_Date(mysql2date('Ymd\TH:i:s', $post_data['post_date'])), 'content' => $content, 'postid' => $post_data['ID'] ); return $struct; } /* blogger.getRecentPosts ...gets recent posts */ function blogger_getRecentPosts($args) { $this->escape($args); $blog_ID = (int) $args[1]; /* though we don't use it yet */ $user_login = $args[2]; $user_pass = $args[3]; $num_posts = $args[4]; if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } do_action('xmlrpc_call', 'blogger.getRecentPosts'); $posts_list = wp_get_recent_posts($num_posts); set_current_user( 0, $user_login ); if (!$posts_list) { $this->error = new IXR_Error(500, __('Either there are no posts, or something went wrong.')); return $this->error; } foreach ($posts_list as $entry) { if( !current_user_can( 'edit_post', $entry['ID'] ) ) continue; $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date']); $categories = implode(',', wp_get_post_categories($entry['ID'])); $content = ''.stripslashes($entry['post_title']).''; $content .= ''.$categories.''; $content .= stripslashes($entry['post_content']); $struct[] = array( 'userid' => $entry['post_author'], 'dateCreated' => new IXR_Date($post_date), 'content' => $content, 'postid' => $entry['ID'], ); } $recent_posts = array(); for ($j=0; $jescape($args); $blog_ID = (int) $args[1]; $user_login = $args[2]; $user_pass = $args[3]; $template = $args[4]; /* could be 'main' or 'archiveIndex', but we don't use it */ if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } do_action('xmlrpc_call', 'blogger.getTemplate'); set_current_user(0, $user_login); if ( !current_user_can('edit_themes') ) { return new IXR_Error(401, __('Sorry, this user can not edit the template.')); } /* warning: here we make the assumption that the blog's URL is on the same server */ $filename = get_option('home') . '/'; $filename = preg_replace('#https?://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename); $f = fopen($filename, 'r'); $content = fread($f, filesize($filename)); fclose($f); /* so it is actually editable with a windows/mac client */ // FIXME: (or delete me) do we really want to cater to bad clients at the expense of good ones by BEEPing up their line breaks? commented. $content = str_replace("\n", "\r\n", $content); return $content; } /* blogger.setTemplate updates the content of blog_filename */ function blogger_setTemplate($args) { $this->escape($args); $blog_ID = (int) $args[1]; $user_login = $args[2]; $user_pass = $args[3]; $content = $args[4]; $template = $args[5]; /* could be 'main' or 'archiveIndex', but we don't use it */ if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } do_action('xmlrpc_call', 'blogger.setTemplate'); set_current_user(0, $user_login); if ( !current_user_can('edit_themes') ) { return new IXR_Error(401, __('Sorry, this user can not edit the template.')); } /* warning: here we make the assumption that the blog's URL is on the same server */ $filename = get_option('home') . '/'; $filename = preg_replace('#https?://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename); if ($f = fopen($filename, 'w+')) { fwrite($f, $content); fclose($f); } else { return new IXR_Error(500, __('Either the file is not writable, or something wrong happened. The file has not been updated.')); } return true; } /* blogger.newPost ...creates a new post */ function blogger_newPost($args) { $this->escape($args); $blog_ID = (int) $args[1]; /* though we don't use it yet */ $user_login = $args[2]; $user_pass = $args[3]; $content = $args[4]; $publish = $args[5]; if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } do_action('xmlrpc_call', 'blogger.newPost'); $cap = ($publish) ? 'publish_posts' : 'edit_posts'; $user = set_current_user(0, $user_login); if ( !current_user_can($cap) ) return new IXR_Error(401, __('Sorry, you are not allowed to post on this blog.')); $post_status = ($publish) ? 'publish' : 'draft'; $post_author = $user->ID; $post_title = xmlrpc_getposttitle($content); $post_category = xmlrpc_getpostcategory($content); $post_content = xmlrpc_removepostdata($content); $post_date = current_time('mysql'); $post_date_gmt = current_time('mysql', 1); $post_data = compact('blog_ID', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status'); $post_ID = wp_insert_post($post_data); if ( is_wp_error( $post_ID ) ) return new IXR_Error(500, $post_ID->get_error_message()); if (!$post_ID) return new IXR_Error(500, __('Sorry, your entry could not be posted. Something wrong happened.')); $this->attach_uploads( $post_ID, $post_content ); logIO('O', "Posted ! ID: $post_ID"); return $post_ID; } /* blogger.editPost ...edits a post */ function blogger_editPost($args) { $this->escape($args); $post_ID = (int) $args[1]; $user_login = $args[2]; $user_pass = $args[3]; $content = $args[4]; $publish = $args[5]; if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } do_action('xmlrpc_call', 'blogger.editPost'); $actual_post = wp_get_single_post($post_ID,ARRAY_A); if (!$actual_post) { return new IXR_Error(404, __('Sorry, no such post.')); } $this->escape($actual_post); set_current_user(0, $user_login); if ( !current_user_can('edit_post', $post_ID) ) return new IXR_Error(401, __('Sorry, you do not have the right to edit this post.')); extract($actual_post, EXTR_SKIP); if ( ('publish' == $post_status) && !current_user_can('publish_posts') ) return new IXR_Error(401, __('Sorry, you do not have the right to publish this post.')); $post_title = xmlrpc_getposttitle($content); $post_category = xmlrpc_getpostcategory($content); $post_content = xmlrpc_removepostdata($content); $postdata = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt'); $result = wp_update_post($postdata); if (!$result) { return new IXR_Error(500, __('For some strange yet very annoying reason, this post could not be edited.')); } $this->attach_uploads( $ID, $post_content ); return true; } /* blogger.deletePost ...deletes a post */ function blogger_deletePost($args) { $this->escape($args); $post_ID = (int) $args[1]; $user_login = $args[2]; $user_pass = $args[3]; $publish = $args[4]; if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } do_action('xmlrpc_call', 'blogger.deletePost'); $actual_post = wp_get_single_post($post_ID,ARRAY_A); if (!$actual_post) { return new IXR_Error(404, __('Sorry, no such post.')); } set_current_user(0, $user_login); if ( !current_user_can('edit_post', $post_ID) ) return new IXR_Error(401, __('Sorry, you do not have the right to delete this post.')); $result = wp_delete_post($post_ID); if (!$result) { return new IXR_Error(500, __('For some strange yet very annoying reason, this post could not be deleted.')); } return true; } /* MetaWeblog API functions * specs on wherever Dave Winer wants them to be */ /* metaweblog.newPost creates a post */ function mw_newPost($args) { $this->escape($args); $blog_ID = (int) $args[0]; // we will support this in the near future $user_login = $args[1]; $user_pass = $args[2]; $content_struct = $args[3]; $publish = $args[4]; if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } $user = set_current_user(0, $user_login); do_action('xmlrpc_call', 'metaWeblog.newPost'); $cap = ( $publish ) ? 'publish_posts' : 'edit_posts'; $error_message = __( 'Sorry, you are not allowed to publish posts on this blog.' ); $post_type = 'post'; $page_template = ''; if( !empty( $content_struct['post_type'] ) ) { if( $content_struct['post_type'] == 'page' ) { $cap = ( $publish ) ? 'publish_pages' : 'edit_pages'; $error_message = __( 'Sorry, you are not allowed to publish pages on this blog.' ); $post_type = 'page'; if( !empty( $content_struct['wp_page_template'] ) ) $page_template = $content_struct['wp_page_template']; } elseif( $content_struct['post_type'] == 'post' ) { // This is the default, no changes needed } else { // No other post_type values are allowed here return new IXR_Error( 401, __( 'Invalid post type.' ) ); } } if( !current_user_can( $cap ) ) { return new IXR_Error( 401, $error_message ); } // Let WordPress generate the post_name (slug) unless // one has been provided. $post_name = ""; if(isset($content_struct["wp_slug"])) { $post_name = $content_struct["wp_slug"]; } // Only use a password if one was given. if(isset($content_struct["wp_password"])) { $post_password = $content_struct["wp_password"]; } // Only set a post parent if one was provided. if(isset($content_struct["wp_page_parent_id"])) { $post_parent = $content_struct["wp_page_parent_id"]; } // Only set the menu_order if it was provided. if(isset($content_struct["wp_page_order"])) { $menu_order = $content_struct["wp_page_order"]; } $post_author = $user->ID; // If an author id was provided then use it instead. if( isset($content_struct["wp_author_id"]) && ($user->ID != $content_struct["wp_author_id"]) ) { switch($post_type) { case "post": if(!current_user_can("edit_others_posts")) { return(new IXR_Error(401, __("You are not allowed to post as this user"))); } break; case "page": if(!current_user_can("edit_others_pages")) { return(new IXR_Error(401, __("You are not allowed to create pages as this user"))); } break; default: return(new IXR_Error(401, __("Invalid post type."))); break; } $post_author = $content_struct["wp_author_id"]; } $post_title = $content_struct['title']; $post_content = apply_filters( 'content_save_pre', $content_struct['description'] ); $post_status = $publish ? 'publish' : 'draft'; if( isset( $content_struct["{$post_type}_status"] ) ) { switch( $content_struct["{$post_type}_status"] ) { case 'draft': case 'private': case 'publish': $post_status = $content_struct["{$post_type}_status"]; break; case 'pending': // Pending is only valid for posts, not pages. if( $post_type === 'post' ) { $post_status = $content_struct["{$post_type}_status"]; } break; default: $post_status = $publish ? 'publish' : 'draft'; break; } } $post_excerpt = $content_struct['mt_excerpt']; $post_more = $content_struct['mt_text_more']; $tags_input = $content_struct['mt_keywords']; if(isset($content_struct["mt_allow_comments"])) { if(!is_numeric($content_struct["mt_allow_comments"])) { switch($content_struct["mt_allow_comments"]) { case "closed": $comment_status = "closed"; break; case "open": $comment_status = "open"; break; default: $comment_status = get_option("default_comment_status"); break; } } else { switch((int) $content_struct["mt_allow_comments"]) { case 0: case 2: $comment_status = "closed"; break; case 1: $comment_status = "open"; break; default: $comment_status = get_option("default_comment_status"); break; } } } else { $comment_status = get_option("default_comment_status"); } if(isset($content_struct["mt_allow_pings"])) { if(!is_numeric($content_struct["mt_allow_pings"])) { switch($content_struct['mt_allow_pings']) { case "closed": $ping_status = "closed"; break; case "open": $ping_status = "open"; break; default: $ping_status = get_option("default_ping_status"); break; } } else { switch((int) $content_struct["mt_allow_pings"]) { case 0: $ping_status = "closed"; break; case 1: $ping_status = "open"; break; default: $ping_status = get_option("default_ping_status"); break; } } } else { $ping_status = get_option("default_ping_status"); } if ($post_more) { $post_content = $post_content . "" . $post_more; } $to_ping = $content_struct['mt_tb_ping_urls']; if ( is_array($to_ping) ) $to_ping = implode(' ', $to_ping); // Do some timestamp voodoo if ( !empty( $content_struct['date_created_gmt'] ) ) $dateCreated = str_replace( 'Z', '', $content_struct['date_created_gmt']->getIso() ) . 'Z'; // We know this is supposed to be GMT, so we're going to slap that Z on there by force elseif ( !empty( $content_struct['dateCreated']) ) $dateCreated = $content_struct['dateCreated']->getIso(); if ( !empty( $dateCreated ) ) { $post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated)); $post_date_gmt = iso8601_to_datetime($dateCreated, GMT); } else { $post_date = current_time('mysql'); $post_date_gmt = current_time('mysql', 1); } $catnames = $content_struct['categories']; logIO('O', 'Post cats: ' . var_export($catnames,true)); $post_category = array(); if (is_array($catnames)) { foreach ($catnames as $cat) { $post_category[] = get_cat_ID($cat); } } // We've got all the data -- post it: $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping', 'post_type', 'post_name', 'post_password', 'post_parent', 'menu_order', 'tags_input', 'page_template'); $post_ID = wp_insert_post($postdata, true); if ( is_wp_error( $post_ID ) ) return new IXR_Error(500, $post_ID->get_error_message()); if (!$post_ID) { return new IXR_Error(500, __('Sorry, your entry could not be posted. Something wrong happened.')); } if ( isset($content_struct['custom_fields']) ) { $this->set_custom_fields($post_ID, $content_struct['custom_fields']); } // Handle enclosures $enclosure = $content_struct['enclosure']; if( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) { add_post_meta( $post_ID, 'enclosure', $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type'] ); } $this->attach_uploads( $post_ID, $post_content ); logIO('O', "Posted ! ID: $post_ID"); return strval($post_ID); } function attach_uploads( $post_ID, $post_content ) { global $wpdb; // find any unattached files $attachments = $wpdb->get_results( "SELECT ID, guid FROM {$wpdb->posts} WHERE post_parent = '-1' AND post_type = 'attachment'" ); if( is_array( $attachments ) ) { foreach( $attachments as $file ) { if( strpos( $post_content, $file->guid ) !== false ) { $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->posts} SET post_parent = %d WHERE ID = %d", $post_ID, $file->ID) ); } } } } /* metaweblog.editPost ...edits a post */ function mw_editPost($args) { $this->escape($args); $post_ID = (int) $args[0]; $user_login = $args[1]; $user_pass = $args[2]; $content_struct = $args[3]; $publish = $args[4]; if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } $user = set_current_user(0, $user_login); do_action('xmlrpc_call', 'metaWeblog.editPost'); $cap = ( $publish ) ? 'publish_posts' : 'edit_posts'; $error_message = __( 'Sorry, you are not allowed to publish posts on this blog.' ); $post_type = 'post'; $page_template = ''; if( !empty( $content_struct['post_type'] ) ) { if( $content_struct['post_type'] == 'page' ) { $cap = ( $publish ) ? 'publish_pages' : 'edit_pages'; $error_message = __( 'Sorry, you are not allowed to publish pages on this blog.' ); $post_type = 'page'; if( !empty( $content_struct['wp_page_template'] ) ) $page_template = $content_struct['wp_page_template']; } elseif( $content_struct['post_type'] == 'post' ) { // This is the default, no changes needed } else { // No other post_type values are allowed here return new IXR_Error( 401, __( 'Invalid post type.' ) ); } } if( !current_user_can( $cap ) ) { return new IXR_Error( 401, $error_message ); } $postdata = wp_get_single_post($post_ID, ARRAY_A); // If there is no post data for the give post id, stop // now and return an error. Other wise a new post will be // created (which was the old behavior). if(empty($postdata["ID"])) { return(new IXR_Error(404, __("Invalid post id."))); } $this->escape($postdata); extract($postdata, EXTR_SKIP); // Let WordPress manage slug if none was provided. $post_name = ""; if(isset($content_struct["wp_slug"])) { $post_name = $content_struct["wp_slug"]; } // Only use a password if one was given. if(isset($content_struct["wp_password"])) { $post_password = $content_struct["wp_password"]; } // Only set a post parent if one was given. if(isset($content_struct["wp_page_parent_id"])) { $post_parent = $content_struct["wp_page_parent_id"]; } // Only set the menu_order if it was given. if(isset($content_struct["wp_page_order"])) { $menu_order = $content_struct["wp_page_order"]; } $post_author = $postdata["post_author"]; // Only set the post_author if one is set. if( isset($content_struct["wp_author_id"]) && ($user->ID != $content_struct["wp_author_id"]) ) { switch($post_type) { case "post": if(!current_user_can("edit_others_posts")) { return(new IXR_Error(401, __("You are not allowed to change the post author as this user."))); } break; case "page": if(!current_user_can("edit_others_pages")) { return(new IXR_Error(401, __("You are not allowed to change the page author as this user."))); } break; default: return(new IXR_Error(401, __("Invalid post type."))); break; } $post_author = $content_struct["wp_author_id"]; } if(isset($content_struct["mt_allow_comments"])) { if(!is_numeric($content_struct["mt_allow_comments"])) { switch($content_struct["mt_allow_comments"]) { case "closed": $comment_status = "closed"; break; case "open": $comment_status = "open"; break; default: $comment_status = get_option("default_comment_status"); break; } } else { switch((int) $content_struct["mt_allow_comments"]) { case 0: case 2: $comment_status = "closed"; break; case 1: $comment_status = "open"; break; default: $comment_status = get_option("default_comment_status"); break; } } } if(isset($content_struct["mt_allow_pings"])) { if(!is_numeric($content_struct["mt_allow_pings"])) { switch($content_struct["mt_allow_pings"]) { case "closed": $ping_status = "closed"; break; case "open": $ping_status = "open"; break; default: $ping_status = get_option("default_ping_status"); break; } } else { switch((int) $content_struct["mt_allow_pings"]) { case 0: $ping_status = "closed"; break; case 1: $ping_status = "open"; break; default: $ping_status = get_option("default_ping_status"); break; } } } $post_title = $content_struct['title']; $post_content = apply_filters( 'content_save_pre', $content_struct['description'] ); $catnames = $content_struct['categories']; $post_category = array(); if (is_array($catnames)) { foreach ($catnames as $cat) { $post_category[] = get_cat_ID($cat); } } $post_excerpt = $content_struct['mt_excerpt']; $post_more = $content_struct['mt_text_more']; $post_status = $publish ? 'publish' : 'draft'; if( isset( $content_struct["{$post_type}_status"] ) ) { switch( $content_struct["{$post_type}_status"] ) { case 'draft': case 'private': case 'publish': $post_status = $content_struct["{$post_type}_status"]; break; case 'pending': // Pending is only valid for posts, not pages. if( $post_type === 'post' ) { $post_status = $content_struct["{$post_type}_status"]; } break; default: $post_status = $publish ? 'publish' : 'draft'; break; } } $tags_input = $content_struct['mt_keywords']; if ( ('publish' == $post_status) ) { if ( ( 'page' == $post_type ) && !current_user_can('publish_pages') ) return new IXR_Error(401, __('Sorry, you do not have the right to publish this page.')); else if ( !current_user_can('publish_posts') ) return new IXR_Error(401, __('Sorry, you do not have the right to publish this post.')); } if ($post_more) { $post_content = $post_content . "" . $post_more; } $to_ping = $content_struct['mt_tb_ping_urls']; if ( is_array($to_ping) ) $to_ping = implode(' ', $to_ping); // Do some timestamp voodoo if ( !empty( $content_struct['date_created_gmt'] ) ) $dateCreated = str_replace( 'Z', '', $content_struct['date_created_gmt']->getIso() ) . 'Z'; // We know this is supposed to be GMT, so we're going to slap that Z on there by force elseif ( !empty( $content_struct['dateCreated']) ) $dateCreated = $content_struct['dateCreated']->getIso(); if ( !empty( $dateCreated ) ) { $post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated)); $post_date_gmt = iso8601_to_datetime($dateCreated, GMT); } else { $post_date = $postdata['post_date']; $post_date_gmt = $postdata['post_date_gmt']; } // We've got all the data -- post it: $newpost = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt', 'to_ping', 'post_name', 'post_password', 'post_parent', 'menu_order', 'post_author', 'tags_input', 'page_template'); $result = wp_update_post($newpost, true); if ( is_wp_error( $result ) ) return new IXR_Error(500, $result->get_error_message()); if (!$result) { return new IXR_Error(500, __('Sorry, your entry could not be edited. Something wrong happened.')); } if ( isset($content_struct['custom_fields']) ) { $this->set_custom_fields($post_ID, $content_struct['custom_fields']); } // Handle enclosures $enclosure = $content_struct['enclosure']; if( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) { add_post_meta( $post_ID, 'enclosure', $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type'] ); } $this->attach_uploads( $ID, $post_content ); logIO('O',"(MW) Edited ! ID: $post_ID"); return true; } /* metaweblog.getPost ...returns a post */ function mw_getPost($args) { $this->escape($args); $post_ID = (int) $args[0]; $user_login = $args[1]; $user_pass = $args[2]; if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } set_current_user( 0, $user_login ); if( !current_user_can( 'edit_post', $post_ID ) ) return new IXR_Error( 401, __( 'Sorry, you can not edit this post.' ) ); do_action('xmlrpc_call', 'metaWeblog.getPost'); $postdata = wp_get_single_post($post_ID, ARRAY_A); if ($postdata['post_date'] != '') { $post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date']); $post_date_gmt = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt']); $categories = array(); $catids = wp_get_post_categories($post_ID); foreach($catids as $catid) $categories[] = get_cat_name($catid); $tagnames = array(); $tags = wp_get_post_tags( $post_ID ); if ( !empty( $tags ) ) { foreach ( $tags as $tag ) $tagnames[] = $tag->name; $tagnames = implode( ', ', $tagnames ); } else { $tagnames = ''; } $post = get_extended($postdata['post_content']); $link = post_permalink($postdata['ID']); // Get the author info. $author = get_userdata($postdata['post_author']); $allow_comments = ('open' == $postdata['comment_status']) ? 1 : 0; $allow_pings = ('open' == $postdata['ping_status']) ? 1 : 0; // Consider future posts as published if( $postdata['post_status'] === 'future' ) { $postdata['post_status'] = 'publish'; } $resp = array( 'dateCreated' => new IXR_Date($post_date), 'userid' => $postdata['post_author'], 'postid' => $postdata['ID'], 'description' => $post['main'], 'title' => $postdata['post_title'], 'link' => $link, 'permaLink' => $link, // commented out because no other tool seems to use this // 'content' => $entry['post_content'], 'categories' => $categories, 'mt_excerpt' => $postdata['post_excerpt'], 'mt_text_more' => $post['extended'], 'mt_allow_comments' => $allow_comments, 'mt_allow_pings' => $allow_pings, 'mt_keywords' => $tagnames, 'wp_slug' => $postdata['post_name'], 'wp_password' => $postdata['post_password'], 'wp_author_id' => $author->ID, 'wp_author_display_name' => $author->display_name, 'date_created_gmt' => new IXR_Date($post_date_gmt), 'post_status' => $postdata['post_status'], 'custom_fields' => $this->get_custom_fields($post_ID) ); return $resp; } else { return new IXR_Error(404, __('Sorry, no such post.')); } } /* metaweblog.getRecentPosts ...returns recent posts */ function mw_getRecentPosts($args) { $this->escape($args); $blog_ID = (int) $args[0]; $user_login = $args[1]; $user_pass = $args[2]; $num_posts = (int) $args[3]; if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } do_action('xmlrpc_call', 'metaWeblog.getRecentPosts'); $posts_list = wp_get_recent_posts($num_posts); if (!$posts_list) { $this->error = new IXR_Error(500, __('Either there are no posts, or something went wrong.')); return $this->error; } set_current_user( 0, $user_login ); foreach ($posts_list as $entry) { if( !current_user_can( 'edit_post', $entry['ID'] ) ) continue; $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date']); $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt']); $categories = array(); $catids = wp_get_post_categories($entry['ID']); foreach($catids as $catid) { $categories[] = get_cat_name($catid); } $tagnames = array(); $tags = wp_get_post_tags( $entry['ID'] ); if ( !empty( $tags ) ) { foreach ( $tags as $tag ) { $tagnames[] = $tag->name; } $tagnames = implode( ', ', $tagnames ); } else { $tagnames = ''; } $post = get_extended($entry['post_content']); $link = post_permalink($entry['ID']); // Get the post author info. $author = get_userdata($entry['post_author']); $allow_comments = ('open' == $entry['comment_status']) ? 1 : 0; $allow_pings = ('open' == $entry['ping_status']) ? 1 : 0; // Consider future posts as published if( $entry['post_status'] === 'future' ) { $entry['post_status'] = 'publish'; } $struct[] = array( 'dateCreated' => new IXR_Date($post_date), 'userid' => $entry['post_author'], 'postid' => $entry['ID'], 'description' => $post['main'], 'title' => $entry['post_title'], 'link' => $link, 'permaLink' => $link, // commented out because no other tool seems to use this // 'content' => $entry['post_content'], 'categories' => $categories, 'mt_excerpt' => $entry['post_excerpt'], 'mt_text_more' => $post['extended'], 'mt_allow_comments' => $allow_comments, 'mt_allow_pings' => $allow_pings, 'mt_keywords' => $tagnames, 'wp_slug' => $entry['post_name'], 'wp_password' => $entry['post_password'], 'wp_author_id' => $author->ID, 'wp_author_display_name' => $author->display_name, 'date_created_gmt' => new IXR_Date($post_date_gmt), 'post_status' => $entry['post_status'], 'custom_fields' => $this->get_custom_fields($entry['ID']) ); } $recent_posts = array(); for ($j=0; $jescape($args); $blog_ID = (int) $args[0]; $user_login = $args[1]; $user_pass = $args[2]; if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } set_current_user( 0, $user_login ); if( !current_user_can( 'edit_posts' ) ) return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this blog in order to view categories.' ) ); do_action('xmlrpc_call', 'metaWeblog.getCategories'); $categories_struct = array(); if ( $cats = get_categories('get=all') ) { foreach ( $cats as $cat ) { $struct['categoryId'] = $cat->term_id; $struct['parentId'] = $cat->parent; $struct['description'] = $cat->name; $struct['categoryName'] = $cat->name; $struct['htmlUrl'] = wp_specialchars(get_category_link($cat->term_id)); $struct['rssUrl'] = wp_specialchars(get_category_rss_link(false, $cat->term_id, $cat->name)); $categories_struct[] = $struct; } } return $categories_struct; } /* metaweblog.newMediaObject uploads a file, following your settings */ function mw_newMediaObject($args) { // adapted from a patch by Johann Richard // http://mycvs.org/archives/2004/06/30/file-upload-to-wordpress-in-ecto/ global $wpdb; $blog_ID = (int) $args[0]; $user_login = $wpdb->escape($args[1]); $user_pass = $wpdb->escape($args[2]); $data = $args[3]; $name = sanitize_file_name( $data['name'] ); $type = $data['type']; $bits = $data['bits']; logIO('O', '(MW) Received '.strlen($bits).' bytes'); if ( !$this->login_pass_ok($user_login, $user_pass) ) return $this->error; do_action('xmlrpc_call', 'metaWeblog.newMediaObject'); set_current_user(0, $user_login); if ( !current_user_can('upload_files') ) { logIO('O', '(MW) User does not have upload_files capability'); $this->error = new IXR_Error(401, __('You are not allowed to upload files to this site.')); return $this->error; } if ( $upload_err = apply_filters( "pre_upload_error", false ) ) return new IXR_Error(500, $upload_err); if(!empty($data["overwrite"]) && ($data["overwrite"] == true)) { // Get postmeta info on the object. $old_file = $wpdb->get_row(" SELECT ID FROM {$wpdb->posts} WHERE post_title = '{$name}' AND post_type = 'attachment' "); // Delete previous file. wp_delete_attachment($old_file->ID); // Make sure the new name is different by pre-pending the // previous post id. $filename = preg_replace("/^wpid\d+-/", "", $name); $name = "wpid{$old_file->ID}-{$filename}"; } $upload = wp_upload_bits($name, $type, $bits); if ( ! empty($upload['error']) ) { $errorString = sprintf(__('Could not write file %1$s (%2$s)'), $name, $upload['error']); logIO('O', '(MW) ' . $errorString); return new IXR_Error(500, $errorString); } // Construct the attachment array // attach to post_id -1 $post_id = -1; $attachment = array( 'post_title' => $name, 'post_content' => '', 'post_type' => 'attachment', 'post_parent' => $post_id, 'post_mime_type' => $type, 'guid' => $upload[ 'url' ] ); // Save the data $id = wp_insert_attachment( $attachment, $upload[ 'file' ], $post_id ); wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $upload['file'] ) ); return apply_filters( 'wp_handle_upload', array( 'file' => $name, 'url' => $upload[ 'url' ], 'type' => $type ) ); } /* MovableType API functions * specs on http://www.movabletype.org/docs/mtmanual_programmatic.html */ /* mt.getRecentPostTitles ...returns recent posts' titles */ function mt_getRecentPostTitles($args) { $this->escape($args); $blog_ID = (int) $args[0]; $user_login = $args[1]; $user_pass = $args[2]; $num_posts = (int) $args[3]; if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } do_action('xmlrpc_call', 'mt.getRecentPostTitles'); $posts_list = wp_get_recent_posts($num_posts); if (!$posts_list) { $this->error = new IXR_Error(500, __('Either there are no posts, or something went wrong.')); return $this->error; } set_current_user( 0, $user_login ); foreach ($posts_list as $entry) { if( !current_user_can( 'edit_post', $entry['ID'] ) ) continue; $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date']); $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt']); $struct[] = array( 'dateCreated' => new IXR_Date($post_date), 'userid' => $entry['post_author'], 'postid' => $entry['ID'], 'title' => $entry['post_title'], 'date_created_gmt' => new IXR_Date($post_date_gmt) ); } $recent_posts = array(); for ($j=0; $jescape($args); $blog_ID = (int) $args[0]; $user_login = $args[1]; $user_pass = $args[2]; if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } set_current_user( 0, $user_login ); if( !current_user_can( 'edit_posts' ) ) return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this blog in order to view categories.' ) ); do_action('xmlrpc_call', 'mt.getCategoryList'); $categories_struct = array(); if ( $cats = get_categories('hide_empty=0&hierarchical=0') ) { foreach ($cats as $cat) { $struct['categoryId'] = $cat->term_id; $struct['categoryName'] = $cat->name; $categories_struct[] = $struct; } } return $categories_struct; } /* mt.getPostCategories ...returns a post's categories */ function mt_getPostCategories($args) { $this->escape($args); $post_ID = (int) $args[0]; $user_login = $args[1]; $user_pass = $args[2]; if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } set_current_user( 0, $user_login ); if( !current_user_can( 'edit_post', $post_ID ) ) return new IXR_Error( 401, __( 'Sorry, you can not edit this post.' ) ); do_action('xmlrpc_call', 'mt.getPostCategories'); $categories = array(); $catids = wp_get_post_categories(intval($post_ID)); // first listed category will be the primary category $isPrimary = true; foreach($catids as $catid) { $categories[] = array( 'categoryName' => get_cat_name($catid), 'categoryId' => (string) $catid, 'isPrimary' => $isPrimary ); $isPrimary = false; } return $categories; } /* mt.setPostCategories ...sets a post's categories */ function mt_setPostCategories($args) { $this->escape($args); $post_ID = (int) $args[0]; $user_login = $args[1]; $user_pass = $args[2]; $categories = $args[3]; if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } do_action('xmlrpc_call', 'mt.setPostCategories'); set_current_user(0, $user_login); if ( !current_user_can('edit_post', $post_ID) ) return new IXR_Error(401, __('Sorry, you can not edit this post.')); foreach($categories as $cat) { $catids[] = $cat['categoryId']; } wp_set_post_categories($post_ID, $catids); return true; } /* mt.supportedMethods ...returns an array of methods supported by this server */ function mt_supportedMethods($args) { do_action('xmlrpc_call', 'mt.supportedMethods'); $supported_methods = array(); foreach($this->methods as $key=>$value) { $supported_methods[] = $key; } return $supported_methods; } /* mt.supportedTextFilters ...returns an empty array because we don't support per-post text filters yet */ function mt_supportedTextFilters($args) { do_action('xmlrpc_call', 'mt.supportedTextFilters'); return apply_filters('xmlrpc_text_filters', array()); } /* mt.getTrackbackPings ...returns trackbacks sent to a given post */ function mt_getTrackbackPings($args) { global $wpdb; $post_ID = intval($args); do_action('xmlrpc_call', 'mt.getTrackbackPings'); $actual_post = wp_get_single_post($post_ID, ARRAY_A); if (!$actual_post) { return new IXR_Error(404, __('Sorry, no such post.')); } $comments = $wpdb->get_results( $wpdb->prepare("SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) ); if (!$comments) { return array(); } $trackback_pings = array(); foreach($comments as $comment) { if ( 'trackback' == $comment->comment_type ) { $content = $comment->comment_content; $title = substr($content, 8, (strpos($content, '') - 8)); $trackback_pings[] = array( 'pingTitle' => $title, 'pingURL' => $comment->comment_author_url, 'pingIP' => $comment->comment_author_IP ); } } return $trackback_pings; } /* mt.publishPost ...sets a post's publish status to 'publish' */ function mt_publishPost($args) { $this->escape($args); $post_ID = (int) $args[0]; $user_login = $args[1]; $user_pass = $args[2]; if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } do_action('xmlrpc_call', 'mt.publishPost'); set_current_user(0, $user_login); if ( !current_user_can('edit_post', $post_ID) ) return new IXR_Error(401, __('Sorry, you can not edit this post.')); $postdata = wp_get_single_post($post_ID,ARRAY_A); $postdata['post_status'] = 'publish'; // retain old cats $cats = wp_get_post_categories($post_ID); $postdata['post_category'] = $cats; $this->escape($postdata); $result = wp_update_post($postdata); return $result; } /* PingBack functions * specs on www.hixie.ch/specs/pingback/pingback */ /* pingback.ping gets a pingback and registers it */ function pingback_ping($args) { global $wpdb; do_action('xmlrpc_call', 'pingback.ping'); $this->escape($args); $pagelinkedfrom = $args[0]; $pagelinkedto = $args[1]; $title = ''; $pagelinkedfrom = str_replace('&', '&', $pagelinkedfrom); $pagelinkedto = str_replace('&', '&', $pagelinkedto); $pagelinkedto = str_replace('&', '&', $pagelinkedto); // Check if the page linked to is in our site $pos1 = strpos($pagelinkedto, str_replace(array('http://www.','http://','https://www.','https://'), '', get_option('home'))); if( !$pos1 ) return new IXR_Error(0, __('Is there no link to us?')); // let's find which post is linked to // FIXME: does url_to_postid() cover all these cases already? // if so, then let's use it and drop the old code. $urltest = parse_url($pagelinkedto); if ($post_ID = url_to_postid($pagelinkedto)) { $way = 'url_to_postid()'; } elseif (preg_match('#p/[0-9]{1,}#', $urltest['path'], $match)) { // the path defines the post_ID (archives/p/XXXX) $blah = explode('/', $match[0]); $post_ID = (int) $blah[1]; $way = 'from the path'; } elseif (preg_match('#p=[0-9]{1,}#', $urltest['query'], $match)) { // the querystring defines the post_ID (?p=XXXX) $blah = explode('=', $match[0]); $post_ID = (int) $blah[1]; $way = 'from the querystring'; } elseif (isset($urltest['fragment'])) { // an #anchor is there, it's either... if (intval($urltest['fragment'])) { // ...an integer #XXXX (simpliest case) $post_ID = (int) $urltest['fragment']; $way = 'from the fragment (numeric)'; } elseif (preg_match('/post-[0-9]+/',$urltest['fragment'])) { // ...a post id in the form 'post-###' $post_ID = preg_replace('/[^0-9]+/', '', $urltest['fragment']); $way = 'from the fragment (post-###)'; } elseif (is_string($urltest['fragment'])) { // ...or a string #title, a little more complicated $title = preg_replace('/[^a-z0-9]/i', '.', $urltest['fragment']); $sql = $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_title RLIKE %s", $title); if (! ($post_ID = $wpdb->get_var($sql)) ) { // returning unknown error '0' is better than die()ing return new IXR_Error(0, ''); } $way = 'from the fragment (title)'; } } else { // TODO: Attempt to extract a post ID from the given URL return new IXR_Error(33, __('The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.')); } $post_ID = (int) $post_ID; logIO("O","(PB) URL='$pagelinkedto' ID='$post_ID' Found='$way'"); $post = get_post($post_ID); if ( !$post ) // Post_ID not found return new IXR_Error(33, __('The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.')); if ( $post_ID == url_to_postid($pagelinkedfrom) ) return new IXR_Error(0, __('The source URL and the target URL cannot both point to the same resource.')); // Check if pings are on if ( 'closed' == $post->ping_status ) return new IXR_Error(33, __('The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.')); // Let's check that the remote site didn't already pingback this entry $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $post_ID, $pagelinkedfrom) ); if ( $wpdb->num_rows ) // We already have a Pingback from this URL return new IXR_Error(48, __('The pingback has already been registered.')); // very stupid, but gives time to the 'from' server to publish ! sleep(1); // Let's check the remote site $linea = wp_remote_fopen( $pagelinkedfrom ); if ( !$linea ) return new IXR_Error(16, __('The source URL does not exist.')); $linea = apply_filters('pre_remote_source', $linea, $pagelinkedto); // Work around bug in strip_tags(): $linea = str_replace(']*>/", "\n\n", $linea ); preg_match('|([^<]*?)|is', $linea, $matchtitle); $title = $matchtitle[1]; if ( empty( $title ) ) return new IXR_Error(32, __('We cannot find a title on that page.')); $linea = strip_tags( $linea, '' ); // just keep the tag we need $p = explode( "\n\n", $linea ); $preg_target = preg_quote($pagelinkedto); foreach ( $p as $para ) { if ( strpos($para, $pagelinkedto) !== false ) { // it exists, but is it a link? preg_match("|]+?".$preg_target."[^>]*>([^>]+?)|", $para, $context); // If the URL isn't in a link context, keep looking if ( empty($context) ) continue; // We're going to use this fake tag to mark the context in a bit // the marker is needed in case the link text appears more than once in the paragraph $excerpt = preg_replace('|\|', '', $para); // prevent really long link text if ( strlen($context[1]) > 100 ) $context[1] = substr($context[1], 0, 100) . '...'; $marker = ''.$context[1].''; // set up our marker $excerpt= str_replace($context[0], $marker, $excerpt); // swap out the link for our marker $excerpt = strip_tags($excerpt, ''); // strip all tags but our context marker $excerpt = trim($excerpt); $preg_marker = preg_quote($marker); $excerpt = preg_replace("|.*?\s(.{0,100}$preg_marker.{0,100})\s.*|s", '$1', $excerpt); $excerpt = strip_tags($excerpt); // YES, again, to remove the marker wrapper break; } } if ( empty($context) ) // Link to target not found return new IXR_Error(17, __('The source URL does not contain a link to the target URL, and so cannot be used as a source.')); $pagelinkedfrom = str_replace('&', '&', $pagelinkedfrom); $context = '[...] ' . wp_specialchars( $excerpt ) . ' [...]'; $pagelinkedfrom = $wpdb->escape( $pagelinkedfrom ); $comment_post_ID = (int) $post_ID; $comment_author = $title; $this->escape($comment_author); $comment_author_url = $pagelinkedfrom; $comment_content = $context; $this->escape($comment_content); $comment_type = 'pingback'; $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_content', 'comment_type'); $comment_ID = wp_new_comment($commentdata); do_action('pingback_post', $comment_ID); return sprintf(__('Pingback from %1$s to %2$s registered. Keep the web talking! :-)'), $pagelinkedfrom, $pagelinkedto); } /* pingback.extensions.getPingbacks returns an array of URLs that pingbacked the given URL specs on http://www.aquarionics.com/misc/archives/blogite/0198.html */ function pingback_extensions_getPingbacks($args) { global $wpdb; do_action('xmlrpc_call', 'pingback.extensions.getPingsbacks'); $this->escape($args); $url = $args; $post_ID = url_to_postid($url); if (!$post_ID) { // We aren't sure that the resource is available and/or pingback enabled return new IXR_Error(33, __('The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.')); } $actual_post = wp_get_single_post($post_ID, ARRAY_A); if (!$actual_post) { // No such post = resource not found return new IXR_Error(32, __('The specified target URL does not exist.')); } $comments = $wpdb->get_results( $wpdb->prepare("SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) ); if (!$comments) { return array(); } $pingbacks = array(); foreach($comments as $comment) { if ( 'pingback' == $comment->comment_type ) $pingbacks[] = $comment->comment_author_url; } return $pingbacks; } } $wp_xmlrpc_server = new wp_xmlrpc_server(); ?> wp/dev/wp-rdf.php0000644000106600010660000000073111016305267011114 0ustar wp/dev/wp-login.php0000644000106600010660000004542311041657025011460 0ustar element. * @param string $message Optional. Message to display in header. * @param WP_Error $wp_error Optional. WordPress Error Object */ function login_header($title = 'Login', $message = '', $wp_error = '') { global $error; if ( empty($wp_error) ) $wp_error = new WP_Error(); ?> > <?php bloginfo('name'); ?> › <?php echo $title; ?>

    add('error', $error); unset($error); } if ( $wp_error->get_error_code() ) { $errors = ''; $messages = ''; foreach ( $wp_error->get_error_codes() as $code ) { $severity = $wp_error->get_error_data($code); foreach ( $wp_error->get_error_messages($code) as $error ) { if ( 'message' == $severity ) $messages .= ' ' . $error . "
    \n"; else $errors .= ' ' . $error . "
    \n"; } } if ( !empty($errors) ) echo '
    ' . apply_filters('login_errors', $errors) . "
    \n"; if ( !empty($messages) ) echo '

    ' . apply_filters('login_messages', $messages) . "

    \n"; } } // End of login_header() /** * retrieve_password() - Handles sending password retrieval email to user * * {@internal Missing Long Description}} * * @uses $wpdb WordPress Database object * * @return bool|WP_Error True: when finish. WP_Error on error */ function retrieve_password() { global $wpdb; $errors = new WP_Error(); if ( empty( $_POST['user_login'] ) && empty( $_POST['user_email'] ) ) $errors->add('empty_username', __('ERROR: Enter a username or e-mail address.')); if ( strstr($_POST['user_login'], '@') ) { $user_data = get_user_by_email(trim($_POST['user_login'])); if ( empty($user_data) ) $errors->add('invalid_email', __('ERROR: There is no user registered with that email address.')); } else { $login = trim($_POST['user_login']); $user_data = get_userdatabylogin($login); } do_action('lostpassword_post'); if ( $errors->get_error_code() ) return $errors; if ( !$user_data ) { $errors->add('invalidcombo', __('ERROR: Invalid username or e-mail.')); return $errors; } // redefining user_login ensures we return the right case in the email $user_login = $user_data->user_login; $user_email = $user_data->user_email; do_action('retreive_password', $user_login); // Misspelled and deprecated do_action('retrieve_password', $user_login); $allow = apply_filters('allow_password_reset', true, $user_data->ID); if ( ! $allow ) return new WP_Error('no_password_reset', __('Password reset is not allowed for this user')); else if ( is_wp_error($allow) ) return $allow; $key = $wpdb->get_var($wpdb->prepare("SELECT user_activation_key FROM $wpdb->users WHERE user_login = %s", $user_login)); if ( empty($key) ) { // Generate something random for a key... $key = wp_generate_password(20, false); do_action('retrieve_password_key', $user_login, $key); // Now insert the new md5 key into the db $wpdb->query($wpdb->prepare("UPDATE $wpdb->users SET user_activation_key = %s WHERE user_login = %s", $key, $user_login)); } $message = __('Someone has asked to reset the password for the following site and username.') . "\r\n\r\n"; $message .= get_option('siteurl') . "\r\n\r\n"; $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n"; $message .= __('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.') . "\r\n\r\n"; $message .= site_url("wp-login.php?action=rp&key=$key", 'login') . "\r\n"; if ( !wp_mail($user_email, sprintf(__('[%s] Password Reset'), get_option('blogname')), $message) ) die('

    ' . __('The e-mail could not be sent.') . "
    \n" . __('Possible reason: your host may have disabled the mail() function...') . '

    '); return true; } /** * reset_password() - Handles resetting the user's password * * {@internal Missing Long Description}} * * @uses $wpdb WordPress Database object * * @param string $key Hash to validate sending user's password * @return bool|WP_Error */ function reset_password($key) { global $wpdb; $key = preg_replace('/[^a-z0-9]/i', '', $key); if ( empty( $key ) ) return new WP_Error('invalid_key', __('Invalid key')); $user = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->users WHERE user_activation_key = %s", $key)); if ( empty( $user ) ) return new WP_Error('invalid_key', __('Invalid key')); do_action('password_reset', $user); // Generate something random for a password... $new_pass = wp_generate_password(); wp_set_password($new_pass, $user->ID); $message = sprintf(__('Username: %s'), $user->user_login) . "\r\n"; $message .= sprintf(__('Password: %s'), $new_pass) . "\r\n"; $message .= site_url('wp-login.php', 'login') . "\r\n"; if ( !wp_mail($user->user_email, sprintf(__('[%s] Your new password'), get_option('blogname')), $message) ) die('

    ' . __('The e-mail could not be sent.') . "
    \n" . __('Possible reason: your host may have disabled the mail() function...') . '

    '); // send a copy of password change notification to the admin // but check to see if it's the admin whose password we're changing, and skip this if ( $user->user_email != get_option('admin_email') ) { $message = sprintf(__('Password Lost and Changed for user: %s'), $user->user_login) . "\r\n"; wp_mail(get_option('admin_email'), sprintf(__('[%s] Password Lost/Changed'), get_option('blogname')), $message); } return true; } /** * register_new_user() - Handles registering a new user * * {@internal Missing Long Description}} * * @param string $user_login User's username for logging in * @param string $user_email User's email address to send password and add * @return int|WP_Error Either user's ID or error on failure. */ function register_new_user($user_login, $user_email) { $errors = new WP_Error(); $user_login = sanitize_user( $user_login ); $user_email = apply_filters( 'user_registration_email', $user_email ); // Check the username if ( $user_login == '' ) $errors->add('empty_username', __('ERROR: Please enter a username.')); elseif ( !validate_username( $user_login ) ) { $errors->add('invalid_username', __('ERROR: This username is invalid. Please enter a valid username.')); $user_login = ''; } elseif ( username_exists( $user_login ) ) $errors->add('username_exists', __('ERROR: This username is already registered, please choose another one.')); // Check the e-mail address if ($user_email == '') { $errors->add('empty_email', __('ERROR: Please type your e-mail address.')); } elseif ( !is_email( $user_email ) ) { $errors->add('invalid_email', __('ERROR: The email address isn’t correct.')); $user_email = ''; } elseif ( email_exists( $user_email ) ) $errors->add('email_exists', __('ERROR: This email is already registered, please choose another one.')); do_action('register_post', $user_login, $user_email, $errors); $errors = apply_filters( 'registration_errors', $errors ); if ( $errors->get_error_code() ) return $errors; $user_pass = wp_generate_password(); $user_id = wp_create_user( $user_login, $user_pass, $user_email ); if ( !$user_id ) { $errors->add('registerfail', sprintf(__('ERROR: Couldn’t register you... please contact the webmaster !'), get_option('admin_email'))); return $errors; } wp_new_user_notification($user_id, $user_pass); return $user_id; } // // Main // $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; $errors = new WP_Error(); if ( isset($_GET['key']) ) $action = 'resetpass'; nocache_headers(); header('Content-Type: '.get_bloginfo('html_type').'; charset='.get_bloginfo('charset')); if ( defined('RELOCATE') ) { // Move flag is set if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) ) $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] ); $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; if ( dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_option('siteurl') ) update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) ); } //Set a cookie now to see if they are supported by the browser. setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN); if ( SITECOOKIEPATH != COOKIEPATH ) setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN); $http_post = ('POST' == $_SERVER['REQUEST_METHOD']); switch ($action) { case 'logout' : wp_logout(); $redirect_to = 'wp-login.php?loggedout=true'; if ( isset( $_REQUEST['redirect_to'] ) ) $redirect_to = $_REQUEST['redirect_to']; wp_safe_redirect($redirect_to); exit(); break; case 'lostpassword' : case 'retrievepassword' : if ( $http_post ) { $errors = retrieve_password(); if ( !is_wp_error($errors) ) { wp_redirect('wp-login.php?checkemail=confirm'); exit(); } } if ( 'invalidkey' == $_GET['error'] ) $errors->add('invalidkey', __('Sorry, that key does not appear to be valid.')); do_action('lost_password'); login_header(__('Lost Password'), '

    ' . __('Please enter your username or e-mail address. You will receive a new password via e-mail.') . '

    ', $errors); ?>

    ' . __('Register For This Site') . '

    ', $errors); ?>

    has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' ) ) $redirect_to = admin_url('profile.php'); wp_safe_redirect($redirect_to); exit(); } $errors = $user; // Clear errors if loggedout is set. if ( !empty($_GET['loggedout']) ) $errors = new WP_Error(); // If cookies are disabled we can't log in even with a valid user+pass if ( isset($_POST['testcookie']) && empty($_COOKIE[TEST_COOKIE]) ) $errors->add('test_cookie', __("ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.")); // Some parts of this script use the main login form to display a message if ( isset($_GET['loggedout']) && TRUE == $_GET['loggedout'] ) $errors->add('loggedout', __('You are now logged out.'), 'message'); elseif ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] ) $errors->add('registerdiabled', __('User registration is currently not allowed.')); elseif ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] ) $errors->add('confirm', __('Check your e-mail for the confirmation link.'), 'message'); elseif ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] ) $errors->add('newpass', __('Check your e-mail for your new password.'), 'message'); elseif ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message'); login_header(__('Login'), '', $errors); ?>

     

    wp/dev/wp-comments-post.php0000644000106600010660000000602311027014610013140 0ustar get_row( $wpdb->prepare("SELECT post_status, comment_status FROM $wpdb->posts WHERE ID = %d", $comment_post_ID) ); if ( empty($status->comment_status) ) { do_action('comment_id_not_found', $comment_post_ID); exit; } elseif ( !comments_open($comment_post_ID) ) { do_action('comment_closed', $comment_post_ID); wp_die( __('Sorry, comments are closed for this item.') ); } elseif ( in_array($status->post_status, array('draft', 'pending') ) ) { do_action('comment_on_draft', $comment_post_ID); exit; } $comment_author = trim(strip_tags($_POST['author'])); $comment_author_email = trim($_POST['email']); $comment_author_url = trim($_POST['url']); $comment_content = trim($_POST['comment']); // If the user is logged in $user = wp_get_current_user(); if ( $user->ID ) { $comment_author = $wpdb->escape($user->display_name); $comment_author_email = $wpdb->escape($user->user_email); $comment_author_url = $wpdb->escape($user->user_url); if ( current_user_can('unfiltered_html') ) { if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $_POST['_wp_unfiltered_html_comment'] ) { kses_remove_filters(); // start with a clean slate kses_init_filters(); // set up the filters } } } else { if ( get_option('comment_registration') ) wp_die( __('Sorry, you must be logged in to post a comment.') ); } $comment_type = ''; if ( get_option('require_name_email') && !$user->ID ) { if ( 6 > strlen($comment_author_email) || '' == $comment_author ) wp_die( __('Error: please fill the required fields (name, email).') ); elseif ( !is_email($comment_author_email)) wp_die( __('Error: please enter a valid email address.') ); } if ( '' == $comment_content ) wp_die( __('Error: please type a comment.') ); $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'user_ID'); $comment_id = wp_new_comment( $commentdata ); $comment = get_comment($comment_id); if ( !$user->ID ) { setcookie('comment_author_' . COOKIEHASH, $comment->comment_author, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); setcookie('comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); setcookie('comment_author_url_' . COOKIEHASH, clean_url($comment->comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); } $location = ( empty($_POST['redirect_to']) ? get_permalink($comment_post_ID) : $_POST['redirect_to'] ) . '#comment-' . $comment_id; $location = apply_filters('comment_post_redirect', $location, $comment); wp_redirect($location); ?> wp/dev/wp-settings.php0000644000106600010660000004142411046175113012203 0ustar $v ) if ( !in_array($k, $noUnset) && isset($GLOBALS[$k]) ) { $GLOBALS[$k] = NULL; unset($GLOBALS[$k]); } } wp_unregister_GLOBALS(); unset( $wp_filter, $cache_lastcommentmodified, $cache_lastpostdate ); /** * The $blog_id global, which you can change in the config allows you to create a simple * multiple blog installation using just one WordPress and changing $blog_id around. * * @global int $blog_id * @since 2.0.0 */ if ( ! isset($blog_id) ) $blog_id = 1; // Fix for IIS, which doesn't set REQUEST_URI if ( empty( $_SERVER['REQUEST_URI'] ) ) { // IIS Mod-Rewrite if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) { $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL']; } // IIS Isapi_Rewrite else if (isset($_SERVER['HTTP_X_REWRITE_URL'])) { $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL']; } else { // Use ORIG_PATH_INFO if there is no PATH_INFO if ( !isset($_SERVER['PATH_INFO']) && isset($_SERVER['ORIG_PATH_INFO']) ) $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO']; // Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice) if ( isset($_SERVER['PATH_INFO']) ) { if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] ) $_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO']; else $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO']; } // Append the query string if it exists and isn't null if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) { $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; } } } // Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests if ( isset($_SERVER['SCRIPT_FILENAME']) && ( strpos($_SERVER['SCRIPT_FILENAME'], 'php.cgi') == strlen($_SERVER['SCRIPT_FILENAME']) - 7 ) ) $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED']; // Fix for Dreamhost and other PHP as CGI hosts if (strpos($_SERVER['SCRIPT_NAME'], 'php.cgi') !== false) unset($_SERVER['PATH_INFO']); // Fix empty PHP_SELF $PHP_SELF = $_SERVER['PHP_SELF']; if ( empty($PHP_SELF) ) $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]); if ( version_compare( '4.3', phpversion(), '>' ) ) { die( sprintf( /*WP_I18N_OLD_PHP*/'Your server is running PHP version %s but WordPress requires at least 4.3.'/*/WP_I18N_OLD_PHP*/, php_version() ) ); } if ( !defined('WP_CONTENT_DIR') ) define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down if ( !extension_loaded('mysql') && !file_exists(WP_CONTENT_DIR . '/db.php') ) die( /*WP_I18N_OLD_MYSQL*/'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.'/*/WP_I18N_OLD_MYSQL*/ ); /** * timer_start() - PHP 4 standard microtime start capture * * @access private * @since 0.71 * @global int $timestart Seconds and Microseconds added together from when function is called * @return bool Always returns true */ function timer_start() { global $timestart; $mtime = explode(' ', microtime() ); $mtime = $mtime[1] + $mtime[0]; $timestart = $mtime; return true; } /** * timer_stop() - Return and/or display the time from the page start to when function is called. * * You can get the results and print them by doing: * * $nTimePageTookToExecute = timer_stop(); * echo $nTimePageTookToExecute; * * * Or instead, you can do: * * timer_stop(1); * * which will do what the above does. If you need the result, you can assign it to a variable, but * most cases, you only need to echo it. * * @since 0.71 * @global int $timestart Seconds and Microseconds added together from when timer_start() is called * @global int $timeend Seconds and Microseconds added together from when function is called * * @param int $display Use '0' or null to not echo anything and 1 to echo the total time * @param int $precision The amount of digits from the right of the decimal to display. Default is 3. * @return float The "second.microsecond" finished time calculation */ function timer_stop($display = 0, $precision = 3) { //if called like timer_stop(1), will echo $timetotal global $timestart, $timeend; $mtime = microtime(); $mtime = explode(' ',$mtime); $mtime = $mtime[1] + $mtime[0]; $timeend = $mtime; $timetotal = $timeend-$timestart; $r = ( function_exists('number_format_i18n') ) ? number_format_i18n($timetotal, $precision) : number_format($timetotal, $precision); if ( $display ) echo $r; return $r; } timer_start(); // Add define('WP_DEBUG',true); to wp-config.php to enable display of notices during development. if (defined('WP_DEBUG') and WP_DEBUG == true) { error_reporting(E_ALL); } else { error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE); } // For an advanced caching plugin to use, static because you would only want one if ( defined('WP_CACHE') ) @include WP_CONTENT_DIR . '/advanced-cache.php'; /** * Stores the location of the WordPress directory of functions, classes, and core content. * * @since 1.0.0 */ define('WPINC', 'wp-includes'); if ( !defined('WP_LANG_DIR') ) { /** * Stores the location of the language directory. First looks for language folder in WP_CONTENT_DIR * and uses that folder if it exists. Or it uses the "languages" folder in WPINC. * * @since 2.1.0 */ if ( file_exists(WP_CONTENT_DIR . '/languages') && @is_dir(WP_CONTENT_DIR . '/languages') ) { define('WP_LANG_DIR', WP_CONTENT_DIR . '/languages'); // no leading slash, no trailing slash, full path, not relative to ABSPATH if (!defined('LANGDIR')) { // Old static relative path maintained for limited backwards compatibility - won't work in some cases define('LANGDIR', 'wp-content/languages'); } } else { define('WP_LANG_DIR', ABSPATH . WPINC . '/languages'); // no leading slash, no trailing slash, full path, not relative to ABSPATH if (!defined('LANGDIR')) { // Old relative path maintained for backwards compatibility define('LANGDIR', WPINC . '/languages'); } } } require (ABSPATH . WPINC . '/compat.php'); require (ABSPATH . WPINC . '/functions.php'); require (ABSPATH . WPINC . '/classes.php'); require_wp_db(); if ( !empty($wpdb->error) ) dead_db(); $prefix = $wpdb->set_prefix($table_prefix); if ( is_wp_error($prefix) ) wp_die(/*WP_I18N_BAD_PREFIX*/'ERROR: $table_prefix in wp-config.php can only contain numbers, letters, and underscores.'/*/WP_I18N_BAD_PREFIX*/); if ( file_exists(WP_CONTENT_DIR . '/object-cache.php') ) require_once (WP_CONTENT_DIR . '/object-cache.php'); else require_once (ABSPATH . WPINC . '/cache.php'); wp_cache_init(); if ( function_exists('wp_cache_add_global_groups') ) { wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta')); wp_cache_add_non_persistent_groups(array( 'comment', 'counts', 'plugins' )); } require (ABSPATH . WPINC . '/plugin.php'); require (ABSPATH . WPINC . '/default-filters.php'); include_once(ABSPATH . WPINC . '/streams.php'); include_once(ABSPATH . WPINC . '/gettext.php'); require_once (ABSPATH . WPINC . '/l10n.php'); if ( !is_blog_installed() && (strpos($_SERVER['PHP_SELF'], 'install.php') === false && !defined('WP_INSTALLING')) ) { if ( defined('WP_SITEURL') ) $link = WP_SITEURL . '/wp-admin/install.php'; elseif (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $link = preg_replace('|/wp-admin/?.*?$|', '/', $_SERVER['PHP_SELF']) . 'wp-admin/install.php'; else $link = preg_replace('|/[^/]+?$|', '/', $_SERVER['PHP_SELF']) . 'wp-admin/install.php'; require_once(ABSPATH . WPINC . '/kses.php'); require_once(ABSPATH . WPINC . '/pluggable.php'); wp_redirect($link); die(); // have to die here ~ Mark } require (ABSPATH . WPINC . '/formatting.php'); require (ABSPATH . WPINC . '/capabilities.php'); require (ABSPATH . WPINC . '/query.php'); require (ABSPATH . WPINC . '/theme.php'); require (ABSPATH . WPINC . '/user.php'); require (ABSPATH . WPINC . '/general-template.php'); require (ABSPATH . WPINC . '/link-template.php'); require (ABSPATH . WPINC . '/author-template.php'); require (ABSPATH . WPINC . '/post.php'); require (ABSPATH . WPINC . '/post-template.php'); require (ABSPATH . WPINC . '/category.php'); require (ABSPATH . WPINC . '/category-template.php'); require (ABSPATH . WPINC . '/comment.php'); require (ABSPATH . WPINC . '/comment-template.php'); require (ABSPATH . WPINC . '/rewrite.php'); require (ABSPATH . WPINC . '/feed.php'); require (ABSPATH . WPINC . '/bookmark.php'); require (ABSPATH . WPINC . '/bookmark-template.php'); require (ABSPATH . WPINC . '/kses.php'); require (ABSPATH . WPINC . '/cron.php'); require (ABSPATH . WPINC . '/version.php'); require (ABSPATH . WPINC . '/deprecated.php'); require (ABSPATH . WPINC . '/script-loader.php'); require (ABSPATH . WPINC . '/taxonomy.php'); require (ABSPATH . WPINC . '/update.php'); require (ABSPATH . WPINC . '/canonical.php'); require (ABSPATH . WPINC . '/shortcodes.php'); require (ABSPATH . WPINC . '/media.php'); if ( !defined('WP_CONTENT_URL') ) define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up /** * Allows for the plugins directory to be moved from the default location. * * @since 2.6 */ if ( !defined('WP_PLUGIN_DIR') ) define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // full path, no trailing slash if ( !defined('WP_PLUGIN_URL') ) define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); // full url, no trailing slash if ( !defined('PLUGINDIR') ) define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat. if ( ! defined('WP_INSTALLING') ) { // Used to guarantee unique hash cookies $cookiehash = md5(get_option('siteurl')); /** * Used to guarantee unique hash cookies * @since 1.5 */ define('COOKIEHASH', $cookiehash); } /** * Should be exactly the same as the default value of SECRET_KEY in wp-config-sample.php * @since 2.5 */ $wp_default_secret_key = 'put your unique phrase here'; /** * It is possible to define this in wp-config.php * @since 2.0.0 */ if ( !defined('USER_COOKIE') ) define('USER_COOKIE', 'wordpressuser_' . COOKIEHASH); /** * It is possible to define this in wp-config.php * @since 2.0.0 */ if ( !defined('PASS_COOKIE') ) define('PASS_COOKIE', 'wordpresspass_' . COOKIEHASH); /** * It is possible to define this in wp-config.php * @since 2.5 */ if ( !defined('AUTH_COOKIE') ) define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH); /** * It is possible to define this in wp-config.php * @since 2.6 */ if ( !defined('SECURE_AUTH_COOKIE') ) define('SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH); /** * It is possible to define this in wp-config.php * @since 2.6 */ if ( !defined('LOGGED_IN_COOKIE') ) define('LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH); /** * It is possible to define this in wp-config.php * @since 2.3.0 */ if ( !defined('TEST_COOKIE') ) define('TEST_COOKIE', 'wordpress_test_cookie'); /** * It is possible to define this in wp-config.php * @since 1.2.0 */ if ( !defined('COOKIEPATH') ) define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) ); /** * It is possible to define this in wp-config.php * @since 1.5.0 */ if ( !defined('SITECOOKIEPATH') ) define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) ); /** * It is possible to define this in wp-config.php * @since 2.6 */ if ( !defined('ADMIN_COOKIE_PATH') ) define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' ); /** * It is possible to define this in wp-config.php * @since 2.6 */ if ( !defined('PLUGINS_COOKIE_PATH') ) define( 'PLUGINS_COOKIE_PATH', preg_replace('|https?://[^/]+|i', '', WP_PLUGIN_URL) ); /** * It is possible to define this in wp-config.php * @since 2.0.0 */ if ( !defined('COOKIE_DOMAIN') ) define('COOKIE_DOMAIN', false); /** * It is possible to define this in wp-config.php * @since 2.6 */ if ( !defined('FORCE_SSL_ADMIN') ) define('FORCE_SSL_ADMIN', false); force_ssl_admin(FORCE_SSL_ADMIN); /** * It is possible to define this in wp-config.php * @since 2.6 */ if ( !defined('FORCE_SSL_LOGIN') ) define('FORCE_SSL_LOGIN', false); force_ssl_login(FORCE_SSL_LOGIN); /** * It is possible to define this in wp-config.php * @since 2.5.0 */ if ( !defined( 'AUTOSAVE_INTERVAL' ) ) define( 'AUTOSAVE_INTERVAL', 60 ); require (ABSPATH . WPINC . '/vars.php'); // Check for hacks file if the option is enabled if (get_option('hack_file')) { if (file_exists(ABSPATH . 'my-hacks.php')) require(ABSPATH . 'my-hacks.php'); } if ( get_option('active_plugins') ) { $current_plugins = get_option('active_plugins'); if ( is_array($current_plugins) ) { foreach ($current_plugins as $plugin) { if ( '' != $plugin && 0 == validate_file($plugin) && file_exists(WP_PLUGIN_DIR . '/' . $plugin) ) include_once(WP_PLUGIN_DIR . '/' . $plugin); } } } require (ABSPATH . WPINC . '/pluggable.php'); /* * In most cases the default internal encoding is latin1, which is of no use, * since we want to use the mb_ functions for utf-8 strings */ if (function_exists('mb_internal_encoding')) { if (!@mb_internal_encoding(get_option('blog_charset'))) mb_internal_encoding('UTF-8'); } if ( defined('WP_CACHE') && function_exists('wp_cache_postload') ) wp_cache_postload(); do_action('plugins_loaded'); $default_constants = array( 'WP_POST_REVISIONS' => true ); foreach ( $default_constants as $c => $v ) @define( $c, $v ); // will fail if the constant is already defined unset($default_constants, $c, $v); // If already slashed, strip. if ( get_magic_quotes_gpc() ) { $_GET = stripslashes_deep($_GET ); $_POST = stripslashes_deep($_POST ); $_COOKIE = stripslashes_deep($_COOKIE); } // Escape with wpdb. $_GET = add_magic_quotes($_GET ); $_POST = add_magic_quotes($_POST ); $_COOKIE = add_magic_quotes($_COOKIE); $_SERVER = add_magic_quotes($_SERVER); do_action('sanitize_comment_cookies'); /** * WordPress Query object * @global object $wp_the_query * @since 2.0.0 */ $wp_the_query =& new WP_Query(); /** * Holds the reference to @see $wp_the_query * Use this global for WordPress queries * @global object $wp_query * @since 1.5.0 */ $wp_query =& $wp_the_query; /** * Holds the WordPress Rewrite object for creating pretty URLs * @global object $wp_rewrite * @since 1.5.0 */ $wp_rewrite =& new WP_Rewrite(); /** * WordPress Object * @global object $wp * @since 2.0.0 */ $wp =& new WP(); do_action('setup_theme'); /** * Web Path to the current active template directory * @since 1.5 */ define('TEMPLATEPATH', get_template_directory()); /** * Web Path to the current active template stylesheet directory * @since 2.1 */ define('STYLESHEETPATH', get_stylesheet_directory()); // Load the default text localization domain. load_default_textdomain(); /** * The locale of the blog * @since 1.5.0 */ $locale = get_locale(); $locale_file = WP_LANG_DIR . "/$locale.php"; if ( is_readable($locale_file) ) require_once($locale_file); // Pull in locale data after loading text domain. require_once(ABSPATH . WPINC . '/locale.php'); /** * WordPress Locale object for loading locale domain date and various strings. * @global object $wp_locale * @since 2.1.0 */ $wp_locale =& new WP_Locale(); // Load functions for active theme. if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists(STYLESHEETPATH . '/functions.php') ) include(STYLESHEETPATH . '/functions.php'); if ( file_exists(TEMPLATEPATH . '/functions.php') ) include(TEMPLATEPATH . '/functions.php'); /** * shutdown_action_hook() - Runs just before PHP shuts down execution. * * @access private * @since 1.2 */ function shutdown_action_hook() { do_action('shutdown'); wp_cache_close(); } register_shutdown_function('shutdown_action_hook'); $wp->init(); // Sets up current user. // Everything is loaded and initialized. do_action('init'); ?> wp/dev/wp-atom.php0000644000106600010660000000105311016305267011277 0ustar wp/dev/index2.php0000644000106600010660000000061511016346411011103 0ustar wp/dev/wp-config.php0000644000106600010660000000156311063620261011606 0ustar wp/dev/wp-load.php0000644000106600010660000000363611027741773011277 0ustar wp-config.php file. I need this before we can get started. Need more help? We got it. You can create a wp-config.php file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.

    Create a Configuration File"/*/WP_I18N_NO_CONFIG*/, $path), /*WP_I18N_ERROR_TITLE*/"WordPress › Error"/*/WP_I18N_ERROR_TITLE*/); } ?> wp/dev/wp-rss2.php0000644000106600010660000000105311016305267011230 0ustar wp/dev/wp-register.php0000644000106600010660000000047411016305267012171 0ustar wp/dev/wp-includes/0000755000106600010660000000000011051167752011441 5ustar wp/dev/wp-includes/author-template.php0000644000106600010660000003353311027014610015257 0ustar display_name); } /** * Display the name of the author of the current post. * * The behavior of this function is based off of old functionality predating * get_the_author(). This function is not deprecated, but is designed to echo * the value from get_the_author() and as an result of any old theme that might * still use the old behavior will also pass the value from get_the_author(). * * The normal, expected behavior of this function is to echo the author and not * return it. However, backwards compatiability has to be maintained. * * @since 0.71 * @see get_the_author() * @link http://codex.wordpress.org/Template_Tags/the_author * * @param string $deprecated Deprecated. * @param string $deprecated_echo Echo the string or return it. * @return string The author's display name, from get_the_author(). */ function the_author($deprecated = '', $deprecated_echo = true) { if ( $deprecated_echo ) echo get_the_author(); return get_the_author(); } /** * Retrieve the description of the author of the current post. * * @since 1.5 * @uses $authordata The current author's DB object. * @return string The author's description. */ function get_the_author_description() { global $authordata; return $authordata->description; } /** * Display the description of the author of the current post. * * @link http://codex.wordpress.org/Template_Tags/the_author_description * @since 1.0.0 * @see get_the_author_description() */ function the_author_description() { echo get_the_author_description(); } /** * Retrieve the login name of the author of the current post. * * @since 1.5 * @uses $authordata The current author's DB object. * @return string The author's login name (username). */ function get_the_author_login() { global $authordata; return $authordata->user_login; } /** * Display the login name of the author of the current post. * * @link http://codex.wordpress.org/Template_Tags/the_author_login * @since 0.71 * @see get_the_author_login() */ function the_author_login() { echo get_the_author_login(); } /** * Retrieve the first name of the author of the current post. * * @since 1.5 * @uses $authordata The current author's DB object. * @return string The author's first name. */ function get_the_author_firstname() { global $authordata; return $authordata->first_name; } /** * Display the first name of the author of the current post. * * @link http://codex.wordpress.org/Template_Tags/the_author_firstname * @since 0.71 * @uses get_the_author_firstname() */ function the_author_firstname() { echo get_the_author_firstname(); } /** * Retrieve the last name of the author of the current post. * * @since 1.5 * @uses $authordata The current author's DB object. * @return string The author's last name. */ function get_the_author_lastname() { global $authordata; return $authordata->last_name; } /** * Display the last name of the author of the current post. * * @link http://codex.wordpress.org/Template_Tags/the_author_lastname * @since 0.71 * @uses get_the_author_lastname() */ function the_author_lastname() { echo get_the_author_lastname(); } /** * Retrieve the nickname of the author of the current post. * * @since 1.5 * @uses $authordata The current author's DB object. * @return string The author's nickname. */ function get_the_author_nickname() { global $authordata; return $authordata->nickname; } /** * Display the nickname of the author of the current post. * * @link http://codex.wordpress.org/Template_Tags/the_author_nickname * @since 0.71 * @uses get_the_author_nickname() */ function the_author_nickname() { echo get_the_author_nickname(); } /** * Retrieve the ID of the author of the current post. * * @since 1.5 * @uses $authordata The current author's DB object. * @return int The author's ID. */ function get_the_author_ID() { global $authordata; return (int) $authordata->ID; } /** * Display the ID of the author of the current post. * * @link http://codex.wordpress.org/Template_Tags/the_author_ID * @since 0.71 * @uses get_the_author_ID() */ function the_author_ID() { echo get_the_author_id(); } /** * Retrieve the email of the author of the current post. * * @since 1.5 * @uses $authordata The current author's DB object. * @return string The author's username. */ function get_the_author_email() { global $authordata; return $authordata->user_email; } /** * Display the email of the author of the current post. * * @link http://codex.wordpress.org/Template_Tags/the_author_email * @since 0.71 * @uses get_the_author_email() */ function the_author_email() { echo apply_filters('the_author_email', get_the_author_email() ); } /** * Retrieve the URL to the home page of the author of the current post. * * @since 1.5 * @uses $authordata The current author's DB object. * @return string The URL to the author's page. */ function get_the_author_url() { global $authordata; if ( 'http://' == $authordata->user_url ) return ''; return $authordata->user_url; } /** * Display the URL to the home page of the author of the current post. * * @link http://codex.wordpress.org/Template_Tags/the_author_url * @since 0.71 * @uses get_the_author_url() */ function the_author_url() { echo get_the_author_url(); } /** * Display either author's link or author's name. * * If the author has a home page set, echo an HTML link, otherwise just echo the * author's name. * * @link http://codex.wordpress.org/Template_Tags/the_author_link * @since 2.1 * @uses get_the_author_url() * @uses the_author() */ function the_author_link() { if (get_the_author_url()) { echo '' . get_the_author() . ''; } else { the_author(); } } /** * Retrieve the ICQ number of the author of the current post. * * @since 1.5 * @uses $authordata The current author's DB object. * @return string The author's ICQ number. */ function get_the_author_icq() { global $authordata; return $authordata->icq; } /** * Display the ICQ number of the author of the current post. * * @link http://codex.wordpress.org/Template_Tags/the_author_icq * @since 0.71 * @see get_the_author_icq() */ function the_author_icq() { echo get_the_author_icq(); } /** * Retrieve the AIM name of the author of the current post. * * @since 1.5 * @uses $authordata The current author's DB object. * @return string The author's AIM name. */ function get_the_author_aim() { global $authordata; return str_replace(' ', '+', $authordata->aim); } /** * Display the AIM name of the author of the current post. * * @link http://codex.wordpress.org/Template_Tags/the_author_aim * @since 0.71 * @see get_the_author_aim() */ function the_author_aim() { echo get_the_author_aim(); } /** * Retrieve the Yahoo! IM name of the author of the current post. * * @since 1.5 * @uses $authordata The current author's DB object. * @return string The author's Yahoo! IM name. */ function get_the_author_yim() { global $authordata; return $authordata->yim; } /** * Display the Yahoo! IM name of the author of the current post. * * @link http://codex.wordpress.org/Template_Tags/the_author_yim * @since 0.71 * @see get_the_author_yim() */ function the_author_yim() { echo get_the_author_yim(); } /** * Retrieve the MSN address of the author of the current post. * * @since 1.5 * @uses $authordata The current author's DB object. * @return string The author's MSN address. */ function get_the_author_msn() { global $authordata; return $authordata->msn; } /** * Display the MSN address of the author of the current post. * * @link http://codex.wordpress.org/Template_Tags/the_author_msn * @since 0.71 * @see get_the_author_msn() */ function the_author_msn() { echo get_the_author_msn(); } /** * Retrieve the number of posts by the author of the current post. * * @since 1.5 * @uses $post The current post in the Loop's DB object. * @uses get_usernumposts() * @return int The number of posts by the author. */ function get_the_author_posts() { global $post; return get_usernumposts($post->post_author); } /** * Display the number of posts by the author of the current post. * * @link http://codex.wordpress.org/Template_Tags/the_author_posts * @since 0.71 * @uses get_the_author_posts() Echos returned value from function. */ function the_author_posts() { echo get_the_author_posts(); } /** * Display an HTML link to the author page of the author of the current post. * * Does just echo get_author_posts_url() function, like the others do. The * reason for this, is that another function is used to help in printing the * link to the author's posts. * * @link http://codex.wordpress.org/Template_Tags/the_author_posts_link * @since 1.2 * @uses $authordata The current author's DB object. * @uses get_author_posts_url() * @uses get_the_author() * @param string $deprecated Deprecated. */ function the_author_posts_link($deprecated = '') { global $authordata; printf( '%3$s', get_author_posts_url( $authordata->ID, $authordata->user_nicename ), sprintf( __( 'Posts by %s' ), attribute_escape( get_the_author() ) ), get_the_author() ); } /** * Retrieve the URL to the author page of the author of the current post. * * @since 2.1 * @uses $wp_rewrite WP_Rewrite * @return string The URL to the author's page. */ function get_author_posts_url($author_id, $author_nicename = '') { global $wp_rewrite; $auth_ID = (int) $author_id; $link = $wp_rewrite->get_author_permastruct(); if ( empty($link) ) { $file = get_option('home') . '/'; $link = $file . '?author=' . $auth_ID; } else { if ( '' == $author_nicename ) { $user = get_userdata($author_id); if ( !empty($user->user_nicename) ) $author_nicename = $user->user_nicename; } $link = str_replace('%author%', $author_nicename, $link); $link = get_option('home') . trailingslashit($link); } $link = apply_filters('author_link', $link, $author_id, $author_nicename); return $link; } /** * Retrieve the specified author's preferred display name. * * @since 1.0.0 * @param int $auth_id The ID of the author. * @return string The author's display name. */ function get_author_name( $auth_id ) { $authordata = get_userdata( $auth_id ); return $authordata->display_name; } /** * List all the authors of the blog, with several options available. * * optioncount (boolean) (false): Show the count in parenthesis next to the * author's name. * exclude_admin (boolean) (true): Exclude the 'admin' user that is installed by * default. * show_fullname (boolean) (false): Show their full names. * hide_empty (boolean) (true): Don't show authors without any posts. * feed (string) (''): If isn't empty, show links to author's feeds. * feed_image (string) (''): If isn't empty, use this image to link to feeds. * echo (boolean) (true): Set to false to return the output, instead of echoing. * * @link http://codex.wordpress.org/Template_Tags/wp_list_authors * @since 1.2 * @param array $args The argument array. * @return null|string The output, if echo is set to false. */ function wp_list_authors($args = '') { global $wpdb; $defaults = array( 'optioncount' => false, 'exclude_admin' => true, 'show_fullname' => false, 'hide_empty' => true, 'feed' => '', 'feed_image' => '', 'feed_type' => '', 'echo' => true ); $r = wp_parse_args( $args, $defaults ); extract($r, EXTR_SKIP); $return = ''; /** @todo Move select to get_authors(). */ $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin' " : '') . "ORDER BY display_name"); $author_count = array(); foreach ((array) $wpdb->get_results("SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE post_type = 'post' AND " . get_private_posts_cap_sql( 'post' ) . " GROUP BY post_author") as $row) { $author_count[$row->post_author] = $row->count; } foreach ( (array) $authors as $author ) { $author = get_userdata( $author->ID ); $posts = (isset($author_count[$author->ID])) ? $author_count[$author->ID] : 0; $name = $author->display_name; if ( $show_fullname && ($author->first_name != '' && $author->last_name != '') ) $name = "$author->first_name $author->last_name"; if ( !($posts == 0 && $hide_empty) ) $return .= '

  • '; if ( $posts == 0 ) { if ( !$hide_empty ) $link = $name; } else { $link = 'display_name)) . '">' . $name . ''; if ( (! empty($feed_image)) || (! empty($feed)) ) { $link .= ' '; if (empty($feed_image)) $link .= '('; $link .= ''; else $link .= $name; $link .= ''; if ( empty($feed_image) ) $link .= ')'; } if ( $optioncount ) $link .= ' ('. $posts . ')'; } if ( !($posts == 0 && $hide_empty) ) $return .= $link . '
  • '; } if ( !$echo ) return $return; echo $return; } ?> wp/dev/wp-includes/class-smtp.php0000644000106600010660000010121311030241204014214 0ustar smtp_conn = 0; $this->error = null; $this->helo_rply = null; $this->do_debug = 0; } /************************************************************* * CONNECTION FUNCTIONS * ***********************************************************/ /** * Connect to the server specified on the port specified. * If the port is not specified use the default SMTP_PORT. * If tval is specified then a connection will try and be * established with the server for that number of seconds. * If tval is not specified the default is 30 seconds to * try on the connection. * * SMTP CODE SUCCESS: 220 * SMTP CODE FAILURE: 421 * @access public * @return bool */ function Connect($host,$port=0,$tval=30) { # set the error val to null so there is no confusion $this->error = null; # make sure we are __not__ connected if($this->connected()) { # ok we are connected! what should we do? # for now we will just give an error saying we # are already connected $this->error = array("error" => "Already connected to a server"); return false; } if(empty($port)) { $port = $this->SMTP_PORT; } #connect to the smtp server $this->smtp_conn = fsockopen($host, # the host of the server $port, # the port to use $errno, # error number if any $errstr, # error message if any $tval); # give up after ? secs # verify we connected properly if(empty($this->smtp_conn)) { $this->error = array("error" => "Failed to connect to server", "errno" => $errno, "errstr" => $errstr); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF; } return false; } # sometimes the SMTP server takes a little longer to respond # so we will give it a longer timeout for the first read // Windows still does not have support for this timeout function if(substr(PHP_OS, 0, 3) != "WIN") socket_set_timeout($this->smtp_conn, $tval, 0); # get any announcement stuff $announce = $this->get_lines(); # set the timeout of any socket functions at 1/10 of a second //if(function_exists("socket_set_timeout")) // socket_set_timeout($this->smtp_conn, 0, 100000); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $announce; } return true; } /** * Performs SMTP authentication. Must be run after running the * Hello() method. Returns true if successfully authenticated. * @access public * @return bool */ function Authenticate($username, $password) { // Start authentication fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($code != 334) { $this->error = array("error" => "AUTH not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } // Send encoded username fputs($this->smtp_conn, base64_encode($username) . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($code != 334) { $this->error = array("error" => "Username not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } // Send encoded password fputs($this->smtp_conn, base64_encode($password) . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($code != 235) { $this->error = array("error" => "Password not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return true; } /** * Returns true if connected to a server otherwise false * @access private * @return bool */ function Connected() { if(!empty($this->smtp_conn)) { $sock_status = socket_get_status($this->smtp_conn); if($sock_status["eof"]) { # hmm this is an odd situation... the socket is # valid but we aren't connected anymore if($this->do_debug >= 1) { echo "SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected"; } $this->Close(); return false; } return true; # everything looks good } return false; } /** * Closes the socket and cleans up the state of the class. * It is not considered good to use this function without * first trying to use QUIT. * @access public * @return void */ function Close() { $this->error = null; # so there is no confusion $this->helo_rply = null; if(!empty($this->smtp_conn)) { # close the connection and cleanup fclose($this->smtp_conn); $this->smtp_conn = 0; } } /*************************************************************** * SMTP COMMANDS * *************************************************************/ /** * Issues a data command and sends the msg_data to the server * finializing the mail transaction. $msg_data is the message * that is to be send with the headers. Each header needs to be * on a single line followed by a with the message headers * and the message body being separated by and additional . * * Implements rfc 821: DATA * * SMTP CODE INTERMEDIATE: 354 * [data] * . * SMTP CODE SUCCESS: 250 * SMTP CODE FAILURE: 552,554,451,452 * SMTP CODE FAILURE: 451,554 * SMTP CODE ERROR : 500,501,503,421 * @access public * @return bool */ function Data($msg_data) { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Data() without being connected"); return false; } fputs($this->smtp_conn,"DATA" . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 354) { $this->error = array("error" => "DATA command not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } # the server is ready to accept data! # according to rfc 821 we should not send more than 1000 # including the CRLF # characters on a single line so we will break the data up # into lines by \r and/or \n then if needed we will break # each of those into smaller lines to fit within the limit. # in addition we will be looking for lines that start with # a period '.' and append and additional period '.' to that # line. NOTE: this does not count towards are limit. # normalize the line breaks so we know the explode works $msg_data = str_replace("\r\n","\n",$msg_data); $msg_data = str_replace("\r","\n",$msg_data); $lines = explode("\n",$msg_data); # we need to find a good way to determine is headers are # in the msg_data or if it is a straight msg body # currently I'm assuming rfc 822 definitions of msg headers # and if the first field of the first line (':' sperated) # does not contain a space then it _should_ be a header # and we can process all lines before a blank "" line as # headers. $field = substr($lines[0],0,strpos($lines[0],":")); $in_headers = false; if(!empty($field) && !strstr($field," ")) { $in_headers = true; } $max_line_length = 998; # used below; set here for ease in change while(list(,$line) = @each($lines)) { $lines_out = null; if($line == "" && $in_headers) { $in_headers = false; } # ok we need to break this line up into several # smaller lines while(strlen($line) > $max_line_length) { $pos = strrpos(substr($line,0,$max_line_length)," "); # Patch to fix DOS attack if(!$pos) { $pos = $max_line_length - 1; } $lines_out[] = substr($line,0,$pos); $line = substr($line,$pos + 1); # if we are processing headers we need to # add a LWSP-char to the front of the new line # rfc 822 on long msg headers if($in_headers) { $line = "\t" . $line; } } $lines_out[] = $line; # now send the lines to the server while(list(,$line_out) = @each($lines_out)) { if(strlen($line_out) > 0) { if(substr($line_out, 0, 1) == ".") { $line_out = "." . $line_out; } } fputs($this->smtp_conn,$line_out . $this->CRLF); } } # ok all the message data has been sent so lets get this # over with aleady fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 250) { $this->error = array("error" => "DATA not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return true; } /** * Expand takes the name and asks the server to list all the * people who are members of the _list_. Expand will return * back and array of the result or false if an error occurs. * Each value in the array returned has the format of: * [ ] * The definition of is defined in rfc 821 * * Implements rfc 821: EXPN * * SMTP CODE SUCCESS: 250 * SMTP CODE FAILURE: 550 * SMTP CODE ERROR : 500,501,502,504,421 * @access public * @return string array */ function Expand($name) { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Expand() without being connected"); return false; } fputs($this->smtp_conn,"EXPN " . $name . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 250) { $this->error = array("error" => "EXPN not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } # parse the reply and place in our array to return to user $entries = explode($this->CRLF,$rply); while(list(,$l) = @each($entries)) { $list[] = substr($l,4); } return $list; } /** * Sends the HELO command to the smtp server. * This makes sure that we and the server are in * the same known state. * * Implements from rfc 821: HELO * * SMTP CODE SUCCESS: 250 * SMTP CODE ERROR : 500, 501, 504, 421 * @access public * @return bool */ function Hello($host="") { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Hello() without being connected"); return false; } # if a hostname for the HELO wasn't specified determine # a suitable one to send if(empty($host)) { # we need to determine some sort of appopiate default # to send to the server $host = "localhost"; } // Send extended hello first (RFC 2821) if(!$this->SendHello("EHLO", $host)) { if(!$this->SendHello("HELO", $host)) return false; } return true; } /** * Sends a HELO/EHLO command. * @access private * @return bool */ function SendHello($hello, $host) { fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER: " . $this->CRLF . $rply; } if($code != 250) { $this->error = array("error" => $hello . " not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } $this->helo_rply = $rply; return true; } /** * Gets help information on the keyword specified. If the keyword * is not specified then returns generic help, ussually contianing * A list of keywords that help is available on. This function * returns the results back to the user. It is up to the user to * handle the returned data. If an error occurs then false is * returned with $this->error set appropiately. * * Implements rfc 821: HELP [ ] * * SMTP CODE SUCCESS: 211,214 * SMTP CODE ERROR : 500,501,502,504,421 * @access public * @return string */ function Help($keyword="") { $this->error = null; # to avoid confusion if(!$this->connected()) { $this->error = array( "error" => "Called Help() without being connected"); return false; } $extra = ""; if(!empty($keyword)) { $extra = " " . $keyword; } fputs($this->smtp_conn,"HELP" . $extra . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 211 && $code != 214) { $this->error = array("error" => "HELP not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return $rply; } /** * Starts a mail transaction from the email address specified in * $from. Returns true if successful or false otherwise. If True * the mail transaction is started and then one or more Recipient * commands may be called followed by a Data command. * * Implements rfc 821: MAIL FROM: * * SMTP CODE SUCCESS: 250 * SMTP CODE SUCCESS: 552,451,452 * SMTP CODE SUCCESS: 500,501,421 * @access public * @return bool */ function Mail($from) { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Mail() without being connected"); return false; } fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 250) { $this->error = array("error" => "MAIL not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return true; } /** * Sends the command NOOP to the SMTP server. * * Implements from rfc 821: NOOP * * SMTP CODE SUCCESS: 250 * SMTP CODE ERROR : 500, 421 * @access public * @return bool */ function Noop() { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Noop() without being connected"); return false; } fputs($this->smtp_conn,"NOOP" . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 250) { $this->error = array("error" => "NOOP not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return true; } /** * Sends the quit command to the server and then closes the socket * if there is no error or the $close_on_error argument is true. * * Implements from rfc 821: QUIT * * SMTP CODE SUCCESS: 221 * SMTP CODE ERROR : 500 * @access public * @return bool */ function Quit($close_on_error=true) { $this->error = null; # so there is no confusion if(!$this->connected()) { $this->error = array( "error" => "Called Quit() without being connected"); return false; } # send the quit command to the server fputs($this->smtp_conn,"quit" . $this->CRLF); # get any good-bye messages $byemsg = $this->get_lines(); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $byemsg; } $rval = true; $e = null; $code = substr($byemsg,0,3); if($code != 221) { # use e as a tmp var cause Close will overwrite $this->error $e = array("error" => "SMTP server rejected quit command", "smtp_code" => $code, "smtp_rply" => substr($byemsg,4)); $rval = false; if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF; } } if(empty($e) || $close_on_error) { $this->Close(); } return $rval; } /** * Sends the command RCPT to the SMTP server with the TO: argument of $to. * Returns true if the recipient was accepted false if it was rejected. * * Implements from rfc 821: RCPT TO: * * SMTP CODE SUCCESS: 250,251 * SMTP CODE FAILURE: 550,551,552,553,450,451,452 * SMTP CODE ERROR : 500,501,503,421 * @access public * @return bool */ function Recipient($to) { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Recipient() without being connected"); return false; } fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 250 && $code != 251) { $this->error = array("error" => "RCPT not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return true; } /** * Sends the RSET command to abort and transaction that is * currently in progress. Returns true if successful false * otherwise. * * Implements rfc 821: RSET * * SMTP CODE SUCCESS: 250 * SMTP CODE ERROR : 500,501,504,421 * @access public * @return bool */ function Reset() { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Reset() without being connected"); return false; } fputs($this->smtp_conn,"RSET" . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 250) { $this->error = array("error" => "RSET failed", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return true; } /** * Starts a mail transaction from the email address specified in * $from. Returns true if successful or false otherwise. If True * the mail transaction is started and then one or more Recipient * commands may be called followed by a Data command. This command * will send the message to the users terminal if they are logged * in. * * Implements rfc 821: SEND FROM: * * SMTP CODE SUCCESS: 250 * SMTP CODE SUCCESS: 552,451,452 * SMTP CODE SUCCESS: 500,501,502,421 * @access public * @return bool */ function Send($from) { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Send() without being connected"); return false; } fputs($this->smtp_conn,"SEND FROM:" . $from . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 250) { $this->error = array("error" => "SEND not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return true; } /** * Starts a mail transaction from the email address specified in * $from. Returns true if successful or false otherwise. If True * the mail transaction is started and then one or more Recipient * commands may be called followed by a Data command. This command * will send the message to the users terminal if they are logged * in and send them an email. * * Implements rfc 821: SAML FROM: * * SMTP CODE SUCCESS: 250 * SMTP CODE SUCCESS: 552,451,452 * SMTP CODE SUCCESS: 500,501,502,421 * @access public * @return bool */ function SendAndMail($from) { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called SendAndMail() without being connected"); return false; } fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 250) { $this->error = array("error" => "SAML not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return true; } /** * Starts a mail transaction from the email address specified in * $from. Returns true if successful or false otherwise. If True * the mail transaction is started and then one or more Recipient * commands may be called followed by a Data command. This command * will send the message to the users terminal if they are logged * in or mail it to them if they are not. * * Implements rfc 821: SOML FROM: * * SMTP CODE SUCCESS: 250 * SMTP CODE SUCCESS: 552,451,452 * SMTP CODE SUCCESS: 500,501,502,421 * @access public * @return bool */ function SendOrMail($from) { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called SendOrMail() without being connected"); return false; } fputs($this->smtp_conn,"SOML FROM:" . $from . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 250) { $this->error = array("error" => "SOML not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return true; } /** * This is an optional command for SMTP that this class does not * support. This method is here to make the RFC821 Definition * complete for this class and __may__ be implimented in the future * * Implements from rfc 821: TURN * * SMTP CODE SUCCESS: 250 * SMTP CODE FAILURE: 502 * SMTP CODE ERROR : 500, 503 * @access public * @return bool */ function Turn() { $this->error = array("error" => "This method, TURN, of the SMTP ". "is not implemented"); if($this->do_debug >= 1) { echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF; } return false; } /** * Verifies that the name is recognized by the server. * Returns false if the name could not be verified otherwise * the response from the server is returned. * * Implements rfc 821: VRFY * * SMTP CODE SUCCESS: 250,251 * SMTP CODE FAILURE: 550,551,553 * SMTP CODE ERROR : 500,501,502,421 * @access public * @return int */ function Verify($name) { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Verify() without being connected"); return false; } fputs($this->smtp_conn,"VRFY " . $name . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 250 && $code != 251) { $this->error = array("error" => "VRFY failed on name '$name'", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return $rply; } /******************************************************************* * INTERNAL FUNCTIONS * ******************************************************************/ /** * Read in as many lines as possible * either before eof or socket timeout occurs on the operation. * With SMTP we can tell if we have more lines to read if the * 4th character is '-' symbol. If it is a space then we don't * need to read anything else. * @access private * @return string */ function get_lines() { $data = ""; while($str = fgets($this->smtp_conn,515)) { if($this->do_debug >= 4) { echo "SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF; echo "SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF; } $data .= $str; if($this->do_debug >= 4) { echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF; } # if the 4th character is a space then we are done reading # so just break the loop if(substr($str,3,1) == " ") { break; } } return $data; } } ?> wp/dev/wp-includes/theme.php0000644000106600010660000004564211043646540013265 0ustar text_direction) && file_exists("$dir/{$wp_locale->text_direction}.css") ) $stylesheet_uri = "$stylesheet_dir_uri/{$wp_locale->text_direction}.css"; else $stylesheet_uri = ''; return apply_filters('locale_stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri); } function get_template() { return apply_filters('template', get_option('template')); } function get_template_directory() { $template = get_template(); $template_dir = get_theme_root() . "/$template"; return apply_filters('template_directory', $template_dir, $template); } function get_template_directory_uri() { $template = get_template(); $template_dir_uri = get_theme_root_uri() . "/$template"; return apply_filters('template_directory_uri', $template_dir_uri, $template); } function get_theme_data( $theme_file ) { $themes_allowed_tags = array( 'a' => array( 'href' => array(),'title' => array() ), 'abbr' => array( 'title' => array() ), 'acronym' => array( 'title' => array() ), 'code' => array(), 'em' => array(), 'strong' => array() ); $theme_data = implode( '', file( $theme_file ) ); $theme_data = str_replace ( '\r', '\n', $theme_data ); preg_match( '|Theme Name:(.*)$|mi', $theme_data, $theme_name ); preg_match( '|Theme URI:(.*)$|mi', $theme_data, $theme_uri ); preg_match( '|Description:(.*)$|mi', $theme_data, $description ); if ( preg_match( '|Author URI:(.*)$|mi', $theme_data, $author_uri ) ) $author_uri = clean_url( trim( $author_uri[1]) ); else $author_uti = ''; if ( preg_match( '|Template:(.*)$|mi', $theme_data, $template ) ) $template = wp_kses( trim( $template[1] ), $themes_allowed_tags ); else $template = ''; if ( preg_match( '|Version:(.*)|i', $theme_data, $version ) ) $version = wp_kses( trim( $version[1] ), $themes_allowed_tags ); else $version = ''; if ( preg_match('|Status:(.*)|i', $theme_data, $status) ) $status = wp_kses( trim( $status[1] ), $themes_allowed_tags ); else $status = 'publish'; if ( preg_match('|Tags:(.*)|i', $theme_data, $tags) ) $tags = array_map( 'trim', explode( ',', wp_kses( trim( $tags[1] ), array() ) ) ); else $tags = array(); $name = $theme = wp_kses( trim( $theme_name[1] ), $themes_allowed_tags ); $theme_uri = clean_url( trim( $theme_uri[1] ) ); $description = wptexturize( wp_kses( trim( $description[1] ), $themes_allowed_tags ) ); if ( preg_match( '|Author:(.*)$|mi', $theme_data, $author_name ) ) { if ( empty( $author_uri ) ) { $author = wp_kses( trim( $author_name[1] ), $themes_allowed_tags ); } else { $author = sprintf( '%3$s', $author_uri, __( 'Visit author homepage' ), wp_kses( trim( $author_name[1] ), $themes_allowed_tags ) ); } } else { $author = __('Anonymous'); } return array( 'Name' => $name, 'Title' => $theme, 'URI' => $theme_uri, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template, 'Status' => $status, 'Tags' => $tags ); } function get_themes() { global $wp_themes, $wp_broken_themes; if ( isset($wp_themes) ) return $wp_themes; $themes = array(); $wp_broken_themes = array(); $theme_loc = $theme_root = get_theme_root(); if ( '/' != WP_CONTENT_DIR ) // don't want to replace all forward slashes, see Trac #4541 $theme_loc = str_replace(WP_CONTENT_DIR, '', $theme_root); // Files in wp-content/themes directory and one subdir down $themes_dir = @ opendir($theme_root); if ( !$themes_dir ) return false; while ( ($theme_dir = readdir($themes_dir)) !== false ) { if ( is_dir($theme_root . '/' . $theme_dir) && is_readable($theme_root . '/' . $theme_dir) ) { if ( $theme_dir{0} == '.' || $theme_dir == '..' || $theme_dir == 'CVS' ) continue; $stylish_dir = @ opendir($theme_root . '/' . $theme_dir); $found_stylesheet = false; while ( ($theme_file = readdir($stylish_dir)) !== false ) { if ( $theme_file == 'style.css' ) { $theme_files[] = $theme_dir . '/' . $theme_file; $found_stylesheet = true; break; } } @closedir($stylish_dir); if ( !$found_stylesheet ) { // look for themes in that dir $subdir = "$theme_root/$theme_dir"; $subdir_name = $theme_dir; $theme_subdir = @ opendir( $subdir ); while ( ($theme_dir = readdir($theme_subdir)) !== false ) { if ( is_dir( $subdir . '/' . $theme_dir) && is_readable($subdir . '/' . $theme_dir) ) { if ( $theme_dir{0} == '.' || $theme_dir == '..' || $theme_dir == 'CVS' ) continue; $stylish_dir = @ opendir($subdir . '/' . $theme_dir); $found_stylesheet = false; while ( ($theme_file = readdir($stylish_dir)) !== false ) { if ( $theme_file == 'style.css' ) { $theme_files[] = $subdir_name . '/' . $theme_dir . '/' . $theme_file; $found_stylesheet = true; break; } } @closedir($stylish_dir); } } @closedir($theme_subdir); $wp_broken_themes[$theme_dir] = array('Name' => $theme_dir, 'Title' => $theme_dir, 'Description' => __('Stylesheet is missing.')); } } } if ( is_dir( $theme_dir ) ) @closedir( $theme_dir ); if ( !$themes_dir || !$theme_files ) return $themes; sort($theme_files); foreach ( (array) $theme_files as $theme_file ) { if ( !is_readable("$theme_root/$theme_file") ) { $wp_broken_themes[$theme_file] = array('Name' => $theme_file, 'Title' => $theme_file, 'Description' => __('File not readable.')); continue; } $theme_data = get_theme_data("$theme_root/$theme_file"); $name = $theme_data['Name']; $title = $theme_data['Title']; $description = wptexturize($theme_data['Description']); $version = $theme_data['Version']; $author = $theme_data['Author']; $template = $theme_data['Template']; $stylesheet = dirname($theme_file); $screenshot = false; foreach ( array('png', 'gif', 'jpg', 'jpeg') as $ext ) { if (file_exists("$theme_root/$stylesheet/screenshot.$ext")) { $screenshot = "screenshot.$ext"; break; } } if ( empty($name) ) { $name = dirname($theme_file); $title = $name; } if ( empty($template) ) { if ( file_exists(dirname("$theme_root/$theme_file/index.php")) ) $template = dirname($theme_file); else continue; } $template = trim($template); if ( !file_exists("$theme_root/$template/index.php") ) { $parent_dir = dirname(dirname($theme_file)); if ( file_exists("$theme_root/$parent_dir/$template/index.php") ) { $template = "$parent_dir/$template"; } else { $wp_broken_themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => __('Template is missing.')); continue; } } $stylesheet_files = array(); $stylesheet_dir = @ dir("$theme_root/$stylesheet"); if ( $stylesheet_dir ) { while ( ($file = $stylesheet_dir->read()) !== false ) { if ( !preg_match('|^\.+$|', $file) && preg_match('|\.css$|', $file) ) $stylesheet_files[] = "$theme_loc/$stylesheet/$file"; } } $template_files = array(); $template_dir = @ dir("$theme_root/$template"); if ( $template_dir ) { while(($file = $template_dir->read()) !== false) { if ( !preg_match('|^\.+$|', $file) && preg_match('|\.php$|', $file) ) $template_files[] = "$theme_loc/$template/$file"; } } $template_dir = dirname($template_files[0]); $stylesheet_dir = dirname($stylesheet_files[0]); if ( empty($template_dir) ) $template_dir = '/'; if ( empty($stylesheet_dir) ) $stylesheet_dir = '/'; // Check for theme name collision. This occurs if a theme is copied to // a new theme directory and the theme header is not updated. Whichever // theme is first keeps the name. Subsequent themes get a suffix applied. // The Default and Classic themes always trump their pretenders. if ( isset($themes[$name]) ) { if ( ('WordPress Default' == $name || 'WordPress Classic' == $name) && ('default' == $stylesheet || 'classic' == $stylesheet) ) { // If another theme has claimed to be one of our default themes, move // them aside. $suffix = $themes[$name]['Stylesheet']; $new_name = "$name/$suffix"; $themes[$new_name] = $themes[$name]; $themes[$new_name]['Name'] = $new_name; } else { $name = "$name/$stylesheet"; } } $themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template, 'Stylesheet' => $stylesheet, 'Template Files' => $template_files, 'Stylesheet Files' => $stylesheet_files, 'Template Dir' => $template_dir, 'Stylesheet Dir' => $stylesheet_dir, 'Status' => $theme_data['Status'], 'Screenshot' => $screenshot, 'Tags' => $theme_data['Tags']); } // Resolve theme dependencies. $theme_names = array_keys($themes); foreach ( (array) $theme_names as $theme_name ) { $themes[$theme_name]['Parent Theme'] = ''; if ( $themes[$theme_name]['Stylesheet'] != $themes[$theme_name]['Template'] ) { foreach ( (array) $theme_names as $parent_theme_name ) { if ( ($themes[$parent_theme_name]['Stylesheet'] == $themes[$parent_theme_name]['Template']) && ($themes[$parent_theme_name]['Template'] == $themes[$theme_name]['Template']) ) { $themes[$theme_name]['Parent Theme'] = $themes[$parent_theme_name]['Name']; break; } } } } $wp_themes = $themes; return $themes; } function get_theme($theme) { $themes = get_themes(); if ( array_key_exists($theme, $themes) ) return $themes[$theme]; return NULL; } function get_current_theme() { if ( $theme = get_option('current_theme') ) return $theme; $themes = get_themes(); $theme_names = array_keys($themes); $current_template = get_option('template'); $current_stylesheet = get_option('stylesheet'); $current_theme = 'WordPress Default'; if ( $themes ) { foreach ( (array) $theme_names as $theme_name ) { if ( $themes[$theme_name]['Stylesheet'] == $current_stylesheet && $themes[$theme_name]['Template'] == $current_template ) { $current_theme = $themes[$theme_name]['Name']; break; } } } update_option('current_theme', $current_theme); return $current_theme; } function get_theme_root() { return apply_filters('theme_root', WP_CONTENT_DIR . "/themes"); } function get_theme_root_uri() { return apply_filters('theme_root_uri', content_url('themes'), get_option('siteurl')); } function get_query_template($type) { $template = ''; $type = preg_replace( '|[^a-z0-9-]+|', '', $type ); if ( file_exists(TEMPLATEPATH . "/{$type}.php") ) $template = TEMPLATEPATH . "/{$type}.php"; return apply_filters("{$type}_template", $template); } function get_404_template() { return get_query_template('404'); } function get_archive_template() { return get_query_template('archive'); } function get_author_template() { return get_query_template('author'); } function get_category_template() { $template = ''; if ( file_exists(TEMPLATEPATH . "/category-" . absint( get_query_var('cat') ) . '.php') ) $template = TEMPLATEPATH . "/category-" . absint( get_query_var('cat') ) . '.php'; elseif ( file_exists(TEMPLATEPATH . "/category.php") ) $template = TEMPLATEPATH . "/category.php"; return apply_filters('category_template', $template); } function get_tag_template() { $template = ''; if ( file_exists(TEMPLATEPATH . "/tag-" . get_query_var('tag') . '.php') ) $template = TEMPLATEPATH . "/tag-" . get_query_var('tag') . '.php'; elseif ( file_exists(TEMPLATEPATH . "/tag.php") ) $template = TEMPLATEPATH . "/tag.php"; return apply_filters('tag_template', $template); } function get_taxonomy_template() { $template = ''; $taxonomy = get_query_var('taxonomy'); $term = get_query_var('term'); if ( $taxonomy && $term && file_exists(TEMPLATEPATH . "/taxonomy-$taxonomy-$term.php") ) $template = TEMPLATEPATH . "/taxonomy-$taxonomy-$term.php"; elseif ( $taxonomy && file_exists(TEMPLATEPATH . "/taxonomy-$taxonomy.php") ) $template = TEMPLATEPATH . "/taxonomy-$taxonomy.php"; elseif ( file_exists(TEMPLATEPATH . "/taxonomy.php") ) $template = TEMPLATEPATH . "/taxonomy.php"; return apply_filters('taxonomy_template', $template); } function get_date_template() { return get_query_template('date'); } function get_home_template() { $template = ''; if ( file_exists(TEMPLATEPATH . "/home.php") ) $template = TEMPLATEPATH . "/home.php"; elseif ( file_exists(TEMPLATEPATH . "/index.php") ) $template = TEMPLATEPATH . "/index.php"; return apply_filters('home_template', $template); } function get_page_template() { global $wp_query; $id = (int) $wp_query->post->ID; $template = get_post_meta($id, '_wp_page_template', true); if ( 'default' == $template ) $template = ''; if ( !empty($template) && !validate_file($template) && file_exists(TEMPLATEPATH . "/$template") ) $template = TEMPLATEPATH . "/$template"; elseif ( file_exists(TEMPLATEPATH . "/page.php") ) $template = TEMPLATEPATH . "/page.php"; else $template = ''; return apply_filters('page_template', $template); } function get_paged_template() { return get_query_template('paged'); } function get_search_template() { return get_query_template('search'); } function get_single_template() { return get_query_template('single'); } function get_attachment_template() { global $posts; $type = explode('/', $posts[0]->post_mime_type); if ( $template = get_query_template($type[0]) ) return $template; elseif ( $template = get_query_template($type[1]) ) return $template; elseif ( $template = get_query_template("$type[0]_$type[1]") ) return $template; else return get_query_template('attachment'); } function get_comments_popup_template() { if ( file_exists( TEMPLATEPATH . '/comments-popup.php') ) $template = TEMPLATEPATH . '/comments-popup.php'; else $template = get_theme_root() . '/default/comments-popup.php'; return apply_filters('comments_popup_template', $template); } function load_template($_template_file) { global $posts, $post, $wp_did_header, $wp_did_template_redirect, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID; if ( is_array($wp_query->query_vars) ) extract($wp_query->query_vars, EXTR_SKIP); require_once($_template_file); } function locale_stylesheet() { $stylesheet = get_locale_stylesheet_uri(); if ( empty($stylesheet) ) return; echo ''; } function preview_theme() { if ( ! (isset($_GET['template']) && isset($_GET['preview'])) ) return; if ( !current_user_can( 'switch_themes' ) ) return; $_GET[template] = preg_replace('|[^a-z0-9_.-]|i', '', $_GET[template]); if ( validate_file($_GET[template]) ) return; add_filter('template', create_function('', "return '$_GET[template]';") ); if ( isset($_GET['stylesheet']) ) { $_GET[stylesheet] = preg_replace('|[^a-z0-9_.-]|i', '', $_GET[stylesheet]); if ( validate_file($_GET[stylesheet]) ) return; add_filter('stylesheet', create_function('', "return '$_GET[stylesheet]';") ); } ob_start( 'preview_theme_ob_filter' ); } add_action('setup_theme', 'preview_theme'); function preview_theme_ob_filter( $content ) { return preg_replace_callback( "|()|", 'preview_theme_ob_filter_callback', $content ); } function preview_theme_ob_filter_callback( $matches ) { if ( ( false !== strpos($matches[3], '/wp-admin/') ) || ( false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], get_option('home')) ) || ( false !== strpos($matches[3], '/feed/') ) || ( false !== strpos($matches[3], '/trackback/') ) ) return $matches[1] . "#$matches[2] onclick=$matches[2]return false;" . $matches[4]; $link = add_query_arg( array('preview' => 1, 'template' => $_GET['template'], 'stylesheet' => @$_GET['stylesheet'] ), $matches[3] ); if ( 0 === strpos($link, 'preview=1') ) $link = "?$link"; return $matches[1] . attribute_escape( $link ) . $matches[4]; } function switch_theme($template, $stylesheet) { update_option('template', $template); update_option('stylesheet', $stylesheet); delete_option('current_theme'); $theme = get_current_theme(); do_action('switch_theme', $theme); } function validate_current_theme() { // Don't validate during an install/upgrade. if ( defined('WP_INSTALLING') ) return true; if ( get_template() != 'default' && !file_exists(get_template_directory() . '/index.php') ) { switch_theme('default', 'default'); return false; } if ( get_stylesheet() != 'default' && !file_exists(get_template_directory() . '/style.css') ) { switch_theme('default', 'default'); return false; } return true; } function get_theme_mod($name, $default = false) { $theme = get_current_theme(); $mods = get_option("mods_$theme"); if ( isset($mods[$name]) ) return apply_filters( "theme_mod_$name", $mods[$name] ); return apply_filters( "theme_mod_$name", sprintf($default, get_template_directory_uri(), get_stylesheet_directory_uri()) ); } function set_theme_mod($name, $value) { $theme = get_current_theme(); $mods = get_option("mods_$theme"); $mods[$name] = $value; update_option("mods_$theme", $mods); wp_cache_delete("mods_$theme", 'options'); } function remove_theme_mod( $name ) { $theme = get_current_theme(); $mods = get_option("mods_$theme"); if ( !isset($mods[$name]) ) return; unset($mods[$name]); if ( empty($mods) ) return remove_theme_mods(); update_option("mods_$theme", $mods); wp_cache_delete("mods_$theme", 'options'); } function remove_theme_mods() { $theme = get_current_theme(); delete_option("mods_$theme"); } function get_header_textcolor() { return get_theme_mod('header_textcolor', HEADER_TEXTCOLOR); } function header_textcolor() { echo get_header_textcolor(); } function get_header_image() { return get_theme_mod('header_image', HEADER_IMAGE); } function header_image() { echo get_header_image(); } function add_custom_image_header($header_callback, $admin_header_callback) { if ( ! empty($header_callback) ) add_action('wp_head', $header_callback); if ( ! is_admin() ) return; require_once(ABSPATH . 'wp-admin/custom-header.php'); $GLOBALS['custom_image_header'] =& new Custom_Image_Header($admin_header_callback); add_action('admin_menu', array(&$GLOBALS['custom_image_header'], 'init')); } ?> wp/dev/wp-includes/class-IXR.php0000644000106600010660000006674211024773357013742 0ustar data = $data; if (!$type) { $type = $this->calculateType(); } $this->type = $type; if ($type == 'struct') { /* Turn all the values in the array in to new IXR_Value objects */ foreach ($this->data as $key => $value) { $this->data[$key] = new IXR_Value($value); } } if ($type == 'array') { for ($i = 0, $j = count($this->data); $i < $j; $i++) { $this->data[$i] = new IXR_Value($this->data[$i]); } } } function calculateType() { if ($this->data === true || $this->data === false) { return 'boolean'; } if (is_integer($this->data)) { return 'int'; } if (is_double($this->data)) { return 'double'; } // Deal with IXR object types base64 and date if (is_object($this->data) && is_a($this->data, 'IXR_Date')) { return 'date'; } if (is_object($this->data) && is_a($this->data, 'IXR_Base64')) { return 'base64'; } // If it is a normal PHP object convert it in to a struct if (is_object($this->data)) { $this->data = get_object_vars($this->data); return 'struct'; } if (!is_array($this->data)) { return 'string'; } /* We have an array - is it an array or a struct ? */ if ($this->isStruct($this->data)) { return 'struct'; } else { return 'array'; } } function getXml() { /* Return XML for this value */ switch ($this->type) { case 'boolean': return ''.(($this->data) ? '1' : '0').''; break; case 'int': return ''.$this->data.''; break; case 'double': return ''.$this->data.''; break; case 'string': return ''.htmlspecialchars($this->data).''; break; case 'array': $return = ''."\n"; foreach ($this->data as $item) { $return .= ' '.$item->getXml()."\n"; } $return .= ''; return $return; break; case 'struct': $return = ''."\n"; foreach ($this->data as $name => $value) { $name = htmlspecialchars($name); $return .= " $name"; $return .= $value->getXml()."\n"; } $return .= ''; return $return; break; case 'date': case 'base64': return $this->data->getXml(); break; } return false; } function isStruct($array) { /* Nasty function to check if an array is a struct or not */ $expected = 0; foreach ($array as $key => $value) { if ((string)$key != (string)$expected) { return true; } $expected++; } return false; } } /** * IXR_Message * * @package IXR * @since 1.5 */ class IXR_Message { var $message; var $messageType; // methodCall / methodResponse / fault var $faultCode; var $faultString; var $methodName; var $params; // Current variable stacks var $_arraystructs = array(); // The stack used to keep track of the current array/struct var $_arraystructstypes = array(); // Stack keeping track of if things are structs or array var $_currentStructName = array(); // A stack as well var $_param; var $_value; var $_currentTag; var $_currentTagContents; // The XML parser var $_parser; function IXR_Message ($message) { $this->message = $message; } function parse() { // first remove the XML declaration $this->message = preg_replace('/<\?xml(.*)?\?'.'>/', '', $this->message); if (trim($this->message) == '') { return false; } $this->_parser = xml_parser_create(); // Set XML parser to take the case of tags in to account xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false); // Set XML parser callback functions xml_set_object($this->_parser, $this); xml_set_element_handler($this->_parser, 'tag_open', 'tag_close'); xml_set_character_data_handler($this->_parser, 'cdata'); if (!xml_parse($this->_parser, $this->message)) { /* die(sprintf('XML error: %s at line %d', xml_error_string(xml_get_error_code($this->_parser)), xml_get_current_line_number($this->_parser))); */ return false; } xml_parser_free($this->_parser); // Grab the error messages, if any if ($this->messageType == 'fault') { $this->faultCode = $this->params[0]['faultCode']; $this->faultString = $this->params[0]['faultString']; } return true; } function tag_open($parser, $tag, $attr) { $this->_currentTagContents = ''; $this->currentTag = $tag; switch($tag) { case 'methodCall': case 'methodResponse': case 'fault': $this->messageType = $tag; break; /* Deal with stacks of arrays and structs */ case 'data': // data is to all intents and puposes more interesting than array $this->_arraystructstypes[] = 'array'; $this->_arraystructs[] = array(); break; case 'struct': $this->_arraystructstypes[] = 'struct'; $this->_arraystructs[] = array(); break; } } function cdata($parser, $cdata) { $this->_currentTagContents .= $cdata; } function tag_close($parser, $tag) { $valueFlag = false; switch($tag) { case 'int': case 'i4': $value = (int) trim($this->_currentTagContents); $valueFlag = true; break; case 'double': $value = (double) trim($this->_currentTagContents); $valueFlag = true; break; case 'string': $value = $this->_currentTagContents; $valueFlag = true; break; case 'dateTime.iso8601': $value = new IXR_Date(trim($this->_currentTagContents)); // $value = $iso->getTimestamp(); $valueFlag = true; break; case 'value': // "If no type is indicated, the type is string." if (trim($this->_currentTagContents) != '') { $value = (string)$this->_currentTagContents; $valueFlag = true; } break; case 'boolean': $value = (boolean) trim($this->_currentTagContents); $valueFlag = true; break; case 'base64': $value = base64_decode( trim( $this->_currentTagContents ) ); $valueFlag = true; break; /* Deal with stacks of arrays and structs */ case 'data': case 'struct': $value = array_pop($this->_arraystructs); array_pop($this->_arraystructstypes); $valueFlag = true; break; case 'member': array_pop($this->_currentStructName); break; case 'name': $this->_currentStructName[] = trim($this->_currentTagContents); break; case 'methodName': $this->methodName = trim($this->_currentTagContents); break; } if ($valueFlag) { if (count($this->_arraystructs) > 0) { // Add value to struct or array if ($this->_arraystructstypes[count($this->_arraystructstypes)-1] == 'struct') { // Add to struct $this->_arraystructs[count($this->_arraystructs)-1][$this->_currentStructName[count($this->_currentStructName)-1]] = $value; } else { // Add to array $this->_arraystructs[count($this->_arraystructs)-1][] = $value; } } else { // Just add as a paramater $this->params[] = $value; } } $this->_currentTagContents = ''; } } /** * IXR_Server * * @package IXR * @since 1.5 */ class IXR_Server { var $data; var $callbacks = array(); var $message; var $capabilities; function IXR_Server($callbacks = false, $data = false) { $this->setCapabilities(); if ($callbacks) { $this->callbacks = $callbacks; } $this->setCallbacks(); $this->serve($data); } function serve($data = false) { if (!$data) { global $HTTP_RAW_POST_DATA; if (!$HTTP_RAW_POST_DATA) { die('XML-RPC server accepts POST requests only.'); } $data = $HTTP_RAW_POST_DATA; } $this->message = new IXR_Message($data); if (!$this->message->parse()) { $this->error(-32700, 'parse error. not well formed'); } if ($this->message->messageType != 'methodCall') { $this->error(-32600, 'server error. invalid xml-rpc. not conforming to spec. Request must be a methodCall'); } $result = $this->call($this->message->methodName, $this->message->params); // Is the result an error? if (is_a($result, 'IXR_Error')) { $this->error($result); } // Encode the result $r = new IXR_Value($result); $resultxml = $r->getXml(); // Create the XML $xml = << $resultxml EOD; // Send it $this->output($xml); } function call($methodname, $args) { if (!$this->hasMethod($methodname)) { return new IXR_Error(-32601, 'server error. requested method '.$methodname.' does not exist.'); } $method = $this->callbacks[$methodname]; // Perform the callback and send the response if (count($args) == 1) { // If only one paramater just send that instead of the whole array $args = $args[0]; } // Are we dealing with a function or a method? if (substr($method, 0, 5) == 'this:') { // It's a class method - check it exists $method = substr($method, 5); if (!method_exists($this, $method)) { return new IXR_Error(-32601, 'server error. requested class method "'.$method.'" does not exist.'); } // Call the method $result = $this->$method($args); } else { // It's a function - does it exist? if (is_array($method)) { if (!method_exists($method[0], $method[1])) { return new IXR_Error(-32601, 'server error. requested object method "'.$method[1].'" does not exist.'); } } else if (!function_exists($method)) { return new IXR_Error(-32601, 'server error. requested function "'.$method.'" does not exist.'); } // Call the function $result = call_user_func($method, $args); } return $result; } function error($error, $message = false) { // Accepts either an error object or an error code and message if ($message && !is_object($error)) { $error = new IXR_Error($error, $message); } $this->output($error->getXml()); } function output($xml) { $xml = ''."\n".$xml; $length = strlen($xml); header('Connection: close'); header('Content-Length: '.$length); header('Content-Type: text/xml'); header('Date: '.date('r')); echo $xml; exit; } function hasMethod($method) { return in_array($method, array_keys($this->callbacks)); } function setCapabilities() { // Initialises capabilities array $this->capabilities = array( 'xmlrpc' => array( 'specUrl' => 'http://www.xmlrpc.com/spec', 'specVersion' => 1 ), 'faults_interop' => array( 'specUrl' => 'http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php', 'specVersion' => 20010516 ), 'system.multicall' => array( 'specUrl' => 'http://www.xmlrpc.com/discuss/msgReader$1208', 'specVersion' => 1 ), ); } function getCapabilities($args) { return $this->capabilities; } function setCallbacks() { $this->callbacks['system.getCapabilities'] = 'this:getCapabilities'; $this->callbacks['system.listMethods'] = 'this:listMethods'; $this->callbacks['system.multicall'] = 'this:multiCall'; } function listMethods($args) { // Returns a list of methods - uses array_reverse to ensure user defined // methods are listed before server defined methods return array_reverse(array_keys($this->callbacks)); } function multiCall($methodcalls) { // See http://www.xmlrpc.com/discuss/msgReader$1208 $return = array(); foreach ($methodcalls as $call) { $method = $call['methodName']; $params = $call['params']; if ($method == 'system.multicall') { $result = new IXR_Error(-32600, 'Recursive calls to system.multicall are forbidden'); } else { $result = $this->call($method, $params); } if (is_a($result, 'IXR_Error')) { $return[] = array( 'faultCode' => $result->code, 'faultString' => $result->message ); } else { $return[] = array($result); } } return $return; } } /** * IXR_Request * * @package IXR * @since 1.5 */ class IXR_Request { var $method; var $args; var $xml; function IXR_Request($method, $args) { $this->method = $method; $this->args = $args; $this->xml = << {$this->method} EOD; foreach ($this->args as $arg) { $this->xml .= ''; $v = new IXR_Value($arg); $this->xml .= $v->getXml(); $this->xml .= "\n"; } $this->xml .= ''; } function getLength() { return strlen($this->xml); } function getXml() { return $this->xml; } } /** * IXR_Client * * @package IXR * @since 1.5 */ class IXR_Client { var $server; var $port; var $path; var $useragent; var $response; var $message = false; var $debug = false; var $timeout; // Storage place for an error message var $error = false; function IXR_Client($server, $path = false, $port = 80, $timeout = false) { if (!$path) { // Assume we have been given a URL instead $bits = parse_url($server); $this->server = $bits['host']; $this->port = isset($bits['port']) ? $bits['port'] : 80; $this->path = isset($bits['path']) ? $bits['path'] : '/'; // Make absolutely sure we have a path if (!$this->path) { $this->path = '/'; } } else { $this->server = $server; $this->path = $path; $this->port = $port; } $this->useragent = 'Incutio XML-RPC'; $this->timeout = $timeout; } function query() { $args = func_get_args(); $method = array_shift($args); $request = new IXR_Request($method, $args); $length = $request->getLength(); $xml = $request->getXml(); $r = "\r\n"; $request = "POST {$this->path} HTTP/1.0$r"; $request .= "Host: {$this->server}$r"; $request .= "Content-Type: text/xml$r"; $request .= "User-Agent: {$this->useragent}$r"; $request .= "Content-length: {$length}$r$r"; $request .= $xml; // Now send the request if ($this->debug) { echo '
    '.htmlspecialchars($request)."\n
    \n\n"; } if ($this->timeout) { $fp = @fsockopen($this->server, $this->port, $errno, $errstr, $this->timeout); } else { $fp = @fsockopen($this->server, $this->port, $errno, $errstr); } if (!$fp) { $this->error = new IXR_Error(-32300, "transport error - could not open socket: $errno $errstr"); return false; } fputs($fp, $request); $contents = ''; $gotFirstLine = false; $gettingHeaders = true; while (!feof($fp)) { $line = fgets($fp, 4096); if (!$gotFirstLine) { // Check line for '200' if (strstr($line, '200') === false) { $this->error = new IXR_Error(-32300, 'transport error - HTTP status code was not 200'); return false; } $gotFirstLine = true; } if (trim($line) == '') { $gettingHeaders = false; } if (!$gettingHeaders) { $contents .= trim($line)."\n"; } } if ($this->debug) { echo '
    '.htmlspecialchars($contents)."\n
    \n\n"; } // Now parse what we've got back $this->message = new IXR_Message($contents); if (!$this->message->parse()) { // XML error $this->error = new IXR_Error(-32700, 'parse error. not well formed'); return false; } // Is the message a fault? if ($this->message->messageType == 'fault') { $this->error = new IXR_Error($this->message->faultCode, $this->message->faultString); return false; } // Message must be OK return true; } function getResponse() { // methodResponses can only have one param - return that return $this->message->params[0]; } function isError() { return (is_object($this->error)); } function getErrorCode() { return $this->error->code; } function getErrorMessage() { return $this->error->message; } } /** * IXR_Error * * @package IXR * @since 1.5 */ class IXR_Error { var $code; var $message; function IXR_Error($code, $message) { $this->code = $code; $this->message = htmlspecialchars($message); } function getXml() { $xml = << faultCode {$this->code} faultString {$this->message} EOD; return $xml; } } /** * IXR_Date * * @package IXR * @since 1.5 */ class IXR_Date { var $year; var $month; var $day; var $hour; var $minute; var $second; function IXR_Date($time) { // $time can be a PHP timestamp or an ISO one if (is_numeric($time)) { $this->parseTimestamp($time); } else { $this->parseIso($time); } } function parseTimestamp($timestamp) { $this->year = date('Y', $timestamp); $this->month = date('m', $timestamp); $this->day = date('d', $timestamp); $this->hour = date('H', $timestamp); $this->minute = date('i', $timestamp); $this->second = date('s', $timestamp); } function parseIso($iso) { $this->year = substr($iso, 0, 4); $this->month = substr($iso, 4, 2); $this->day = substr($iso, 6, 2); $this->hour = substr($iso, 9, 2); $this->minute = substr($iso, 12, 2); $this->second = substr($iso, 15, 2); $this->timezone = substr($iso, 17); } function getIso() { return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second.$this->timezone; } function getXml() { return ''.$this->getIso().''; } function getTimestamp() { return mktime($this->hour, $this->minute, $this->second, $this->month, $this->day, $this->year); } } /** * IXR_Base64 * * @package IXR * @since 1.5 */ class IXR_Base64 { var $data; function IXR_Base64($data) { $this->data = $data; } function getXml() { return ''.base64_encode($this->data).''; } } /** * IXR_IntrospectionServer * * @package IXR * @since 1.5 */ class IXR_IntrospectionServer extends IXR_Server { var $signatures; var $help; function IXR_IntrospectionServer() { $this->setCallbacks(); $this->setCapabilities(); $this->capabilities['introspection'] = array( 'specUrl' => 'http://xmlrpc.usefulinc.com/doc/reserved.html', 'specVersion' => 1 ); $this->addCallback( 'system.methodSignature', 'this:methodSignature', array('array', 'string'), 'Returns an array describing the return type and required parameters of a method' ); $this->addCallback( 'system.getCapabilities', 'this:getCapabilities', array('struct'), 'Returns a struct describing the XML-RPC specifications supported by this server' ); $this->addCallback( 'system.listMethods', 'this:listMethods', array('array'), 'Returns an array of available methods on this server' ); $this->addCallback( 'system.methodHelp', 'this:methodHelp', array('string', 'string'), 'Returns a documentation string for the specified method' ); } function addCallback($method, $callback, $args, $help) { $this->callbacks[$method] = $callback; $this->signatures[$method] = $args; $this->help[$method] = $help; } function call($methodname, $args) { // Make sure it's in an array if ($args && !is_array($args)) { $args = array($args); } // Over-rides default call method, adds signature check if (!$this->hasMethod($methodname)) { return new IXR_Error(-32601, 'server error. requested method "'.$this->message->methodName.'" not specified.'); } $method = $this->callbacks[$methodname]; $signature = $this->signatures[$methodname]; $returnType = array_shift($signature); // Check the number of arguments if (count($args) != count($signature)) { return new IXR_Error(-32602, 'server error. wrong number of method parameters'); } // Check the argument types $ok = true; $argsbackup = $args; for ($i = 0, $j = count($args); $i < $j; $i++) { $arg = array_shift($args); $type = array_shift($signature); switch ($type) { case 'int': case 'i4': if (is_array($arg) || !is_int($arg)) { $ok = false; } break; case 'base64': case 'string': if (!is_string($arg)) { $ok = false; } break; case 'boolean': if ($arg !== false && $arg !== true) { $ok = false; } break; case 'float': case 'double': if (!is_float($arg)) { $ok = false; } break; case 'date': case 'dateTime.iso8601': if (!is_a($arg, 'IXR_Date')) { $ok = false; } break; } if (!$ok) { return new IXR_Error(-32602, 'server error. invalid method parameters'); } } // It passed the test - run the "real" method call return parent::call($methodname, $argsbackup); } function methodSignature($method) { if (!$this->hasMethod($method)) { return new IXR_Error(-32601, 'server error. requested method "'.$method.'" not specified.'); } // We should be returning an array of types $types = $this->signatures[$method]; $return = array(); foreach ($types as $type) { switch ($type) { case 'string': $return[] = 'string'; break; case 'int': case 'i4': $return[] = 42; break; case 'double': $return[] = 3.1415; break; case 'dateTime.iso8601': $return[] = new IXR_Date(time()); break; case 'boolean': $return[] = true; break; case 'base64': $return[] = new IXR_Base64('base64'); break; case 'array': $return[] = array('array'); break; case 'struct': $return[] = array('struct' => 'struct'); break; } } return $return; } function methodHelp($method) { return $this->help[$method]; } } /** * IXR_ClientMulticall * * @package IXR * @since 1.5 */ class IXR_ClientMulticall extends IXR_Client { var $calls = array(); function IXR_ClientMulticall($server, $path = false, $port = 80) { parent::IXR_Client($server, $path, $port); $this->useragent = 'The Incutio XML-RPC PHP Library (multicall client)'; } function addCall() { $args = func_get_args(); $methodName = array_shift($args); $struct = array( 'methodName' => $methodName, 'params' => $args ); $this->calls[] = $struct; } function query() { // Prepare multicall, then call the parent::query() method return parent::query('system.multicall', $this->calls); } } ?> wp/dev/wp-includes/cache.php0000644000106600010660000002714011016304601013204 0ustar add($key, $data, $flag, $expire); } /** * Closes the cache. * * This function has ceased to do anything since WordPress 2.5. The * functionality was removed along with the rest of the persistant cache. This * does not mean that plugins can't implement this function when they need to * make sure that the cache is cleaned up after WordPress no longer needs it. * * @since 2.0 * * @return bool Always returns True */ function wp_cache_close() { return true; } /** * Removes the cache contents matching ID and flag. * * @since 2.0 * @uses $wp_object_cache Object Cache Class * @see WP_Object_Cache::delete() * * @param int|string $id What the contents in the cache are called * @param string $flag Where the cache contents are grouped * @return bool True on successful removal, false on failure */ function wp_cache_delete($id, $flag = '') { global $wp_object_cache; return $wp_object_cache->delete($id, $flag); } /** * Removes all cache items. * * @since 2.0 * @uses $wp_object_cache Object Cache Class * @see WP_Object_Cache::flush() * * @return bool Always returns true */ function wp_cache_flush() { global $wp_object_cache; return $wp_object_cache->flush(); } /** * Retrieves the cache contents from the cache by ID and flag. * * @since 2.0 * @uses $wp_object_cache Object Cache Class * @see WP_Object_Cache::get() * * @param int|string $id What the contents in the cache are called * @param string $flag Where the cache contents are grouped * @return bool|mixed False on failure to retrieve contents or the cache * contents on success */ function wp_cache_get($id, $flag = '') { global $wp_object_cache; return $wp_object_cache->get($id, $flag); } /** * Sets up Object Cache Global and assigns it. * * @since 2.0 * @global WP_Object_Cache $wp_object_cache WordPress Object Cache */ function wp_cache_init() { $GLOBALS['wp_object_cache'] =& new WP_Object_Cache(); } /** * Replaces the contents of the cache with new data. * * @since 2.0 * @uses $wp_object_cache Object Cache Class * @see WP_Object_Cache::replace() * * @param int|string $id What to call the contents in the cache * @param mixed $data The contents to store in the cache * @param string $flag Where to group the cache contents * @param int $expire When to expire the cache contents * @return bool False if cache ID and group already exists, true on success */ function wp_cache_replace($key, $data, $flag = '', $expire = 0) { global $wp_object_cache; return $wp_object_cache->replace($key, $data, $flag, $expire); } /** * Saves the data to the cache. * * @since 2.0 * @uses $wp_object_cache Object Cache Class * @see WP_Object_Cache::set() * * @param int|string $id What to call the contents in the cache * @param mixed $data The contents to store in the cache * @param string $flag Where to group the cache contents * @param int $expire When to expire the cache contents * @return bool False if cache ID and group already exists, true on success */ function wp_cache_set($key, $data, $flag = '', $expire = 0) { global $wp_object_cache; return $wp_object_cache->set($key, $data, $flag, $expire); } /** * Adds a group or set of groups to the list of global groups. * * @since 2.6 * * @param string|array $groups A group or an array of groups to add */ function wp_cache_add_global_groups( $groups ) { // Default cache doesn't persist so nothing to do here. return; } /** * Adds a group or set of groups to the list of non-persistent groups. * * @since 2.6 * * @param string|array $groups A group or an array of groups to add */ function wp_cache_add_non_persistent_groups( $groups ) { // Default cache doesn't persist so nothing to do here. return; } /** * WordPress Object Cache * * The WordPress Object Cache is used to save on trips to the database. The * Object Cache stores all of the cache data to memory and makes the cache * contents available by using a key, which is used to name and later retrieve * the cache contents. * * The Object Cache can be replaced by other caching mechanisms by placing files * in the wp-content folder which is looked at in wp-settings. If that file * exists, then this file will not be included. * * @package WordPress * @subpackage Cache * @since 2.0 */ class WP_Object_Cache { /** * Holds the cached objects * * @var array * @access private * @since 2.0 */ var $cache = array (); /** * Cache objects that do not exist in the cache * * @var array * @access private * @since 2.0 */ var $non_existant_objects = array (); /** * The amount of times the cache data was already stored in the cache. * * @since 2.5 * @access private * @var int */ var $cache_hits = 0; /** * Amount of times the cache did not have the request in cache * * @var int * @access public * @since 2.0 */ var $cache_misses = 0; /** * Adds data to the cache if it doesn't already exist. * * @uses WP_Object_Cache::get Checks to see if the cache already has data. * @uses WP_Object_Cache::set Sets the data after the checking the cache * contents existance. * * @since 2.0 * * @param int|string $id What to call the contents in the cache * @param mixed $data The contents to store in the cache * @param string $group Where to group the cache contents * @param int $expire When to expire the cache contents * @return bool False if cache ID and group already exists, true on success */ function add($id, $data, $group = 'default', $expire = '') { if (empty ($group)) $group = 'default'; if (false !== $this->get($id, $group, false)) return false; return $this->set($id, $data, $group, $expire); } /** * Remove the contents of the cache ID in the group * * If the cache ID does not exist in the group and $force parameter is set * to false, then nothing will happen. The $force parameter is set to false * by default. * * On success the group and the id will be added to the * $non_existant_objects property in the class. * * @since 2.0 * * @param int|string $id What the contents in the cache are called * @param string $group Where the cache contents are grouped * @param bool $force Optional. Whether to force the unsetting of the cache * ID in the group * @return bool False if the contents weren't deleted and true on success */ function delete($id, $group = 'default', $force = false) { if (empty ($group)) $group = 'default'; if (!$force && false === $this->get($id, $group, false)) return false; unset ($this->cache[$group][$id]); $this->non_existant_objects[$group][$id] = true; return true; } /** * Clears the object cache of all data * * @since 2.0 * * @return bool Always returns true */ function flush() { $this->cache = array (); return true; } /** * Retrieves the cache contents, if it exists * * The contents will be first attempted to be retrieved by searching by the * ID in the cache group. If the cache is hit (success) then the contents * are returned. * * On failure, the $non_existant_objects property is checked and if the * cache group and ID exist in there the cache misses will not be * incremented. If not in the nonexistant objects property, then the cache * misses will be incremented and the cache group and ID will be added to * the nonexistant objects. * * @since 2.0 * * @param int|string $id What the contents in the cache are called * @param string $group Where the cache contents are grouped * @return bool|mixed False on failure to retrieve contents or the cache * contents on success */ function get($id, $group = 'default') { if (empty ($group)) $group = 'default'; if (isset ($this->cache[$group][$id])) { $this->cache_hits += 1; return $this->cache[$group][$id]; } if ( isset ($this->non_existant_objects[$group][$id]) ) return false; $this->non_existant_objects[$group][$id] = true; $this->cache_misses += 1; return false; } /** * Replace the contents in the cache, if contents already exist * * @since 2.0 * @see WP_Object_Cache::set() * * @param int|string $id What to call the contents in the cache * @param mixed $data The contents to store in the cache * @param string $group Where to group the cache contents * @param int $expire When to expire the cache contents * @return bool False if not exists, true if contents were replaced */ function replace($id, $data, $group = 'default', $expire = '') { if (empty ($group)) $group = 'default'; if (false === $this->get($id, $group, false)) return false; return $this->set($id, $data, $group, $expire); } /** * Sets the data contents into the cache * * The cache contents is grouped by the $group parameter followed by the * $id. This allows for duplicate ids in unique groups. Therefore, naming of * the group should be used with care and should follow normal function * naming guidelines outside of core WordPress usage. * * The $expire parameter is not used, because the cache will automatically * expire for each time a page is accessed and PHP finishes. The method is * more for cache plugins which use files. * * @since 2.0 * * @param int|string $id What to call the contents in the cache * @param mixed $data The contents to store in the cache * @param string $group Where to group the cache contents * @param int $expire Not Used * @return bool Always returns true */ function set($id, $data, $group = 'default', $expire = '') { if (empty ($group)) $group = 'default'; if (NULL === $data) $data = ''; $this->cache[$group][$id] = $data; if(isset($this->non_existant_objects[$group][$id])) unset ($this->non_existant_objects[$group][$id]); return true; } /** * Echos the stats of the caching. * * Gives the cache hits, and cache misses. Also prints every cached group, * key and the data. * * @since 2.0 */ function stats() { echo "

    "; echo "Cache Hits: {$this->cache_hits}
    "; echo "Cache Misses: {$this->cache_misses}
    "; echo "

    "; foreach ($this->cache as $group => $cache) { echo "

    "; echo "Group: $group
    "; echo "Cache:"; echo "

    ";
    			print_r($cache);
    			echo "
    "; } } /** * PHP4 constructor; Calls PHP 5 style constructor * * @since 2.0 * * @return WP_Object_Cache */ function WP_Object_Cache() { return $this->__construct(); } /** * Sets up object properties; PHP 5 style constructor * * @since 2.0.8 * @return null|WP_Object_Cache If cache is disabled, returns null. */ function __construct() { /** * @todo This should be moved to the PHP4 style constructor, PHP5 * already calls __destruct() */ register_shutdown_function(array(&$this, "__destruct")); } /** * Will save the object cache before object is completely destroyed. * * Called upon object destruction, which should be when PHP ends. * * @since 2.0.8 * * @return bool True value. Won't be used by PHP */ function __destruct() { return true; } } ?> wp/dev/wp-includes/class.wp-dependencies.php0000644000106600010660000001255011014734564016333 0ustar queue : (array) $handles; $this->all_deps( $handles ); foreach( $this->to_do as $handle ) { if ( !in_array($handle, $this->done) && isset($this->registered[$handle]) ) { if ( $this->registered[$handle]->src ) { // Else it defines a group. $this->do_item( $handle ); } $this->done[] = $handle; } } $this->to_do = array(); return $this->done; } function do_item( $handle ) { return isset($this->registered[$handle]); } /** * Determines dependencies * * Recursively builds array of items to process taking dependencies into account. Does NOT catch infinite loops. * * @param mixed handles Accepts (string) dep name or (array of strings) dep names * @param bool recursion Used internally when function calls itself */ function all_deps( $handles, $recursion = false ) { if ( !$handles = (array) $handles ) return false; foreach ( $handles as $handle ) { $handle = explode('?', $handle); if ( isset($handle[1]) ) $this->args[$handle[0]] = $handle[1]; $handle = $handle[0]; if ( isset($this->to_do[$handle]) ) // Already grobbed it and its deps continue; $keep_going = true; if ( !isset($this->registered[$handle]) ) $keep_going = false; // Script doesn't exist elseif ( $this->registered[$handle]->deps && array_diff($this->registered[$handle]->deps, array_keys($this->registered)) ) $keep_going = false; // Script requires deps which don't exist (not a necessary check. efficiency?) elseif ( $this->registered[$handle]->deps && !$this->all_deps( $this->registered[$handle]->deps, true ) ) $keep_going = false; // Script requires deps which don't exist if ( !$keep_going ) { // Either script or its deps don't exist. if ( $recursion ) return false; // Abort this branch. else continue; // We're at the top level. Move on to the next one. } $this->to_do[$handle] = true; } if ( !$recursion ) // at the end $this->to_do = array_keys( $this->to_do ); return true; } /** * Adds item * * Adds the item only if no item of that name already exists * * @param string handle Script name * @param string src Script url * @param array deps (optional) Array of script names on which this script depends * @param string ver (optional) Script version (used for cache busting) * @return array Hierarchical array of dependencies */ function add( $handle, $src, $deps = array(), $ver = false, $args = null ) { if ( isset($this->registered[$handle]) ) return false; $this->registered[$handle] = new _WP_Dependency( $handle, $src, $deps, $ver, $args ); return true; } /** * Adds extra data * * Adds data only if script has already been added * * @param string handle Script name * @param string data_name Name of object in which to store extra data * @param array data Array of extra data * @return bool success */ function add_data( $handle, $data_name, $data ) { if ( !isset($this->registered[$handle]) ) return false; return $this->registered[$handle]->add_data( $data_name, $data ); } function remove( $handles ) { foreach ( (array) $handles as $handle ) unset($this->registered[$handle]); } function enqueue( $handles ) { foreach ( (array) $handles as $handle ) { $handle = explode('?', $handle); if ( !in_array($handle[0], $this->queue) && isset($this->registered[$handle[0]]) ) { $this->queue[] = $handle[0]; if ( isset($handle[1]) ) $this->args[$handle[0]] = $handle[1]; } } } function dequeue( $handles ) { foreach ( (array) $handles as $handle ) unset( $this->queue[$handle] ); } function query( $handle, $list = 'registered' ) { // registered, queue, done, to_do switch ( $list ) : case 'registered': case 'scripts': // back compat if ( isset($this->registered[$handle]) ) return $this->registered[$handle]; break; case 'to_print': // back compat case 'printed': // back compat if ( 'to_print' == $list ) $list = 'to_do'; else $list = 'printed'; default: if ( in_array($handle, $this->$list) ) return true; break; endswitch; return false; } } class _WP_Dependency { var $handle; var $src; var $deps = array(); var $ver = false; var $args = null; var $extra = array(); function _WP_Dependency() { @list($this->handle, $this->src, $this->deps, $this->ver, $this->args) = func_get_args(); if ( !is_array($this->deps) ) $this->deps = array(); if ( !$this->ver ) $this->ver = false; } function add_data( $name, $data ) { if ( !is_scalar($name) ) return false; $this->extra[$name] = $data; return true; } } wp/dev/wp-includes/feed-rdf.php0000644000106600010660000000404410734266201013624 0ustar '; ?> > "> <?php bloginfo_rss('name'); wp_title_rss(); ?> hourly 1 2000-01-01T12:00+00:00 <?php the_title_rss() ?> post_date_gmt, false); ?> ]]> wp/dev/wp-includes/post-template.php0000644000106600010660000005033711017634473014761 0ustar '', 'after' => '', 'echo' => true); $r = wp_parse_args($args, $defaults); extract( $r, EXTR_SKIP ); $title = $before . $title . $after; $title = attribute_escape(strip_tags($title)); if ( $echo ) echo $title; else return $title; } function get_the_title( $id = 0 ) { $post = &get_post($id); $title = $post->post_title; if ( !is_admin() ) { if ( !empty($post->post_password) ) $title = sprintf(__('Protected: %s'), $title); else if ( isset($post->post_status) && 'private' == $post->post_status ) $title = sprintf(__('Private: %s'), $title); } return apply_filters( 'the_title', $title ); } function the_guid( $id = 0 ) { echo get_the_guid($id); } function get_the_guid( $id = 0 ) { $post = &get_post($id); return apply_filters('get_the_guid', $post->guid); } function the_content($more_link_text = '(more...)', $stripteaser = 0, $more_file = '') { $content = get_the_content($more_link_text, $stripteaser, $more_file); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content; } function get_the_content($more_link_text = '(more...)', $stripteaser = 0, $more_file = '') { global $id, $post, $more, $page, $pages, $multipage, $preview, $pagenow; $output = ''; if ( !empty($post->post_password) ) { // if there's a password if ( !isset($_COOKIE['wp-postpass_'.COOKIEHASH]) || stripslashes($_COOKIE['wp-postpass_'.COOKIEHASH]) != $post->post_password ) { // and it doesn't match the cookie $output = get_the_password_form(); return $output; } } if ( $more_file != '' ) $file = $more_file; else $file = $pagenow; //$_SERVER['PHP_SELF']; if ( $page > count($pages) ) // if the requested page doesn't exist $page = count($pages); // give them the highest numbered page that DOES exist $content = $pages[$page-1]; if ( preg_match('//', $content, $matches) ) { $content = explode($matches[0], $content, 2); if ( !empty($matches[1]) && !empty($more_link_text) ) $more_link_text = strip_tags(wp_kses_no_null(trim($matches[1]))); } else { $content = array($content); } if ( (false !== strpos($post->post_content, '') && ((!$multipage) || ($page==1))) ) $stripteaser = 1; $teaser = $content[0]; if ( ($more) && ($stripteaser) ) $teaser = ''; $output .= $teaser; if ( count($content) > 1 ) { if ( $more ) { $output .= ''.$content[1]; } else { $output = balanceTags($output); if ( ! empty($more_link_text) ) $output .= ' $more_link_text"; } } if ( $preview ) // preview fix for javascript bug with foreign languages $output = preg_replace('/\%u([0-9A-F]{4,4})/e', "'&#'.base_convert('\\1',16,10).';'", $output); return $output; } function the_excerpt() { echo apply_filters('the_excerpt', get_the_excerpt()); } function get_the_excerpt($deprecated = '') { global $post; $output = ''; $output = $post->post_excerpt; if ( !empty($post->post_password) ) { // if there's a password if ( !isset($_COOKIE['wp-postpass_'.COOKIEHASH]) || $_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password ) { // and it doesn't match the cookie $output = __('There is no excerpt because this is a protected post.'); return $output; } } return apply_filters('get_the_excerpt', $output); } function has_excerpt( $id = 0 ) { $post = &get_post( $id ); return ( !empty( $post->post_excerpt ) ); } function wp_link_pages($args = '') { $defaults = array( 'before' => '

    ' . __('Pages:'), 'after' => '

    ', 'next_or_number' => 'number', 'nextpagelink' => __('Next page'), 'previouspagelink' => __('Previous page'), 'pagelink' => '%', 'more_file' => '', 'echo' => 1 ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); global $post, $page, $numpages, $multipage, $more, $pagenow; if ( $more_file != '' ) $file = $more_file; else $file = $pagenow; $output = ''; if ( $multipage ) { if ( 'number' == $next_or_number ) { $output .= $before; for ( $i = 1; $i < ($numpages+1); $i = $i + 1 ) { $j = str_replace('%',"$i",$pagelink); $output .= ' '; if ( ($i != $page) || ((!$more) && ($page==1)) ) { if ( 1 == $i ) { $output .= ''; } else { if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) ) $output .= ''; else $output .= ''; } } $output .= $j; if ( ($i != $page) || ((!$more) && ($page==1)) ) $output .= ''; } $output .= $after; } else { if ( $more ) { $output .= $before; $i = $page - 1; if ( $i && $more ) { if ( 1 == $i ) { $output .= '' . $previouspagelink . ''; } else { if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) ) $output .= '' . $previouspagelink . ''; else $output .= '' . $previouspagelink . ''; } } $i = $page + 1; if ( $i <= $numpages && $more ) { if ( 1 == $i ) { $output .= '' . $nextpagelink . ''; } else { if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) ) $output .= '' . $nextpagelink . ''; else $output .= '' . $nextpagelink . ''; } } $output .= $after; } } } if ( $echo ) echo $output; return $output; } // // Post-meta: Custom per-post fields. // function post_custom( $key = '' ) { $custom = get_post_custom(); if ( 1 == count($custom[$key]) ) return $custom[$key][0]; else return $custom[$key]; } // this will probably change at some point... function the_meta() { if ( $keys = get_post_custom_keys() ) { echo "\n"; } } // // Pages // function wp_dropdown_pages($args = '') { $defaults = array( 'depth' => 0, 'child_of' => 0, 'selected' => 0, 'echo' => 1, 'name' => 'page_id', 'show_option_none' => '' ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); $pages = get_pages($r); $output = ''; if ( ! empty($pages) ) { $output = "\n"; } $output = apply_filters('wp_dropdown_pages', $output); if ( $echo ) echo $output; return $output; } function wp_list_pages($args = '') { $defaults = array( 'depth' => 0, 'show_date' => '', 'date_format' => get_option('date_format'), 'child_of' => 0, 'exclude' => '', 'title_li' => __('Pages'), 'echo' => 1, 'authors' => '', 'sort_column' => 'menu_order, post_title' ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); $output = ''; $current_page = 0; // sanitize, mostly to keep spaces out $r['exclude'] = preg_replace('[^0-9,]', '', $r['exclude']); // Allow plugins to filter an array of excluded pages $r['exclude'] = implode(',', apply_filters('wp_list_pages_excludes', explode(',', $r['exclude']))); // Query pages. $r['hierarchical'] = 0; $pages = get_pages($r); if ( !empty($pages) ) { if ( $r['title_li'] ) $output .= ''; } $output = apply_filters('wp_list_pages', $output); if ( $r['echo'] ) echo $output; else return $output; } // // Page helpers // function walk_page_tree() { $walker = new Walker_Page; $args = func_get_args(); return call_user_func_array(array(&$walker, 'walk'), $args); } function walk_page_dropdown_tree() { $walker = new Walker_PageDropdown; $args = func_get_args(); return call_user_func_array(array(&$walker, 'walk'), $args); } // // Attachments // function the_attachment_link($id = 0, $fullsize = false, $deprecated = false, $permalink = false) { if ( $fullsize ) echo wp_get_attachment_link($id, 'full', $permalink); else echo wp_get_attachment_link($id, 'thumbnail', $permalink); } // get an attachment page link using an image or icon if possible function wp_get_attachment_link($id = 0, $size = 'thumbnail', $permalink = false, $icon = false) { $id = intval($id); $_post = & get_post( $id ); if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) ) return __('Missing Attachment'); if ( $permalink ) $url = get_attachment_link($_post->ID); $post_title = attribute_escape($_post->post_title); $link_text = wp_get_attachment_image($id, $size, $icon); if ( !$link_text ) $link_text = $_post->post_title; return "$link_text"; } // deprecated - use wp_get_attachment_link() function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) { $id = (int) $id; $_post = & get_post($id); if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) ) return __('Missing Attachment'); if ( $permalink ) $url = get_attachment_link($_post->ID); $post_title = attribute_escape($_post->post_title); $innerHTML = get_attachment_innerHTML($_post->ID, $fullsize, $max_dims); return "$innerHTML"; } // deprecated: use wp_get_attachment_image_src() function get_attachment_icon_src( $id = 0, $fullsize = false ) { $id = (int) $id; if ( !$post = & get_post($id) ) return false; $file = get_attached_file( $post->ID ); if ( !$fullsize && $src = wp_get_attachment_thumb_url( $post->ID ) ) { // We have a thumbnail desired, specified and existing $src_file = basename($src); $class = 'attachmentthumb'; } elseif ( wp_attachment_is_image( $post->ID ) ) { // We have an image without a thumbnail $src = wp_get_attachment_url( $post->ID ); $src_file = & $file; $class = 'attachmentimage'; } elseif ( $src = wp_mime_type_icon( $post->ID ) ) { // No thumb, no image. We'll look for a mime-related icon instead. $icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' ); $src_file = $icon_dir . '/' . basename($src); } if ( !isset($src) || !$src ) return false; return array($src, $src_file); } // deprecated: use wp_get_attachment_image() function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) { $id = (int) $id; if ( !$post = & get_post($id) ) return false; if ( !$src = get_attachment_icon_src( $post->ID, $fullsize ) ) return false; list($src, $src_file) = $src; // Do we need to constrain the image? if ( ($max_dims = apply_filters('attachment_max_dims', $max_dims)) && file_exists($src_file) ) { $imagesize = getimagesize($src_file); if (($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1] ) { $actual_aspect = $imagesize[0] / $imagesize[1]; $desired_aspect = $max_dims[0] / $max_dims[1]; if ( $actual_aspect >= $desired_aspect ) { $height = $actual_aspect * $max_dims[0]; $constraint = "width='{$max_dims[0]}' "; $post->iconsize = array($max_dims[0], $height); } else { $width = $max_dims[1] / $actual_aspect; $constraint = "height='{$max_dims[1]}' "; $post->iconsize = array($width, $max_dims[1]); } } else { $post->iconsize = array($imagesize[0], $imagesize[1]); $constraint = ''; } } else { $constraint = ''; } $post_title = attribute_escape($post->post_title); $icon = "$post_title"; return apply_filters( 'attachment_icon', $icon, $post->ID ); } // deprecated: use wp_get_attachment_image() function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) { $id = (int) $id; if ( !$post = & get_post($id) ) return false; if ( $innerHTML = get_attachment_icon($post->ID, $fullsize, $max_dims)) return $innerHTML; $innerHTML = attribute_escape($post->post_title); return apply_filters('attachment_innerHTML', $innerHTML, $post->ID); } function prepend_attachment($content) { global $post; if ( empty($post->post_type) || $post->post_type != 'attachment' ) return $content; $p = '

    '; // show the medium sized image representation of the attachment if available, and link to the raw file $p .= wp_get_attachment_link(0, 'medium', false); $p .= '

    '; $p = apply_filters('prepend_attachment', $p); return "$p\n$content"; } // // Misc // function get_the_password_form() { global $post; $label = 'pwbox-'.(empty($post->ID) ? rand() : $post->ID); $output = '

    ' . __("This post is password protected. To view it please enter your password below:") . '

    '; return $output; } /** * is_page_template() - Determine wether or not we are in a page template * * This template tag allows you to determine wether or not you are in a page template. * You can optional provide a template name and then the check will be specific to * that template. * * @package Template Tags * @global object $wp_query * @param string $template The specific template name if specific matching is required */ function is_page_template($template = '') { if (!is_page()) { return false; } global $wp_query; $page = $wp_query->get_queried_object(); $custom_fields = get_post_custom_values('_wp_page_template',$page->ID); $page_template = $custom_fields[0]; // We have no argument passed so just see if a page_template has been specified if ( empty( $template ) ) { if (!empty( $page_template ) ) { return true; } } elseif ( $template == $page_template) { return true; } return false; } /** * wp_post_revision_title() - returns formatted datetimestamp of a revision (linked to that revisions's page) * * @package WordPress * @subpackage Post Revisions * @since 2.6 * * @uses date_i18n() * * @param int|object $revision revision ID or revision object * @param bool $link optional Link to revisions's page? * @return string i18n formatted datetimestamp or localized 'Corrent Revision' */ function wp_post_revision_title( $revision, $link = true ) { if ( !$revision = get_post( $revision ) ) return $revision; if ( !in_array( $revision->post_type, array( 'post', 'page', 'revision' ) ) ) return false; $datef = _c( 'j F, Y @ G:i|revision date format'); $autosavef = __( '%s [Autosave]' ); $currentf = __( '%s [Current Revision]' ); $date = date_i18n( $datef, strtotime( $revision->post_modified_gmt . ' +0000' ) ); if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) ) $date = "$date"; if ( !wp_is_post_revision( $revision ) ) $date = sprintf( $currentf, $date ); elseif ( wp_is_post_autosave( $revision ) ) $date = sprintf( $autosavef, $date ); return $date; } /** * wp_list_post_revisions() - echoes list of a post's revisions * * Can output either a UL with edit links or a TABLE with diff interface, and restore action links * * Second argument controls parameters: * (bool) parent : include the parent (the "Current Revision") in the list * (string) format : 'list' or 'form-table'. 'list' outputs UL, 'form-table' outputs TABLE with UI * (int) right : what revision is currently being viewed - used in form-table format * (int) left : what revision is currently being diffed against right - used in form-table format * * @package WordPress * @subpackage Post Revisions * @since 2.6 * * @uses wp_get_post_revisions() * @uses wp_post_revision_title() * @uses get_edit_post_link() * @uses get_author_name() * * @param int|object $post_id post ID or post object * @param string|array $args see description @see wp_parse_args() */ function wp_list_post_revisions( $post_id = 0, $args = null ) { // TODO? split into two functions (list, form-table) ? if ( !$post = get_post( $post_id ) ) return; $defaults = array( 'parent' => false, 'right' => false, 'left' => false, 'format' => 'list', 'type' => 'all' ); extract( wp_parse_args( $args, $defaults ), EXTR_SKIP ); switch ( $type ) { case 'autosave' : if ( !$autosave = wp_get_post_autosave( $post->ID ) ) return; $revisions = array( $autosave ); break; case 'revision' : // just revisions - remove autosave later case 'all' : default : if ( !$revisions = wp_get_post_revisions( $post->ID ) ) return; break; } $titlef = _c( '%1$s by %2$s|post revision 1:datetime, 2:name' ); if ( $parent ) array_unshift( $revisions, $post ); $rows = ''; $class = false; $can_edit_post = current_user_can( 'edit_post', $post->ID ); foreach ( $revisions as $revision ) { if ( !current_user_can( 'read_post', $revision->ID ) ) continue; if ( 'revision' === $type && wp_is_post_autosave( $revision ) ) continue; $date = wp_post_revision_title( $revision ); $name = get_author_name( $revision->post_author ); if ( 'form-table' == $format ) { if ( $left ) $left_checked = $left == $revision->ID ? ' checked="checked"' : ''; else $left_checked = $right_checked ? ' checked="checked"' : ''; // [sic] (the next one) $right_checked = $right == $revision->ID ? ' checked="checked"' : ''; $class = $class ? '' : " class='alternate'"; if ( $post->ID != $revision->ID && $can_edit_post ) $actions = 'ID|$revision->ID" ) . '">' . __( 'Restore' ) . ''; else $actions = ''; $rows .= "\n"; $rows .= "\t\n"; $rows .= "\t$date\n"; $rows .= "\t$name\n"; $rows .= "\t$actions\n"; $rows .= "\n"; } else { $title = sprintf( $titlef, $date, $name ); $rows .= "\t
  • $title
  • \n"; } } if ( 'form-table' == $format ) : ?>

    \n"; echo $rows; echo ""; endif; } wp/dev/wp-includes/rewrite.php0000644000106600010660000010234211050117170013621 0ustar add_rule($regex, $redirect, $after); } //Add a new tag (like %postname%) //warning: you must call this on init or earlier, otherwise the query var addition stuff won't work function add_rewrite_tag($tagname, $regex) { //validation if (strlen($tagname) < 3 || $tagname{0} != '%' || $tagname{strlen($tagname)-1} != '%') { return; } $qv = trim($tagname, '%'); global $wp_rewrite, $wp; $wp->add_query_var($qv); $wp_rewrite->add_rewrite_tag($tagname, $regex, $qv . '='); } //Add a new feed type like /atom1/ function add_feed($feedname, $function) { global $wp_rewrite; if (!in_array($feedname, $wp_rewrite->feeds)) { //override the file if it is $wp_rewrite->feeds[] = $feedname; } $hook = 'do_feed_' . $feedname; // Remove default function hook remove_action($hook, $hook, 10, 1); add_action($hook, $function, 10, 1); return $hook; } define('EP_PERMALINK', 1 ); define('EP_ATTACHMENT', 2 ); define('EP_DATE', 4 ); define('EP_YEAR', 8 ); define('EP_MONTH', 16 ); define('EP_DAY', 32 ); define('EP_ROOT', 64 ); define('EP_COMMENTS', 128 ); define('EP_SEARCH', 256 ); define('EP_CATEGORIES', 512 ); define('EP_TAGS', 1024 ); define('EP_AUTHORS', 2048); define('EP_PAGES', 4096); //pseudo-places define('EP_NONE', 0 ); define('EP_ALL', 8191); //and an endpoint, like /trackback/ function add_rewrite_endpoint($name, $places) { global $wp_rewrite; $wp_rewrite->add_endpoint($name, $places); } /** * _wp_filter_taxonomy_base() - filter the URL base for taxonomies, to remove any manually prepended /index.php/ * @param string $base the taxonomy base that we're going to filter * @return string * @author Mark Jaquith */ function _wp_filter_taxonomy_base( $base ) { if ( !empty( $base ) ) { $base = preg_replace( '|^/index\.php/|', '', $base ); $base = trim( $base, '/' ); } return $base; } // examine a url (supposedly from this blog) and try to // determine the post ID it represents. function url_to_postid($url) { global $wp_rewrite; $url = apply_filters('url_to_postid', $url); // First, check to see if there is a 'p=N' or 'page_id=N' to match against if ( preg_match('#[?&](p|page_id|attachment_id)=(\d+)#', $url, $values) ) { $id = absint($values[2]); if ($id) return $id; } // Check to see if we are using rewrite rules $rewrite = $wp_rewrite->wp_rewrite_rules(); // Not using rewrite rules, and 'p=N' and 'page_id=N' methods failed, so we're out of options if ( empty($rewrite) ) return 0; // $url cleanup by Mark Jaquith // This fixes things like #anchors, ?query=strings, missing 'www.', // added 'www.', or added 'index.php/' that will mess up our WP_Query // and return a false negative // Get rid of the #anchor $url_split = explode('#', $url); $url = $url_split[0]; // Get rid of URL ?query=string $url_split = explode('?', $url); $url = $url_split[0]; // Add 'www.' if it is absent and should be there if ( false !== strpos(get_option('home'), '://www.') && false === strpos($url, '://www.') ) $url = str_replace('://', '://www.', $url); // Strip 'www.' if it is present and shouldn't be if ( false === strpos(get_option('home'), '://www.') ) $url = str_replace('://www.', '://', $url); // Strip 'index.php/' if we're not using path info permalinks if ( !$wp_rewrite->using_index_permalinks() ) $url = str_replace('index.php/', '', $url); if ( false !== strpos($url, get_option('home')) ) { // Chop off http://domain.com $url = str_replace(get_option('home'), '', $url); } else { // Chop off /path/to/blog $home_path = parse_url(get_option('home')); $home_path = $home_path['path']; $url = str_replace($home_path, '', $url); } // Trim leading and lagging slashes $url = trim($url, '/'); $request = $url; // Done with cleanup // Look for matches. $request_match = $request; foreach ($rewrite as $match => $query) { // If the requesting file is the anchor of the match, prepend it // to the path info. if ( (! empty($url)) && (strpos($match, $url) === 0) && ($url != $request)) { $request_match = $url . '/' . $request; } if ( preg_match("!^$match!", $request_match, $matches) ) { // Got a match. // Trim the query of everything up to the '?'. $query = preg_replace("!^.+\?!", '', $query); // Substitute the substring matches into the query. eval("\$query = \"" . addslashes($query) . "\";"); // Filter out non-public query vars global $wp; parse_str($query, $query_vars); $query = array(); foreach ( $query_vars as $key => $value ) { if ( in_array($key, $wp->public_query_vars) ) $query[$key] = $value; } // Do the query $query = new WP_Query($query); if ( $query->is_single || $query->is_page ) return $query->post->ID; else return 0; } } return 0; } /* WP_Rewrite class *******************************************************************************/ class WP_Rewrite { var $permalink_structure; var $use_trailing_slashes; var $category_base; var $tag_base; var $category_structure; var $tag_structure; var $author_base = 'author'; var $author_structure; var $date_structure; var $page_structure; var $search_base = 'search'; var $search_structure; var $comments_base = 'comments'; var $feed_base = 'feed'; var $comments_feed_structure; var $feed_structure; var $front; var $root = ''; var $index = 'index.php'; var $matches = ''; var $rules; var $extra_rules = array(); //those not generated by the class, see add_rewrite_rule() var $extra_rules_top = array(); //those not generated by the class, see add_rewrite_rule() var $non_wp_rules = array(); //rules that don't redirect to WP's index.php var $extra_permastructs = array(); var $endpoints; var $use_verbose_rules = false; var $use_verbose_page_rules = true; var $rewritecode = array( '%year%', '%monthnum%', '%day%', '%hour%', '%minute%', '%second%', '%postname%', '%post_id%', '%category%', '%tag%', '%author%', '%pagename%', '%search%' ); var $rewritereplace = array( '([0-9]{4})', '([0-9]{1,2})', '([0-9]{1,2})', '([0-9]{1,2})', '([0-9]{1,2})', '([0-9]{1,2})', '([^/]+)', '([0-9]+)', '(.+?)', '(.+?)', '([^/]+)', '([^/]+?)', '(.+)' ); var $queryreplace = array ( 'year=', 'monthnum=', 'day=', 'hour=', 'minute=', 'second=', 'name=', 'p=', 'category_name=', 'tag=', 'author_name=', 'pagename=', 's=' ); var $feeds = array ( 'feed', 'rdf', 'rss', 'rss2', 'atom' ); function using_permalinks() { if (empty($this->permalink_structure)) return false; else return true; } function using_index_permalinks() { if (empty($this->permalink_structure)) { return false; } // If the index is not in the permalink, we're using mod_rewrite. if (preg_match('#^/*' . $this->index . '#', $this->permalink_structure)) { return true; } return false; } function using_mod_rewrite_permalinks() { if ( $this->using_permalinks() && ! $this->using_index_permalinks()) return true; else return false; } function preg_index($number) { $match_prefix = '$'; $match_suffix = ''; if (! empty($this->matches)) { $match_prefix = '$' . $this->matches . '['; $match_suffix = ']'; } return "$match_prefix$number$match_suffix"; } function page_uri_index() { global $wpdb; //get pages in order of hierarchy, i.e. children after parents $posts = get_page_hierarchy($wpdb->get_results("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_type = 'page'")); //now reverse it, because we need parents after children for rewrite rules to work properly $posts = array_reverse($posts, true); $page_uris = array(); $page_attachment_uris = array(); if ( !$posts ) return array( array(), array() ); foreach ($posts as $id => $post) { // URL => page name $uri = get_page_uri($id); $attachments = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent = %d", $id )); if ( $attachments ) { foreach ( $attachments as $attachment ) { $attach_uri = get_page_uri($attachment->ID); $page_attachment_uris[$attach_uri] = $attachment->ID; } } $page_uris[$uri] = $id; } return array( $page_uris, $page_attachment_uris ); } function page_rewrite_rules() { $rewrite_rules = array(); $page_structure = $this->get_page_permastruct(); if ( ! $this->use_verbose_page_rules ) { $this->add_rewrite_tag('%pagename%', "(.+?)", 'pagename='); $rewrite_rules = array_merge($rewrite_rules, $this->generate_rewrite_rules($page_structure, EP_PAGES)); return $rewrite_rules; } $page_uris = $this->page_uri_index(); $uris = $page_uris[0]; $attachment_uris = $page_uris[1]; if( is_array( $attachment_uris ) ) { foreach ($attachment_uris as $uri => $pagename) { $this->add_rewrite_tag('%pagename%', "($uri)", 'attachment='); $rewrite_rules = array_merge($rewrite_rules, $this->generate_rewrite_rules($page_structure, EP_PAGES)); } } if( is_array( $uris ) ) { foreach ($uris as $uri => $pagename) { $this->add_rewrite_tag('%pagename%', "($uri)", 'pagename='); $rewrite_rules = array_merge($rewrite_rules, $this->generate_rewrite_rules($page_structure, EP_PAGES)); } } return $rewrite_rules; } function get_date_permastruct() { if (isset($this->date_structure)) { return $this->date_structure; } if (empty($this->permalink_structure)) { $this->date_structure = ''; return false; } // The date permalink must have year, month, and day separated by slashes. $endians = array('%year%/%monthnum%/%day%', '%day%/%monthnum%/%year%', '%monthnum%/%day%/%year%'); $this->date_structure = ''; $date_endian = ''; foreach ($endians as $endian) { if (false !== strpos($this->permalink_structure, $endian)) { $date_endian= $endian; break; } } if ( empty($date_endian) ) $date_endian = '%year%/%monthnum%/%day%'; // Do not allow the date tags and %post_id% to overlap in the permalink // structure. If they do, move the date tags to $front/date/. $front = $this->front; preg_match_all('/%.+?%/', $this->permalink_structure, $tokens); $tok_index = 1; foreach ($tokens[0] as $token) { if ( ($token == '%post_id%') && ($tok_index <= 3) ) { $front = $front . 'date/'; break; } $tok_index++; } $this->date_structure = $front . $date_endian; return $this->date_structure; } function get_year_permastruct() { $structure = $this->get_date_permastruct($this->permalink_structure); if (empty($structure)) { return false; } $structure = str_replace('%monthnum%', '', $structure); $structure = str_replace('%day%', '', $structure); $structure = preg_replace('#/+#', '/', $structure); return $structure; } function get_month_permastruct() { $structure = $this->get_date_permastruct($this->permalink_structure); if (empty($structure)) { return false; } $structure = str_replace('%day%', '', $structure); $structure = preg_replace('#/+#', '/', $structure); return $structure; } function get_day_permastruct() { return $this->get_date_permastruct($this->permalink_structure); } function get_category_permastruct() { if (isset($this->category_structure)) { return $this->category_structure; } if (empty($this->permalink_structure)) { $this->category_structure = ''; return false; } if (empty($this->category_base)) $this->category_structure = trailingslashit( $this->front . 'category' ); else $this->category_structure = trailingslashit( '/' . $this->root . $this->category_base ); $this->category_structure .= '%category%'; return $this->category_structure; } function get_tag_permastruct() { if (isset($this->tag_structure)) { return $this->tag_structure; } if (empty($this->permalink_structure)) { $this->tag_structure = ''; return false; } if (empty($this->tag_base)) $this->tag_structure = trailingslashit( $this->front . 'tag' ); else $this->tag_structure = trailingslashit( '/' . $this->root . $this->tag_base ); $this->tag_structure .= '%tag%'; return $this->tag_structure; } function get_extra_permastruct($name) { if ( isset($this->extra_permastructs[$name]) ) return $this->extra_permastructs[$name]; return false; } function get_author_permastruct() { if (isset($this->author_structure)) { return $this->author_structure; } if (empty($this->permalink_structure)) { $this->author_structure = ''; return false; } $this->author_structure = $this->front . $this->author_base . '/%author%'; return $this->author_structure; } function get_search_permastruct() { if (isset($this->search_structure)) { return $this->search_structure; } if (empty($this->permalink_structure)) { $this->search_structure = ''; return false; } $this->search_structure = $this->root . $this->search_base . '/%search%'; return $this->search_structure; } function get_page_permastruct() { if (isset($this->page_structure)) { return $this->page_structure; } if (empty($this->permalink_structure)) { $this->page_structure = ''; return false; } $this->page_structure = $this->root . '%pagename%'; return $this->page_structure; } function get_feed_permastruct() { if (isset($this->feed_structure)) { return $this->feed_structure; } if (empty($this->permalink_structure)) { $this->feed_structure = ''; return false; } $this->feed_structure = $this->root . $this->feed_base . '/%feed%'; return $this->feed_structure; } function get_comment_feed_permastruct() { if (isset($this->comment_feed_structure)) { return $this->comment_feed_structure; } if (empty($this->permalink_structure)) { $this->comment_feed_structure = ''; return false; } $this->comment_feed_structure = $this->root . $this->comments_base . '/' . $this->feed_base . '/%feed%'; return $this->comment_feed_structure; } function add_rewrite_tag($tag, $pattern, $query) { // If the tag already exists, replace the existing pattern and query for // that tag, otherwise add the new tag, pattern, and query to the end of // the arrays. $position = array_search($tag, $this->rewritecode); if (FALSE !== $position && NULL !== $position) { $this->rewritereplace[$position] = $pattern; $this->queryreplace[$position] = $query; } else { $this->rewritecode[] = $tag; $this->rewritereplace[] = $pattern; $this->queryreplace[] = $query; } } //the main WP_Rewrite function. generate the rules from permalink structure function generate_rewrite_rules($permalink_structure, $ep_mask = EP_NONE, $paged = true, $feed = true, $forcomments = false, $walk_dirs = true, $endpoints = true) { //build a regex to match the feed section of URLs, something like (feed|atom|rss|rss2)/? $feedregex2 = ''; foreach ($this->feeds as $feed_name) { $feedregex2 .= $feed_name . '|'; } $feedregex2 = '(' . trim($feedregex2, '|') . ')/?$'; //$feedregex is identical but with /feed/ added on as well, so URLs like /feed/atom //and /atom are both possible $feedregex = $this->feed_base . '/' . $feedregex2; //build a regex to match the trackback and page/xx parts of URLs $trackbackregex = 'trackback/?$'; $pageregex = 'page/?([0-9]{1,})/?$'; //build up an array of endpoint regexes to append => queries to append if ($endpoints) { $ep_query_append = array (); foreach ($this->endpoints as $endpoint) { //match everything after the endpoint name, but allow for nothing to appear there $epmatch = $endpoint[1] . '(/(.*))?/?$'; //this will be appended on to the rest of the query for each dir $epquery = '&' . $endpoint[1] . '='; $ep_query_append[$epmatch] = array ( $endpoint[0], $epquery ); } } //get everything up to the first rewrite tag $front = substr($permalink_structure, 0, strpos($permalink_structure, '%')); //build an array of the tags (note that said array ends up being in $tokens[0]) preg_match_all('/%.+?%/', $permalink_structure, $tokens); $num_tokens = count($tokens[0]); $index = $this->index; //probably 'index.php' $feedindex = $index; $trackbackindex = $index; //build a list from the rewritecode and queryreplace arrays, that will look something like //tagname=$matches[i] where i is the current $i for ($i = 0; $i < $num_tokens; ++$i) { if (0 < $i) { $queries[$i] = $queries[$i - 1] . '&'; } else { $queries[$i] = ''; } $query_token = str_replace($this->rewritecode, $this->queryreplace, $tokens[0][$i]) . $this->preg_index($i+1); $queries[$i] .= $query_token; } //get the structure, minus any cruft (stuff that isn't tags) at the front $structure = $permalink_structure; if ($front != '/') { $structure = str_replace($front, '', $structure); } //create a list of dirs to walk over, making rewrite rules for each level //so for example, a $structure of /%year%/%month%/%postname% would create //rewrite rules for /%year%/, /%year%/%month%/ and /%year%/%month%/%postname% $structure = trim($structure, '/'); if ($walk_dirs) { $dirs = explode('/', $structure); } else { $dirs[] = $structure; } $num_dirs = count($dirs); //strip slashes from the front of $front $front = preg_replace('|^/+|', '', $front); //the main workhorse loop $post_rewrite = array(); $struct = $front; for ($j = 0; $j < $num_dirs; ++$j) { //get the struct for this dir, and trim slashes off the front $struct .= $dirs[$j] . '/'; //accumulate. see comment near explode('/', $structure) above $struct = ltrim($struct, '/'); //replace tags with regexes $match = str_replace($this->rewritecode, $this->rewritereplace, $struct); //make a list of tags, and store how many there are in $num_toks $num_toks = preg_match_all('/%.+?%/', $struct, $toks); //get the 'tagname=$matches[i]' $query = ( isset($queries) && is_array($queries) ) ? $queries[$num_toks - 1] : ''; //set up $ep_mask_specific which is used to match more specific URL types switch ($dirs[$j]) { case '%year%': $ep_mask_specific = EP_YEAR; break; case '%monthnum%': $ep_mask_specific = EP_MONTH; break; case '%day%': $ep_mask_specific = EP_DAY; break; } //create query for /page/xx $pagematch = $match . $pageregex; $pagequery = $index . '?' . $query . '&paged=' . $this->preg_index($num_toks + 1); //create query for /feed/(feed|atom|rss|rss2|rdf) $feedmatch = $match . $feedregex; $feedquery = $feedindex . '?' . $query . '&feed=' . $this->preg_index($num_toks + 1); //create query for /(feed|atom|rss|rss2|rdf) (see comment near creation of $feedregex) $feedmatch2 = $match . $feedregex2; $feedquery2 = $feedindex . '?' . $query . '&feed=' . $this->preg_index($num_toks + 1); //if asked to, turn the feed queries into comment feed ones if ($forcomments) { $feedquery .= '&withcomments=1'; $feedquery2 .= '&withcomments=1'; } //start creating the array of rewrites for this dir $rewrite = array(); if ($feed) //...adding on /feed/ regexes => queries $rewrite = array($feedmatch => $feedquery, $feedmatch2 => $feedquery2); if ($paged) //...and /page/xx ones $rewrite = array_merge($rewrite, array($pagematch => $pagequery)); //do endpoints if ($endpoints) { foreach ($ep_query_append as $regex => $ep) { //add the endpoints on if the mask fits if ($ep[0] & $ep_mask || $ep[0] & $ep_mask_specific) { $rewrite[$match . $regex] = $index . '?' . $query . $ep[1] . $this->preg_index($num_toks + 2); } } } //if we've got some tags in this dir if ($num_toks) { $post = false; $page = false; //check to see if this dir is permalink-level: i.e. the structure specifies an //individual post. Do this by checking it contains at least one of 1) post name, //2) post ID, 3) page name, 4) timestamp (year, month, day, hour, second and //minute all present). Set these flags now as we need them for the endpoints. if (strpos($struct, '%postname%') !== false || strpos($struct, '%post_id%') !== false || strpos($struct, '%pagename%') !== false || (strpos($struct, '%year%') !== false && strpos($struct, '%monthnum%') !== false && strpos($struct, '%day%') !== false && strpos($struct, '%hour%') !== false && strpos($struct, '%minute%') !== false && strpos($struct, '%second%') !== false)) { $post = true; if (strpos($struct, '%pagename%') !== false) $page = true; } //if we're creating rules for a permalink, do all the endpoints like attachments etc if ($post) { $post = true; //create query and regex for trackback $trackbackmatch = $match . $trackbackregex; $trackbackquery = $trackbackindex . '?' . $query . '&tb=1'; //trim slashes from the end of the regex for this dir $match = rtrim($match, '/'); //get rid of brackets $submatchbase = str_replace(array('(',')'),'',$match); //add a rule for at attachments, which take the form of /some-text $sub1 = $submatchbase . '/([^/]+)/'; $sub1tb = $sub1 . $trackbackregex; //add trackback regex /trackback/... $sub1feed = $sub1 . $feedregex; //and /feed/(atom|...) $sub1feed2 = $sub1 . $feedregex2; //and /(feed|atom...) //add an ? as we don't have to match that last slash, and finally a $ so we //match to the end of the URL //add another rule to match attachments in the explicit form: ///attachment/some-text $sub2 = $submatchbase . '/attachment/([^/]+)/'; $sub2tb = $sub2 . $trackbackregex; //and add trackbacks /attachment/trackback $sub2feed = $sub2 . $feedregex; //feeds, /attachment/feed/(atom|...) $sub2feed2 = $sub2 . $feedregex2; //and feeds again on to this /attachment/(feed|atom...) //create queries for these extra tag-ons we've just dealt with $subquery = $index . '?attachment=' . $this->preg_index(1); $subtbquery = $subquery . '&tb=1'; $subfeedquery = $subquery . '&feed=' . $this->preg_index(2); //do endpoints for attachments if (! empty($endpoint) ) { foreach ($ep_query_append as $regex => $ep) { if ($ep[0] & EP_ATTACHMENT) { $rewrite[$sub1 . $regex] = $subquery . '?' . $ep[1] . $this->preg_index(2); $rewrite[$sub2 . $regex] = $subquery . '?' . $ep[1] . $this->preg_index(2); } } } //now we've finished with endpoints, finish off the $sub1 and $sub2 matches $sub1 .= '?$'; $sub2 .= '?$'; //allow URLs like /2 for /page/2 $match = $match . '(/[0-9]+)?/?$'; $query = $index . '?' . $query . '&page=' . $this->preg_index($num_toks + 1); } else { //not matching a permalink so this is a lot simpler //close the match and finalise the query $match .= '?$'; $query = $index . '?' . $query; } //create the final array for this dir by joining the $rewrite array (which currently //only contains rules/queries for trackback, pages etc) to the main regex/query for //this dir $rewrite = array_merge($rewrite, array($match => $query)); //if we're matching a permalink, add those extras (attachments etc) on if ($post) { //add trackback $rewrite = array_merge(array($trackbackmatch => $trackbackquery), $rewrite); //add regexes/queries for attachments, attachment trackbacks and so on if ( ! $page ) //require /attachment/stuff form for pages because of confusion with subpages $rewrite = array_merge($rewrite, array($sub1 => $subquery, $sub1tb => $subtbquery, $sub1feed => $subfeedquery, $sub1feed2 => $subfeedquery)); $rewrite = array_merge(array($sub2 => $subquery, $sub2tb => $subtbquery, $sub2feed => $subfeedquery, $sub2feed2 => $subfeedquery), $rewrite); } } //if($num_toks) //add the rules for this dir to the accumulating $post_rewrite $post_rewrite = array_merge($rewrite, $post_rewrite); } //foreach ($dir) return $post_rewrite; //the finished rules. phew! } function generate_rewrite_rule($permalink_structure, $walk_dirs = false) { return $this->generate_rewrite_rules($permalink_structure, EP_NONE, false, false, false, $walk_dirs); } /* rewrite_rules * Construct rewrite matches and queries from permalink structure. * Returns an associate array of matches and queries. */ function rewrite_rules() { $rewrite = array(); if (empty($this->permalink_structure)) { return $rewrite; } // robots.txt $robots_rewrite = array('robots.txt$' => $this->index . '?robots=1'); //Default Feed rules - These are require to allow for the direct access files to work with permalink structure starting with %category% $default_feeds = array( '.*wp-atom.php$' => $this->index .'?feed=atom', '.*wp-rdf.php$' => $this->index .'?feed=rdf', '.*wp-rss.php$' => $this->index .'?feed=rss', '.*wp-rss2.php$' => $this->index .'?feed=rss2', '.*wp-feed.php$' => $this->index .'?feed=feed', '.*wp-commentsrss2.php$' => $this->index . '?feed=rss2&withcomments=1'); // Post $post_rewrite = $this->generate_rewrite_rules($this->permalink_structure, EP_PERMALINK); $post_rewrite = apply_filters('post_rewrite_rules', $post_rewrite); // Date $date_rewrite = $this->generate_rewrite_rules($this->get_date_permastruct(), EP_DATE); $date_rewrite = apply_filters('date_rewrite_rules', $date_rewrite); // Root $root_rewrite = $this->generate_rewrite_rules($this->root . '/', EP_ROOT); $root_rewrite = apply_filters('root_rewrite_rules', $root_rewrite); // Comments $comments_rewrite = $this->generate_rewrite_rules($this->root . $this->comments_base, EP_COMMENTS, true, true, true, false); $comments_rewrite = apply_filters('comments_rewrite_rules', $comments_rewrite); // Search $search_structure = $this->get_search_permastruct(); $search_rewrite = $this->generate_rewrite_rules($search_structure, EP_SEARCH); $search_rewrite = apply_filters('search_rewrite_rules', $search_rewrite); // Categories $category_rewrite = $this->generate_rewrite_rules($this->get_category_permastruct(), EP_CATEGORIES); $category_rewrite = apply_filters('category_rewrite_rules', $category_rewrite); // Tags $tag_rewrite = $this->generate_rewrite_rules($this->get_tag_permastruct(), EP_TAGS); $tag_rewrite = apply_filters('tag_rewrite_rules', $tag_rewrite); // Authors $author_rewrite = $this->generate_rewrite_rules($this->get_author_permastruct(), EP_AUTHORS); $author_rewrite = apply_filters('author_rewrite_rules', $author_rewrite); // Pages $page_rewrite = $this->page_rewrite_rules(); $page_rewrite = apply_filters('page_rewrite_rules', $page_rewrite); // Extra permastructs foreach ( $this->extra_permastructs as $permastruct ) $this->extra_rules_top = array_merge($this->extra_rules_top, $this->generate_rewrite_rules($permastruct, EP_NONE)); // Put them together. if ( $this->use_verbose_page_rules ) $this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $default_feeds, $page_rewrite, $root_rewrite, $comments_rewrite, $search_rewrite, $category_rewrite, $tag_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $this->extra_rules); else $this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $default_feeds, $root_rewrite, $comments_rewrite, $search_rewrite, $category_rewrite, $tag_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $page_rewrite, $this->extra_rules); do_action_ref_array('generate_rewrite_rules', array(&$this)); $this->rules = apply_filters('rewrite_rules_array', $this->rules); return $this->rules; } function wp_rewrite_rules() { $this->rules = get_option('rewrite_rules'); if ( empty($this->rules) ) { $this->matches = 'matches'; $this->rewrite_rules(); update_option('rewrite_rules', $this->rules); } return $this->rules; } function mod_rewrite_rules() { if ( ! $this->using_permalinks()) { return ''; } $site_root = parse_url(get_option('siteurl')); $site_root = trailingslashit($site_root['path']); $home_root = parse_url(get_option('home')); $home_root = trailingslashit($home_root['path']); $rules = "\n"; $rules .= "RewriteEngine On\n"; $rules .= "RewriteBase $home_root\n"; //add in the rules that don't redirect to WP's index.php (and thus shouldn't be handled by WP at all) foreach ($this->non_wp_rules as $match => $query) { // Apache 1.3 does not support the reluctant (non-greedy) modifier. $match = str_replace('.+?', '.+', $match); // If the match is unanchored and greedy, prepend rewrite conditions // to avoid infinite redirects and eclipsing of real files. if ($match == '(.+)/?$' || $match == '([^/]+)/?$' ) { //nada. } $rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA,L]\n"; } if ($this->use_verbose_rules) { $this->matches = ''; $rewrite = $this->rewrite_rules(); $num_rules = count($rewrite); $rules .= "RewriteCond %{REQUEST_FILENAME} -f [OR]\n" . "RewriteCond %{REQUEST_FILENAME} -d\n" . "RewriteRule ^.*$ - [S=$num_rules]\n"; foreach ($rewrite as $match => $query) { // Apache 1.3 does not support the reluctant (non-greedy) modifier. $match = str_replace('.+?', '.+', $match); // If the match is unanchored and greedy, prepend rewrite conditions // to avoid infinite redirects and eclipsing of real files. if ($match == '(.+)/?$' || $match == '([^/]+)/?$' ) { //nada. } if (strpos($query, $this->index) !== false) { $rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA,L]\n"; } else { $rules .= 'RewriteRule ^' . $match . ' ' . $site_root . $query . " [QSA,L]\n"; } } } else { $rules .= "RewriteCond %{REQUEST_FILENAME} !-f\n" . "RewriteCond %{REQUEST_FILENAME} !-d\n" . "RewriteRule . {$home_root}{$this->index} [L]\n"; } $rules .= "\n"; $rules = apply_filters('mod_rewrite_rules', $rules); $rules = apply_filters('rewrite_rules', $rules); // Deprecated return $rules; } //Add a straight rewrite rule function add_rule($regex, $redirect, $after = 'bottom') { //get everything up to the first ? $index = (strpos($redirect, '?') == false ? strlen($redirect) : strpos($redirect, '?')); $front = substr($redirect, 0, $index); if ($front != $this->index) { //it doesn't redirect to WP's index.php $this->add_external_rule($regex, $redirect); } else { if ( 'bottom' == $after) $this->extra_rules = array_merge($this->extra_rules, array($regex => $redirect)); else $this->extra_rules_top = array_merge($this->extra_rules_top, array($regex => $redirect)); //$this->extra_rules[$regex] = $redirect; } } //add a rule that doesn't redirect to index.php function add_external_rule($regex, $redirect) { $this->non_wp_rules[$regex] = $redirect; } //add an endpoint, like /trackback/, to be inserted after certain URL types (specified in $places) function add_endpoint($name, $places) { global $wp; $this->endpoints[] = array ( $places, $name ); $wp->add_query_var($name); } function add_permastruct($name, $struct, $with_front = true) { if ( $with_front ) $struct = $this->front . $struct; $this->extra_permastructs[$name] = $struct; } function flush_rules() { delete_option('rewrite_rules'); $this->wp_rewrite_rules(); if ( function_exists('save_mod_rewrite_rules') ) save_mod_rewrite_rules(); } function init() { $this->extra_rules = $this->non_wp_rules = $this->endpoints = array(); $this->permalink_structure = get_option('permalink_structure'); $this->front = substr($this->permalink_structure, 0, strpos($this->permalink_structure, '%')); $this->root = ''; if ($this->using_index_permalinks()) { $this->root = $this->index . '/'; } $this->category_base = get_option( 'category_base' ); $this->tag_base = get_option( 'tag_base' ); unset($this->category_structure); unset($this->author_structure); unset($this->date_structure); unset($this->page_structure); unset($this->search_structure); unset($this->feed_structure); unset($this->comment_feed_structure); $this->use_trailing_slashes = ( substr($this->permalink_structure, -1, 1) == '/' ) ? true : false; // Enable generic rules for pages if permalink structure doesn't begin with a wildcard. $structure = ltrim($this->permalink_structure, '/'); if ( $this->using_index_permalinks() ) $structure = ltrim($this->permalink_structure, $this->index . '/'); if ( 0 === strpos($structure, '%postname%') || 0 === strpos($structure, '%category%') || 0 === strpos($structure, '%tag%') || 0 === strpos($structure, '%author%') ) $this->use_verbose_page_rules = true; else $this->use_verbose_page_rules = false; } function set_permalink_structure($permalink_structure) { if ($permalink_structure != $this->permalink_structure) { update_option('permalink_structure', $permalink_structure); $this->init(); } } function set_category_base($category_base) { if ($category_base != $this->category_base) { update_option('category_base', $category_base); $this->init(); } } function set_tag_base( $tag_base ) { if ( $tag_base != $this->tag_base ) { update_option( 'tag_base', $tag_base ); $this->init(); } } function WP_Rewrite() { $this->init(); } } ?> wp/dev/wp-includes/feed-rss2.php0000644000106600010660000000406210765546356013762 0ustar '; ?> > <?php bloginfo_rss('name'); wp_title_rss(); ?> <?php the_title_rss() ?> ]]> ]]> post_content ) > 0 ) : ?> ]]> ]]> wp/dev/wp-includes/plugin.php0000644000106600010660000005207311017045414013447 0ustar * function example_hook($example) { echo $example; } * * add_filter('example_filter', 'example_hook'); * * * In WordPress 1.5.1+, hooked functions can take extra arguments that are set when * the matching do_action() or apply_filters() call is run. The $accepted_args * allow for calling functions only when the number of args match. Hooked functions * can take extra arguments that are set when the matching do_action() or * apply_filters() call is run. For example, the action comment_id_not_found * will pass any functions that hook onto it the ID of the requested comment. * * Note: the function will return true no matter if the function was hooked * fails or not. There are no checks for whether the function exists beforehand and no checks * to whether the $function_to_add is even a string. It is up to you to take care and * this is done for optimization purposes, so everything is as quick as possible. * * @package WordPress * @subpackage Plugin * @since 0.71 * @global array $wp_filter Stores all of the filters added in the form of * wp_filter['tag']['array of priorities']['array of functions serialized']['array of ['array (functions, accepted_args)]'] * @global array $merged_filters Tracks the tags that need to be merged for later. If the hook is added, it doesn't need to run through that process. * * @param string $tag The name of the filter to hook the $function_to_add to. * @param callback $function_to_add The name of the function to be called when the filter is applied. * @param int $priority optional. Used to specify the order in which the functions associated with a particular action are executed (default: 10). Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action. * @param int $accepted_args optional. The number of arguments the function accept (default 1). * @return boolean true */ function add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1) { global $wp_filter, $merged_filters; $idx = _wp_filter_build_unique_id($tag, $function_to_add, $priority); $wp_filter[$tag][$priority][$idx] = array('function' => $function_to_add, 'accepted_args' => $accepted_args); unset( $merged_filters[ $tag ] ); return true; } /** * has_filter() - Check if any filter has been registered for a hook. * * @package WordPress * @subpackage Plugin * @since 2.5 * @global array $wp_filter Stores all of the filters * * @param string $tag The name of the filter hook. * @param callback $function_to_check optional. If specified, return the priority of that function on this hook or false if not attached. * @return int|boolean Optionally returns the priority on that hook for the specified function. */ function has_filter($tag, $function_to_check = false) { global $wp_filter; $has = !empty($wp_filter[$tag]); if ( false === $function_to_check || false == $has ) return $has; if ( !$idx = _wp_filter_build_unique_id($tag, $function_to_check, false) ) return false; foreach ( array_keys($wp_filter[$tag]) as $priority ) { if ( isset($wp_filter[$tag][$priority][$idx]) ) return $priority; } return false; } /** * apply_filters() - Call the functions added to a filter hook. * * The callback functions attached to filter hook $tag are invoked by * calling this function. This function can be used to create a new filter hook * by simply calling this function with the name of the new hook specified using * the $tag parameter. * * The function allows for additional arguments to be added and passed to hooks. * * function example_hook($string, $arg1, $arg2) * { * //Do stuff * return $string; * } * $value = apply_filters('example_filter', 'filter me', 'arg1', 'arg2'); * * * @package WordPress * @subpackage Plugin * @since 0.71 * @global array $wp_filter Stores all of the filters * @global array $merge_filters Merges the filter hooks using this function. * @global array $wp_current_filter stores the list of current filters with the current one last * * @param string $tag The name of the filter hook. * @param mixed $value The value on which the filters hooked to $tag are applied on. * @param mixed $var,... Additional variables passed to the functions hooked to $tag. * @return mixed The filtered value after all hooked functions are applied to it. */ function apply_filters($tag, $value) { global $wp_filter, $merged_filters, $wp_current_filter; $args = array(); $wp_current_filter[] = $tag; // Do 'all' actions first if ( isset($wp_filter['all']) ) { $args = func_get_args(); _wp_call_all_hook($args); } if ( !isset($wp_filter[$tag]) ) { array_pop($wp_current_filter); return $value; } // Sort if ( !isset( $merged_filters[ $tag ] ) ) { ksort($wp_filter[$tag]); $merged_filters[ $tag ] = true; } reset( $wp_filter[ $tag ] ); if ( empty($args) ) $args = func_get_args(); do { foreach( (array) current($wp_filter[$tag]) as $the_ ) if ( !is_null($the_['function']) ){ $args[1] = $value; $value = call_user_func_array($the_['function'], array_slice($args, 1, (int) $the_['accepted_args'])); } } while ( next($wp_filter[$tag]) !== false ); array_pop( $wp_current_filter ); return $value; } /** * remove_filter() - Removes a function from a specified filter hook. * * This function removes a function attached to a specified filter hook. This * method can be used to remove default functions attached to a specific filter * hook and possibly replace them with a substitute. * * To remove a hook, the $function_to_remove and $priority arguments * must match when the hook was added. This goes for both filters and actions. No warning * will be given on removal failure. * * @package WordPress * @subpackage Plugin * @since 1.2 * * @param string $tag The filter hook to which the function to be removed is hooked. * @param callback $function_to_remove The name of the function which should be removed. * @param int $priority optional. The priority of the function (default: 10). * @param int $accepted_args optional. The number of arguments the function accpets (default: 1). * @return boolean Whether the function existed before it was removed. */ function remove_filter($tag, $function_to_remove, $priority = 10, $accepted_args = 1) { $function_to_remove = _wp_filter_build_unique_id($tag, $function_to_remove, $priority); $r = isset($GLOBALS['wp_filter'][$tag][$priority][$function_to_remove]); if ( true === $r) { unset($GLOBALS['wp_filter'][$tag][$priority][$function_to_remove]); if ( empty($GLOBALS['wp_filter'][$tag][$priority]) ) unset($GLOBALS['wp_filter'][$tag][$priority]); unset($GLOBALS['merged_filters'][$tag]); } return $r; } /** * current_filter() - Return the name of the current filter or action. * * @package WordPress * @subpackage Plugin * @since 2.5 * * @return string Hook name of the current filter or action. */ function current_filter() { global $wp_current_filter; return end( $wp_current_filter ); } /** * add_action() - Hooks a function on to a specific action. * * Actions are the hooks that the WordPress core launches at specific points * during execution, or when specific events occur. Plugins can specify that * one or more of its PHP functions are executed at these points, using the * Action API. * * @uses add_filter() Adds an action. Parameter list and functionality are the same. * * @package WordPress * @subpackage Plugin * @since 1.2 * * @param string $tag The name of the action to which the $function_to-add is hooked. * @param callback $function_to_add The name of the function you wish to be called. * @param int $priority optional. Used to specify the order in which the functions associated with a particular action are executed (default: 10). Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action. * @param int $accepted_args optional. The number of arguments the function accept (default 1). */ function add_action($tag, $function_to_add, $priority = 10, $accepted_args = 1) { return add_filter($tag, $function_to_add, $priority, $accepted_args); } /** * do_action() - Execute functions hooked on a specific action hook. * * This function invokes all functions attached to action hook $tag. * It is possible to create new action hooks by simply calling this function, * specifying the name of the new hook using the $tag parameter. * * You can pass extra arguments to the hooks, much like you can with apply_filters(). * * @see apply_filters() This function works similar with the exception that nothing is * returned and only the functions or methods are called. * * @package WordPress * @subpackage Plugin * @since 1.2 * @global array $wp_filter Stores all of the filters * @global array $wp_actions Increments the amount of times action was triggered. * * @param string $tag The name of the action to be executed. * @param mixed $arg,... Optional additional arguments which are passed on to the functions hooked to the action. * @return null Will return null if $tag does not exist in $wp_filter array */ function do_action($tag, $arg = '') { global $wp_filter, $wp_actions, $merged_filters, $wp_current_filter; if ( is_array($wp_actions) ) $wp_actions[] = $tag; else $wp_actions = array($tag); $wp_current_filter[] = $tag; // Do 'all' actions first if ( isset($wp_filter['all']) ) { $all_args = func_get_args(); _wp_call_all_hook($all_args); } if ( !isset($wp_filter[$tag]) ) { array_pop($wp_current_filter); return; } $args = array(); if ( is_array($arg) && 1 == count($arg) && is_object($arg[0]) ) // array(&$this) $args[] =& $arg[0]; else $args[] = $arg; for ( $a = 2; $a < func_num_args(); $a++ ) $args[] = func_get_arg($a); // Sort if ( !isset( $merged_filters[ $tag ] ) ) { ksort($wp_filter[$tag]); $merged_filters[ $tag ] = true; } reset( $wp_filter[ $tag ] ); do { foreach ( (array) current($wp_filter[$tag]) as $the_ ) if ( !is_null($the_['function']) ) call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args'])); } while ( next($wp_filter[$tag]) !== false ); array_pop($wp_current_filter); } /** * did_action() - Return the number times an action is fired. * * @package WordPress * @subpackage Plugin * @since 2.1 * @global array $wp_actions Increments the amount of times action was triggered. * * @param string $tag The name of the action hook. * @return int The number of times action hook $tag is fired */ function did_action($tag) { global $wp_actions; if ( empty($wp_actions) ) return 0; return count(array_keys($wp_actions, $tag)); } /** * do_action_ref_array() - Execute functions hooked on a specific action hook, specifying arguments in an array. * * @see do_action() This function is identical, but the arguments passed to * the functions hooked to $tag are supplied using an array. * * @package WordPress * @subpackage Plugin * @since 2.1 * @global array $wp_filter Stores all of the filters * @global array $wp_actions Increments the amount of times action was triggered. * * @param string $tag The name of the action to be executed. * @param array $args The arguments supplied to the functions hooked to $tag * @return null Will return null if $tag does not exist in $wp_filter array */ function do_action_ref_array($tag, $args) { global $wp_filter, $wp_actions, $merged_filters, $wp_current_filter; if ( !is_array($wp_actions) ) $wp_actions = array($tag); else $wp_actions[] = $tag; $wp_current_filter[] = $tag; // Do 'all' actions first if ( isset($wp_filter['all']) ) { $all_args = func_get_args(); _wp_call_all_hook($all_args); } if ( !isset($wp_filter[$tag]) ) { array_pop($wp_current_filter); return; } // Sort if ( !isset( $merged_filters[ $tag ] ) ) { ksort($wp_filter[$tag]); $merged_filters[ $tag ] = true; } reset( $wp_filter[ $tag ] ); do { foreach( (array) current($wp_filter[$tag]) as $the_ ) if ( !is_null($the_['function']) ) call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args'])); } while ( next($wp_filter[$tag]) !== false ); array_pop($wp_current_filter); } /** * has_action() - Check if any action has been registered for a hook. * * @package WordPress * @subpackage Plugin * @since 2.5 * @see has_filter() has_action() is an alias of has_filter(). * * @param string $tag The name of the action hook. * @param callback $function_to_check optional. If specified, return the priority of that function on this hook or false if not attached. * @return int|boolean Optionally returns the priority on that hook for the specified function. */ function has_action($tag, $function_to_check = false) { return has_filter($tag, $function_to_check); } /** * remove_action() - Removes a function from a specified action hook. * * This function removes a function attached to a specified action hook. This * method can be used to remove default functions attached to a specific filter * hook and possibly replace them with a substitute. * * @package WordPress * @subpackage Plugin * @since 1.2 * * @param string $tag The action hook to which the function to be removed is hooked. * @param callback $function_to_remove The name of the function which should be removed. * @param int $priority optional The priority of the function (default: 10). * @param int $accepted_args optional. The number of arguments the function accpets (default: 1). * @return boolean Whether the function is removed. */ function remove_action($tag, $function_to_remove, $priority = 10, $accepted_args = 1) { return remove_filter($tag, $function_to_remove, $priority, $accepted_args); } // // Functions for handling plugins. // /** * plugin_basename() - Gets the basename of a plugin. * * This method extracts the name of a plugin from its filename. * * @package WordPress * @subpackage Plugin * @since 1.5 * * @access private * * @param string $file The filename of plugin. * @return string The name of a plugin. * @uses WP_PLUGIN_DIR */ function plugin_basename($file) { $file = str_replace('\\','/',$file); // sanitize for Win32 installs $file = preg_replace('|/+|','/', $file); // remove any duplicate slash $plugin_dir = str_replace('\\','/',WP_PLUGIN_DIR); // sanitize for Win32 installs $plugin_dir = preg_replace('|/+|','/', $plugin_dir); // remove any duplicate slash $file = preg_replace('|^' . preg_quote($plugin_dir, '|') . '/|','',$file); // get relative path from plugins dir return $file; } /** * register_activation_hook() - Hook a function on a plugin activation action hook. * * When a plugin is activated, the action 'activate_PLUGINNAME' hook is * activated. In the name of this hook, PLUGINNAME is replaced with the name of * the plugin, including the optional subdirectory. For example, when the plugin * is located in wp-content/plugin/sampleplugin/sample.php, then the * name of this hook will become 'activate_sampleplugin/sample.php' * When the plugin consists of only one file and is (as by default) located at * wp-content/plugin/sample.php the name of this hook will be * 'activate_sample.php'. * * @package WordPress * @subpackage Plugin * @since 2.0 * * @access private * * @param string $file The filename of the plugin including the path. * @param string $function the function hooked to the 'activate_PLUGIN' action. */ function register_activation_hook($file, $function) { $file = plugin_basename($file); add_action('activate_' . $file, $function); } /** * register_deactivation_hook() - Hook a function on a plugin deactivation action hook. * * When a plugin is deactivated, the action 'deactivate_PLUGINNAME' hook is * deactivated. In the name of this hook, PLUGINNAME is replaced with the name of * the plugin, including the optional subdirectory. For example, when the plugin * is located in wp-content/plugin/sampleplugin/sample.php, then the * name of this hook will become 'activate_sampleplugin/sample.php'. * When the plugin consists of only one file and is (as by default) located at * wp-content/plugin/sample.php the name of this hook will be * 'activate_sample.php'. * * @package WordPress * @subpackage Plugin * @since 2.0 * * @access private * * @param string $file The filename of the plugin including the path. * @param string $function the function hooked to the 'activate_PLUGIN' action. */ function register_deactivation_hook($file, $function) { $file = plugin_basename($file); add_action('deactivate_' . $file, $function); } /** * _wp_call_all_hook() - Calls the 'all' hook, which will process the functions hooked into it. * * The 'all' hook passes all of the arguments or parameters that were used for the * hook, which this function was called for. * * This function is used internally for apply_filters(), do_action(), and do_action_ref_array() * and is not meant to be used from outside those functions. This function does not check for the * existence of the all hook, so it will fail unless the all hook exists prior to this function call. * * @package WordPress * @subpackage Plugin * @since 2.5 * @access private * * @uses $wp_filter Used to process all of the functions in the 'all' hook * * @param array $args The collected parameters from the hook that was called. * @param string $hook Optional. The hook name that was used to call the 'all' hook. */ function _wp_call_all_hook($args) { global $wp_filter; reset( $wp_filter['all'] ); do { foreach( (array) current($wp_filter['all']) as $the_ ) if ( !is_null($the_['function']) ) call_user_func_array($the_['function'], $args); } while ( next($wp_filter['all']) !== false ); } /** * _wp_filter_build_unique_id() - Build Unique ID for storage and retrieval * * The old way to serialize the callback caused issues and this function is the * solution. It works by checking for objects and creating an a new property in * the class to keep track of the object and new objects of the same class that * need to be added. * * It also allows for the removal of actions and filters for objects after they * change class properties. It is possible to include the property $wp_filter_id * in your class and set it to "null" or a number to bypass the workaround. However * this will prevent you from adding new classes and any new classes will overwrite * the previous hook by the same class. * * Functions and static method callbacks are just returned as strings and shouldn't * have any speed penalty. * * @package WordPress * @subpackage Plugin * @since 2.2.3 * * @link http://trac.wordpress.org/ticket/3875 * * @access private * * @global array $wp_filter Storage for all of the filters and actions * @param string $tag Used in counting how many hooks were applied * @param string|array $function Used for creating unique id * @param int|bool $priority Used in counting how many hooks were applied. If === false and $function is an object reference, we return the unique id only if it already has one, false otherwise. * @param string $type filter or action * @return string Unique ID for usage as array key */ function _wp_filter_build_unique_id($tag, $function, $priority) { global $wp_filter; // If function then just skip all of the tests and not overwrite the following. if ( is_string($function) ) return $function; // Object Class Calling else if (is_object($function[0]) ) { $obj_idx = get_class($function[0]).$function[1]; if ( !isset($function[0]->wp_filter_id) ) { if ( false === $priority ) return false; $count = count((array)$wp_filter[$tag][$priority]); $function[0]->wp_filter_id = $count; $obj_idx .= $count; unset($count); } else $obj_idx .= $function[0]->wp_filter_id; return $obj_idx; } // Static Calling else if ( is_string($function[0]) ) return $function[0].$function[1]; } ?> wp/dev/wp-includes/bookmark.php0000644000106600010660000002470211016304601013747 0ustar get_row($wpdb->prepare("SELECT * FROM $wpdb->links WHERE link_id = %d LIMIT 1", $bookmark_id)); $link->link_category = array_unique( wp_get_object_terms($link->link_id, 'link_category', 'fields=ids') ); $link = sanitize_bookmark($link, $filter); if ( $output == OBJECT ) { return $link; } elseif ( $output == ARRAY_A ) { return get_object_vars($link); } elseif ( $output == ARRAY_N ) { return array_values(get_object_vars($link)); } else { return $link; } } /** * Retrieve single bookmark data item or field. * * @since 2.3 * @uses get_bookmark() Gets bookmark object using $bookmark as ID * @uses sanitize_bookmark_field() Sanitizes Bookmark field based on $context. * * @param string $field The name of the data field to return * @param int $bookmark The bookmark ID to get field * @param string $context Optional. The context of how the field will be used. * @return string */ function get_bookmark_field( $field, $bookmark, $context = 'display' ) { $bookmark = (int) $bookmark; $bookmark = get_bookmark( $bookmark ); if ( is_wp_error($bookmark) ) return $bookmark; if ( !is_object($bookmark) ) return ''; if ( !isset($bookmark->$field) ) return ''; return sanitize_bookmark_field($field, $bookmark->$field, $bookmark->link_id, $context); } /** * Retrieve bookmark data based on ID. * * @since 2.0 * @deprecated Use get_bookmark() * @see get_bookmark() * * @param int $bookmark_id ID of link * @param string $output Either OBJECT, ARRAY_N, or ARRAY_A * @return object|array */ function get_link($bookmark_id, $output = OBJECT, $filter = 'raw') { return get_bookmark($bookmark_id, $output, $filter); } /** * Retrieves the list of bookmarks * * Attempts to retrieve from the cache first based on MD5 hash of arguments. If * that fails, then the query will be built from the arguments and executed. The * results will be stored to the cache. * * List of default arguments are as follows: * 'orderby' - Default is 'name' (string). How to order the links by. String is * based off of the bookmark scheme. * 'order' - Default is 'ASC' (string). Either 'ASC' or 'DESC'. Orders in either * ascending or descending order. * 'limit' - Default is -1 (integer) or show all. The amount of bookmarks to * display. * 'category' - Default is empty string (string). Include the links in what * category ID(s). * 'category_name' - Default is empty string (string). Get links by category * name. * 'hide_invisible' - Default is 1 (integer). Whether to show (default) or hide * links marked as 'invisible'. * 'show_updated' - Default is 0 (integer). Will show the time of when the * bookmark was last updated. * 'include' - Default is empty string (string). Include other categories * separated by commas. * 'exclude' - Default is empty string (string). Exclude other categories * separated by commas. * * @since 2.1 * @uses $wpdb Database Object * @link http://codex.wordpress.org/Template_Tags/get_bookmarks * * @param string|array $args List of arguments to overwrite the defaults * @return array List of bookmark row objects */ function get_bookmarks($args = '') { global $wpdb; $defaults = array( 'orderby' => 'name', 'order' => 'ASC', 'limit' => -1, 'category' => '', 'category_name' => '', 'hide_invisible' => 1, 'show_updated' => 0, 'include' => '', 'exclude' => '', 'search' => '' ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); $key = md5( serialize( $r ) ); if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) if ( isset( $cache[ $key ] ) ) return apply_filters('get_bookmarks', $cache[ $key ], $r ); $inclusions = ''; if ( !empty($include) ) { $exclude = ''; //ignore exclude, category, and category_name params if using include $category = ''; $category_name = ''; $inclinks = preg_split('/[\s,]+/',$include); if ( count($inclinks) ) { foreach ( $inclinks as $inclink ) { if (empty($inclusions)) $inclusions = ' AND ( link_id = ' . intval($inclink) . ' '; else $inclusions .= ' OR link_id = ' . intval($inclink) . ' '; } } } if (!empty($inclusions)) $inclusions .= ')'; $exclusions = ''; if ( !empty($exclude) ) { $exlinks = preg_split('/[\s,]+/',$exclude); if ( count($exlinks) ) { foreach ( $exlinks as $exlink ) { if (empty($exclusions)) $exclusions = ' AND ( link_id <> ' . intval($exlink) . ' '; else $exclusions .= ' AND link_id <> ' . intval($exlink) . ' '; } } } if (!empty($exclusions)) $exclusions .= ')'; if ( ! empty($category_name) ) { if ( $category = get_term_by('name', $category_name, 'link_category') ) $category = $category->term_id; } if ( ! empty($search) ) { $search = like_escape($search); $search = " AND ( (link_url LIKE '%$search%') OR (link_name LIKE '%$search%') OR (link_description LIKE '%$search%') ) "; } $category_query = ''; $join = ''; if ( !empty($category) ) { $incategories = preg_split('/[\s,]+/',$category); if ( count($incategories) ) { foreach ( $incategories as $incat ) { if (empty($category_query)) $category_query = ' AND ( tt.term_id = ' . intval($incat) . ' '; else $category_query .= ' OR tt.term_id = ' . intval($incat) . ' '; } } } if (!empty($category_query)) { $category_query .= ") AND taxonomy = 'link_category'"; $join = " INNER JOIN $wpdb->term_relationships AS tr ON ($wpdb->links.link_id = tr.object_id) INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_taxonomy_id = tr.term_taxonomy_id"; } if (get_option('links_recently_updated_time')) { $recently_updated_test = ", IF (DATE_ADD(link_updated, INTERVAL " . get_option('links_recently_updated_time') . " MINUTE) >= NOW(), 1,0) as recently_updated "; } else { $recently_updated_test = ''; } $get_updated = ( $show_updated ) ? ', UNIX_TIMESTAMP(link_updated) AS link_updated_f ' : ''; $orderby = strtolower($orderby); $length = ''; switch ($orderby) { case 'length': $length = ", CHAR_LENGTH(link_name) AS length"; break; case 'rand': $orderby = 'rand()'; break; default: $orderby = "link_" . $orderby; } if ( 'link_id' == $orderby ) $orderby = "$wpdb->links.link_id"; $visible = ''; if ( $hide_invisible ) $visible = "AND link_visible = 'Y'"; $query = "SELECT * $length $recently_updated_test $get_updated FROM $wpdb->links $join WHERE 1=1 $visible $category_query"; $query .= " $exclusions $inclusions $search"; $query .= " ORDER BY $orderby $order"; if ($limit != -1) $query .= " LIMIT $limit"; $results = $wpdb->get_results($query); $cache[ $key ] = $results; wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); return apply_filters('get_bookmarks', $results, $r); } /** * Sanitizes all bookmark fields * * @since 2.3 * * @param object|array $bookmark Bookmark row * @param string $context Optional, default is 'display'. How to filter the * fields * @return object|array Same type as $bookmark but with fields sanitized. */ function sanitize_bookmark($bookmark, $context = 'display') { $fields = array('link_id', 'link_url', 'link_name', 'link_image', 'link_target', 'link_category', 'link_description', 'link_visible', 'link_owner', 'link_rating', 'link_updated', 'link_rel', 'link_notes', 'link_rss', ); $do_object = false; if ( is_object($bookmark) ) $do_object = true; foreach ( $fields as $field ) { if ( $do_object ) $bookmark->$field = sanitize_bookmark_field($field, $bookmark->$field, $bookmark->link_id, $context); else $bookmark[$field] = sanitize_bookmark_field($field, $bookmark[$field], $bookmark['link_id'], $context); } return $bookmark; } /** * Sanitizes a bookmark field * * Sanitizes the bookmark fields based on what the field name is. If the field * has a strict value set, then it will be tested for that, else a more generic * filtering is applied. After the more strict filter is applied, if the * $context is 'raw' then the value is immediately return. * * Hooks exist for the more generic cases. With the 'edit' context, the * 'edit_$field' filter will be called and passed the $value and $bookmark_id * respectively. With the 'db' context, the 'pre_$field' filter is called and * passed the value. The 'display' context is the final context and has the * $field has the filter name and is passed the $value, $bookmark_id, and * $context respectively. * * @since 2.3 * * @param string $field The bookmark field * @param mixed $value The bookmark field value * @param int $bookmark_id Bookmark ID * @param string $context How to filter the field value. Either 'raw', 'edit', * 'attribute', 'js', 'db', or 'display' * @return mixed The filtered value */ function sanitize_bookmark_field($field, $value, $bookmark_id, $context) { $int_fields = array('link_id', 'link_rating'); if ( in_array($field, $int_fields) ) $value = (int) $value; $yesno = array('link_visible'); if ( in_array($field, $yesno) ) $value = preg_replace('/[^YNyn]/', '', $value); if ( 'link_target' == $field ) { $targets = array('_top', '_blank'); if ( ! in_array($value, $targets) ) $value = ''; } if ( 'raw' == $context ) return $value; if ( 'edit' == $context ) { $format_to_edit = array('link_notes'); $value = apply_filters("edit_$field", $value, $bookmark_id); if ( in_array($field, $format_to_edit) ) { $value = format_to_edit($value); } else { $value = attribute_escape($value); } } else if ( 'db' == $context ) { $value = apply_filters("pre_$field", $value); } else { // Use display filters by default. $value = apply_filters($field, $value, $bookmark_id, $context); } if ( 'attribute' == $context ) $value = attribute_escape($value); else if ( 'js' == $context ) $value = js_escape($value); return $value; } /** * Deletes entire bookmark cache * * @since 2.1 * @uses wp_cache_delete() Deletes the contents of 'get_bookmarks' */ function delete_get_bookmark_cache() { wp_cache_delete( 'get_bookmarks', 'bookmark' ); } add_action( 'add_link', 'delete_get_bookmark_cache' ); add_action( 'edit_link', 'delete_get_bookmark_cache' ); add_action( 'delete_link', 'delete_get_bookmark_cache' ); ?> wp/dev/wp-includes/default-filters.php0000644000106600010660000001536011031642711015240 0ustar wp/dev/wp-includes/canonical.php0000644000106600010660000002302611047103211014065 0ustar using_permalinks() ) { // rewriting of old ?p=X, ?m=2004, ?m=200401, ?m=20040101 if ( is_single() && isset($_GET['p']) ) { if ( $redirect_url = get_permalink(get_query_var('p')) ) $redirect['query'] = remove_query_arg('p', $redirect['query']); } elseif ( is_page() && isset($_GET['page_id']) ) { if ( $redirect_url = get_permalink(get_query_var('page_id')) ) $redirect['query'] = remove_query_arg('page_id', $redirect['query']); } elseif ( isset($_GET['m']) && ( is_year() || is_month() || is_day() ) ) { $m = get_query_var('m'); switch ( strlen($m) ) { case 4: // Yearly $redirect_url = get_year_link($m); break; case 6: // Monthly $redirect_url = get_month_link( substr($m, 0, 4), substr($m, 4, 2) ); break; case 8: // Daily $redirect_url = get_day_link(substr($m, 0, 4), substr($m, 4, 2), substr($m, 6, 2)); break; } if ( $redirect_url ) $redirect['query'] = remove_query_arg('m', $redirect['query']); // now moving on to non ?m=X year/month/day links } elseif ( is_day() && get_query_var('year') && get_query_var('monthnum') && isset($_GET['day']) ) { if ( $redirect_url = get_day_link(get_query_var('year'), get_query_var('monthnum'), get_query_var('day')) ) $redirect['query'] = remove_query_arg(array('year', 'monthnum', 'day'), $redirect['query']); } elseif ( is_month() && get_query_var('year') && isset($_GET['monthnum']) ) { if ( $redirect_url = get_month_link(get_query_var('year'), get_query_var('monthnum')) ) $redirect['query'] = remove_query_arg(array('year', 'monthnum'), $redirect['query']); } elseif ( is_year() && isset($_GET['year']) ) { if ( $redirect_url = get_year_link(get_query_var('year')) ) $redirect['query'] = remove_query_arg('year', $redirect['query']); } elseif ( is_category() && isset($_GET['cat']) ) { if ( $redirect_url = get_category_link(get_query_var('cat')) ) $redirect['query'] = remove_query_arg('cat', $redirect['query']); } elseif ( is_author() && isset($_GET['author']) ) { $author = get_userdata(get_query_var('author')); if ( false !== $author && $redirect_url = get_author_link(false, $author->ID, $author->user_nicename) ) $redirect['query'] = remove_query_arg('author', $redirect['author']); } // paging if ( $paged = get_query_var('paged') ) { if ( $paged > 0 ) { if ( !$redirect_url ) $redirect_url = $requested_url; $paged_redirect = @parse_url($redirect_url); $paged_redirect['path'] = preg_replace('|/page/[0-9]+?(/+)?$|', '/', $paged_redirect['path']); // strip off any existing paging $paged_redirect['path'] = preg_replace('|/index.php/?$|', '/', $paged_redirect['path']); // strip off trailing /index.php/ if ( $paged > 1 && !is_single() ) { $paged_redirect['path'] = trailingslashit($paged_redirect['path']); if ( $wp_rewrite->using_index_permalinks() && strpos($paged_redirect['path'], '/index.php/') === false ) $paged_redirect['path'] .= 'index.php/'; $paged_redirect['path'] .= user_trailingslashit("page/$paged", 'paged'); } elseif ( !is_home() && !is_single() ){ $paged_redirect['path'] = user_trailingslashit($paged_redirect['path'], 'paged'); } $redirect_url = $paged_redirect['scheme'] . '://' . $paged_redirect['host'] . $paged_redirect['path']; $redirect['path'] = $paged_redirect['path']; } $redirect['query'] = remove_query_arg('paged', $redirect['query']); } } // tack on any additional query vars if ( $redirect_url && $redirect['query'] ) { if ( strpos($redirect_url, '?') !== false ) $redirect_url .= '&'; else $redirect_url .= '?'; $redirect_url .= $redirect['query']; } if ( $redirect_url ) $redirect = @parse_url($redirect_url); // www.example.com vs example.com $user_home = @parse_url(get_option('home')); if ( isset($user_home['host']) ) $redirect['host'] = $user_home['host']; // Handle ports if ( isset($user_home['port']) ) $redirect['port'] = $user_home['port']; else unset($redirect['port']); // trailing /index.php/ $redirect['path'] = preg_replace('|/index.php/$|', '/', $redirect['path']); // strip /index.php/ when we're not using PATHINFO permalinks if ( !$wp_rewrite->using_index_permalinks() ) $redirect['path'] = str_replace('/index.php/', '/', $redirect['path']); // trailing slashes if ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() && !is_404() && (!is_home() || ( is_home() && (get_query_var('paged') > 1) ) ) ) { $user_ts_type = ''; if ( get_query_var('paged') > 0 ) { $user_ts_type = 'paged'; } else { foreach ( array('single', 'category', 'page', 'day', 'month', 'year') as $type ) { $func = 'is_' . $type; if ( call_user_func($func) ) { $user_ts_type = $type; break; } } } $redirect['path'] = user_trailingslashit($redirect['path'], $user_ts_type); } elseif ( is_home() ) { $redirect['path'] = trailingslashit($redirect['path']); } // Always trailing slash the 'home' URL if ( $redirect['path'] == $user_home['path'] ) $redirect['path'] = trailingslashit($redirect['path']); // Ignore differences in host capitalization, as this can lead to infinite redirects if ( strtolower($original['host']) == strtolower($redirect['host']) ) $redirect['host'] = $original['host']; if ( array($original['host'], $original['port'], $original['path'], $original['query']) !== array($redirect['host'], $redirect['port'], $redirect['path'], $redirect['query']) ) { $redirect_url = $redirect['scheme'] . '://' . $redirect['host']; if ( isset($redirect['port']) ) $redirect_url .= ':' . $redirect['port']; $redirect_url .= $redirect['path']; if ( $redirect['query'] ) $redirect_url .= '?' . $redirect['query']; } if ( !$redirect_url || $redirect_url == $requested_url ) return false; // Note that you can use the "redirect_canonical" filter to cancel a canonical redirect for whatever reason by returning FALSE $redirect_url = apply_filters('redirect_canonical', $redirect_url, $requested_url); if ( !$redirect_url || $redirect_url == $requested_url ) // yes, again -- in case the filter aborted the request return false; if ( $do_redirect ) { // protect against chained redirects if ( !redirect_canonical($redirect_url, false) ) { wp_redirect($redirect_url, 301); exit(); } else { return false; } } else { return $redirect_url; } } /** * Attempts to guess correct post based on query vars * * @since 2.3 * @uses $wpdb * * @return bool|string Returns False, if it can't find post, returns correct * location on success. */ function redirect_guess_404_permalink() { global $wpdb; if ( !get_query_var('name') ) return false; $where = $wpdb->prepare("post_name LIKE %s", get_query_var('name') . '%'); // if any of year, monthnum, or day are set, use them to refine the query if ( get_query_var('year') ) $where .= $wpdb->prepare(" AND YEAR(post_date) = %d", get_query_var('year')); if ( get_query_var('monthnum') ) $where .= $wpdb->prepare(" AND MONTH(post_date) = %d", get_query_var('monthnum')); if ( get_query_var('day') ) $where .= $wpdb->prepare(" AND DAYOFMONTH(post_date) = %d", get_query_var('day')); $post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE $where AND post_status = 'publish'"); if ( !$post_id ) return false; return get_permalink($post_id); } add_action('template_redirect', 'redirect_canonical'); ?> wp/dev/wp-includes/images/0000755000106600010660000000000011051167752012706 5ustar wp/dev/wp-includes/images/crystal/0000755000106600010660000000000011051167752014367 5ustar wp/dev/wp-includes/images/crystal/code.png0000644000106600010660000000412510761725341016012 0ustar PNG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y%Ffۧ}F1L*dG=^Abỳ;xFCWy%LGMF€hxANGC0@o:9cV%lp,*`) 1y/@ɇDȱEF$G[g [KKWh:\DAֱ7x-}BJ.YzZ81pv X%#O9vmAMR$E~199_:~NIENDB`wp/dev/wp-includes/images/crystal/text.png0000644000106600010660000000174710761725341016073 0ustar PNG  IHDR.<tEXtSoftwareAdobe ImageReadyqe<IDATxڼYَ0 J !MBl_K|/35gs2y$MO'e׻n_EWhy^j P)J1It>a!Lǣ\./B6P!oT-^y6֟7V؈\8YĎѐ$h Jht;pOТf\.H7f30m$hMߗD<뛪qLMgt:!d׻8lSϦbpz߅N|PHgaaj;E~4Af݂a Жv%i-! 3,TnJR 0@)`aV(WaAQU̍FCHIh%7``+ye.}r4`Ff7/t׻"*6  P\i6a* fUmwmNImv:<Vh zqCC͟FqPN6ovyi6N= ж)[03èSRb$5Gm%(j0⊞A жp[u~VMHá.eT(.z0{t/QI Eʑ};ȶ- J%O&[uhk{gS'c$LtKfL-VC R87hqc#h`0{D@[v'UgȠl'U["}Z%amrp8dݒ f4YوF$:Lm%B-f bA *if]j9dh|! ەVI8L nW?'WBY1ѧϬb%=-R\`T*,ޕi,ZV&)g<ܣ+IENDB`wp/dev/wp-includes/images/crystal/license.txt0000644000106600010660000000022410762616541016553 0ustar Crystal Project Icons by Everaldo Coelho http://everaldo.com Released under LGPL Modified February 2008 for WordPress http://wordpress.orgwp/dev/wp-includes/images/crystal/default.png0000644000106600010660000000117610761725341016527 0ustar PNG  IHDR.<tEXtSoftwareAdobe ImageReadyqe< IDATxęQ E+:ggt]CW৶ZޣCHE4F)8(-bu3zS0 nyj_MTL `ڑx7ȃL+9GSiL04zCa9rh\'u OPit~4̕Ә4R@)Iq:-ةf(霋9yP2x̕ 4^ÊYoL3RS@a`7PZp)eO`p%+yiE/OήƓ)IENDB`wp/dev/wp-includes/images/video.png0000644000106600010660000000112410757461553014530 0ustar PNG  IHDR DtEXtSoftwareAdobe ImageReadyqe<`PLTETTT싌-6hqtw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d߿Wd&[y` G7B6o/Icv]SwBegw `X08~[=עkkZ%]?:,vzIENDB`wp/dev/wp-includes/images/wlw/wp-comments.png0000644000106600010660000000264210702510511016465 0ustar PNG  IHDRw=gAMA7tEXtSoftwareAdobe ImageReadyqe<4IDATxڴVoEfw~q[N$5}p(RD%+\s? J VV"RhpMC";ib;~kwgff=N@pif'~cC<σo P#pyT#B\uyg"Hcۆȫo-(H\zRi<)Qg" ҵܣ_:ub>QΔ ;:(lv6wugG>A,H$MqնjCтZN8d25hR"'O|rCOLAzO u4UEK2 Bimֵ^s˦ /T ҭ"iJ2`dn WbEB~jDTPO|&X\eޚ-8yVLѭ!<"tZ'VGJΈ&k6ujgJ )ULE/!yRs^zq{Ǐw-mϥ;]'6]B%/ƲUz4a V6?&72ў_Myy-jЭJe x9uwpًg#ҢPV7b22:'F"إ{oqCLT ku[!\X\E65={iT|8Bf`7 t44pz.2DцDm7!3M]J6T-U:qnR)kҥK:i_\Ḫ*ٵMv:T~c4Mv0t9ױ)vm˲ ʍRd_vnrG&ti (\GF2qs4@0N_pG6MgAJ؟"r9/ 6heY:99hY$LMMؓ_wu(0IENDB`wp/dev/wp-includes/images/wlw/wp-icon.png0000644000106600010660000000141310702510511015563 0ustar PNG  IHDRagAMA7tEXtSoftwareAdobe ImageReadyqe<IDATxlSkQ~5ulh56RSmKZ6ui?~zPXB1_|GlSAp–oSf6teEs?Ϲs;<C^?,}R,X|xdtDݷtj4E@pnT]8ߡh0OR a|¢sbE}xv|Sݭ4#ΐD&17$N#O4MI]N:7z=ep=`;0CgccPYSSSCCC,j5%+1g+@"DL@P(0++++S$u<1|`$r X@ L&J]]F,ccZJ_s/ RXH#[3{kk_ =.Jsxhu9 ޷h#R!fss=~@T]})(.$x4#C H[j*Op8oA2`:|d<bi\Krc,:nk4-?  `J%LϘc73)EDQvy1]1/,1jyv~U4 #4m/bIENDB`wp/dev/wp-includes/images/smilies/0000755000106600010660000000000011051167752014353 5ustar wp/dev/wp-includes/images/smilies/icon_razz.gif0000644000106600010660000000026010304135300017016 0ustar GIF89aEEE333!,]IjեRpLA''𦫖qj *pƂJ" `<+kYa<v *~20̰,5;wp/dev/wp-includes/images/smilies/icon_mad.gif0000644000106600010660000000025610304135300016576 0ustar GIF89a EEE! ,[IjեpLA'a'j *`pP9ĞAf-+`W A& ;`mXk\ 0ò&;wp/dev/wp-includes/images/smilies/icon_redface.gif0000644000106600010660000000121210304135300017417 0ustar GIF89al[hhu҇isJEEE˃__H6{! NETSCAPE2.0!,f'MYWND'ڰьM@NnA`8]#c<P*ȈW[d|.8w @ mxD qj:<2ylR)<&D#!! , Q'~D8]0kHN.O\[͐ x H  ̓TAfPIxEhJTE!!2, H'NAJc3]j+WOT-$ERBgJ-ˑ%-3|nQu- ! , P'Ac:uX~n"A6;Fhl4C1`xf"05u0e|< PTADhJE!;wp/dev/wp-includes/images/smilies/icon_cool.gif0000644000106600010660000000025410304135300016767 0ustar GIF89a EEE! ,YIjUpCLAgpj k+;vECp4xevE+mAPiN X:o(`e6;wp/dev/wp-includes/images/smilies/icon_twisted.gif0000644000106600010660000000035610304135300017521 0ustar GIF89aEEE*333m!,k DhɘВ$*>DE5@NG @ ꚱ- h> h)8T]°ij,c pّJ<G(F1|FZ(%Z#&(!;wp/dev/wp-includes/images/smilies/icon_rolleyes.gif0000644000106600010660000000074510304135300017676 0ustar GIF89a EEE! NETSCAPE2.0! ,^I jUpL@'g𦫆E:%\PtdPA^;( 0=c2yO J>`c`@ia(fX5! , YVؠg! , F嬳Ԧ.!2 , P$-'! ,  "! , Fe+0ZE! , I!2T]U*B)@LMZXYr! , I%[8WA'&1^! , I!8K[BhPH(F;wp/dev/wp-includes/images/smilies/icon_wink.gif0000644000106600010660000000025210304135300017001 0ustar GIF89a EEE! ,WIjՕpCLA'00%&p/*p`C%+fP4OpUł:`kLhբanfX$;wp/dev/wp-includes/images/smilies/icon_eek.gif0000644000106600010660000000025210304135300016575 0ustar GIF89a EEE! ,WI9jŔ"I"c0@6r +ﱫۮ00P6 F IEy,(i%`'pa6g1܀}g4$;wp/dev/wp-includes/images/smilies/icon_cry.gif0000644000106600010660000000076210304135300016634 0ustar GIF89aEEE؁^^^! NETSCAPE2.0!,\ $AY(T.q 'CA+@An:AJaC" &8tp: 7tgUYj0x !N2Q)<&D#!!, $@HdҜM0lB! ,`@! , @&!! , @HdBI! , `dhB!! ,`@! , @&!! , @Hh "&i;wp/dev/wp-includes/images/smilies/icon_arrow.gif0000644000106600010660000000025210304135300017163 0ustar GIF89a EEE! ,WIjՕpELAgpj BUvsC; `"fs2([Lhբa~fX$;wp/dev/wp-includes/images/smilies/icon_surprised.gif0000644000106600010660000000025610304135300020055 0ustar GIF89a EEE! ,[IjU"pILA''𦫆qj *pƂ ":=+`,@VvaA6XT0ò&;wp/dev/wp-includes/images/smilies/icon_confused.gif0000644000106600010660000000025310304135300017640 0ustar GIF89a EEE! ,XIjՕpCLA''vqj ?*pƂ!\ 'pd/N3(^0-U&kQ@7 3,Km;wp/dev/wp-includes/images/smilies/icon_sad.gif0000644000106600010660000000025310304135300016601 0ustar GIF89a EEE! ,XIjՕpCLA'1%&p'*pnCk3 'pe= ߧN3 U&ݳL@7 3, m;wp/dev/wp-includes/images/smilies/icon_biggrin.gif0000644000106600010660000000025410304135300017454 0ustar GIF89a EEE! ,YI jե"pIL@gpj)wjʛ pJQl:`J PJ4ZNB oYbe6;wp/dev/wp-includes/images/smilies/icon_evil.gif0000644000106600010660000000035410304135300016773 0ustar GIF89aEEE*m!,i @h$*2FC5@NG @ ꚱ- h>h)@T]ᰥ"ij,cIwdGk+:G(F()Z#&(!;wp/dev/wp-includes/images/smilies/icon_neutral.gif0000644000106600010660000000025310304135300017504 0ustar GIF89a EEE! ,XIjՕpCLA' vpj A88r9ʊ)\ԓbd`a -e&kQ@73,Km;wp/dev/wp-includes/images/smilies/icon_question.gif0000644000106600010660000000037010304135300017701 0ustar GIF89aEEEuϾ/+_W߰of!,u&@YVNq' @k,TAIPgK@L`$[CJgMh%x \Szb Q[0$VF<2])<&G#!;wp/dev/wp-includes/images/smilies/icon_mrgreen.gif0000644000106600010660000000053510304135300017474 0ustar GIF89aܱگخ֬ҩΦʢȡƟĞ}|yroli~e|dx`!',zP(Sqi( G$@s40t6EcQlx }8 %`$P!F E" E#E%t$\J&EFD%#"! QIJIA;wp/dev/wp-includes/images/smilies/icon_smile.gif0000644000106600010660000000025610304135300017146 0ustar GIF89aEEE333!,[IjUpLA''vqj ?*pƂ!Ӣ X<+kYAb<v5Xj\ 0ò&;wp/dev/wp-includes/images/smilies/icon_lol.gif0000644000106600010660000000052010304135300016615 0ustar GIF89a EEE! NETSCAPE2.0! ,ZI jեR",AyhTr 1r)\aɎC%<DiJ-A v; Y-4jQ҅xn x1cd"! , I$[8ͫa4 D! ,PH9j! ,0H)j! ,PH9j! ,0H)j;wp/dev/wp-includes/images/smilies/icon_idea.gif0000644000106600010660000000026010304135300016732 0ustar GIF89a EEE! ,]I jUR"pL@g 0R;~C%q2d|>ORԌݶ(¢VhB 3 ̰,p;wp/dev/wp-includes/images/smilies/icon_exclaim.gif0000644000106600010660000000035410304135300017456 0ustar GIF89aEEEuŵ///qoWrpXJG)mkSSO&!,i`'AYhW6q'܂Ak' NG:@!n;"/` tZ(v 8θ,n RپIFr9;})%U)<&#!;wp/dev/wp-includes/images/blank.gif0000644000106600010660000000005311007375340014455 0ustar GIF89a! ,L;wp/dev/wp-includes/images/js.png0000644000106600010660000000100510757461553014034 0ustar PNG  IHDR DtEXtSoftwareAdobe ImageReadyqe<`PLTEeeeæΐ洴zzz\u;IDATxlY @QGBDH $x,X36Wk+Z0-DZྰf5FδkA۶9"ω/ƵڭQ(G_`\}io?@[)'Q!bBem=wM@۶91'Z_D~@N 躮X}E $f$`RoBH<MO zD8eRsMI `g3\< Q~҃SqÆsATPJU8{wj?pO].gȃt$,_şyIENDB`wp/dev/wp-includes/images/pdf.png0000644000106600010660000000262010757461553014175 0ustar PNG  IHDR DtEXtSoftwareAdobe ImageReadyqe<PLTEllOO{qwDD}||??22>> ]]::;;~////e44i77\\倀jjNNKK2255BBffOOO]]zmmoo555l TTT99 MMBBpp페!!sjj}}:: qq++..}}yotnﶶMMM GGGGGGxx쉉FF(([[[˨NN oo@@@!!///%%==mmNN** ww!!NN{{""^^|??""&&OOӂ""FFɯ99Pa)IDATxb`6d̀ X9ŕd A'Y[[EG͝J37NML)Q+Vޗlj&Ɨ?yA J;V]sMQyxڗ|F8t^zz~E'nw.OЄEt\V`z3yx#Y !A jn_K4.~j9m ~%"VM2R?ZZ>k[,tV $%m\䄅\l$;;MO"Aj k̕**W)%%{f`/ 6|Tۮ)nj\LLW;899DP02AX!?8??!,ax U;;7H/&8@Q @5i0yvT\\\N8W580-x+a%U׋'qO X196qhP'}tcDh  aq$ $Q ` @jȕJIENDB`wp/dev/wp-includes/images/tar.png0000644000106600010660000000240010757461553014206 0ustar PNG  IHDR DtEXtSoftwareAdobe ImageReadyqe<PLTEmmm$$$+++WWWyyyࢢձ◗bbb;;;Ϛل111KKKəႂ{{{999ooo!!!ď򣣣-0-̆___qqq䬬...ccc;;9rrrQQQtttaaa|||---[[[ppp赵lllkkkTTT:::<<<&&&///≉F+zIDATxtus@-[qO\ݽWﹻ 4s;o^О\`ъgIsɘmm[T׮RGHhoL}VN|]^hJOyNx3T+ѳD> c91 y㛶{n55^[F8QiA2m汁&,czWtCS:x ,A ݙ`ggå;LJpNݗITw/2_rQsᤏ|لH߯QZ$o(s~|3yP,@E$|_s]d,G}gMPĺwWGhBsQMGKL2)X:sGeɏA[<<#YAE+f3N,˳G 09S ,t8S^@=8Rܫ`'9BN($qPSQs&=n^s<}p  <[n AX*փXϲ k?b*RVL2¬ſYM<jSm8YEtH-^?@HRTN 80ẃ̓{*߯?`j^IENDB`wp/dev/wp-includes/images/css.png0000644000106600010660000000102510757461553014212 0ustar PNG  IHDR DtEXtSoftwareAdobe ImageReadyqe<`PLTEeeeꦦؐ洴zzz9KIDATxlْ @Qqa1_N}:EC*YTv], cfmbT Ť5}8QHZ3VN)zԑ'h0/f|Kr4Ǻ3;bRcVW}o.LQb|Z 9UUQRжmQ+ f17cD8鿄 M)\aeߊI fBȱ1h K6S0x0໑S>u4l(=Wk.;8զm(.~}ot'\`ūIENDB`wp/dev/wp-includes/images/swf.png0000644000106600010660000000300610757461553014222 0ustar PNG  IHDR DtEXtSoftwareAdobe ImageReadyqe<PLTE<<<999󵵵;;;FScpppIVf===nnn·νђN^pjjjVg{^ivP\jGUe[mJXjtzq>>>YjasSdwlSbv\fsCQ`hr~ˡgzewۚݠXj~dnzP_rv:::|LXgoi}YdriqznmyɫʼnQbu{{{cccXh{MZh^pճr̹X_iWWWxK[njy~{y}stttk~̈Wcq۹󯳷btcvVh{]oضXcq]]]bjtRbu ~gggXfx󣭺xQauk액x#IDATxb`ɟz@`iizςP cq\8 FV `08V..E+Fp Fn0b +oR\,QhlÄUO*LJNJ ɥռT4D޸dMf0* / &Ff M^QQ/Tc+БX\r9cc \:UϿцP ")qՙf}:>!19LB o t}t31ݐ}ARx@ueez? TdecC(VoRzyjg06>#Z U b'sr")^WۃNjsoAr[a @Ij7hJ`QP5͹ 5)YVP2cDH X{b攞`Mcy"RdH_rXeT3~O;'i$B,r>yVRXNa~$\BB,ޛ/fer4;QQ&Ovo77;d(͏.& ubi=a.???0&kwh,]ΎE + &Q :ŐQyqff\t IENDB`wp/dev/wp-includes/images/rss.png0000644000106600010660000000641510613253715014227 0ustar PNG  IHDRH- pHYs   OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\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zDbi@h@=xV߇݂2{U|Mr`l#U1VXt[&Sh$`k-|D\gl$:Í/@P;~y*'?n @hx/{$2` ʤ3kc+G\IMaBm_4@ :DtF!8O Ƥur9 ~y;NO_<7Cfa;£txeDdM)9; '>ފd5.A^9rA閖vv"]\;/41 _чOC$7O4g6a/aCN\K:ΨJXu\%!؈P s\ωn;W )`fӗ zu?FP$X'BImjO MXp3)=@XN9 yؖK^J>H Ĺst2QDQ*'/`" @OGEm{lHR3~DMaaΣb`@6k^]fTс<<%K8WǍj}uEm~\ X854 54$"KkPDV,b]rC")e, Xr&T9 q=@SU X&dGb pB IOIENDB`wp/dev/wp-includes/images/default.png0000644000106600010660000000073710757461553015057 0ustar PNG  IHDR DtEXtSoftwareAdobe ImageReadyqe<`PLTEeeeꦦ洴zzz] IDATxl aRƐ 8E>ϊl *I?P:0h!PR,bk9$`̍0"Ak-#Q$d̉A ŽZqFQNg >@])g b] pΗe F@]:XkDbB=c?ؑ92m:4 ! 1@67& 7(%GMsK 4xҧ,"]@~>[2, Q;IENDB`wp/dev/wp-includes/classes.php0000644000106600010660000006041411044121077013604 0ustar public_query_vars) ) $this->public_query_vars[] = $qv; } function set_query_var($key, $value) { $this->query_vars[$key] = $value; } function parse_request($extra_query_vars = '') { global $wp_rewrite; $this->query_vars = array(); $taxonomy_query_vars = array(); if ( is_array($extra_query_vars) ) $this->extra_query_vars = & $extra_query_vars; else if (! empty($extra_query_vars)) parse_str($extra_query_vars, $this->extra_query_vars); // Process PATH_INFO, REQUEST_URI, and 404 for permalinks. // Fetch the rewrite rules. $rewrite = $wp_rewrite->wp_rewrite_rules(); if (! empty($rewrite)) { // If we match a rewrite rule, this will be cleared. $error = '404'; $this->did_permalink = true; if ( isset($_SERVER['PATH_INFO']) ) $pathinfo = $_SERVER['PATH_INFO']; else $pathinfo = ''; $pathinfo_array = explode('?', $pathinfo); $pathinfo = str_replace("%", "%25", $pathinfo_array[0]); $req_uri = $_SERVER['REQUEST_URI']; $req_uri_array = explode('?', $req_uri); $req_uri = $req_uri_array[0]; $self = $_SERVER['PHP_SELF']; $home_path = parse_url(get_option('home')); if ( isset($home_path['path']) ) $home_path = $home_path['path']; else $home_path = ''; $home_path = trim($home_path, '/'); // Trim path info from the end and the leading home path from the // front. For path info requests, this leaves us with the requesting // filename, if any. For 404 requests, this leaves us with the // requested permalink. $req_uri = str_replace($pathinfo, '', rawurldecode($req_uri)); $req_uri = trim($req_uri, '/'); $req_uri = preg_replace("|^$home_path|", '', $req_uri); $req_uri = trim($req_uri, '/'); $pathinfo = trim($pathinfo, '/'); $pathinfo = preg_replace("|^$home_path|", '', $pathinfo); $pathinfo = trim($pathinfo, '/'); $self = trim($self, '/'); $self = preg_replace("|^$home_path|", '', $self); $self = trim($self, '/'); // The requested permalink is in $pathinfo for path info requests and // $req_uri for other requests. if ( ! empty($pathinfo) && !preg_match('|^.*' . $wp_rewrite->index . '$|', $pathinfo) ) { $request = $pathinfo; } else { // If the request uri is the index, blank it out so that we don't try to match it against a rule. if ( $req_uri == $wp_rewrite->index ) $req_uri = ''; $request = $req_uri; } $this->request = $request; // Look for matches. $request_match = $request; foreach ($rewrite as $match => $query) { // Don't try to match against AtomPub calls if ( $req_uri == 'wp-app.php' ) break; // If the requesting file is the anchor of the match, prepend it // to the path info. if ((! empty($req_uri)) && (strpos($match, $req_uri) === 0) && ($req_uri != $request)) { $request_match = $req_uri . '/' . $request; } if (preg_match("!^$match!", $request_match, $matches) || preg_match("!^$match!", urldecode($request_match), $matches)) { // Got a match. $this->matched_rule = $match; // Trim the query of everything up to the '?'. $query = preg_replace("!^.+\?!", '', $query); // Substitute the substring matches into the query. eval("\$query = \"" . addslashes($query) . "\";"); $this->matched_query = $query; // Parse the query. parse_str($query, $perma_query_vars); // If we're processing a 404 request, clear the error var // since we found something. if (isset($_GET['error'])) unset($_GET['error']); if (isset($error)) unset($error); break; } } // If req_uri is empty or if it is a request for ourself, unset error. if (empty($request) || $req_uri == $self || strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false) { if (isset($_GET['error'])) unset($_GET['error']); if (isset($error)) unset($error); if (isset($perma_query_vars) && strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false) unset($perma_query_vars); $this->did_permalink = false; } } $this->public_query_vars = apply_filters('query_vars', $this->public_query_vars); foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) if ( isset($t->query_var) ) $taxonomy_query_vars[$t->query_var] = $taxonomy; for ($i=0; $ipublic_query_vars); $i += 1) { $wpvar = $this->public_query_vars[$i]; if (isset($this->extra_query_vars[$wpvar])) $this->query_vars[$wpvar] = $this->extra_query_vars[$wpvar]; elseif (isset($GLOBALS[$wpvar])) $this->query_vars[$wpvar] = $GLOBALS[$wpvar]; elseif (!empty($_POST[$wpvar])) $this->query_vars[$wpvar] = $_POST[$wpvar]; elseif (!empty($_GET[$wpvar])) $this->query_vars[$wpvar] = $_GET[$wpvar]; elseif (!empty($perma_query_vars[$wpvar])) $this->query_vars[$wpvar] = $perma_query_vars[$wpvar]; if ( !empty( $this->query_vars[$wpvar] ) ) { $this->query_vars[$wpvar] = (string) $this->query_vars[$wpvar]; if ( in_array( $wpvar, $taxonomy_query_vars ) ) { $this->query_vars['taxonomy'] = $taxonomy_query_vars[$wpvar]; $this->query_vars['term'] = $this->query_vars[$wpvar]; } } } foreach ($this->private_query_vars as $var) { if (isset($this->extra_query_vars[$var])) $this->query_vars[$var] = $this->extra_query_vars[$var]; elseif (isset($GLOBALS[$var]) && '' != $GLOBALS[$var]) $this->query_vars[$var] = $GLOBALS[$var]; } if ( isset($error) ) $this->query_vars['error'] = $error; $this->query_vars = apply_filters('request', $this->query_vars); do_action_ref_array('parse_request', array(&$this)); } function send_headers() { @header('X-Pingback: '. get_bloginfo('pingback_url')); if ( is_user_logged_in() ) nocache_headers(); if ( !empty($this->query_vars['error']) && '404' == $this->query_vars['error'] ) { status_header( 404 ); if ( !is_user_logged_in() ) nocache_headers(); @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); } else if ( empty($this->query_vars['feed']) ) { @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); } else { // We're showing a feed, so WP is indeed the only thing that last changed if ( !empty($this->query_vars['withcomments']) || ( empty($this->query_vars['withoutcomments']) && ( !empty($this->query_vars['p']) || !empty($this->query_vars['name']) || !empty($this->query_vars['page_id']) || !empty($this->query_vars['pagename']) || !empty($this->query_vars['attachment']) || !empty($this->query_vars['attachment_id']) ) ) ) $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastcommentmodified('GMT'), 0).' GMT'; else $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0).' GMT'; $wp_etag = '"' . md5($wp_last_modified) . '"'; @header("Last-Modified: $wp_last_modified"); @header("ETag: $wp_etag"); // Support for Conditional GET if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) $client_etag = stripslashes(stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])); else $client_etag = false; $client_last_modified = empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? '' : trim($_SERVER['HTTP_IF_MODIFIED_SINCE']); // If string is empty, return 0. If not, attempt to parse into a timestamp $client_modified_timestamp = $client_last_modified ? strtotime($client_last_modified) : 0; // Make a timestamp for our most recent modification... $wp_modified_timestamp = strtotime($wp_last_modified); if ( ($client_last_modified && $client_etag) ? (($client_modified_timestamp >= $wp_modified_timestamp) && ($client_etag == $wp_etag)) : (($client_modified_timestamp >= $wp_modified_timestamp) || ($client_etag == $wp_etag)) ) { status_header( 304 ); exit; } } do_action_ref_array('send_headers', array(&$this)); } function build_query_string() { $this->query_string = ''; foreach (array_keys($this->query_vars) as $wpvar) { if ( '' != $this->query_vars[$wpvar] ) { $this->query_string .= (strlen($this->query_string) < 1) ? '' : '&'; if ( !is_scalar($this->query_vars[$wpvar]) ) // Discard non-scalars. continue; $this->query_string .= $wpvar . '=' . rawurlencode($this->query_vars[$wpvar]); } } // query_string filter deprecated. Use request filter instead. if ( has_filter('query_string') ) { // Don't bother filtering and parsing if no plugins are hooked in. $this->query_string = apply_filters('query_string', $this->query_string); parse_str($this->query_string, $this->query_vars); } } function register_globals() { global $wp_query; // Extract updated query vars back into global namespace. foreach ($wp_query->query_vars as $key => $value) { $GLOBALS[$key] = $value; } $GLOBALS['query_string'] = & $this->query_string; $GLOBALS['posts'] = & $wp_query->posts; $GLOBALS['post'] = & $wp_query->post; $GLOBALS['request'] = & $wp_query->request; if ( is_single() || is_page() ) { $GLOBALS['more'] = 1; $GLOBALS['single'] = 1; } } function init() { wp_get_current_user(); } function query_posts() { global $wp_the_query; $this->build_query_string(); $wp_the_query->query($this->query_vars); } function handle_404() { global $wp_query; // Issue a 404 if a permalink request doesn't match any posts. Don't // issue a 404 if one was already issued, if the request was a search, // or if the request was a regular query string request rather than a // permalink request. if ( (0 == count($wp_query->posts)) && !is_404() && !is_search() && ( $this->did_permalink || (!empty($_SERVER['QUERY_STRING']) && (false === strpos($_SERVER['REQUEST_URI'], '?'))) ) ) { $wp_query->set_404(); status_header( 404 ); nocache_headers(); } elseif( is_404() != true ) { status_header( 200 ); } } function main($query_args = '') { $this->init(); $this->parse_request($query_args); $this->send_headers(); $this->query_posts(); $this->handle_404(); $this->register_globals(); do_action_ref_array('wp', array(&$this)); } function WP() { // Empty. } } class WP_Error { var $errors = array(); var $error_data = array(); function WP_Error($code = '', $message = '', $data = '') { if ( empty($code) ) return; $this->errors[$code][] = $message; if ( ! empty($data) ) $this->error_data[$code] = $data; } function get_error_codes() { if ( empty($this->errors) ) return array(); return array_keys($this->errors); } function get_error_code() { $codes = $this->get_error_codes(); if ( empty($codes) ) return ''; return $codes[0]; } function get_error_messages($code = '') { // Return all messages if no code specified. if ( empty($code) ) { $all_messages = array(); foreach ( $this->errors as $code => $messages ) $all_messages = array_merge($all_messages, $messages); return $all_messages; } if ( isset($this->errors[$code]) ) return $this->errors[$code]; else return array(); } function get_error_message($code = '') { if ( empty($code) ) $code = $this->get_error_code(); $messages = $this->get_error_messages($code); if ( empty($messages) ) return ''; return $messages[0]; } function get_error_data($code = '') { if ( empty($code) ) $code = $this->get_error_code(); if ( isset($this->error_data[$code]) ) return $this->error_data[$code]; return null; } function add($code, $message, $data = '') { $this->errors[$code][] = $message; if ( ! empty($data) ) $this->error_data[$code] = $data; } function add_data($data, $code = '') { if ( empty($code) ) $code = $this->get_error_code(); $this->error_data[$code] = $data; } } function is_wp_error($thing) { if ( is_object($thing) && is_a($thing, 'WP_Error') ) return true; return false; } /* * A class for displaying various tree-like structures. * Extend the Walker class to use it, see examples at the bottom */ class Walker { var $tree_type; var $db_fields; //abstract callbacks function start_lvl(&$output) {} function end_lvl(&$output) {} function start_el(&$output) {} function end_el(&$output) {} /* * display one element if the element doesn't have any children * otherwise, display the element and its children */ function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) { if ( !$element ) return; $id_field = $this->db_fields['id']; $parent_field = $this->db_fields['parent']; //display this element $cb_args = array_merge( array(&$output, $element, $depth), $args); call_user_func_array(array(&$this, 'start_el'), $cb_args); if ( $max_depth == 0 || ($max_depth != 0 && $max_depth > $depth+1 )) { //whether to descend $num_elements = sizeof( $children_elements ); for ( $i = 0; $i < $num_elements; $i++ ) { $child = $children_elements[$i]; if ( $child->$parent_field == $element->$id_field ) { if ( !isset($newlevel) ) { $newlevel = true; //start the child delimiter $cb_args = array_merge( array(&$output, $depth), $args); call_user_func_array(array(&$this, 'start_lvl'), $cb_args); } array_splice( $children_elements, $i, 1 ); $num_elements--; $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output ); $i = -1; } } } if ( isset($newlevel) && $newlevel ){ //end the child delimiter $cb_args = array_merge( array(&$output, $depth), $args); call_user_func_array(array(&$this, 'end_lvl'), $cb_args); } //end this element $cb_args = array_merge( array(&$output, $element, $depth), $args); call_user_func_array(array(&$this, 'end_el'), $cb_args); } /* * displays array of elements hierarchically * it is a generic function which does not assume any existing order of elements * max_depth = -1 means flatly display every element * max_depth = 0 means display all levels * max_depth > 0 specifies the number of display levels. */ function walk( $elements, $max_depth) { $args = array_slice(func_get_args(), 2); $output = ''; if ($max_depth < -1) //invalid parameter return $output; if (empty($elements)) //nothing to walk return $output; $id_field = $this->db_fields['id']; $parent_field = $this->db_fields['parent']; // flat display if ( -1 == $max_depth ) { $empty_array = array(); foreach ( $elements as $e ) $this->display_element( $e, $empty_array, 1, 0, $args, $output ); return $output; } /* * need to display in hierarchical order * splice elements into two buckets: those without parent and those with parent */ $top_level_elements = array(); $children_elements = array(); foreach ( $elements as $e) { if ( 0 == $e->$parent_field ) $top_level_elements[] = $e; else $children_elements[] = $e; } /* * none of the elements is top level * the first one must be root of the sub elements */ if ( !$top_level_elements ) { $root = $children_elements[0]; $num_elements = sizeof($children_elements); for ( $i = 0; $i < $num_elements; $i++ ) { $child = $children_elements[$i]; if ($root->$parent_field == $child->$parent_field ) { $top_level_elements[] = $child; array_splice( $children_elements, $i, 1 ); $num_elements--; $i--; } } } foreach ( $top_level_elements as $e ) $this->display_element( $e, $children_elements, $max_depth, 0, $args, $output ); /* * if we are displaying all levels, and remaining children_elements is not empty, * then we got orphans, which should be displayed regardless */ if ( ( $max_depth == 0 ) && sizeof( $children_elements ) > 0 ) { $empty_array = array(); foreach ( $children_elements as $orphan_e ) $this->display_element( $orphan_e, $empty_array, 1, 0, $args, $output ); } return $output; } } class Walker_Page extends Walker { var $tree_type = 'page'; var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID'); //TODO: decouple this function start_lvl(&$output, $depth) { $indent = str_repeat("\t", $depth); $output .= "\n$indent
      \n"; } function end_lvl(&$output, $depth) { $indent = str_repeat("\t", $depth); $output .= "$indent
    \n"; } function start_el(&$output, $page, $depth, $current_page, $args) { if ( $depth ) $indent = str_repeat("\t", $depth); else $indent = ''; extract($args, EXTR_SKIP); $css_class = 'page_item page-item-'.$page->ID; if ( !empty($current_page) ) { $_current_page = get_page( $current_page ); if ( in_array($page->ID, (array) $_current_page->ancestors) ) $css_class .= ' current_page_ancestor'; if ( $page->ID == $current_page ) $css_class .= ' current_page_item'; elseif ( $_current_page && $page->ID == $_current_page->post_parent ) $css_class .= ' current_page_parent'; } $output .= $indent . '
  • ' . apply_filters('the_title', $page->post_title) . ''; if ( !empty($show_date) ) { if ( 'modified' == $show_date ) $time = $page->post_modified; else $time = $page->post_date; $output .= " " . mysql2date($date_format, $time); } } function end_el(&$output, $page, $depth) { $output .= "
  • \n"; } } class Walker_PageDropdown extends Walker { var $tree_type = 'page'; var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID'); //TODO: decouple this function start_el(&$output, $page, $depth, $args) { $pad = str_repeat(' ', $depth * 3); $output .= "\t\n"; } } class Walker_Category extends Walker { var $tree_type = 'category'; var $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this function start_lvl(&$output, $depth, $args) { if ( 'list' != $args['style'] ) return; $indent = str_repeat("\t", $depth); $output .= "$indent
      \n"; } function end_lvl(&$output, $depth, $args) { if ( 'list' != $args['style'] ) return; $indent = str_repeat("\t", $depth); $output .= "$indent
    \n"; } function start_el(&$output, $category, $depth, $args) { extract($args); $cat_name = attribute_escape( $category->name); $cat_name = apply_filters( 'list_cats', $cat_name, $category ); $link = 'description) ) $link .= 'title="' . sprintf(__( 'View all posts filed under %s' ), $cat_name) . '"'; else $link .= 'title="' . attribute_escape( apply_filters( 'category_description', $category->description, $category )) . '"'; $link .= '>'; $link .= $cat_name . ''; if ( (! empty($feed_image)) || (! empty($feed)) ) { $link .= ' '; if ( empty($feed_image) ) $link .= '('; $link .= ''; $link .= ''; if ( empty($feed_image) ) $link .= ')'; } if ( isset($show_count) && $show_count ) $link .= ' (' . intval($category->count) . ')'; if ( isset($show_date) && $show_date ) { $link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp); } if ( isset($current_category) && $current_category ) $_current_category = get_category( $current_category ); if ( 'list' == $args['style'] ) { $output .= "\tterm_id; if ( isset($current_category) && $current_category && ($category->term_id == $current_category) ) $class .= ' current-cat'; elseif ( isset($_current_category) && $_current_category && ($category->term_id == $_current_category->parent) ) $class .= ' current-cat-parent'; $output .= ' class="'.$class.'"'; $output .= ">$link\n"; } else { $output .= "\t$link
    \n"; } } function end_el(&$output, $page, $depth, $args) { if ( 'list' != $args['style'] ) return; $output .= "\n"; } } class Walker_CategoryDropdown extends Walker { var $tree_type = 'category'; var $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this function start_el(&$output, $category, $depth, $args) { $pad = str_repeat(' ', $depth * 3); $cat_name = apply_filters('list_cats', $category->name, $category); $output .= "\t\n"; } } class WP_Ajax_Response { var $responses = array(); function WP_Ajax_Response( $args = '' ) { if ( !empty($args) ) $this->add($args); } // a WP_Error object can be passed in 'id' or 'data' function add( $args = '' ) { $defaults = array( 'what' => 'object', 'action' => false, 'id' => '0', 'old_id' => false, 'position' => 1, // -1 = top, 1 = bottom, html ID = after, -html ID = before 'data' => '', 'supplemental' => array() ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); $position = preg_replace( '/[^a-z0-9:_-]/i', '', $position ); if ( is_wp_error($id) ) { $data = $id; $id = 0; } $response = ''; if ( is_wp_error($data) ) { foreach ( $data->get_error_codes() as $code ) { $response .= "get_error_message($code) . "]]>"; if ( !$error_data = $data->get_error_data($code) ) continue; $class = ''; if ( is_object($error_data) ) { $class = ' class="' . get_class($error_data) . '"'; $error_data = get_object_vars($error_data); } $response .= ""; if ( is_scalar($error_data) ) { $response .= ""; } elseif ( is_array($error_data) ) { foreach ( $error_data as $k => $v ) $response .= "<$k>"; } $response .= ""; } } else { $response = ""; } $s = ''; if ( (array) $supplemental ) { foreach ( $supplemental as $k => $v ) $s .= "<$k>"; $s = "$s"; } if ( false === $action ) $action = $_POST['action']; $x = ''; $x .= ""; // The action attribute in the xml output is formatted like a nonce action $x .= "<$what id='$id' " . ( false === $old_id ? '' : "old_id='$old_id' " ) . "position='$position'>"; $x .= $response; $x .= $s; $x .= ""; $x .= ""; $this->responses[] = $x; return $x; } function send() { header('Content-Type: text/xml'); echo ""; foreach ( $this->responses as $response ) echo $response; echo ''; die(); } } ?> wp/dev/wp-includes/atomlib.php0000644000106600010660000002526011027014610013571 0ustar * @version 0.4 * @since 2.3 */ /** * Structure that store common Atom Feed Properties * * @package AtomLib */ class AtomFeed { /** * Stores Links * @var array * @access public */ var $links = array(); /** * Stores Categories * @var array * @access public */ var $categories = array(); /** * Stores Entries * * @var array * @access public */ var $entries = array(); } /** * Structure that store Atom Entry Properties * * @package AtomLib */ class AtomEntry { /** * Stores Links * @var array * @access public */ var $links = array(); /** * Stores Categories * @var array * @access public */ var $categories = array(); } /** * AtomLib Atom Parser API * * @package AtomLib */ class AtomParser { var $NS = 'http://www.w3.org/2005/Atom'; var $ATOM_CONTENT_ELEMENTS = array('content','summary','title','subtitle','rights'); var $ATOM_SIMPLE_ELEMENTS = array('id','updated','published','draft'); var $debug = false; var $depth = 0; var $indent = 2; var $in_content; var $ns_contexts = array(); var $ns_decls = array(); var $content_ns_decls = array(); var $content_ns_contexts = array(); var $is_xhtml = false; var $is_html = false; var $is_text = true; var $skipped_div = false; var $FILE = "php://input"; var $feed; var $current; function AtomParser() { $this->feed = new AtomFeed(); $this->current = null; $this->map_attrs_func = create_function('$k,$v', 'return "$k=\"$v\"";'); $this->map_xmlns_func = create_function('$p,$n', '$xd = "xmlns"; if(strlen($n[0])>0) $xd .= ":{$n[0]}"; return "{$xd}=\"{$n[1]}\"";'); } function _p($msg) { if($this->debug) { print str_repeat(" ", $this->depth * $this->indent) . $msg ."\n"; } } function error_handler($log_level, $log_text, $error_file, $error_line) { $this->error = $log_text; } function parse() { set_error_handler(array(&$this, 'error_handler')); array_unshift($this->ns_contexts, array()); $parser = xml_parser_create_ns(); xml_set_object($parser, $this); xml_set_element_handler($parser, "start_element", "end_element"); xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,0); xml_set_character_data_handler($parser, "cdata"); xml_set_default_handler($parser, "_default"); xml_set_start_namespace_decl_handler($parser, "start_ns"); xml_set_end_namespace_decl_handler($parser, "end_ns"); $this->content = ''; $ret = true; $fp = fopen($this->FILE, "r"); while ($data = fread($fp, 4096)) { if($this->debug) $this->content .= $data; if(!xml_parse($parser, $data, feof($fp))) { trigger_error(sprintf(__('XML error: %s at line %d')."\n", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); $ret = false; break; } } fclose($fp); xml_parser_free($parser); restore_error_handler(); return $ret; } function start_element($parser, $name, $attrs) { $tag = array_pop(split(":", $name)); switch($name) { case $this->NS . ':feed': $this->current = $this->feed; break; case $this->NS . ':entry': $this->current = new AtomEntry(); break; }; $this->_p("start_element('$name')"); #$this->_p(print_r($this->ns_contexts,true)); #$this->_p('current(' . $this->current . ')'); array_unshift($this->ns_contexts, $this->ns_decls); $this->depth++; if(!empty($this->in_content)) { $this->content_ns_decls = array(); if($this->is_html || $this->is_text) trigger_error("Invalid content in element found. Content must not be of type text or html if it contains markup."); $attrs_prefix = array(); // resolve prefixes for attributes foreach($attrs as $key => $value) { $with_prefix = $this->ns_to_prefix($key, true); $attrs_prefix[$with_prefix[1]] = $this->xml_escape($value); } $attrs_str = join(' ', array_map($this->map_attrs_func, array_keys($attrs_prefix), array_values($attrs_prefix))); if(strlen($attrs_str) > 0) { $attrs_str = " " . $attrs_str; } $with_prefix = $this->ns_to_prefix($name); if(!$this->is_declared_content_ns($with_prefix[0])) { array_push($this->content_ns_decls, $with_prefix[0]); } $xmlns_str = ''; if(count($this->content_ns_decls) > 0) { array_unshift($this->content_ns_contexts, $this->content_ns_decls); $xmlns_str .= join(' ', array_map($this->map_xmlns_func, array_keys($this->content_ns_contexts[0]), array_values($this->content_ns_contexts[0]))); if(strlen($xmlns_str) > 0) { $xmlns_str = " " . $xmlns_str; } } array_push($this->in_content, array($tag, $this->depth, "<". $with_prefix[1] ."{$xmlns_str}{$attrs_str}" . ">")); } else if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) { $this->in_content = array(); $this->is_xhtml = $attrs['type'] == 'xhtml'; $this->is_html = $attrs['type'] == 'html' || $attrs['type'] == 'text/html'; $this->is_text = !in_array('type',array_keys($attrs)) || $attrs['type'] == 'text'; $type = $this->is_xhtml ? 'XHTML' : ($this->is_html ? 'HTML' : ($this->is_text ? 'TEXT' : $attrs['type'])); if(in_array('src',array_keys($attrs))) { $this->current->$tag = $attrs; } else { array_push($this->in_content, array($tag,$this->depth, $type)); } } else if($tag == 'link') { array_push($this->current->links, $attrs); } else if($tag == 'category') { array_push($this->current->categories, $attrs); } $this->ns_decls = array(); } function end_element($parser, $name) { $tag = array_pop(split(":", $name)); $ccount = count($this->in_content); # if we are *in* content, then let's proceed to serialize it if(!empty($this->in_content)) { # if we are ending the original content element # then let's finalize the content if($this->in_content[0][0] == $tag && $this->in_content[0][1] == $this->depth) { $origtype = $this->in_content[0][2]; array_shift($this->in_content); $newcontent = array(); foreach($this->in_content as $c) { if(count($c) == 3) { array_push($newcontent, $c[2]); } else { if($this->is_xhtml || $this->is_text) { array_push($newcontent, $this->xml_escape($c)); } else { array_push($newcontent, $c); } } } if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS)) { $this->current->$tag = array($origtype, join('',$newcontent)); } else { $this->current->$tag = join('',$newcontent); } $this->in_content = array(); } else if($this->in_content[$ccount-1][0] == $tag && $this->in_content[$ccount-1][1] == $this->depth) { $this->in_content[$ccount-1][2] = substr($this->in_content[$ccount-1][2],0,-1) . "/>"; } else { # else, just finalize the current element's content $endtag = $this->ns_to_prefix($name); array_push($this->in_content, array($tag, $this->depth, "")); } } array_shift($this->ns_contexts); $this->depth--; if($name == ($this->NS . ':entry')) { array_push($this->feed->entries, $this->current); $this->current = null; } $this->_p("end_element('$name')"); } function start_ns($parser, $prefix, $uri) { $this->_p("starting: " . $prefix . ":" . $uri); array_push($this->ns_decls, array($prefix,$uri)); } function end_ns($parser, $prefix) { $this->_p("ending: #" . $prefix . "#"); } function cdata($parser, $data) { $this->_p("data: #" . str_replace(array("\n"), array("\\n"), trim($data)) . "#"); if(!empty($this->in_content)) { array_push($this->in_content, $data); } } function _default($parser, $data) { # when does this gets called? } function ns_to_prefix($qname, $attr=false) { # split 'http://www.w3.org/1999/xhtml:div' into ('http','//www.w3.org/1999/xhtml','div') $components = split(":", $qname); # grab the last one (e.g 'div') $name = array_pop($components); if(!empty($components)) { # re-join back the namespace component $ns = join(":",$components); foreach($this->ns_contexts as $context) { foreach($context as $mapping) { if($mapping[1] == $ns && strlen($mapping[0]) > 0) { return array($mapping, "$mapping[0]:$name"); } } } } if($attr) { return array(null, $name); } else { foreach($this->ns_contexts as $context) { foreach($context as $mapping) { if(strlen($mapping[0]) == 0) { return array($mapping, $name); } } } } } function is_declared_content_ns($new_mapping) { foreach($this->content_ns_contexts as $context) { foreach($context as $mapping) { if($new_mapping == $mapping) { return true; } } } return false; } function xml_escape($string) { return str_replace(array('&','"',"'",'<','>'), array('&','"',''','<','>'), $string ); } } ?> wp/dev/wp-includes/shortcodes.php0000644000106600010660000001656711030735765014350 0ustar * $out = do_shortcode($content); * * * @link http://codex.wordpress.org/Shortcode_API * * @package WordPress * @subpackage Shortcodes * @since 2.5 */ /** * Container for storing shortcode tags and their hook to call for the shortcode * * @since 2.5 * @name $shortcode_tags * @var array * @global array $shortcode_tags */ $shortcode_tags = array(); /** * Add hook for shortcode tag. * * There can only be one hook for each shortcode. Which means that if another * plugin has a similar shortcode, it will override yours or yours will override * theirs depending on which order the plugins are included and/or ran. * * Simplest example of a shortcode tag using the API: * * * // [footag foo="bar"] * function footag_func($atts) { * return "foo = {$atts[foo]}"; * } * add_shortcode('footag', 'footag_func'); * * * Example with nice attribute defaults: * * * // [bartag foo="bar"] * function bartag_func($atts) { * extract(shortcode_atts(array( * 'foo' => 'no foo', * 'baz' => 'default baz', * ), $atts)); * * return "foo = {$foo}"; * } * add_shortcode('bartag', 'bartag_func'); * * * Example with enclosed content: * * * // [baztag]content[/baztag] * function baztag_func($atts, $content='') { * return "content = $content"; * } * add_shortcode('baztag', 'baztag_func'); * * * @since 2.5 * @uses $shortcode_tags * * @param string $tag Shortcode tag to be searched in post content. * @param callable $func Hook to run when shortcode is found. */ function add_shortcode($tag, $func) { global $shortcode_tags; if ( is_callable($func) ) $shortcode_tags[$tag] = $func; } /** * Removes hook for shortcode. * * @since 2.5 * @uses $shortcode_tags * * @param string $tag shortcode tag to remove hook for. */ function remove_shortcode($tag) { global $shortcode_tags; unset($shortcode_tags[$tag]); } /** * Clear all shortcodes. * * This function is simple, it clears all of the shortcode tags by replacing the * shortcodes global by a empty array. This is actually a very efficient method * for removing all shortcodes. * * @since 2.5 * @uses $shortcode_tags */ function remove_all_shortcodes() { global $shortcode_tags; $shortcode_tags = array(); } /** * Search content for shortcodes and filter shortcodes through their hooks. * * If there are no shortcode tags defined, then the content will be returned * without any filtering. This might cause issues when plugins are disabled but * the shortcode will still show up in the post or content. * * @since 2.5 * @uses $shortcode_tags * @uses get_shortcode_regex() Gets the search pattern for searching shortcodes. * * @param string $content Content to search for shortcodes * @return string Content with shortcodes filtered out. */ function do_shortcode($content) { global $shortcode_tags; if (empty($shortcode_tags) || !is_array($shortcode_tags)) return $content; $pattern = get_shortcode_regex(); return preg_replace_callback('/'.$pattern.'/s', 'do_shortcode_tag', $content); } /** * Retrieve the shortcode regular expression for searching. * * The regular expression combines the shortcode tags in the regular expression * in a regex class. * * @since 2.5 * @uses $shortcode_tags * * @return string The shortcode search regular expression */ function get_shortcode_regex() { global $shortcode_tags; $tagnames = array_keys($shortcode_tags); $tagregexp = join( '|', array_map('preg_quote', $tagnames) ); return '\[('.$tagregexp.')\b(.*?)(?:(\/))?\](?:(.+?)\[\/\1\])?'; } /** * Regular Expression callable for do_shortcode() for calling shortcode hook. * * @since 2.5 * @access private * @uses $shortcode_tags * * @param array $m Regular expression match array * @return mixed False on failure. */ function do_shortcode_tag($m) { global $shortcode_tags; $tag = $m[1]; $attr = shortcode_parse_atts($m[2]); if ( isset($m[4]) ) { // enclosing tag - extra parameter return call_user_func($shortcode_tags[$tag], $attr, $m[4]); } else { // self-closing tag return call_user_func($shortcode_tags[$tag], $attr); } } /** * Retrieve all attributes from the shortcodes tag. * * The attributes list has the attribute name as the key and the value of the * attribute as the value in the key/value pair. This allows for easier * retrieval of the attributes, since all attributes have to be known. * * @since 2.5 * * @param string $text * @return array List of attributes and their value. */ function shortcode_parse_atts($text) { $atts = array(); $pattern = '/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/'; $text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text); if ( preg_match_all($pattern, $text, $match, PREG_SET_ORDER) ) { foreach ($match as $m) { if (!empty($m[1])) $atts[strtolower($m[1])] = stripcslashes($m[2]); elseif (!empty($m[3])) $atts[strtolower($m[3])] = stripcslashes($m[4]); elseif (!empty($m[5])) $atts[strtolower($m[5])] = stripcslashes($m[6]); elseif (isset($m[7]) and strlen($m[7])) $atts[] = stripcslashes($m[7]); elseif (isset($m[8])) $atts[] = stripcslashes($m[8]); } } else { $atts = ltrim($text); } return $atts; } /** * Combine user attributes with known attributes and fill in defaults when needed. * * The pairs should be considered to be all of the attributes which are * supported by the caller and given as a list. The returned attributes will * only contain the attributes in the $pairs list. * * If the $atts list has unsupported attributes, then they will be ignored and * removed from the final returned list. * * @since 2.5 * * @param array $pairs Entire list of supported attributes and their defaults. * @param array $atts User defined attributes in shortcode tag. * @return array Combined and filtered attribute list. */ function shortcode_atts($pairs, $atts) { $atts = (array)$atts; $out = array(); foreach($pairs as $name => $default) { if ( array_key_exists($name, $atts) ) $out[$name] = $atts[$name]; else $out[$name] = $default; } return $out; } /** * Remove all shortcode tags from the given content. * * @since 2.5 * @uses $shortcode_tags * * @param string $content Content to remove shortcode tags. * @return string Content without shortcode tags. */ function strip_shortcodes( $content ) { global $shortcode_tags; if (empty($shortcode_tags) || !is_array($shortcode_tags)) return $content; $pattern = get_shortcode_regex(); return preg_replace('/'.$pattern.'/s', '', $content); } add_filter('the_content', 'do_shortcode', 11); // AFTER wpautop() ?>wp/dev/wp-includes/post.php0000644000106600010660000027707711050631316013152 0ustar (int) $GLOBALS['post']->post_parent ); } else { return false; } } elseif ( is_object( $args ) ) { $args = array('post_parent' => (int) $args->post_parent ); } elseif ( is_numeric( $args ) ) { $args = array('post_parent' => (int) $args); } $defaults = array( 'numberposts' => -1, 'post_type' => '', 'post_status' => '', 'post_parent' => 0 ); $r = wp_parse_args( $args, $defaults ); $children = get_posts( $r ); if ( !$children ) return false; update_post_cache($children); foreach ( $children as $key => $child ) $kids[$child->ID] =& $children[$key]; if ( $output == OBJECT ) { return $kids; } elseif ( $output == ARRAY_A ) { foreach ( $kids as $kid ) $weeuns[$kid->ID] = get_object_vars($kids[$kid->ID]); return $weeuns; } elseif ( $output == ARRAY_N ) { foreach ( $kids as $kid ) $babes[$kid->ID] = array_values(get_object_vars($kids[$kid->ID])); return $babes; } else { return $kids; } } /** * get_extended() - Get extended entry info () * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.0.0 * * @param string $post {@internal Missing Description}} * @return array {@internal Missing Description}} */ function get_extended($post) { //Match the new style more links if ( preg_match('//', $post, $matches) ) { list($main, $extended) = explode($matches[0], $post, 2); } else { $main = $post; $extended = ''; } // Strip leading and trailing whitespace $main = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $main); $extended = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $extended); return array('main' => $main, 'extended' => $extended); } /** * get_post() - Retrieves post data given a post ID or post object. * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.5.1 * @uses $wpdb * @link http://codex.wordpress.org/Function_Reference/get_post * * @param int|object &$post post ID or post object * @param string $output {@internal Missing Description}} * @param string $filter {@internal Missing Description}} * @return mixed {@internal Missing Description}} */ function &get_post(&$post, $output = OBJECT, $filter = 'raw') { global $wpdb; $null = null; if ( empty($post) ) { if ( isset($GLOBALS['post']) ) $_post = & $GLOBALS['post']; else return $null; } elseif ( is_object($post) ) { _get_post_ancestors($post); wp_cache_add($post->ID, $post, 'posts'); $_post = &$post; } else { $post = (int) $post; if ( ! $_post = wp_cache_get($post, 'posts') ) { $_post = & $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d LIMIT 1", $post)); if ( ! $_post ) return $null; _get_post_ancestors($_post); wp_cache_add($_post->ID, $_post, 'posts'); } } $_post = sanitize_post($_post, $filter); if ( $output == OBJECT ) { return $_post; } elseif ( $output == ARRAY_A ) { $__post = get_object_vars($_post); return $__post; } elseif ( $output == ARRAY_N ) { $__post = array_values(get_object_vars($_post)); return $__post; } else { return $_post; } } /** * Retrieve ancestors of a post. * * @package WordPress * @subpackage Post * @since 2.5 * * @param int|object $post Post ID or post object * @return array Ancestor IDs or empty array if none are found. */ function get_post_ancestors($post) { $post = get_post($post); if ( !empty($post->ancestors) ) return $post->ancestors; return array(); } /** * Retrieve data from a post field based on Post ID. * * Examples of the post field will be, 'post_type', 'post_status', 'content', * etc and based off of the post object property or key names. * * The context values are based off of the taxonomy filter functions and * supported values are found within those functions. * * @package WordPress * @subpackage Post * @since 2.3 * @uses sanitize_post_field() See for possible $context values. * * @param string $field Post field name * @param id $post Post ID * @param string $context Optional. How to filter the field. Default is display. * @return WP_Error|string Value in post field or WP_Error on failure */ function get_post_field( $field, $post, $context = 'display' ) { $post = (int) $post; $post = get_post( $post ); if ( is_wp_error($post) ) return $post; if ( !is_object($post) ) return ''; if ( !isset($post->$field) ) return ''; return sanitize_post_field($field, $post->$field, $post->ID, $context); } /** * Retrieve the mime type of an attachment based on the ID. * * This function can be used with any post type, but it makes more sense with * attachments. * * @package WordPress * @subpackage Post * @since 2.0 * * @param int $ID Optional. Post ID. * @return bool|string False on failure or returns the mime type */ function get_post_mime_type($ID = '') { $post = & get_post($ID); if ( is_object($post) ) return $post->post_mime_type; return false; } /** * Retrieve the post status based on the Post ID. * * If the post ID is of an attachment, then the parent post status will be given * instead. * * @package WordPress * @subpackage Post * @since 2.0 * * @param int $ID Post ID * @return string|bool Post status or false on failure. */ function get_post_status($ID = '') { $post = get_post($ID); if ( is_object($post) ) { if ( ('attachment' == $post->post_type) && $post->post_parent && ($post->ID != $post->post_parent) ) return get_post_status($post->post_parent); else return $post->post_status; } return false; } /** * Retrieve all of the WordPress supported post statuses. * * Posts have a limited set of valid status values, this provides the * post_status values and descriptions. * * @package WordPress * @subpackage Post * @since 2.5 * * @return array List of post statuses. */ function get_post_statuses( ) { $status = array( 'draft' => __('Draft'), 'pending' => __('Pending Review'), 'private' => __('Private'), 'publish' => __('Published') ); return $status; } /** * Retrieve all of the WordPress support page statuses. * * Pages have a limited set of valid status values, this provides the * post_status values and descriptions. * * @package WordPress * @subpackage Page * @since 2.5 * * @return array List of page statuses. */ function get_page_statuses( ) { $status = array( 'draft' => __('Draft'), 'private' => __('Private'), 'publish' => __('Published') ); return $status; } /** * get_post_type() - Returns post type * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.1 * * @uses $wpdb * @uses $posts {@internal Missing Description}} * * @param mixed $post post object or post ID * @return mixed post type or false */ function get_post_type($post = false) { global $posts; if ( false === $post ) $post = $posts[0]; elseif ( (int) $post ) $post = get_post($post, OBJECT); if ( is_object($post) ) return $post->post_type; return false; } /** * set_post_type() - Set post type * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.5 * * @uses $wpdb * @uses $posts {@internal Missing Description}} * * @param mixed $post_id post ID * @param mixed post type * @return bool {@internal Missing Description}} */ function set_post_type( $post_id = 0, $post_type = 'post' ) { global $wpdb; $post_type = sanitize_post_field('post_type', $post_type, $post_id, 'db'); $return = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_type = %s WHERE ID = %d", $post_type, $post_id) ); if ( 'page' == $post_type ) clean_page_cache($post_id); else clean_post_cache($post_id); return $return; } /** * get_posts() - Returns a number of posts * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.2 * @uses $wpdb * @link http://codex.wordpress.org/Template_Tags/get_posts * * @param array $args {@internal Missing Description}} * @return array {@internal Missing Description}} */ function get_posts($args = null) { $defaults = array( 'numberposts' => 5, 'offset' => 0, 'category' => 0, 'orderby' => 'post_date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' =>'', 'post_type' => 'post', 'post_parent' => 0 ); $r = wp_parse_args( $args, $defaults ); if ( empty( $r['post_status'] ) ) $r['post_status'] = ( 'attachment' == $r['post_type'] ) ? 'inherit' : 'publish'; if ( ! empty($r['numberposts']) ) $r['posts_per_page'] = $r['numberposts']; if ( ! empty($r['category']) ) $r['cat'] = $r['category']; if ( ! empty($r['include']) ) { $incposts = preg_split('/[\s,]+/',$r['include']); $r['posts_per_page'] = count($incposts); // only the number of posts included $r['post__in'] = $incposts; } elseif ( ! empty($r['exclude']) ) $r['post__not_in'] = preg_split('/[\s,]+/',$r['exclude']); $get_posts = new WP_Query; return $get_posts->query($r); } // // Post meta functions // /** * add_post_meta() - adds metadata for post * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.5 * @uses $wpdb * @link http://codex.wordpress.org/Function_Reference/add_post_meta * * @param int $post_id post ID * @param string $key {@internal Missing Description}} * @param mixed $value {@internal Missing Description}} * @param bool $unique whether to check for a value with the same key * @return bool {@internal Missing Description}} */ function add_post_meta($post_id, $meta_key, $meta_value, $unique = false) { global $wpdb; // make sure meta is added to the post, not a revision if ( $the_post = wp_is_post_revision($post_id) ) $post_id = $the_post; // expected_slashed ($meta_key) $meta_key = stripslashes($meta_key); if ( $unique && $wpdb->get_var( $wpdb->prepare( "SELECT meta_key FROM $wpdb->postmeta WHERE meta_key = %s AND post_id = %d", $meta_key, $post_id ) ) ) return false; $meta_value = maybe_serialize($meta_value); $wpdb->insert( $wpdb->postmeta, compact( 'post_id', 'meta_key', 'meta_value' ) ); wp_cache_delete($post_id, 'post_meta'); return true; } /** * delete_post_meta() - delete post metadata * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.5 * @uses $wpdb * @link http://codex.wordpress.org/Function_Reference/delete_post_meta * * @param int $post_id post ID * @param string $key {@internal Missing Description}} * @param mixed $value {@internal Missing Description}} * @return bool {@internal Missing Description}} */ function delete_post_meta($post_id, $key, $value = '') { global $wpdb; $post_id = absint( $post_id ); // expected_slashed ($key, $value) $key = stripslashes( $key ); $value = stripslashes( $value ); if ( empty( $value ) ) $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $key ) ); else $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s AND meta_value = %s", $post_id, $key, $value ) ); if ( !$meta_id ) return false; if ( empty( $value ) ) $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $key ) ); else $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s AND meta_value = %s", $post_id, $key, $value ) ); wp_cache_delete($post_id, 'post_meta'); return true; } /** * get_post_meta() - Get a post meta field * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.5 * @uses $wpdb * @link http://codex.wordpress.org/Function_Reference/get_post_meta * * @param int $post_id post ID * @param string $key The meta key to retrieve * @param bool $single Whether to return a single value * @return mixed {@internal Missing Description}} */ function get_post_meta($post_id, $key, $single = false) { $post_id = (int) $post_id; $meta_cache = wp_cache_get($post_id, 'post_meta'); if ( isset($meta_cache[$key]) ) { if ( $single ) { return maybe_unserialize( $meta_cache[$key][0] ); } else { return maybe_unserialize( $meta_cache[$key] ); } } if ( !$meta_cache ) { update_postmeta_cache($post_id); $meta_cache = wp_cache_get($post_id, 'post_meta'); } if ( $single ) { if ( isset($meta_cache[$key][0]) ) return maybe_unserialize($meta_cache[$key][0]); else return ''; } else { return maybe_unserialize($meta_cache[$key]); } } /** * update_post_meta() - Update a post meta field * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.5 * @uses $wpdb * @link http://codex.wordpress.org/Function_Reference/update_post_meta * * @param int $post_id post ID * @param string $key {@internal Missing Description}} * @param mixed $value {@internal Missing Description}} * @param mixed $prev_value previous value (for differentiating between meta fields with the same key and post ID) * @return bool {@internal Missing Description}} */ function update_post_meta($post_id, $meta_key, $meta_value, $prev_value = '') { global $wpdb; // expected_slashed ($meta_key) $meta_key = stripslashes($meta_key); if ( ! $wpdb->get_var( $wpdb->prepare( "SELECT meta_key FROM $wpdb->postmeta WHERE meta_key = %s AND post_id = %d", $meta_key, $post_id ) ) ) { return add_post_meta($post_id, $meta_key, $meta_value); } $meta_value = maybe_serialize($meta_value); $data = compact( 'meta_value' ); $where = compact( 'meta_key', 'post_id' ); if ( !empty( $prev_value ) ) { $prev_value = maybe_serialize($prev_value); $where['meta_value'] = $prev_value; } $wpdb->update( $wpdb->postmeta, $data, $where ); wp_cache_delete($post_id, 'post_meta'); return true; } /** * delete_post_meta_by_key() - Delete everything from post meta matching $post_meta_key * * @package WordPress * @subpackage Post * @since 2.3 * @uses $wpdb * * @param string $post_meta_key What to search for when deleting * @return bool Whether the post meta key was deleted from the database */ function delete_post_meta_by_key($post_meta_key) { global $wpdb; if ( $wpdb->query($wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_key = %s", $post_meta_key)) ) { /** @todo Get post_ids and delete cache */ // wp_cache_delete($post_id, 'post_meta'); return true; } return false; } /** * get_post_custom() - Retrieve post custom fields * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.2 * @link http://codex.wordpress.org/Function_Reference/get_post_custom * * @uses $id * @uses $wpdb * * @param int $post_id post ID * @return array {@internal Missing Description}} */ function get_post_custom($post_id = 0) { global $id; if ( !$post_id ) $post_id = (int) $id; $post_id = (int) $post_id; if ( ! wp_cache_get($post_id, 'post_meta') ) update_postmeta_cache($post_id); return wp_cache_get($post_id, 'post_meta'); } /** * get_post_custom_keys() - Retrieve post custom field names * * @package WordPress * @subpackage Post * @since 1.2 * @link http://codex.wordpress.org/Function_Reference/get_post_custom_keys * * @param int $post_id post ID * @return array|null Either array of the keys, or null if keys would not be retrieved */ function get_post_custom_keys( $post_id = 0 ) { $custom = get_post_custom( $post_id ); if ( !is_array($custom) ) return; if ( $keys = array_keys($custom) ) return $keys; } /** * get_post_custom_values() - Retrieve values for a custom post field * * @package WordPress * @subpackage Post * @since 1.2 * @link http://codex.wordpress.org/Function_Reference/get_post_custom_values * * @param string $key field name * @param int $post_id post ID * @return mixed {@internal Missing Description}} */ function get_post_custom_values( $key = '', $post_id = 0 ) { $custom = get_post_custom($post_id); return $custom[$key]; } /** * sanitize_post() - Sanitize every post field * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.3 * * @param object|array $post The Post Object or Array * @param string $context How to sanitize post fields * @return object|array The now sanitized Post Object or Array (will be the same type as $post) */ function sanitize_post($post, $context = 'display') { if ( 'raw' == $context ) return $post; if ( is_object($post) ) { foreach ( array_keys(get_object_vars($post)) as $field ) $post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context); } else { foreach ( array_keys($post) as $field ) $post[$field] = sanitize_post_field($field, $post[$field], $post['ID'], $context); } return $post; } /** * sanitize_post_field() - Sanitize post field based on context * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.3 * * @param string $field The Post Object field name * @param string $value The Post Object value * @param int $postid Post ID * @param string $context How to sanitize post fields * @return string Sanitized value */ function sanitize_post_field($field, $value, $post_id, $context) { $int_fields = array('ID', 'post_parent', 'menu_order'); if ( in_array($field, $int_fields) ) $value = (int) $value; if ( 'raw' == $context ) return $value; $prefixed = false; if ( false !== strpos($field, 'post_') ) { $prefixed = true; $field_no_prefix = str_replace('post_', '', $field); } if ( 'edit' == $context ) { $format_to_edit = array('post_content', 'post_excerpt', 'post_title', 'post_password'); if ( $prefixed ) { $value = apply_filters("edit_$field", $value, $post_id); // Old school $value = apply_filters("${field_no_prefix}_edit_pre", $value, $post_id); } else { $value = apply_filters("edit_post_$field", $value, $post_id); } if ( in_array($field, $format_to_edit) ) { if ( 'post_content' == $field ) $value = format_to_edit($value, user_can_richedit()); else $value = format_to_edit($value); } else { $value = attribute_escape($value); } } else if ( 'db' == $context ) { if ( $prefixed ) { $value = apply_filters("pre_$field", $value); $value = apply_filters("${field_no_prefix}_save_pre", $value); } else { $value = apply_filters("pre_post_$field", $value); $value = apply_filters("${field}_pre", $value); } } else { // Use display filters by default. if ( $prefixed ) $value = apply_filters($field, $value, $post_id, $context); else $value = apply_filters("post_$field", $value, $post_id, $context); } if ( 'attribute' == $context ) $value = attribute_escape($value); else if ( 'js' == $context ) $value = js_escape($value); return $value; } /** * Count number of posts of a post type and is user has permissions to view. * * This function provides an efficient method of finding the amount of post's * type a blog has. Another method is to count the amount of items in * get_posts(), but that method has a lot of overhead with doing so. Therefore, * when developing for 2.5+, use this function instead. * * The $perm parameter checks for 'readable' value and if the user can read * private posts, it will display that for the user that is signed in. * * @package WordPress * @subpackage Post * @since 2.5 * @link http://codex.wordpress.org/Template_Tags/wp_count_posts * * @param string $type Optional. Post type to retrieve count * @param string $perm Optional. 'readable' or empty. * @return object Number of posts for each status */ function wp_count_posts( $type = 'post', $perm = '' ) { global $wpdb; $user = wp_get_current_user(); $cache_key = $type; $query = "SELECT post_status, COUNT( * ) AS num_posts FROM {$wpdb->posts} WHERE post_type = %s"; if ( 'readable' == $perm && is_user_logged_in() ) { if ( !current_user_can("read_private_{$type}s") ) { $cache_key .= '_' . $perm . '_' . $user->ID; $query .= " AND (post_status != 'private' OR ( post_author = '$user->ID' AND post_status = 'private' ))"; } } $query .= ' GROUP BY post_status'; $count = wp_cache_get($cache_key, 'counts'); if ( false !== $count ) return $count; $count = $wpdb->get_results( $wpdb->prepare( $query, $type ), ARRAY_A ); $stats = array( ); foreach( (array) $count as $row_num => $row ) { $stats[$row['post_status']] = $row['num_posts']; } $stats = (object) $stats; wp_cache_set($cache_key, $stats, 'counts'); return $stats; } /** * wp_count_attachments() - Count number of attachments * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.5 * * @param string|array $post_mime_type Array or comma-separated list of MIME patterns * @return array Number of posts for each post_mime_type */ function wp_count_attachments( $mime_type = '' ) { global $wpdb; $and = wp_post_mime_type_where( $mime_type ); $count = $wpdb->get_results( "SELECT post_mime_type, COUNT( * ) AS num_posts FROM $wpdb->posts WHERE post_type = 'attachment' $and GROUP BY post_mime_type", ARRAY_A ); $stats = array( ); foreach( (array) $count as $row ) { $stats[$row['post_mime_type']] = $row['num_posts']; } return (object) $stats; } /** * wp_match_mime_type() - Check a MIME-Type against a list * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.5 * * @param string|array $wildcard_mime_types e.g. audio/mpeg or image (same as image/*) or flash (same as *flash*) * @param string|array $real_mime_types post_mime_type values * @return array array(wildcard=>array(real types)) */ function wp_match_mime_types($wildcard_mime_types, $real_mime_types) { $matches = array(); if ( is_string($wildcard_mime_types) ) $wildcard_mime_types = array_map('trim', explode(',', $wildcard_mime_types)); if ( is_string($real_mime_types) ) $real_mime_types = array_map('trim', explode(',', $real_mime_types)); $wild = '[-._a-z0-9]*'; foreach ( (array) $wildcard_mime_types as $type ) { $type = str_replace('*', $wild, $type); $patternses[1][$type] = "^$type$"; if ( false === strpos($type, '/') ) { $patternses[2][$type] = "^$type/"; $patternses[3][$type] = $type; } } asort($patternses); foreach ( $patternses as $patterns ) foreach ( $patterns as $type => $pattern ) foreach ( (array) $real_mime_types as $real ) if ( preg_match("#$pattern#", $real) && ( empty($matches[$type]) || false === array_search($real, $matches[$type]) ) ) $matches[$type][] = $real; return $matches; } /** * wp_get_post_mime_type_where() - Convert MIME types into SQL * * @package WordPress * @subpackage Post * @since 2.5 * * @param string|array $mime_types MIME types * @return string SQL AND clause */ function wp_post_mime_type_where($post_mime_types) { $where = ''; $wildcards = array('', '%', '%/%'); if ( is_string($post_mime_types) ) $post_mime_types = array_map('trim', explode(',', $post_mime_types)); foreach ( (array) $post_mime_types as $mime_type ) { $mime_type = preg_replace('/\s/', '', $mime_type); $slashpos = strpos($mime_type, '/'); if ( false !== $slashpos ) { $mime_group = preg_replace('/[^-*.a-zA-Z0-9]/', '', substr($mime_type, 0, $slashpos)); $mime_subgroup = preg_replace('/[^-*.a-zA-Z0-9]/', '', substr($mime_type, $slashpos + 1)); if ( empty($mime_subgroup) ) $mime_subgroup = '*'; else $mime_subgroup = str_replace('/', '', $mime_subgroup); $mime_pattern = "$mime_group/$mime_subgroup"; } else { $mime_pattern = preg_replace('/[^-*.a-zA-Z0-9]/', '', $mime_type); if ( false === strpos($mime_pattern, '*') ) $mime_pattern .= '/*'; } $mime_pattern = preg_replace('/\*+/', '%', $mime_pattern); if ( in_array( $mime_type, $wildcards ) ) return ''; if ( false !== strpos($mime_pattern, '%') ) $wheres[] = "post_mime_type LIKE '$mime_pattern'"; else $wheres[] = "post_mime_type = '$mime_pattern'"; } if ( !empty($wheres) ) $where = ' AND (' . join(' OR ', $wheres) . ') '; return $where; } /** * wp_delete_post() - Deletes a Post * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.0.0 * * @param int $postid post ID * @return mixed {@internal Missing Description}} */ function wp_delete_post($postid = 0) { global $wpdb, $wp_rewrite; if ( !$post = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d", $postid)) ) return $post; if ( 'attachment' == $post->post_type ) return wp_delete_attachment($postid); do_action('delete_post', $postid); /** @todo delete for pluggable post taxonomies too */ wp_delete_object_term_relationships($postid, array('category', 'post_tag')); $parent_data = array( 'post_parent' => $post->post_parent ); $parent_where = array( 'post_parent' => $postid ); if ( 'page' == $post->post_type) { // if the page is defined in option page_on_front or post_for_posts, // adjust the corresponding options if ( get_option('page_on_front') == $postid ) { update_option('show_on_front', 'posts'); delete_option('page_on_front'); } if ( get_option('page_for_posts') == $postid ) { delete_option('page_for_posts'); } // Point children of this page to its parent, also clean the cache of affected children $children_query = $wpdb->prepare("SELECT * FROM $wpdb->posts WHERE post_parent = %d AND post_type='page'", $postid); $children = $wpdb->get_results($children_query); $wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => 'page' ) ); } // Do raw query. wp_get_post_revisions() is filtered $revision_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'revision'", $postid ) ); // Use wp_delete_post (via wp_delete_post_revision) again. Ensures any meta/misplaced data gets cleaned up. foreach ( $revision_ids as $revision_id ) wp_delete_post_revision( $revision_id ); // Point all attachments to this post up one level $wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => 'attachment' ) ); $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->posts WHERE ID = %d", $postid )); $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->comments WHERE comment_post_ID = %d", $postid )); $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d", $postid )); if ( 'page' == $post->post_type ) { clean_page_cache($postid); foreach ( (array) $children as $child ) clean_page_cache($child->ID); $wp_rewrite->flush_rules(); } else { clean_post_cache($postid); } do_action('deleted_post', $postid); return $post; } /** * wp_get_post_categories() - Retrieve the list of categories for a post * * Compatibility layer for themes and plugins. Also an easy layer of abstraction * away from the complexity of the taxonomy layer. * * @package WordPress * @subpackage Post * @since 2.1 * * @uses wp_get_object_terms() Retrieves the categories. Args details can be found here * * @param int $post_id Optional. The Post ID * @param array $args Optional. Overwrite the defaults * @return array {@internal Missing Description}} */ function wp_get_post_categories( $post_id = 0, $args = array() ) { $post_id = (int) $post_id; $defaults = array('fields' => 'ids'); $args = wp_parse_args( $args, $defaults ); $cats = wp_get_object_terms($post_id, 'category', $args); return $cats; } /** * wp_get_post_tags() - Retrieve the post tags * * @package WordPress * @subpackage Post * @since 2.3 * * @uses wp_get_object_terms() Gets the tags for returning. Args can be found here * * @param int $post_id Optional. The Post ID * @param array $args Optional. Overwrite the defaults * @return mixed The tags the post has currently */ function wp_get_post_tags( $post_id = 0, $args = array() ) { $post_id = (int) $post_id; $defaults = array('fields' => 'all'); $args = wp_parse_args( $args, $defaults ); $tags = wp_get_object_terms($post_id, 'post_tag', $args); return $tags; } /** * wp_get_recent_posts() - Get the $num most recent posts * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.0.0 * * @param int $num number of posts to get * @return array {@internal Missing Description}} */ function wp_get_recent_posts($num = 10) { global $wpdb; // Set the limit clause, if we got a limit $num = (int) $num; if ($num) { $limit = "LIMIT $num"; } $sql = "SELECT * FROM $wpdb->posts WHERE post_type = 'post' ORDER BY post_date DESC $limit"; $result = $wpdb->get_results($sql,ARRAY_A); return $result?$result:array(); } /** * wp_get_single_post() - Get one post * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.0.0 * @uses $wpdb * * @param int $postid post ID * @param string $mode How to return result, either OBJECT, ARRAY_N, or ARRAY_A * @return object|array Post object or array holding post contents and information */ function wp_get_single_post($postid = 0, $mode = OBJECT) { $postid = (int) $postid; $post = get_post($postid, $mode); // Set categories and tags if($mode == OBJECT) { $post->post_category = wp_get_post_categories($postid); $post->tags_input = wp_get_post_tags($postid, array('fields' => 'names')); } else { $post['post_category'] = wp_get_post_categories($postid); $post['tags_input'] = wp_get_post_tags($postid, array('fields' => 'names')); } return $post; } /** * wp_insert_post() - Insert a post * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.0.0 * * @uses $wpdb * @uses $wp_rewrite * @uses $user_ID * @uses $allowedtags * * @param array $postarr post contents * @return int post ID or 0 on error */ function wp_insert_post($postarr = array(), $wp_error = false) { global $wpdb, $wp_rewrite, $user_ID; $defaults = array('post_status' => 'draft', 'post_type' => 'post', 'post_author' => $user_ID, 'ping_status' => get_option('default_ping_status'), 'post_parent' => 0, 'menu_order' => 0, 'to_ping' => '', 'pinged' => '', 'post_password' => '', 'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => ''); $postarr = wp_parse_args($postarr, $defaults); $postarr = sanitize_post($postarr, 'db'); // export array as variables extract($postarr, EXTR_SKIP); // Are we updating or creating? $update = false; if ( !empty($ID) ) { $update = true; $previous_status = get_post_field('post_status', $ID); } else { $previous_status = 'new'; } if ( ('' == $post_content) && ('' == $post_title) && ('' == $post_excerpt) ) { if ( $wp_error ) return new WP_Error('empty_content', __('Content, title, and excerpt are empty.')); else return 0; } // Make sure we set a valid category if (0 == count($post_category) || !is_array($post_category)) { $post_category = array(get_option('default_category')); } if ( empty($post_author) ) $post_author = $user_ID; if ( empty($post_status) ) $post_status = 'draft'; if ( empty($post_type) ) $post_type = 'post'; // Get the post ID and GUID if ( $update ) { $post_ID = (int) $ID; $guid = get_post_field( 'guid', $post_ID ); } // Create a valid post name. Drafts are allowed to have an empty // post name. if ( empty($post_name) ) { if ( 'draft' != $post_status ) $post_name = sanitize_title($post_title); } else { $post_name = sanitize_title($post_name); } // If the post date is empty (due to having been new or a draft) and status is not 'draft', set date to now if ( empty($post_date) || '0000-00-00 00:00:00' == $post_date ) { if ( !in_array($post_status, array('draft', 'pending')) ) $post_date = current_time('mysql'); else $post_date = '0000-00-00 00:00:00'; } if ( empty($post_date_gmt) || '0000-00-00 00:00:00' == $post_date_gmt ) { if ( !in_array($post_status, array('draft', 'pending')) ) $post_date_gmt = get_gmt_from_date($post_date); else $post_date_gmt = '0000-00-00 00:00:00'; } if ( $update || '0000-00-00 00:00:00' == $post_date ) { $post_modified = current_time( 'mysql' ); $post_modified_gmt = current_time( 'mysql', 1 ); } else { $post_modified = $post_date; $post_modified_gmt = $post_date_gmt; } if ( 'publish' == $post_status ) { $now = gmdate('Y-m-d H:i:59'); if ( mysql2date('U', $post_date_gmt) > mysql2date('U', $now) ) $post_status = 'future'; } if ( empty($comment_status) ) { if ( $update ) $comment_status = 'closed'; else $comment_status = get_option('default_comment_status'); } if ( empty($ping_status) ) $ping_status = get_option('default_ping_status'); if ( isset($to_ping) ) $to_ping = preg_replace('|\s+|', "\n", $to_ping); else $to_ping = ''; if ( ! isset($pinged) ) $pinged = ''; if ( isset($post_parent) ) $post_parent = (int) $post_parent; else $post_parent = 0; if ( isset($menu_order) ) $menu_order = (int) $menu_order; else $menu_order = 0; if ( !isset($post_password) ) $post_password = ''; if ( 'draft' != $post_status ) { $post_name_check = $wpdb->get_var($wpdb->prepare("SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d AND post_parent = %d LIMIT 1", $post_name, $post_type, $post_ID, $post_parent)); if ($post_name_check || in_array($post_name, $wp_rewrite->feeds) ) { $suffix = 2; do { $alt_post_name = substr($post_name, 0, 200-(strlen($suffix)+1)). "-$suffix"; $post_name_check = $wpdb->get_var($wpdb->prepare("SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d AND post_parent = %d LIMIT 1", $alt_post_name, $post_type, $post_ID, $post_parent)); $suffix++; } while ($post_name_check); $post_name = $alt_post_name; } } // expected_slashed (everything!) $data = compact( array( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_content_filtered', 'post_title', 'post_excerpt', 'post_status', 'post_type', 'comment_status', 'ping_status', 'post_password', 'post_name', 'to_ping', 'pinged', 'post_modified', 'post_modified_gmt', 'post_parent', 'menu_order', 'guid' ) ); $data = stripslashes_deep( $data ); $where = array( 'ID' => $post_ID ); if ($update) { do_action( 'pre_post_update', $post_ID ); if ( false === $wpdb->update( $wpdb->posts, $data, $where ) ) { if ( $wp_error ) return new WP_Error('db_update_error', __('Could not update post in the database'), $wpdb->last_error); else return 0; } } else { $data['post_mime_type'] = stripslashes( $post_mime_type ); // This isn't in the update if ( false === $wpdb->insert( $wpdb->posts, $data ) ) { if ( $wp_error ) return new WP_Error('db_insert_error', __('Could not insert post into the database'), $wpdb->last_error); else return 0; } $post_ID = (int) $wpdb->insert_id; // use the newly generated $post_ID $where = array( 'ID' => $post_ID ); } if ( empty($post_name) && 'draft' != $post_status ) { $post_name = sanitize_title($post_title, $post_ID); $wpdb->update( $wpdb->posts, compact( 'post_name' ), $where ); } wp_set_post_categories( $post_ID, $post_category ); wp_set_post_tags( $post_ID, $tags_input ); $current_guid = get_post_field( 'guid', $post_ID ); if ( 'page' == $post_type ) clean_page_cache($post_ID); else clean_post_cache($post_ID); // Set GUID if ( !$update && '' == $current_guid ) $wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post_ID ) ), $where ); $post = get_post($post_ID); if ( !empty($page_template) && 'page' == $post_type ) { $post->page_template = $page_template; $page_templates = get_page_templates(); if ( 'default' != $page_template && !in_array($page_template, $page_templates) ) { if ( $wp_error ) return new WP_Error('invalid_page_template', __('The page template is invalid.')); else return 0; } update_post_meta($post_ID, '_wp_page_template', $page_template); } wp_transition_post_status($post_status, $previous_status, $post); if ( $update) do_action('edit_post', $post_ID, $post); do_action('save_post', $post_ID, $post); do_action('wp_insert_post', $post_ID, $post); return $post_ID; } /** * wp_update_post() - Update a post * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.0.0 * @uses $wpdb * * @param array $postarr post data * @return int {@internal Missing Description}} */ function wp_update_post($postarr = array()) { if ( is_object($postarr) ) $postarr = get_object_vars($postarr); // First, get all of the original fields $post = wp_get_single_post($postarr['ID'], ARRAY_A); // Escape data pulled from DB. $post = add_magic_quotes($post); // Passed post category list overwrites existing category list if not empty. if ( isset($postarr['post_category']) && is_array($postarr['post_category']) && 0 != count($postarr['post_category']) ) $post_cats = $postarr['post_category']; else $post_cats = $post['post_category']; // Drafts shouldn't be assigned a date unless explicitly done so by the user if ( in_array($post['post_status'], array('draft', 'pending')) && empty($postarr['edit_date']) && empty($postarr['post_date']) && ('0000-00-00 00:00:00' == $post['post_date']) ) $clear_date = true; else $clear_date = false; // Merge old and new fields with new fields overwriting old ones. $postarr = array_merge($post, $postarr); $postarr['post_category'] = $post_cats; if ( $clear_date ) { $postarr['post_date'] = ''; $postarr['post_date_gmt'] = ''; } if ($postarr['post_type'] == 'attachment') return wp_insert_attachment($postarr); return wp_insert_post($postarr); } /** * wp_publish_post() - Mark a post as "published" * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.1 * @uses $wpdb * * @param int $post_id Post ID * @return int|null {@internal Missing Description}} */ function wp_publish_post($post_id) { global $wpdb; $post = get_post($post_id); if ( empty($post) ) return; if ( 'publish' == $post->post_status ) return; $wpdb->update( $wpdb->posts, array( 'post_status' => 'publish' ), array( 'ID' => $post_id ) ); $old_status = $post->post_status; $post->post_status = 'publish'; wp_transition_post_status('publish', $old_status, $post); // Update counts for the post's terms. foreach ( get_object_taxonomies('post') as $taxonomy ) { $terms = wp_get_object_terms($post_id, $taxonomy, 'fields=tt_ids'); wp_update_term_count($terms, $taxonomy); } do_action('edit_post', $post_id, $post); do_action('save_post', $post_id, $post); do_action('wp_insert_post', $post_id, $post); } /** * check_and_publish_future_post() - check to make sure post has correct status before * passing it on to be published. Invoked by cron 'publish_future_post' event * This safeguard prevents cron from publishing drafts, etc. * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.5 * @uses $wpdb * * @param int $post_id Post ID * @return int|null {@internal Missing Description}} */ function check_and_publish_future_post($post_id) { $post = get_post($post_id); if ( empty($post) ) return; if ( 'future' != $post->post_status ) return; return wp_publish_post($post_id); } /** * wp_add_post_tags() - Adds the tags to a post * * @uses wp_set_post_tags() Same first two paraeters, but the last parameter is always set to true. * * @package WordPress * @subpackage Post * @since 2.3 * * @param int $post_id Optional. Post ID * @param string $tags The tags to set for the post * @return bool|null Will return false if $post_id is not an integer or is 0. Will return null otherwise */ function wp_add_post_tags($post_id = 0, $tags = '') { return wp_set_post_tags($post_id, $tags, true); } /** * wp_set_post_tags() - Set the tags for a post * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.3 * @uses $wpdb * * @param int $post_id post ID * @param string $tags The tags to set for the post * @param bool $append If true, don't delete existing tags, just add on. If false, replace the tags with the new tags. * @return bool|null Will return false if $post_id is not an integer or is 0. Will return null otherwise */ function wp_set_post_tags( $post_id = 0, $tags = '', $append = false ) { $post_id = (int) $post_id; if ( !$post_id ) return false; if ( empty($tags) ) $tags = array(); $tags = (is_array($tags)) ? $tags : explode( ',', trim($tags, " \n\t\r\0\x0B,") ); wp_set_object_terms($post_id, $tags, 'post_tag', $append); } /** * wp_set_post_categories() - Set categories for a post * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.1 * @uses $wpdb * * @param int $post_ID post ID * @param array $post_categories * @return bool|mixed {@internal Missing Description}} */ function wp_set_post_categories($post_ID = 0, $post_categories = array()) { $post_ID = (int) $post_ID; // If $post_categories isn't already an array, make it one: if (!is_array($post_categories) || 0 == count($post_categories) || empty($post_categories)) $post_categories = array(get_option('default_category')); else if ( 1 == count($post_categories) && '' == $post_categories[0] ) return true; $post_categories = array_map('intval', $post_categories); $post_categories = array_unique($post_categories); return wp_set_object_terms($post_ID, $post_categories, 'category'); } // wp_set_post_categories() /** * wp_transition_post_status() - Change the post transition status * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.3 * * @param string $new_status {@internal Missing Description}} * @param string $old_status {@internal Missing Description}} * @param int $post {@internal Missing Description}} */ function wp_transition_post_status($new_status, $old_status, $post) { if ( $new_status != $old_status ) { do_action('transition_post_status', $new_status, $old_status, $post); do_action("${old_status}_to_$new_status", $post); } do_action("${new_status}_$post->post_type", $post->ID, $post); } // // Trackback and ping functions // /** * add_ping() - Add a URL to those already pung * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.5 * @uses $wpdb * * @param int $post_id post ID * @param string $uri {@internal Missing Description}} * @return mixed {@internal Missing Description}} */ function add_ping($post_id, $uri) { global $wpdb; $pung = $wpdb->get_var( $wpdb->prepare( "SELECT pinged FROM $wpdb->posts WHERE ID = %d", $post_id )); $pung = trim($pung); $pung = preg_split('/\s/', $pung); $pung[] = $uri; $new = implode("\n", $pung); $new = apply_filters('add_ping', $new); // expected_slashed ($new) $new = stripslashes($new); return $wpdb->update( $wpdb->posts, array( 'pinged' => $new ), array( 'ID' => $post_id ) ); } /** * get_enclosed() - Get enclosures already enclosed for a post * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.5 * @uses $wpdb * * @param int $post_id post ID * @return array {@internal Missing Description}} */ function get_enclosed($post_id) { $custom_fields = get_post_custom( $post_id ); $pung = array(); if ( !is_array( $custom_fields ) ) return $pung; foreach ( $custom_fields as $key => $val ) { if ( 'enclosure' != $key || !is_array( $val ) ) continue; foreach( $val as $enc ) { $enclosure = split( "\n", $enc ); $pung[] = trim( $enclosure[ 0 ] ); } } $pung = apply_filters('get_enclosed', $pung); return $pung; } /** * get_pung() - Get URLs already pinged for a post * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.5 * @uses $wpdb * * @param int $post_id post ID * @return array {@internal Missing Description}} */ function get_pung($post_id) { global $wpdb; $pung = $wpdb->get_var( $wpdb->prepare( "SELECT pinged FROM $wpdb->posts WHERE ID = %d", $post_id )); $pung = trim($pung); $pung = preg_split('/\s/', $pung); $pung = apply_filters('get_pung', $pung); return $pung; } /** * get_to_ping() - Get any URLs in the todo list * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.5 * @uses $wpdb * * @param int $post_id post ID * @return array {@internal Missing Description}} */ function get_to_ping($post_id) { global $wpdb; $to_ping = $wpdb->get_var( $wpdb->prepare( "SELECT to_ping FROM $wpdb->posts WHERE ID = %d", $post_id )); $to_ping = trim($to_ping); $to_ping = preg_split('/\s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY); $to_ping = apply_filters('get_to_ping', $to_ping); return $to_ping; } /** * trackback_url_list() - Do trackbacks for a list of urls * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.0.0 * * @param string $tb_list comma separated list of URLs * @param int $post_id post ID */ function trackback_url_list($tb_list, $post_id) { if (!empty($tb_list)) { // get post data $postdata = wp_get_single_post($post_id, ARRAY_A); // import postdata as variables extract($postdata, EXTR_SKIP); // form an excerpt $excerpt = strip_tags($post_excerpt?$post_excerpt:$post_content); if (strlen($excerpt) > 255) { $excerpt = substr($excerpt,0,252) . '...'; } $trackback_urls = explode(',', $tb_list); foreach($trackback_urls as $tb_url) { $tb_url = trim($tb_url); trackback($tb_url, stripslashes($post_title), $excerpt, $post_id); } } } // // Page functions // /** * get_all_page_ids() - Get a list of page IDs * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.0 * @uses $wpdb * * @return array {@internal Missing Description}} */ function get_all_page_ids() { global $wpdb; if ( ! $page_ids = wp_cache_get('all_page_ids', 'posts') ) { $page_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type = 'page'"); wp_cache_add('all_page_ids', $page_ids, 'posts'); } return $page_ids; } /** * get_page() - Retrieves page data given a page ID or page object * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.5.1 * * @param mixed &$page page object or page ID * @param string $output what to output * @param string $filter How the return value should be filtered. * @return mixed {@internal Missing Description}} */ function &get_page(&$page, $output = OBJECT, $filter = 'raw') { if ( empty($page) ) { if ( isset( $GLOBALS['page'] ) && isset( $GLOBALS['page']->ID ) ) return get_post($GLOBALS['page'], $output, $filter); else return null; } return get_post($page, $output, $filter); } /** * get_page_by_path() - Retrieves a page given its path * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.1 * @uses $wpdb * * @param string $page_path page path * @param string $output output type * @return mixed {@internal Missing Description}} */ function get_page_by_path($page_path, $output = OBJECT) { global $wpdb; $page_path = rawurlencode(urldecode($page_path)); $page_path = str_replace('%2F', '/', $page_path); $page_path = str_replace('%20', ' ', $page_path); $page_paths = '/' . trim($page_path, '/'); $leaf_path = sanitize_title(basename($page_paths)); $page_paths = explode('/', $page_paths); foreach($page_paths as $pathdir) $full_path .= ($pathdir!=''?'/':'') . sanitize_title($pathdir); $pages = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_name = %s AND (post_type = 'page' OR post_type = 'attachment')", $leaf_path )); if ( empty($pages) ) return NULL; foreach ($pages as $page) { $path = '/' . $leaf_path; $curpage = $page; while ($curpage->post_parent != 0) { $curpage = $wpdb->get_row( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE ID = %d and post_type='page'", $curpage->post_parent )); $path = '/' . $curpage->post_name . $path; } if ( $path == $full_path ) return get_page($page->ID, $output); } return NULL; } /** * get_page_by_title() - Retrieve a page given its title * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.1 * @uses $wpdb * * @param string $page_title page title * @param string $output output type * @return mixed {@internal Missing Description}} */ function get_page_by_title($page_title, $output = OBJECT) { global $wpdb; $page = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type='page'", $page_title )); if ( $page ) return get_page($page, $output); return NULL; } /** * get_page_children() - Retrieve child pages * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.5.1 * * @param int $page_id page ID * @param array $pages list of pages * @return array {@internal Missing Description}} */ function &get_page_children($page_id, $pages) { $page_list = array(); foreach ( $pages as $page ) { if ( $page->post_parent == $page_id ) { $page_list[] = $page; if ( $children = get_page_children($page->ID, $pages) ) $page_list = array_merge($page_list, $children); } } return $page_list; } /** * get_page_hierarchy() - {@internal Missing Short Description}} * * Fetches the pages returned as a FLAT list, but arranged in order of their hierarchy, * i.e., child parents immediately follow their parents. * * @package WordPress * @subpackage Post * @since 2.0 * * @param array $posts posts array * @param int $parent parent page ID * @return array {@internal Missing Description}} */ function get_page_hierarchy($posts, $parent = 0) { $result = array ( ); if ($posts) { foreach ($posts as $post) { if ($post->post_parent == $parent) { $result[$post->ID] = $post->post_name; $children = get_page_hierarchy($posts, $post->ID); $result += $children; //append $children to $result } } } return $result; } /** * get_page_uri() - Builds a page URI * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.5 * * @param int $page_id page ID * @return string {@internal Missing Description}} */ function get_page_uri($page_id) { $page = get_page($page_id); $uri = $page->post_name; // A page cannot be it's own parent. if ( $page->post_parent == $page->ID ) return $uri; while ($page->post_parent != 0) { $page = get_page($page->post_parent); $uri = $page->post_name . "/" . $uri; } return $uri; } /** * get_pages() - Retrieve a list of pages * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.5 * @uses $wpdb * * @param mixed $args Optional. Array or string of options * @return array List of pages matching defaults or $args */ function &get_pages($args = '') { global $wpdb; $defaults = array( 'child_of' => 0, 'sort_order' => 'ASC', 'sort_column' => 'post_title', 'hierarchical' => 1, 'exclude' => '', 'include' => '', 'meta_key' => '', 'meta_value' => '', 'authors' => '' ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); $key = md5( serialize( $r ) ); if ( $cache = wp_cache_get( 'get_pages', 'posts' ) ) if ( isset( $cache[ $key ] ) ) return apply_filters('get_pages', $cache[ $key ], $r ); $inclusions = ''; if ( !empty($include) ) { $child_of = 0; //ignore child_of, exclude, meta_key, and meta_value params if using include $exclude = ''; $meta_key = ''; $meta_value = ''; $hierarchical = false; $incpages = preg_split('/[\s,]+/',$include); if ( count($incpages) ) { foreach ( $incpages as $incpage ) { if (empty($inclusions)) $inclusions = $wpdb->prepare(' AND ( ID = %d ', $incpage); else $inclusions .= $wpdb->prepare(' OR ID = %d ', $incpage); } } } if (!empty($inclusions)) $inclusions .= ')'; $exclusions = ''; if ( !empty($exclude) ) { $expages = preg_split('/[\s,]+/',$exclude); if ( count($expages) ) { foreach ( $expages as $expage ) { if (empty($exclusions)) $exclusions = $wpdb->prepare(' AND ( ID <> %d ', $expage); else $exclusions .= $wpdb->prepare(' AND ID <> %d ', $expage); } } } if (!empty($exclusions)) $exclusions .= ')'; $author_query = ''; if (!empty($authors)) { $post_authors = preg_split('/[\s,]+/',$authors); if ( count($post_authors) ) { foreach ( $post_authors as $post_author ) { //Do we have an author id or an author login? if ( 0 == intval($post_author) ) { $post_author = get_userdatabylogin($post_author); if ( empty($post_author) ) continue; if ( empty($post_author->ID) ) continue; $post_author = $post_author->ID; } if ( '' == $author_query ) $author_query = $wpdb->prepare(' post_author = %d ', $post_author); else $author_query .= $wpdb->prepare(' OR post_author = %d ', $post_author); } if ( '' != $author_query ) $author_query = " AND ($author_query)"; } } $join = ''; $where = "$exclusions $inclusions "; if ( ! empty( $meta_key ) || ! empty( $meta_value ) ) { $join = " LEFT JOIN $wpdb->postmeta ON ( $wpdb->posts.ID = $wpdb->postmeta.post_id )"; // meta_key and met_value might be slashed $meta_key = stripslashes($meta_key); $meta_value = stripslashes($meta_value); if ( ! empty( $meta_key ) ) $where .= $wpdb->prepare(" AND $wpdb->postmeta.meta_key = %s", $meta_key); if ( ! empty( $meta_value ) ) $where .= $wpdb->prepare(" AND $wpdb->postmeta.meta_value = %s", $meta_value); } $query = "SELECT * FROM $wpdb->posts $join WHERE (post_type = 'page' AND post_status = 'publish') $where "; $query .= $author_query; $query .= " ORDER BY " . $sort_column . " " . $sort_order ; $pages = $wpdb->get_results($query); if ( empty($pages) ) return apply_filters('get_pages', array(), $r); // Update cache. update_page_cache($pages); if ( $child_of || $hierarchical ) $pages = & get_page_children($child_of, $pages); $cache[ $key ] = $pages; wp_cache_set( 'get_pages', $cache, 'posts' ); $pages = apply_filters('get_pages', $pages, $r); return $pages; } // // Attachment functions // /** * is_local_attachment() - Check if the attachment URI is local one and is really an attachment. * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.0 * * @param string $url URL to check * @return bool {@internal Missing Description}} */ function is_local_attachment($url) { if (strpos($url, get_bloginfo('url')) === false) return false; if (strpos($url, get_bloginfo('url') . '/?attachment_id=') !== false) return true; if ( $id = url_to_postid($url) ) { $post = & get_post($id); if ( 'attachment' == $post->post_type ) return true; } return false; } /** * wp_insert_attachment() - Insert an attachment * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.0 * * @uses $wpdb * @uses $user_ID * * @param object $object attachment object * @param string $file filename * @param int $post_parent parent post ID * @return int {@internal Missing Description}} */ function wp_insert_attachment($object, $file = false, $parent = 0) { global $wpdb, $user_ID; $defaults = array('post_status' => 'draft', 'post_type' => 'post', 'post_author' => $user_ID, 'ping_status' => get_option('default_ping_status'), 'post_parent' => 0, 'menu_order' => 0, 'to_ping' => '', 'pinged' => '', 'post_password' => '', 'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => ''); $object = wp_parse_args($object, $defaults); if ( !empty($parent) ) $object['post_parent'] = $parent; $object = sanitize_post($object, 'db'); // export array as variables extract($object, EXTR_SKIP); // Make sure we set a valid category if (0 == count($post_category) || !is_array($post_category)) { $post_category = array(get_option('default_category')); } if ( empty($post_author) ) $post_author = $user_ID; $post_type = 'attachment'; $post_status = 'inherit'; // Are we updating or creating? $update = false; if ( !empty($ID) ) { $update = true; $post_ID = (int) $ID; } // Create a valid post name. if ( empty($post_name) ) $post_name = sanitize_title($post_title); else $post_name = sanitize_title($post_name); // expected_slashed ($post_name) $post_name_check = $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM $wpdb->posts WHERE post_name = '$post_name' AND post_status = 'inherit' AND ID != %d LIMIT 1", $post_ID)); if ($post_name_check) { $suffix = 2; while ($post_name_check) { $alt_post_name = $post_name . "-$suffix"; // expected_slashed ($alt_post_name, $post_name) $post_name_check = $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM $wpdb->posts WHERE post_name = '$alt_post_name' AND post_status = 'inherit' AND ID != %d AND post_parent = %d LIMIT 1", $post_ID, $post_parent)); $suffix++; } $post_name = $alt_post_name; } if ( empty($post_date) ) $post_date = current_time('mysql'); if ( empty($post_date_gmt) ) $post_date_gmt = current_time('mysql', 1); if ( empty($post_modified) ) $post_modified = $post_date; if ( empty($post_modified_gmt) ) $post_modified_gmt = $post_date_gmt; if ( empty($comment_status) ) { if ( $update ) $comment_status = 'closed'; else $comment_status = get_option('default_comment_status'); } if ( empty($ping_status) ) $ping_status = get_option('default_ping_status'); if ( isset($to_ping) ) $to_ping = preg_replace('|\s+|', "\n", $to_ping); else $to_ping = ''; if ( isset($post_parent) ) $post_parent = (int) $post_parent; else $post_parent = 0; if ( isset($menu_order) ) $menu_order = (int) $menu_order; else $menu_order = 0; if ( !isset($post_password) ) $post_password = ''; if ( ! isset($pinged) ) $pinged = ''; // expected_slashed (everything!) $data = compact( array( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_content_filtered', 'post_title', 'post_excerpt', 'post_status', 'post_type', 'comment_status', 'ping_status', 'post_password', 'post_name', 'to_ping', 'pinged', 'post_modified', 'post_modified_gmt', 'post_parent', 'menu_order', 'post_mime_type', 'guid' ) ); $data = stripslashes_deep( $data ); if ( $update ) { $wpdb->update( $wpdb->posts, $data, array( 'ID' => $post_ID ) ); } else { $wpdb->insert( $wpdb->posts, $data ); $post_ID = (int) $wpdb->insert_id; } if ( empty($post_name) ) { $post_name = sanitize_title($post_title, $post_ID); $wpdb->update( $wpdb->posts, compact("post_name"), array( 'ID' => $post_ID ) ); } wp_set_post_categories($post_ID, $post_category); if ( $file ) update_attached_file( $post_ID, $file ); clean_post_cache($post_ID); if ( $update) { do_action('edit_attachment', $post_ID); } else { do_action('add_attachment', $post_ID); } return $post_ID; } /** * wp_delete_attachment() - Delete an attachment * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.0 * @uses $wpdb * * @param int $postid attachment Id * @return mixed {@internal Missing Description}} */ function wp_delete_attachment($postid) { global $wpdb; if ( !$post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d", $postid)) ) return $post; if ( 'attachment' != $post->post_type ) return false; $meta = wp_get_attachment_metadata( $postid ); $file = get_attached_file( $postid ); /** @todo Delete for pluggable post taxonomies too */ wp_delete_object_term_relationships($postid, array('category', 'post_tag')); $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->posts WHERE ID = %d", $postid )); $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->comments WHERE comment_post_ID = %d", $postid )); $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d ", $postid )); if ( ! empty($meta['thumb']) ) { // Don't delete the thumb if another attachment uses it if (! $wpdb->get_row( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attachment_metadata' AND meta_value LIKE %s AND post_id <> %d", '%'.$meta['thumb'].'%', $postid)) ) { $thumbfile = str_replace(basename($file), $meta['thumb'], $file); $thumbfile = apply_filters('wp_delete_file', $thumbfile); @ unlink($thumbfile); } } // remove intermediate images if there are any $sizes = apply_filters('intermediate_image_sizes', array('thumbnail', 'medium')); foreach ( $sizes as $size ) { if ( $intermediate = image_get_intermediate_size($postid, $size) ) { $intermediate_file = apply_filters('wp_delete_file', $intermediate['path']); @ unlink($intermediate_file); } } $file = apply_filters('wp_delete_file', $file); if ( ! empty($file) ) @ unlink($file); clean_post_cache($postid); do_action('delete_attachment', $postid); return $post; } /** * wp_get_attachment_metadata() - Retrieve metadata for an attachment * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.1 * * @param int $post_id attachment ID * @param bool $unfiltered Optional, default is false. If true, filters are not run * @return array {@internal Missing Description}} */ function wp_get_attachment_metadata( $post_id, $unfiltered = false ) { $post_id = (int) $post_id; if ( !$post =& get_post( $post_id ) ) return false; $data = get_post_meta( $post->ID, '_wp_attachment_metadata', true ); if ( $unfiltered ) return $data; return apply_filters( 'wp_get_attachment_metadata', $data, $post->ID ); } /** * wp_update_attachment_metadata() - Update metadata for an attachment * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.1 * * @param int $post_id attachment ID * @param array $data attachment data * @return int {@internal Missing Description}} */ function wp_update_attachment_metadata( $post_id, $data ) { $post_id = (int) $post_id; if ( !$post =& get_post( $post_id ) ) return false; $data = apply_filters( 'wp_update_attachment_metadata', $data, $post->ID ); return update_post_meta( $post->ID, '_wp_attachment_metadata', $data); } /** * wp_get_attachment_url() - Retrieve the URL for an attachment * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.1 * * @param int $post_id attachment ID * @return string {@internal Missing Description}} */ function wp_get_attachment_url( $post_id = 0 ) { $post_id = (int) $post_id; if ( !$post =& get_post( $post_id ) ) return false; $url = get_the_guid( $post->ID ); if ( 'attachment' != $post->post_type || !$url ) return false; return apply_filters( 'wp_get_attachment_url', $url, $post->ID ); } /** * wp_get_attachment_thumb_file() - Retrieve thumbnail for an attachment * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.1 * * @param int $post_id attachment ID * @return mixed {@internal Missing Description}} */ function wp_get_attachment_thumb_file( $post_id = 0 ) { $post_id = (int) $post_id; if ( !$post =& get_post( $post_id ) ) return false; if ( !is_array( $imagedata = wp_get_attachment_metadata( $post->ID ) ) ) return false; $file = get_attached_file( $post->ID ); if ( !empty($imagedata['thumb']) && ($thumbfile = str_replace(basename($file), $imagedata['thumb'], $file)) && file_exists($thumbfile) ) return apply_filters( 'wp_get_attachment_thumb_file', $thumbfile, $post->ID ); return false; } /** * wp_get_attachment_thumb_url() - Retrieve URL for an attachment thumbnail * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.1 * * @param int $post_id attachment ID * @return string {@internal Missing Description}} */ function wp_get_attachment_thumb_url( $post_id = 0 ) { $post_id = (int) $post_id; if ( !$post =& get_post( $post_id ) ) return false; if ( !$url = wp_get_attachment_url( $post->ID ) ) return false; $sized = image_downsize( $post_id, 'thumbnail' ); if ( $sized ) return $sized[0]; if ( !$thumb = wp_get_attachment_thumb_file( $post->ID ) ) return false; $url = str_replace(basename($url), basename($thumb), $url); return apply_filters( 'wp_get_attachment_thumb_url', $url, $post->ID ); } /** * wp_attachment_is_image() - Check if the attachment is an image * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.1 * * @param int $post_id attachment ID * @return bool {@internal Missing Description}} */ function wp_attachment_is_image( $post_id = 0 ) { $post_id = (int) $post_id; if ( !$post =& get_post( $post_id ) ) return false; if ( !$file = get_attached_file( $post->ID ) ) return false; $ext = preg_match('/\.([^.]+)$/', $file, $matches) ? strtolower($matches[1]) : false; $image_exts = array('jpg', 'jpeg', 'gif', 'png'); if ( 'image/' == substr($post->post_mime_type, 0, 6) || $ext && 'import' == $post->post_mime_type && in_array($ext, $image_exts) ) return true; return false; } /** * wp_mime_type_icon() - Retrieve the icon for a MIME type * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.1 * * @param string $mime MIME type * @return string|bool {@internal Missing Description}} */ function wp_mime_type_icon( $mime = 0 ) { if ( !is_numeric($mime) ) $icon = wp_cache_get("mime_type_icon_$mime"); if ( empty($icon) ) { $post_id = 0; $post_mimes = array(); if ( is_numeric($mime) ) { $mime = (int) $mime; if ( $post =& get_post( $mime ) ) { $post_id = (int) $post->ID; $ext = preg_replace('/^.+?\.([^.]+)$/', '$1', $post->guid); if ( !empty($ext) ) { $post_mimes[] = $ext; if ( $ext_type = wp_ext2type( $ext ) ) $post_mimes[] = $ext_type; } $mime = $post->post_mime_type; } else { $mime = 0; } } else { $post_mimes[] = $mime; } $icon_files = wp_cache_get('icon_files'); if ( !is_array($icon_files) ) { $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/crystal' ); $icon_dir_uri = apply_filters( 'icon_dir_uri', includes_url('images/crystal') ); $dirs = apply_filters( 'icon_dirs', array($icon_dir => $icon_dir_uri) ); $icon_files = array(); while ( $dirs ) { $dir = array_shift($keys = array_keys($dirs)); $uri = array_shift($dirs); if ( $dh = opendir($dir) ) { while ( false !== $file = readdir($dh) ) { $file = basename($file); if ( substr($file, 0, 1) == '.' ) continue; if ( !in_array(strtolower(substr($file, -4)), array('.png', '.gif', '.jpg') ) ) { if ( is_dir("$dir/$file") ) $dirs["$dir/$file"] = "$uri/$file"; continue; } $icon_files["$dir/$file"] = "$uri/$file"; } closedir($dh); } } wp_cache_set('icon_files', $icon_files, 600); } // Icon basename - extension = MIME wildcard foreach ( $icon_files as $file => $uri ) $types[ preg_replace('/^([^.]*).*$/', '$1', basename($file)) ] =& $icon_files[$file]; if ( ! empty($mime) ) { $post_mimes[] = substr($mime, 0, strpos($mime, '/')); $post_mimes[] = substr($mime, strpos($mime, '/') + 1); $post_mimes[] = str_replace('/', '_', $mime); } $matches = wp_match_mime_types(array_keys($types), $post_mimes); $matches['default'] = array('default'); foreach ( $matches as $match => $wilds ) { if ( isset($types[$wilds[0]])) { $icon = $types[$wilds[0]]; if ( !is_numeric($mime) ) wp_cache_set("mime_type_icon_$mime", $icon); break; } } } return apply_filters( 'wp_mime_type_icon', $icon, $mime, $post_id ); // Last arg is 0 if function pass mime type. } /** * wp_check_for_changed_slugs() - {@internal Missing Short Description}} * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.1 * * @param int $post_id The Post ID * @return int Same as $post_id */ function wp_check_for_changed_slugs($post_id) { if ( !isset($_POST['wp-old-slug']) || !strlen($_POST['wp-old-slug']) ) return $post_id; $post = &get_post($post_id); // we're only concerned with published posts if ( $post->post_status != 'publish' || $post->post_type != 'post' ) return $post_id; // only bother if the slug has changed if ( $post->post_name == $_POST['wp-old-slug'] ) return $post_id; $old_slugs = (array) get_post_meta($post_id, '_wp_old_slug'); // if we haven't added this old slug before, add it now if ( !count($old_slugs) || !in_array($_POST['wp-old-slug'], $old_slugs) ) add_post_meta($post_id, '_wp_old_slug', $_POST['wp-old-slug']); // if the new slug was used previously, delete it from the list if ( in_array($post->post_name, $old_slugs) ) delete_post_meta($post_id, '_wp_old_slug', $post->post_name); return $post_id; } /** * get_private_posts_cap_sql() - {@internal Missing Short Description}} * * This function provides a standardized way to appropriately select on * the post_status of posts/pages. The function will return a piece of * SQL code that can be added to a WHERE clause; this SQL is constructed * to allow all published posts, and all private posts to which the user * has access. * * @package WordPress * @subpackage Post * @since 2.2 * * @uses $user_ID * @uses apply_filters() Call 'pub_priv_sql_capability' filter for plugins with different post types * * @param string $post_type currently only supports 'post' or 'page'. * @return string SQL code that can be added to a where clause. */ function get_private_posts_cap_sql($post_type) { global $user_ID; $cap = ''; // Private posts if ($post_type == 'post') { $cap = 'read_private_posts'; // Private pages } elseif ($post_type == 'page') { $cap = 'read_private_pages'; // Dunno what it is, maybe plugins have their own post type? } else { $cap = apply_filters('pub_priv_sql_capability', $cap); if (empty($cap)) { // We don't know what it is, filters don't change anything, // so set the SQL up to return nothing. return '1 = 0'; } } $sql = '(post_status = \'publish\''; if (current_user_can($cap)) { // Does the user have the capability to view private posts? Guess so. $sql .= ' OR post_status = \'private\''; } elseif (is_user_logged_in()) { // Users can view their own private posts. $sql .= ' OR post_status = \'private\' AND post_author = \'' . $user_ID . '\''; } $sql .= ')'; return $sql; } /** * get_lastpostdate() - {@internal Missing Short Description}} * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 0.71 * * @uses $wpdb * @uses $blog_id * @uses apply_filters() Calls 'get_lastpostdate' filter * * @global mixed $cache_lastpostdate Stores the last post date * @global mixed $pagenow The current page being viewed * * @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'. * @return string The date of the last post. */ function get_lastpostdate($timezone = 'server') { global $cache_lastpostdate, $wpdb, $blog_id; $add_seconds_server = date('Z'); if ( !isset($cache_lastpostdate[$blog_id][$timezone]) ) { switch(strtolower($timezone)) { case 'gmt': $lastpostdate = $wpdb->get_var("SELECT post_date_gmt FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY post_date_gmt DESC LIMIT 1"); break; case 'blog': $lastpostdate = $wpdb->get_var("SELECT post_date FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY post_date_gmt DESC LIMIT 1"); break; case 'server': $lastpostdate = $wpdb->get_var("SELECT DATE_ADD(post_date_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY post_date_gmt DESC LIMIT 1"); break; } $cache_lastpostdate[$blog_id][$timezone] = $lastpostdate; } else { $lastpostdate = $cache_lastpostdate[$blog_id][$timezone]; } return apply_filters( 'get_lastpostdate', $lastpostdate, $timezone ); } /** * get_lastpostmodified() - {@internal Missing Short Description}} * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 1.2 * * @uses $wpdb * @uses $blog_id * @uses apply_filters() Calls 'get_lastpostmodified' filter * * @global mixed $cache_lastpostmodified Stores the date the last post was modified * @global mixed $pagenow The current page being viewed * * @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'. * @return string The date the post was last modified. */ function get_lastpostmodified($timezone = 'server') { global $cache_lastpostmodified, $wpdb, $blog_id; $add_seconds_server = date('Z'); if ( !isset($cache_lastpostmodified[$blog_id][$timezone]) ) { switch(strtolower($timezone)) { case 'gmt': $lastpostmodified = $wpdb->get_var("SELECT post_modified_gmt FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY post_modified_gmt DESC LIMIT 1"); break; case 'blog': $lastpostmodified = $wpdb->get_var("SELECT post_modified FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY post_modified_gmt DESC LIMIT 1"); break; case 'server': $lastpostmodified = $wpdb->get_var("SELECT DATE_ADD(post_modified_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY post_modified_gmt DESC LIMIT 1"); break; } $lastpostdate = get_lastpostdate($timezone); if ( $lastpostdate > $lastpostmodified ) { $lastpostmodified = $lastpostdate; } $cache_lastpostmodified[$blog_id][$timezone] = $lastpostmodified; } else { $lastpostmodified = $cache_lastpostmodified[$blog_id][$timezone]; } return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone ); } /** * update_post_cache() - Updates posts in cache * * @usedby update_page_cache() update_page_cache() aliased by this function. * * @package WordPress * @subpackage Cache * @since 1.5.1 * * @param array $posts Array of post objects */ function update_post_cache(&$posts) { if ( !$posts ) return; foreach ( $posts as $post ) wp_cache_add($post->ID, $post, 'posts'); } /** * clean_post_cache() - Will clean the post in the cache * * Cleaning means delete from the cache of the post. Will call to clean * the term object cache associated with the post ID. * * @package WordPress * @subpackage Cache * @since 2.0 * * @uses do_action() Will call the 'clean_post_cache' hook action. * * @param int $id The Post ID in the cache to clean */ function clean_post_cache($id) { global $wpdb; $id = (int) $id; wp_cache_delete($id, 'posts'); wp_cache_delete($id, 'post_meta'); clean_object_term_cache($id, 'post'); wp_cache_delete( 'wp_get_archives', 'general' ); do_action('clean_post_cache', $id); if ( $children = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_parent = %d", $id) ) ) { foreach( $children as $cid ) clean_post_cache( $cid ); } } /** * update_page_cache() - Alias of update_post_cache() * * @see update_post_cache() Posts and pages are the same, alias is intentional * * @package WordPress * @subpackage Cache * @since 1.5.1 * * @param array $pages list of page objects */ function update_page_cache(&$pages) { update_post_cache($pages); } /** * clean_page_cache() - Will clean the page in the cache * * Clean (read: delete) page from cache that matches $id. Will also clean * cache associated with 'all_page_ids' and 'get_pages'. * * @package WordPress * @subpackage Cache * @since 2.0 * * @uses do_action() Will call the 'clean_page_cache' hook action. * * @param int $id Page ID to clean */ function clean_page_cache($id) { clean_post_cache($id); wp_cache_delete( 'all_page_ids', 'posts' ); wp_cache_delete( 'get_pages', 'posts' ); do_action('clean_page_cache', $id); } /** * update_post_caches() - Call major cache updating functions for list of Post objects. * * @package WordPress * @subpackage Cache * @since 1.5 * * @uses $wpdb * @uses update_post_cache() * @uses update_object_term_cache() * @uses update_postmeta_cache() * * @param array $posts Array of Post objects */ function update_post_caches(&$posts) { // No point in doing all this work if we didn't match any posts. if ( !$posts ) return; update_post_cache($posts); $post_ids = array(); for ($i = 0; $i < count($posts); $i++) $post_ids[] = $posts[$i]->ID; update_object_term_cache($post_ids, 'post'); update_postmeta_cache($post_ids); } /** * update_postmeta_cache() - {@internal Missing Short Description}} * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Cache * @since 2.1 * * @uses $wpdb * * @param array $post_ids {@internal Missing Description}} * @return bool|array Returns false if there is nothing to update or an array of metadata */ function update_postmeta_cache($post_ids) { global $wpdb; if ( empty( $post_ids ) ) return false; if ( !is_array($post_ids) ) { $post_ids = preg_replace('|[^0-9,]|', '', $post_ids); $post_ids = explode(',', $post_ids); } $post_ids = array_map('intval', $post_ids); $ids = array(); foreach ( (array) $post_ids as $id ) { if ( false === wp_cache_get($id, 'post_meta') ) $ids[] = $id; } if ( empty( $ids ) ) return false; // Get post-meta info $id_list = join(',', $ids); $cache = array(); if ( $meta_list = $wpdb->get_results("SELECT post_id, meta_key, meta_value FROM $wpdb->postmeta WHERE post_id IN ($id_list) ORDER BY post_id, meta_key", ARRAY_A) ) { foreach ( (array) $meta_list as $metarow) { $mpid = (int) $metarow['post_id']; $mkey = $metarow['meta_key']; $mval = $metarow['meta_value']; // Force subkeys to be array type: if ( !isset($cache[$mpid]) || !is_array($cache[$mpid]) ) $cache[$mpid] = array(); if ( !isset($cache[$mpid][$mkey]) || !is_array($cache[$mpid][$mkey]) ) $cache[$mpid][$mkey] = array(); // Add a value to the current pid/key: $cache[$mpid][$mkey][] = $mval; } } foreach ( (array) $ids as $id ) { if ( ! isset($cache[$id]) ) $cache[$id] = array(); } foreach ( array_keys($cache) as $post) wp_cache_set($post, $cache[$post], 'post_meta'); return $cache; } // // Hooks // /** * _transition_post_status() - Hook {@internal Missing Short Description}} * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.3 * * @uses $wpdb * * @param string $new_status {@internal Missing Description}} * @param string $old_status {@internal Missing Description}} * @param object $post Object type containing the post information */ function _transition_post_status($new_status, $old_status, $post) { global $wpdb; if ( $old_status != 'publish' && $new_status == 'publish' ) { // Reset GUID if transitioning to publish and it is empty if ( '' == get_the_guid($post->ID) ) $wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post->ID ) ), array( 'ID' => $post->ID ) ); do_action('private_to_published', $post->ID); // Deprecated, use private_to_publish } // Always clears the hook in case the post status bounced from future to draft. wp_clear_scheduled_hook('publish_future_post', $post->ID); } /** * _future_post_hook() - Hook used to schedule publication for a post marked for the future. * * The $post properties used and must exist are 'ID' and 'post_date_gmt'. * * @package WordPress * @subpackage Post * @since 2.3 * * @param int $post_id Not Used. Can be set to null. * @param object $post Object type containing the post information */ function _future_post_hook($deprecated = '', $post) { wp_clear_scheduled_hook( 'publish_future_post', $post->ID ); wp_schedule_single_event(strtotime($post->post_date_gmt. ' GMT'), 'publish_future_post', array($post->ID)); } /** * _publish_post_hook() - Hook {@internal Missing Short Description}} * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.3 * * @uses $wpdb * @uses XMLRPC_REQUEST * @uses APP_REQUEST * @uses do_action Calls 'xmlprc_publish_post' action if XMLRPC_REQUEST is defined. Calls 'app_publish_post' * action if APP_REQUEST is defined. * * @param int $post_id The ID in the database table of the post being published */ function _publish_post_hook($post_id) { global $wpdb; if ( defined('XMLRPC_REQUEST') ) do_action('xmlrpc_publish_post', $post_id); if ( defined('APP_REQUEST') ) do_action('app_publish_post', $post_id); if ( defined('WP_IMPORTING') ) return; $data = array( 'post_id' => $post_id, 'meta_value' => '1' ); if ( get_option('default_pingback_flag') ) $wpdb->insert( $wpdb->postmeta, $data + array( 'meta_key' => '_pingme' ) ); $wpdb->insert( $wpdb->postmeta, $data + array( 'meta_key' => '_encloseme' ) ); wp_schedule_single_event(time(), 'do_pings'); } /** * _save_post_hook() - Hook used to prevent page/post cache and rewrite rules from staying dirty * * Does two things. If the post is a page and has a template then it will update/add that * template to the meta. For both pages and posts, it will clean the post cache to make sure * that the cache updates to the changes done recently. For pages, the rewrite rules of * WordPress are flushed to allow for any changes. * * The $post parameter, only uses 'post_type' property and 'page_template' property. * * @package WordPress * @subpackage Post * @since 2.3 * * @uses $wp_rewrite Flushes Rewrite Rules. * * @param int $post_id The ID in the database table for the $post * @param object $post Object type containing the post information */ function _save_post_hook($post_id, $post) { if ( $post->post_type == 'page' ) { clean_page_cache($post_id); global $wp_rewrite; $wp_rewrite->flush_rules(); } else { clean_post_cache($post_id); } } // // Private // function _get_post_ancestors(&$_post) { global $wpdb; if ( isset($_post->ancestors) ) return; $_post->ancestors = array(); if ( empty($_post->post_parent) || $_post->ID == $_post->post_parent ) return; $id = $_post->ancestors[] = $_post->post_parent; while ( $ancestor = $wpdb->get_var( $wpdb->prepare("SELECT `post_parent` FROM $wpdb->posts WHERE ID = %d LIMIT 1", $id) ) ) { if ( $id == $ancestor ) break; $id = $_post->ancestors[] = $ancestor; } } /* Post Revisions */ /** * _wp_post_revision_fields() - determines which fields of posts are to be saved in revisions * * Does two things. If passed a post *array*, it will return a post array ready to be * insterted into the posts table as a post revision. * Otherwise, returns an array whose keys are the post fields to be saved for post revisions. * * @package WordPress * @subpackage Post Revisions * @since 2.6 * * @param array $post optional a post array to be processed for insertion as a post revision * @param bool $autosave optional Is the revision an autosave? * @return array post array ready to be inserted as a post revision or array of fields that can be versioned */ function _wp_post_revision_fields( $post = null, $autosave = false ) { static $fields = false; if ( !$fields ) { // Allow these to be versioned $fields = array( 'post_title' => __( 'Title' ), 'post_content' => __( 'Content' ), 'post_excerpt' => __( 'Excerpt' ), ); // Runs only once $fields = apply_filters( '_wp_post_revision_fields', $fields ); // WP uses these internally either in versioning or elsewhere - they cannot be versioned foreach ( array( 'ID', 'post_name', 'post_parent', 'post_date', 'post_date_gmt', 'post_status', 'post_type', 'comment_count', 'post_author' ) as $protect ) unset( $fields[$protect] ); } if ( !is_array($post) ) return $fields; $return = array(); foreach ( array_intersect( array_keys( $post ), array_keys( $fields ) ) as $field ) $return[$field] = $post[$field]; $return['post_parent'] = $post['ID']; $return['post_status'] = 'inherit'; $return['post_type'] = 'revision'; $return['post_name'] = $autosave ? "$post[ID]-autosave" : "$post[ID]-revision"; $return['post_date'] = $post['post_modified']; $return['post_date_gmt'] = $post['post_modified_gmt']; return $return; } /** * wp_save_post_revision() - Saves an already existing post as a post revision. Typically used immediately prior to post updates. * * @package WordPress * @subpackage Post Revisions * @since 2.6 * * @uses _wp_put_post_revision() * * @param int $post_id The ID of the post to save as a revision * @return mixed null or 0 if error, new revision ID if success */ function wp_save_post_revision( $post_id ) { // We do autosaves manually with wp_create_post_autosave() if ( @constant( 'DOING_AUTOSAVE' ) ) return; // WP_POST_REVISIONS = 0, false if ( !constant('WP_POST_REVISIONS') ) return; if ( !$post = get_post( $post_id, ARRAY_A ) ) return; if ( !in_array( $post['post_type'], array( 'post', 'page' ) ) ) return; $return = _wp_put_post_revision( $post ); // WP_POST_REVISIONS = true (default), -1 if ( !is_numeric( WP_POST_REVISIONS ) || WP_POST_REVISIONS < 0 ) return $return; // all revisions and (possibly) one autosave $revisions = wp_get_post_revisions( $post_id, array( 'order' => 'ASC' ) ); // WP_POST_REVISIONS = (int) (# of autasaves to save) $delete = count($revisions) - WP_POST_REVISIONS; if ( $delete < 1 ) return $return; $revisions = array_slice( $revisions, 0, $delete ); for ( $i = 0; isset($revisions[$i]); $i++ ) { if ( false !== strpos( $revisions[$i]->post_name, 'autosave' ) ) continue; wp_delete_post_revision( $revisions[$i]->ID ); } return $return; } /** * wp_get_post_autosave() - returns the autosaved data of the specified post. * * Returns a post object containing the information that was autosaved for the specified post. * * @package WordPress * @subpackage Post Revisions * @since 2.6 * * @param int $post_id The post ID * @return object|bool the autosaved data or false on failure or when no autosave exists */ function wp_get_post_autosave( $post_id ) { global $wpdb; if ( !$post = get_post( $post_id ) ) return false; $q = array( 'name' => "{$post->ID}-autosave", 'post_parent' => $post->ID, 'post_type' => 'revision', 'post_status' => 'inherit' ); // Use WP_Query so that the result gets cached $autosave_query = new WP_Query; add_action( 'parse_query', '_wp_get_post_autosave_hack' ); $autosave = $autosave_query->query( $q ); remove_action( 'parse_query', '_wp_get_post_autosave_hack' ); if ( $autosave && is_array($autosave) && is_object($autosave[0]) ) return $autosave[0]; return false; } // Internally used to hack WP_Query into submission function _wp_get_post_autosave_hack( $query ) { $query->is_single = false; } /** * wp_is_post_revision() - Determines if the specified post is a revision. * * @package WordPress * @subpackage Post Revisions * @since 2.6 * * @param int|object $post post ID or post object * @return bool|int false if not a revision, ID of revision's parent otherwise */ function wp_is_post_revision( $post ) { if ( !$post = wp_get_post_revision( $post ) ) return false; return (int) $post->post_parent; } /** * wp_is_post_autosave() - Determines if the specified post is an autosave. * * @package WordPress * @subpackage Post Revisions * @since 2.6 * * @param int|object $post post ID or post object * @return bool|int false if not a revision, ID of autosave's parent otherwise */ function wp_is_post_autosave( $post ) { if ( !$post = wp_get_post_revision( $post ) ) return false; if ( "{$post->post_parent}-autosave" !== $post->post_name ) return false; return (int) $post->post_parent; } /** * _wp_put_post_revision() - Inserts post data into the posts table as a post revision * * @package WordPress * @subpackage Post Revisions * @since 2.6 * * @uses wp_insert_post() * * @param int|object|array $post post ID, post object OR post array * @param bool $autosave optional Is the revision an autosave? * @return mixed null or 0 if error, new revision ID if success */ function _wp_put_post_revision( $post = null, $autosave = false ) { if ( is_object($post) ) $post = get_object_vars( $post ); elseif ( !is_array($post) ) $post = get_post($post, ARRAY_A); if ( !$post || empty($post['ID']) ) return; if ( isset($post['post_type']) && 'revision' == $post_post['type'] ) return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) ); $post = _wp_post_revision_fields( $post, $autosave ); $revision_id = wp_insert_post( $post ); if ( is_wp_error($revision_id) ) return $revision_id; if ( $revision_id ) do_action( '_wp_put_post_revision', $revision_id ); return $revision_id; } /** * wp_get_post_revision() - Gets a post revision * * @package WordPress * @subpackage Post Revisions * @since 2.6 * * @uses get_post() * * @param int|object $post post ID or post object * @param $output optional OBJECT, ARRAY_A, or ARRAY_N * @param string $filter optional sanitation filter. @see sanitize_post() * @return mixed null if error or post object if success */ function &wp_get_post_revision(&$post, $output = OBJECT, $filter = 'raw') { $null = null; if ( !$revision = get_post( $post, OBJECT, $filter ) ) return $revision; if ( 'revision' !== $revision->post_type ) return $null; if ( $output == OBJECT ) { return $revision; } elseif ( $output == ARRAY_A ) { $_revision = get_object_vars($revision); return $_revision; } elseif ( $output == ARRAY_N ) { $_revision = array_values(get_object_vars($revision)); return $_revision; } return $revision; } /** * wp_restore_post_revision() - Restores a post to the specified revision * * Can restore a past using all fields of the post revision, or only selected fields. * * @package WordPress * @subpackage Post Revisions * @since 2.6 * * @uses wp_get_post_revision() * @uses wp_update_post() * * @param int|object $revision_id revision ID or revision object * @param array $fields optional What fields to restore from. Defaults to all. * @return mixed null if error, false if no fields to restore, (int) post ID if success */ function wp_restore_post_revision( $revision_id, $fields = null ) { if ( !$revision = wp_get_post_revision( $revision_id, ARRAY_A ) ) return $revision; if ( !is_array( $fields ) ) $fields = array_keys( _wp_post_revision_fields() ); $update = array(); foreach( array_intersect( array_keys( $revision ), $fields ) as $field ) $update[$field] = $revision[$field]; if ( !$update ) return false; $update['ID'] = $revision['post_parent']; $post_id = wp_update_post( $update ); if ( is_wp_error( $post_id ) ) return $post_id; if ( $post_id ) do_action( 'wp_restore_post_revision', $post_id, $revision['ID'] ); return $post_id; } /** * wp_delete_post_revision() - Deletes a revision. * * Deletes the row from the posts table corresponding to the specified revision * * @package WordPress * @subpackage Post Revisions * @since 2.6 * * @uses wp_get_post_revision() * @uses wp_delete_post() * * @param int|object $revision_id revision ID or revision object * @param array $fields optional What fields to restore from. Defaults to all. * @return mixed null if error, false if no fields to restore, (int) post ID if success */ function wp_delete_post_revision( $revision_id ) { if ( !$revision = wp_get_post_revision( $revision_id ) ) return $revision; $delete = wp_delete_post( $revision->ID ); if ( is_wp_error( $delete ) ) return $delete; if ( $delete ) do_action( 'wp_delete_post_revision', $revision->ID, $revision ); return $delete; } /** * wp_get_post_revisions() - Returns all revisions of specified post * * @package WordPress * @subpackage Post Revisions * @since 2.6 * * @uses get_children() * * @param int|object $post_id post ID or post object * @return array empty if no revisions */ function wp_get_post_revisions( $post_id = 0, $args = null ) { if ( !constant('WP_POST_REVISIONS') ) return array(); if ( ( !$post = get_post( $post_id ) ) || empty( $post->ID ) ) return array(); $defaults = array( 'order' => 'DESC', 'orderby' => 'date' ); $args = wp_parse_args( $args, $defaults ); $args = array_merge( $args, array( 'post_parent' => $post->ID, 'post_type' => 'revision', 'post_status' => 'inherit' ) ); if ( !$revisions = get_children( $args ) ) return array(); return $revisions; } wp/dev/wp-includes/class.wp-styles.php0000644000106600010660000000450111035172124015214 0ustar registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version; if ( isset($this->args[$handle]) ) $ver .= '&' . $this->args[$handle]; if ( isset($this->registered[$handle]->args) ) $media = attribute_escape( $this->registered[$handle]->args ); else $media = 'all'; $href = $this->_css_href( $this->registered[$handle]->src, $ver, $handle ); $end_cond = ''; if ( isset($this->registered[$handle]->extra['conditional']) && $this->registered[$handle]->extra['conditional'] ) { echo "\n"; } echo apply_filters( 'style_loader_tag', "\n", $handle ); if ( 'rtl' === $this->text_direction && isset($this->registered[$handle]->extra['rtl']) && $this->registered[$handle]->extra['rtl'] ) { if ( is_bool( $this->registered[$handle]->extra['rtl'] ) ) $rtl_href = str_replace( '.css', '-rtl.css', $href ); else $rtl_href = $this->_css_href( $this->registered[$handle]->extra['rtl'], $ver, "$handle-rtl" ); echo apply_filters( 'style_loader_tag', "\n", $handle ); } echo $end_cond; // Could do something with $this->registered[$handle]->extra here to print out extra CSS rules // echo "\n"; return true; } function all_deps( $handles, $recursion = false ) { $r = parent::all_deps( $handles, $recursion ); if ( !$recursion ) $this->to_do = apply_filters( 'print_styles_array', $this->to_do ); return $r; } function _css_href( $src, $ver, $handle ) { if ( !preg_match('|^https?://|', $src) && !preg_match('|^' . preg_quote(WP_CONTENT_URL) . '|', $src) ) { $src = $this->base_url . $src; } $src = add_query_arg('ver', $ver, $src); $src = apply_filters( 'style_loader_src', $src, $handle ); return clean_url( $src ); } } wp/dev/wp-includes/feed-atom-comments.php0000644000106600010660000000661010754633366015651 0ustar '; ?> > <?php if ( is_singular() ) printf(__('Comments on: %s'), get_the_title_rss()); elseif ( is_search() ) printf(__('Comments for %1$s searching on %2$s'), get_bloginfo_rss( 'name' ), attribute_escape(get_search_query())); else printf(__('Comments for %s'), get_bloginfo_rss( 'name' ) . get_wp_title_rss()); ?> comment_post_ID); get_post_custom($comment_post->ID); ?> <?php if ( !is_singular() ) { $title = get_the_title($comment_post->ID); $title = apply_filters('the_title_rss', $title); printf(__('Comment on %1$s by %2$s'), $title, get_comment_author_rss()); } else { printf(__('By: %s'), get_comment_author_rss()); } ?> ' . get_comment_author_url() . ''; ?> post_password) && $_COOKIE['wp-postpass'] != $comment_post->post_password) : ?> ]]> ]]> comment_ID, $comment_post->ID); ?> wp/dev/wp-includes/feed-atom.php0000644000106600010660000000457711003452672014023 0ustar '; ?> > <?php bloginfo_rss('name'); wp_title_rss(); ?> <![CDATA[<?php the_title_rss() ?>]]> ]]> ]]> wp/dev/wp-includes/locale.php0000644000106600010660000002247510741452722013422 0ustar weekday[0] = __('Sunday'); $this->weekday[1] = __('Monday'); $this->weekday[2] = __('Tuesday'); $this->weekday[3] = __('Wednesday'); $this->weekday[4] = __('Thursday'); $this->weekday[5] = __('Friday'); $this->weekday[6] = __('Saturday'); // The first letter of each day. The _%day%_initial suffix is a hack to make // sure the day initials are unique. $this->weekday_initial[__('Sunday')] = __('S_Sunday_initial'); $this->weekday_initial[__('Monday')] = __('M_Monday_initial'); $this->weekday_initial[__('Tuesday')] = __('T_Tuesday_initial'); $this->weekday_initial[__('Wednesday')] = __('W_Wednesday_initial'); $this->weekday_initial[__('Thursday')] = __('T_Thursday_initial'); $this->weekday_initial[__('Friday')] = __('F_Friday_initial'); $this->weekday_initial[__('Saturday')] = __('S_Saturday_initial'); foreach ($this->weekday_initial as $weekday_ => $weekday_initial_) { $this->weekday_initial[$weekday_] = preg_replace('/_.+_initial$/', '', $weekday_initial_); } // Abbreviations for each day. $this->weekday_abbrev[__('Sunday')] = __('Sun'); $this->weekday_abbrev[__('Monday')] = __('Mon'); $this->weekday_abbrev[__('Tuesday')] = __('Tue'); $this->weekday_abbrev[__('Wednesday')] = __('Wed'); $this->weekday_abbrev[__('Thursday')] = __('Thu'); $this->weekday_abbrev[__('Friday')] = __('Fri'); $this->weekday_abbrev[__('Saturday')] = __('Sat'); // The Months $this->month['01'] = __('January'); $this->month['02'] = __('February'); $this->month['03'] = __('March'); $this->month['04'] = __('April'); $this->month['05'] = __('May'); $this->month['06'] = __('June'); $this->month['07'] = __('July'); $this->month['08'] = __('August'); $this->month['09'] = __('September'); $this->month['10'] = __('October'); $this->month['11'] = __('November'); $this->month['12'] = __('December'); // Abbreviations for each month. Uses the same hack as above to get around the // 'May' duplication. $this->month_abbrev[__('January')] = __('Jan_January_abbreviation'); $this->month_abbrev[__('February')] = __('Feb_February_abbreviation'); $this->month_abbrev[__('March')] = __('Mar_March_abbreviation'); $this->month_abbrev[__('April')] = __('Apr_April_abbreviation'); $this->month_abbrev[__('May')] = __('May_May_abbreviation'); $this->month_abbrev[__('June')] = __('Jun_June_abbreviation'); $this->month_abbrev[__('July')] = __('Jul_July_abbreviation'); $this->month_abbrev[__('August')] = __('Aug_August_abbreviation'); $this->month_abbrev[__('September')] = __('Sep_September_abbreviation'); $this->month_abbrev[__('October')] = __('Oct_October_abbreviation'); $this->month_abbrev[__('November')] = __('Nov_November_abbreviation'); $this->month_abbrev[__('December')] = __('Dec_December_abbreviation'); foreach ($this->month_abbrev as $month_ => $month_abbrev_) { $this->month_abbrev[$month_] = preg_replace('/_.+_abbreviation$/', '', $month_abbrev_); } // The Meridiems $this->meridiem['am'] = __('am'); $this->meridiem['pm'] = __('pm'); $this->meridiem['AM'] = __('AM'); $this->meridiem['PM'] = __('PM'); // Numbers formatting // See http://php.net/number_format $trans = _c('number_format_decimals|$decimals argument for http://php.net/number_format, default is 0'); $this->number_format['decimals'] = ('number_format_decimals' == $trans) ? 0 : $trans; $trans = _c('number_format_decimal_point|$dec_point argument for http://php.net/number_format, default is .'); $this->number_format['decimal_point'] = ('number_format_decimal_point' == $trans) ? '.' : $trans; $trans = _c('number_format_thousands_sep|$thousands_sep argument for http://php.net/number_format, default is ,'); $this->number_format['thousands_sep'] = ('number_format_thousands_sep' == $trans) ? ',' : $trans; // Import global locale vars set during inclusion of $locale.php. foreach ( $this->locale_vars as $var ) { if ( isset($GLOBALS[$var]) ) $this->$var = $GLOBALS[$var]; } } /** * Retrieve the full translated weekday word. * * Week starts on translated Sunday and can be fetched * by using 0 (zero). So the week starts with 0 (zero) * and ends on Saturday with is fetched by using 6 (six). * * @since 2.1.0 * @access public * * @param int $weekday_number 0 for Sunday through 6 Saturday * @return string Full translated weekday */ function get_weekday($weekday_number) { return $this->weekday[$weekday_number]; } /** * Retrieve the translated weekday initial. * * The weekday initial is retrieved by the translated * full weekday word. When translating the weekday initial * pay attention to make sure that the starting letter does * not conflict. * * @since 2.1.0 * @access public * * @param string $weekday_name * @return string */ function get_weekday_initial($weekday_name) { return $this->weekday_initial[$weekday_name]; } /** * Retrieve the translated weekday abbreviation. * * The weekday abbreviation is retrieved by the translated * full weekday word. * * @since 2.1.0 * @access public * * @param string $weekday_name Full translated weekday word * @return string Translated weekday abbreviation */ function get_weekday_abbrev($weekday_name) { return $this->weekday_abbrev[$weekday_name]; } /** * Retrieve the full translated month by month number. * * The $month_number parameter has to be a string * because it must have the '0' in front of any number * that is less than 10. Starts from '01' and ends at * '12'. * * You can use an integer instead and it will add the * '0' before the numbers less than 10 for you. * * @since 2.1.0 * @access public * * @param string|int $month_number '01' through '12' * @return string Translated full month name */ function get_month($month_number) { return $this->month[zeroise($month_number, 2)]; } /** * Retrieve translated version of month abbreviation string. * * The $month_name parameter is expected to be the translated or * translatable version of the month. * * @since 2.1.0 * @access public * * @param string $month_name Translated month to get abbreviated version * @return string Translated abbreviated month */ function get_month_abbrev($month_name) { return $this->month_abbrev[$month_name]; } /** * Retrieve translated version of meridiem string. * * The $meridiem parameter is expected to not be translated. * * @since 2.1.0 * @access public * * @param string $meridiem Either 'am', 'pm', 'AM', or 'PM'. Not translated version. * @return string Translated version */ function get_meridiem($meridiem) { return $this->meridiem[$meridiem]; } /** * Global variables are deprecated. For backwards compatibility only. * * @deprecated For backwards compatibility only. * @access private * * @since 2.1.0 */ function register_globals() { $GLOBALS['weekday'] = $this->weekday; $GLOBALS['weekday_initial'] = $this->weekday_initial; $GLOBALS['weekday_abbrev'] = $this->weekday_abbrev; $GLOBALS['month'] = $this->month; $GLOBALS['month_abbrev'] = $this->month_abbrev; } /** * PHP4 style constructor which calls helper methods to set up object variables * * @uses WP_Locale::init() * @uses WP_Locale::register_globals() * @since 2.1.0 * * @return WP_Locale */ function WP_Locale() { $this->init(); $this->register_globals(); } } ?> wp/dev/wp-includes/registration-functions.php0000644000106600010660000000031010737510563016666 0ustar wp/dev/wp-includes/kses.php0000644000106600010660000007436511040761505013130 0ustar * * @package External * @subpackage KSES * * @internal * *** CONTACT INFORMATION *** * E-mail: metaur at users dot sourceforge dot net * Web page: http://sourceforge.net/projects/kses * Paper mail: Ulf Harnhammar * Ymergatan 17 C * 753 25 Uppsala * SWEDEN * * [kses strips evil scripts!] */ /** * You can override this in your my-hacks.php file * You can also override this in a plugin file. The * my-hacks.php is deprecated in its usage. * * @since 1.2.0 */ if (!defined('CUSTOM_TAGS')) define('CUSTOM_TAGS', false); if (!CUSTOM_TAGS) { /** * Kses global for default allowable HTML tags * * Can be override by using CUSTOM_TAGS constant * @global array $allowedposttags * @since 2.0.0 */ $allowedposttags = array( 'address' => array(), 'a' => array( 'class' => array (), 'href' => array (), 'id' => array (), 'title' => array (), 'rel' => array (), 'rev' => array (), 'name' => array (), 'target' => array()), 'abbr' => array( 'class' => array (), 'title' => array ()), 'acronym' => array( 'title' => array ()), 'b' => array(), 'big' => array(), 'blockquote' => array( 'id' => array (), 'cite' => array (), 'class' => array(), 'lang' => array(), 'xml:lang' => array()), 'br' => array ( 'class' => array ()), 'button' => array( 'disabled' => array (), 'name' => array (), 'type' => array (), 'value' => array ()), 'caption' => array( 'align' => array (), 'class' => array ()), 'cite' => array ( 'class' => array(), 'dir' => array(), 'lang' => array(), 'title' => array ()), 'code' => array ( 'style' => array()), 'col' => array( 'align' => array (), 'char' => array (), 'charoff' => array (), 'span' => array (), 'dir' => array(), 'style' => array (), 'valign' => array (), 'width' => array ()), 'del' => array( 'datetime' => array ()), 'dd' => array(), 'div' => array( 'align' => array (), 'class' => array (), 'dir' => array (), 'lang' => array(), 'style' => array (), 'xml:lang' => array()), 'dl' => array(), 'dt' => array(), 'em' => array(), 'fieldset' => array(), 'font' => array( 'color' => array (), 'face' => array (), 'size' => array ()), 'form' => array( 'action' => array (), 'accept' => array (), 'accept-charset' => array (), 'enctype' => array (), 'method' => array (), 'name' => array (), 'target' => array ()), 'h1' => array( 'align' => array (), 'class' => array ()), 'h2' => array( 'align' => array (), 'class' => array ()), 'h3' => array( 'align' => array (), 'class' => array ()), 'h4' => array( 'align' => array (), 'class' => array ()), 'h5' => array( 'align' => array (), 'class' => array ()), 'h6' => array( 'align' => array (), 'class' => array ()), 'hr' => array( 'align' => array (), 'class' => array (), 'noshade' => array (), 'size' => array (), 'width' => array ()), 'i' => array(), 'img' => array( 'alt' => array (), 'align' => array (), 'border' => array (), 'class' => array (), 'height' => array (), 'hspace' => array (), 'longdesc' => array (), 'vspace' => array (), 'src' => array (), 'style' => array (), 'width' => array ()), 'ins' => array( 'datetime' => array (), 'cite' => array ()), 'kbd' => array(), 'label' => array( 'for' => array ()), 'legend' => array( 'align' => array ()), 'li' => array ( 'align' => array (), 'class' => array ()), 'p' => array( 'class' => array (), 'align' => array (), 'dir' => array(), 'lang' => array(), 'style' => array (), 'xml:lang' => array()), 'pre' => array( 'style' => array(), 'width' => array ()), 'q' => array( 'cite' => array ()), 's' => array(), 'span' => array ( 'class' => array (), 'dir' => array (), 'align' => array (), 'lang' => array (), 'style' => array (), 'title' => array (), 'xml:lang' => array()), 'strike' => array(), 'strong' => array(), 'sub' => array(), 'sup' => array(), 'table' => array( 'align' => array (), 'bgcolor' => array (), 'border' => array (), 'cellpadding' => array (), 'cellspacing' => array (), 'class' => array (), 'dir' => array(), 'id' => array(), 'rules' => array (), 'style' => array (), 'summary' => array (), 'width' => array ()), 'tbody' => array( 'align' => array (), 'char' => array (), 'charoff' => array (), 'valign' => array ()), 'td' => array( 'abbr' => array (), 'align' => array (), 'axis' => array (), 'bgcolor' => array (), 'char' => array (), 'charoff' => array (), 'class' => array (), 'colspan' => array (), 'dir' => array(), 'headers' => array (), 'height' => array (), 'nowrap' => array (), 'rowspan' => array (), 'scope' => array (), 'style' => array (), 'valign' => array (), 'width' => array ()), 'textarea' => array( 'cols' => array (), 'rows' => array (), 'disabled' => array (), 'name' => array (), 'readonly' => array ()), 'tfoot' => array( 'align' => array (), 'char' => array (), 'class' => array (), 'charoff' => array (), 'valign' => array ()), 'th' => array( 'abbr' => array (), 'align' => array (), 'axis' => array (), 'bgcolor' => array (), 'char' => array (), 'charoff' => array (), 'class' => array (), 'colspan' => array (), 'headers' => array (), 'height' => array (), 'nowrap' => array (), 'rowspan' => array (), 'scope' => array (), 'valign' => array (), 'width' => array ()), 'thead' => array( 'align' => array (), 'char' => array (), 'charoff' => array (), 'class' => array (), 'valign' => array ()), 'title' => array(), 'tr' => array( 'align' => array (), 'bgcolor' => array (), 'char' => array (), 'charoff' => array (), 'class' => array (), 'style' => array (), 'valign' => array ()), 'tt' => array(), 'u' => array(), 'ul' => array ( 'class' => array (), 'style' => array (), 'type' => array ()), 'ol' => array ( 'class' => array (), 'start' => array (), 'style' => array (), 'type' => array ()), 'var' => array ()); /** * Kses allowed HTML elements * * @global array $allowedtags * @since 1.0.0 */ $allowedtags = array( 'a' => array( 'href' => array (), 'title' => array ()), 'abbr' => array( 'title' => array ()), 'acronym' => array( 'title' => array ()), 'b' => array(), 'blockquote' => array( 'cite' => array ()), // 'br' => array(), 'cite' => array (), 'code' => array(), 'del' => array( 'datetime' => array ()), // 'dd' => array(), // 'dl' => array(), // 'dt' => array(), 'em' => array (), 'i' => array (), // 'ins' => array('datetime' => array(), 'cite' => array()), // 'li' => array(), // 'ol' => array(), // 'p' => array(), 'q' => array( 'cite' => array ()), 'strike' => array(), 'strong' => array(), // 'sub' => array(), // 'sup' => array(), // 'u' => array(), // 'ul' => array(), ); } /** * wp_kses() - Filters content and keeps only allowable HTML elements. * * This function makes sure that only the allowed HTML element names, * attribute names and attribute values plus only sane HTML entities * will occur in $string. You have to remove any slashes from PHP's * magic quotes before you call this function. * * The default allowed protocols are 'http', 'https', 'ftp', 'mailto', * 'news', 'irc', 'gopher', 'nntp', 'feed', and finally 'telnet. This * covers all common link protocols, except for 'javascript' which * should not be allowed for untrusted users. * * @since 1.0.0 * * @param string $string Content to filter through kses * @param array $allowed_html List of allowed HTML elements * @param array $allowed_protocols Optional. Allowed protocol in links. * @return string Filtered content with only allowed HTML elements */ function wp_kses($string, $allowed_html, $allowed_protocols = array ('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet')) { $string = wp_kses_no_null($string); $string = wp_kses_js_entities($string); $string = wp_kses_normalize_entities($string); $allowed_html_fixed = wp_kses_array_lc($allowed_html); $string = wp_kses_hook($string, $allowed_html_fixed, $allowed_protocols); // WP changed the order of these funcs and added args to wp_kses_hook return wp_kses_split($string, $allowed_html_fixed, $allowed_protocols); } /** * wp_kses_hook() - You add any kses hooks here. * * There is currently only one kses WordPress hook and it is * called here. All parameters are passed to the hooks and * expected to recieve a string. * * @since 1.0.0 * * @param string $string Content to filter through kses * @param array $allowed_html List of allowed HTML elements * @param array $allowed_protocols Allowed protocol in links * @return string Filtered content through 'pre_kses' hook */ function wp_kses_hook($string, $allowed_html, $allowed_protocols) { $string = apply_filters('pre_kses', $string, $allowed_html, $allowed_protocols); return $string; } /** * wp_kses_version() - This function returns kses' version number. * * @since 1.0.0 * * @return string Version Number */ function wp_kses_version() { return '0.2.2'; } /** * wp_kses_split() - Searches for HTML tags, no matter how malformed * * It also matches stray ">" characters. * * @since 1.0.0 * * @param string $string Content to filter * @param array $allowed_html Allowed HTML elements * @param array $allowed_protocols Allowed protocols to keep * @return string Content with fixed HTML tags */ function wp_kses_split($string, $allowed_html, $allowed_protocols) { return preg_replace('%((|$))|(<[^>]*(>|$)|>))%e', "wp_kses_split2('\\1', \$allowed_html, ".'$allowed_protocols)', $string); } /** * wp_kses_split2() - Callback for wp_kses_split for fixing malformed HTML tags * * This function does a lot of work. It rejects some very malformed things * like <:::>. It returns an empty string, if the element isn't allowed (look * ma, no strip_tags()!). Otherwise it splits the tag into an element and an * attribute list. * * After the tag is split into an element and an attribute list, it is run * through another filter which will remove illegal attributes and once * that is completed, will be returned. * * @since 1.0.0 * @uses wp_kses_attr() * * @param string $string Content to filter * @param array $allowed_html Allowed HTML elements * @param array $allowed_protocols Allowed protocols to keep * @return string Fixed HTML element */ function wp_kses_split2($string, $allowed_html, $allowed_protocols) { $string = wp_kses_stripslashes($string); if (substr($string, 0, 1) != '<') return '>'; # It matched a ">" character if (preg_match('%^)?$%', $string, $matches)) { $string = str_replace(array(''), '', $matches[1]); while ( $string != $newstring = wp_kses($string, $allowed_html, $allowed_protocols) ) $string = $newstring; if ( $string == '' ) return ''; // prevent multiple dashes in comments $string = preg_replace('/--+/', '-', $string); // prevent three dashes closing a comment $string = preg_replace('/-$/', '', $string); return ""; } # Allow HTML comments if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9]+)([^>]*)>?$%', $string, $matches)) return ''; # It's seriously malformed $slash = trim($matches[1]); $elem = $matches[2]; $attrlist = $matches[3]; if (!@isset($allowed_html[strtolower($elem)])) return ''; # They are using a not allowed HTML element if ($slash != '') return "<$slash$elem>"; # No attributes are allowed for closing elements return wp_kses_attr("$slash$elem", $attrlist, $allowed_html, $allowed_protocols); } /** * wp_kses_attr() - Removes all attributes, if none are allowed for this element * * If some are allowed it calls wp_kses_hair() to split them further, and then * it builds up new HTML code from the data that kses_hair() returns. It also * removes "<" and ">" characters, if there are any left. One more thing it * does is to check if the tag has a closing XHTML slash, and if it does, it * puts one in the returned code as well. * * @since 1.0.0 * * @param string $element HTML element/tag * @param string $attr HTML attributes from HTML element to closing HTML element tag * @param array $allowed_html Allowed HTML elements * @param array $allowed_protocols Allowed protocols to keep * @return string Sanitized HTML element */ function wp_kses_attr($element, $attr, $allowed_html, $allowed_protocols) { # Is there a closing XHTML slash at the end of the attributes? $xhtml_slash = ''; if (preg_match('%\s/\s*$%', $attr)) $xhtml_slash = ' /'; # Are any attributes allowed at all for this element? if (@ count($allowed_html[strtolower($element)]) == 0) return "<$element$xhtml_slash>"; # Split it $attrarr = wp_kses_hair($attr, $allowed_protocols); # Go through $attrarr, and save the allowed attributes for this element # in $attr2 $attr2 = ''; foreach ($attrarr as $arreach) { if (!@ isset ($allowed_html[strtolower($element)][strtolower($arreach['name'])])) continue; # the attribute is not allowed $current = $allowed_html[strtolower($element)][strtolower($arreach['name'])]; if ($current == '') continue; # the attribute is not allowed if (!is_array($current)) $attr2 .= ' '.$arreach['whole']; # there are no checks else { # there are some checks $ok = true; foreach ($current as $currkey => $currval) if (!wp_kses_check_attr_val($arreach['value'], $arreach['vless'], $currkey, $currval)) { $ok = false; break; } if ($ok) $attr2 .= ' '.$arreach['whole']; # it passed them } # if !is_array($current) } # foreach # Remove any "<" or ">" characters $attr2 = preg_replace('/[<>]/', '', $attr2); return "<$element$attr2$xhtml_slash>"; } /** * wp_kses_hair() - Builds an attribute list from string containing attributes. * * This function does a lot of work. It parses an attribute list into an array * with attribute data, and tries to do the right thing even if it gets weird * input. It will add quotes around attribute values that don't have any quotes * or apostrophes around them, to make it easier to produce HTML code that will * conform to W3C's HTML specification. It will also remove bad URL protocols * from attribute values. It also reduces duplicate attributes by using the * attribute defined first (foo='bar' foo='baz' will result in foo='bar'). * * @since 1.0.0 * * @param string $attr Attribute list from HTML element to closing HTML element tag * @param array $allowed_protocols Allowed protocols to keep * @return array List of attributes after parsing */ function wp_kses_hair($attr, $allowed_protocols) { $attrarr = array (); $mode = 0; $attrname = ''; # Loop through the whole attribute list while (strlen($attr) != 0) { $working = 0; # Was the last operation successful? switch ($mode) { case 0 : # attribute name, href for instance if (preg_match('/^([-a-zA-Z]+)/', $attr, $match)) { $attrname = $match[1]; $working = $mode = 1; $attr = preg_replace('/^[-a-zA-Z]+/', '', $attr); } break; case 1 : # equals sign or valueless ("selected") if (preg_match('/^\s*=\s*/', $attr)) # equals sign { $working = 1; $mode = 2; $attr = preg_replace('/^\s*=\s*/', '', $attr); break; } if (preg_match('/^\s+/', $attr)) # valueless { $working = 1; $mode = 0; if(FALSE === array_key_exists($attrname, $attrarr)) { $attrarr[$attrname] = array ('name' => $attrname, 'value' => '', 'whole' => $attrname, 'vless' => 'y'); } $attr = preg_replace('/^\s+/', '', $attr); } break; case 2 : # attribute value, a URL after href= for instance if (preg_match('/^"([^"]*)"(\s+|$)/', $attr, $match)) # "value" { $thisval = wp_kses_bad_protocol($match[1], $allowed_protocols); if(FALSE === array_key_exists($attrname, $attrarr)) { $attrarr[$attrname] = array ('name' => $attrname, 'value' => $thisval, 'whole' => "$attrname=\"$thisval\"", 'vless' => 'n'); } $working = 1; $mode = 0; $attr = preg_replace('/^"[^"]*"(\s+|$)/', '', $attr); break; } if (preg_match("/^'([^']*)'(\s+|$)/", $attr, $match)) # 'value' { $thisval = wp_kses_bad_protocol($match[1], $allowed_protocols); if(FALSE === array_key_exists($attrname, $attrarr)) { $attrarr[$attrname] = array ('name' => $attrname, 'value' => $thisval, 'whole' => "$attrname='$thisval'", 'vless' => 'n'); } $working = 1; $mode = 0; $attr = preg_replace("/^'[^']*'(\s+|$)/", '', $attr); break; } if (preg_match("%^([^\s\"']+)(\s+|$)%", $attr, $match)) # value { $thisval = wp_kses_bad_protocol($match[1], $allowed_protocols); if(FALSE === array_key_exists($attrname, $attrarr)) { $attrarr[$attrname] = array ('name' => $attrname, 'value' => $thisval, 'whole' => "$attrname=\"$thisval\"", 'vless' => 'n'); } # We add quotes to conform to W3C's HTML spec. $working = 1; $mode = 0; $attr = preg_replace("%^[^\s\"']+(\s+|$)%", '', $attr); } break; } # switch if ($working == 0) # not well formed, remove and try again { $attr = wp_kses_html_error($attr); $mode = 0; } } # while if ($mode == 1 && FALSE === array_key_exists($attrname, $attrarr)) # special case, for when the attribute list ends with a valueless # attribute like "selected" $attrarr[$attrname] = array ('name' => $attrname, 'value' => '', 'whole' => $attrname, 'vless' => 'y'); return $attrarr; } /** * wp_kses_check_attr_val() - Performs different checks for attribute values. * * The currently implemented checks are "maxlen", "minlen", "maxval", "minval" * and "valueless" with even more checks to come soon. * * @since 1.0.0 * * @param string $value Attribute value * @param string $vless Whether the value is valueless or not. Use 'y' or 'n' * @param string $checkname What $checkvalue is checking for. * @param mixed $checkvalue What constraint the value should pass * @return bool Whether check passes (true) or not (false) */ function wp_kses_check_attr_val($value, $vless, $checkname, $checkvalue) { $ok = true; switch (strtolower($checkname)) { case 'maxlen' : # The maxlen check makes sure that the attribute value has a length not # greater than the given value. This can be used to avoid Buffer Overflows # in WWW clients and various Internet servers. if (strlen($value) > $checkvalue) $ok = false; break; case 'minlen' : # The minlen check makes sure that the attribute value has a length not # smaller than the given value. if (strlen($value) < $checkvalue) $ok = false; break; case 'maxval' : # The maxval check does two things: it checks that the attribute value is # an integer from 0 and up, without an excessive amount of zeroes or # whitespace (to avoid Buffer Overflows). It also checks that the attribute # value is not greater than the given value. # This check can be used to avoid Denial of Service attacks. if (!preg_match('/^\s{0,6}[0-9]{1,6}\s{0,6}$/', $value)) $ok = false; if ($value > $checkvalue) $ok = false; break; case 'minval' : # The minval check checks that the attribute value is a positive integer, # and that it is not smaller than the given value. if (!preg_match('/^\s{0,6}[0-9]{1,6}\s{0,6}$/', $value)) $ok = false; if ($value < $checkvalue) $ok = false; break; case 'valueless' : # The valueless check checks if the attribute has a value # (like ) or not ($display"; echo $after; } } /** * Retrieve the html link to the url of the author of the current comment. * * @since 1.5 * @uses apply_filters() Calls 'get_comment_author_link' hook on the complete link HTML or author * * @return string Comment Author name or HTML link for author's URL */ function get_comment_author_link() { /** @todo Only call these functions when they are needed. Include in if... else blocks */ $url = get_comment_author_url(); $author = get_comment_author(); if ( empty( $url ) || 'http://' == $url ) $return = $author; else $return = "$author"; return apply_filters('get_comment_author_link', $return); } /** * Display the html link to the url of the author of the current comment. * * @since 0.71 * @see get_comment_author_link() Echos result */ function comment_author_link() { echo get_comment_author_link(); } /** * Retrieve the IP address of the author of the current comment. * * @since 1.5 * @uses $comment * @uses apply_filters() * * @return unknown */ function get_comment_author_IP() { global $comment; return apply_filters('get_comment_author_IP', $comment->comment_author_IP); } /** * Display the IP address of the author of the current comment. * * @since 0.71 * @see get_comment_author_IP() Echos Result */ function comment_author_IP() { echo get_comment_author_IP(); } /** * Retrieve the url of the author of the current comment. * * @since 1.5 * @uses apply_filters() Calls 'get_comment_author_url' hook on the comment author's URL * * @return string */ function get_comment_author_url() { global $comment; return apply_filters('get_comment_author_url', $comment->comment_author_url); } /** * Display the url of the author of the current comment. * * @since 0.71 * @uses apply_filters() * @uses get_comment_author_url() Retrieves the comment author's URL */ function comment_author_url() { echo apply_filters('comment_url', get_comment_author_url()); } /** * Retrieves the HTML link of the url of the author of the current comment. * * $linktext parameter is only used if the URL does not exist for the comment * author. If the URL does exist then the URL will be used and the $linktext * will be ignored. * * Encapsulate the HTML link between the $before and $after. So it will appear * in the order of $before, link, and finally $after. * * @since 1.5 * @uses apply_filters() Calls the 'get_comment_author_url_link' on the complete HTML before returning. * * @param string $linktext The text to display instead of the comment author's email address * @param string $before The text or HTML to display before the email link. * @param string $after The text or HTML to display after the email link. * @return string The HTML link between the $before and $after parameters */ function get_comment_author_url_link( $linktext = '', $before = '', $after = '' ) { $url = get_comment_author_url(); $display = ($linktext != '') ? $linktext : $url; $display = str_replace( 'http://www.', '', $display ); $display = str_replace( 'http://', '', $display ); if ( '/' == substr($display, -1) ) $display = substr($display, 0, -1); $return = "$before$display$after"; return apply_filters('get_comment_author_url_link', $return); } /** * Displays the HTML link of the url of the author of the current comment. * * @since 0.71 * @see get_comment_author_url_link() Echos result * * @param string $linktext The text to display instead of the comment author's email address * @param string $before The text or HTML to display before the email link. * @param string $after The text or HTML to display after the email link. */ function comment_author_url_link( $linktext = '', $before = '', $after = '' ) { echo get_comment_author_url_link( $linktext, $before, $after ); } /** * Retrieve the comment date of the current comment. * * @since 1.5 * @uses apply_filters() Calls 'get_comment_date' hook with the formated date and the $d parameter respectively * @uses $comment * * @param string $d The format of the date (defaults to user's config) * @return string The comment's date */ function get_comment_date( $d = '' ) { global $comment; if ( '' == $d ) $date = mysql2date( get_option('date_format'), $comment->comment_date); else $date = mysql2date($d, $comment->comment_date); return apply_filters('get_comment_date', $date, $d); } /** * Display the comment date of the current comment. * * @since 0.71 * * @param string $d The format of the date (defaults to user's config) */ function comment_date( $d = '' ) { echo get_comment_date( $d ); } /** * Retrieve the excerpt of the current comment. * * Will cut each word and only output the first 20 words with '...' at the end. * If the word count is less than 20, then no truncating is done and no '...' * will appear. * * @since 1.5 * @uses $comment * @uses apply_filters() Calls 'get_comment_excerpt' on truncated comment * * @return string The maybe truncated comment with 20 words or less */ function get_comment_excerpt() { global $comment; $comment_text = strip_tags($comment->comment_content); $blah = explode(' ', $comment_text); if (count($blah) > 20) { $k = 20; $use_dotdotdot = 1; } else { $k = count($blah); $use_dotdotdot = 0; } $excerpt = ''; for ($i=0; $i<$k; $i++) { $excerpt .= $blah[$i] . ' '; } $excerpt .= ($use_dotdotdot) ? '...' : ''; return apply_filters('get_comment_excerpt', $excerpt); } /** * Display the excerpt of the current comment. * * @since 1.2 * @uses apply_filters() Calls 'comment_excerpt' hook before displaying excerpt */ function comment_excerpt() { echo apply_filters('comment_excerpt', get_comment_excerpt() ); } /** * Retrieve the comment id of the current comment. * * @since 1.5 * @uses $comment * @uses apply_filters() Calls the 'get_comment_ID' hook for the comment ID * * @return int The comment ID */ function get_comment_ID() { global $comment; return apply_filters('get_comment_ID', $comment->comment_ID); } /** * Displays the comment id of the current comment. * * @since 0.71 * @see get_comment_ID() Echos Result */ function comment_ID() { echo get_comment_ID(); } /** * Retrieve the link to the current comment. * * @since 1.5 * @uses $comment * * @return string The permalink to the current comment */ function get_comment_link() { global $comment; return get_permalink( $comment->comment_post_ID ) . '#comment-' . $comment->comment_ID; } /** * Retrieves the link to the current post comments. * * @since 1.5 * * @return string The link to the comments */ function get_comments_link() { return get_permalink() . '#comments'; } /** * Displays the link to the current post comments. * * @since 0.71 * * @param string $deprecated Not Used * @param bool $deprecated Not Used */ function comments_link( $deprecated = '', $deprecated = '' ) { echo get_comments_link(); } /** * Retrieve the amount of comments a post has. * * @since 1.5 * @uses apply_filters() Calls the 'get_comments_number' hook on the number of comments * * @param int $post_id The Post ID * @return int The number of comments a post has */ function get_comments_number( $post_id = 0 ) { global $id; $post_id = (int) $post_id; if ( !$post_id ) $post_id = (int) $id; $post = get_post($post_id); if ( ! isset($post->comment_count) ) $count = 0; else $count = $post->comment_count; return apply_filters('get_comments_number', $count); } /** * Display the language string for the number of comments the current post has. * * @since 0.71 * @uses $id * @uses apply_filters() Calls the 'comments_number' hook on the output and number of comments respectively. * * @param string $zero Text for no comments * @param string $one Text for one comment * @param string $more Text for more than one comment * @param string $deprecated Not used. */ function comments_number( $zero = false, $one = false, $more = false, $deprecated = '' ) { global $id; $number = get_comments_number($id); if ( $number > 1 ) $output = str_replace('%', number_format_i18n($number), ( false === $more ) ? __('% Comments') : $more); elseif ( $number == 0 ) $output = ( false === $zero ) ? __('No Comments') : $zero; else // must be one $output = ( false === $one ) ? __('1 Comment') : $one; echo apply_filters('comments_number', $output, $number); } /** * Retrieve the text of the current comment. * * @since 1.5 * @uses $comment * * @return string The comment content */ function get_comment_text() { global $comment; return apply_filters('get_comment_text', $comment->comment_content); } /** * Displays the text of the current comment. * * @since 0.71 * @uses apply_filters() Passes the comment content through the 'comment_text' hook before display * @uses get_comment_text() Gets the comment content */ function comment_text() { echo apply_filters('comment_text', get_comment_text() ); } /** * Retrieve the comment time of the current comment. * * @since 1.5 * @uses $comment * @uses apply_filter() Calls 'get_comment_time' hook with the formatted time, the $d parameter, and $gmt parameter passed. * * @param string $d Optional. The format of the time (defaults to user's config) * @param bool $gmt Whether to use the GMT date * @return string The formatted time */ function get_comment_time( $d = '', $gmt = false ) { global $comment; $comment_date = $gmt? $comment->comment_date_gmt : $comment->comment_date; if ( '' == $d ) $date = mysql2date(get_option('time_format'), $comment_date); else $date = mysql2date($d, $comment_date); return apply_filters('get_comment_time', $date, $d, $gmt); } /** * Display the comment time of the current comment. * * @since 0.71 * * @param string $d Optional. The format of the time (defaults to user's config) */ function comment_time( $d = '' ) { echo get_comment_time($d); } /** * Retrieve the comment type of the current comment. * * @since 1.5 * @uses $comment * @uses apply_filters() Calls the 'get_comment_type' hook on the comment type * * @return string The comment type */ function get_comment_type() { global $comment; if ( '' == $comment->comment_type ) $comment->comment_type = 'comment'; return apply_filters('get_comment_type', $comment->comment_type); } /** * Display the comment type of the current comment. * * @since 0.71 * * @param string $commenttxt The string to display for comment type * @param string $trackbacktxt The string to display for trackback type * @param string $pingbacktxt The string to display for pingback type */ function comment_type($commenttxt = 'Comment', $trackbacktxt = 'Trackback', $pingbacktxt = 'Pingback') { $type = get_comment_type(); switch( $type ) { case 'trackback' : echo $trackbacktxt; break; case 'pingback' : echo $pingbacktxt; break; default : echo $commenttxt; } } /** * Retrieve The current post's trackback URL. * * There is a check to see if permalink's have been enabled and if so, will * retrieve the pretty path. If permalinks weren't enabled, the ID of the * current post is used and appended to the correct page to go to. * * @since 1.5 * @uses apply_filters() Calls 'trackback_url' on the resulting trackback URL * @uses $id * * @return string The trackback URL after being filtered */ function get_trackback_url() { global $id; if ( '' != get_option('permalink_structure') ) { $tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback', 'single_trackback'); } else { $tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . $id; } return apply_filters('trackback_url', $tb_url); } /** * Displays the current post's trackback URL. * * @since 0.71 * @uses get_trackback_url() Gets the trackback url for the current post * * @param bool $deprecated Remove backwards compat in 2.5 * @return void|string Should only be used to echo the trackback URL, use get_trackback_url() for the result instead. */ function trackback_url($deprecated = true) { if ($deprecated) echo get_trackback_url(); else return get_trackback_url(); } /** * Generates and displays the RDF for the trackback information of current post. * * @since 0.71 * * @param int $deprecated Not used (Was $timezone = 0) */ function trackback_rdf($deprecated = '') { if (stripos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') === false) { echo ' \n"; echo ''; } } /** * Whether the current post is open for comments. * * @since 1.5 * @uses $post * * @param int $post_id An optional post ID to check instead of the current post. * @return bool True if the comments are open */ function comments_open( $post_id=NULL ) { $_post = get_post($post_id); $open = ( 'open' == $_post->comment_status ); return apply_filters( 'comments_open', $open, $post_id ); } /** * Whether the current post is open for pings. * * @since 1.5 * @uses $post * * @param int $post_id An optional post ID to check instead of the current post. * @return bool True if pings are accepted */ function pings_open( $post_id = NULL ) { $_post = get_post($post_id); $open = ( 'open' == $_post->ping_status ); return apply_filters( 'pings_open', $open, $post_id ); } /** * Displays form token for unfiltered comments. * * Will only display nonce token if the current user has permissions for * unfiltered html. Won't display the token for other users. * * The function was backported to 2.0.10 and was added to versions 2.1.3 and * above. Does not exist in versions prior to 2.0.10 in the 2.0 branch and in * the 2.1 branch, prior to 2.1.3. Technically added in 2.2.0. * * @since 2.0.10 Backported to 2.0 branch * @since 2.1.3 * @uses $post Gets the ID of the current post for the token */ function wp_comment_form_unfiltered_html_nonce() { global $post; if ( current_user_can('unfiltered_html') ) wp_nonce_field('unfiltered-html-comment_' . $post->ID, '_wp_unfiltered_html_comment', false); } /** * Loads the comment template specified in $file. * * Will not display the comments template if not on single post or page, or if * the post does not have comments. * * Uses the WordPress database object to query for the comments. The comments * are passed through the 'comments_array' filter hook with the list of comments * and the post ID respectively. * * The $file path is passed through a filter hook called, 'comments_template' * which includes the TEMPLATEPATH and $file combined. Tries the $filtered path * first and if it fails it will require the default comment themplate from the * default theme. If either does not exist, then the WordPress process will be * halted. It is advised for that reason, that the default theme is not deleted. * * @since 1.5 * @global array $comment List of comment objects for the current post * @uses $wpdb * @uses $id * @uses $post * @uses $withcomments Will not try to get the comments if the post has none. * * @param string $file Optional, default '/comments.php'. The file to load * @return null Returns null if no comments appear */ function comments_template( $file = '/comments.php' ) { global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity; if ( ! (is_single() || is_page() || $withcomments) ) return; $req = get_option('require_name_email'); $commenter = wp_get_current_commenter(); extract($commenter, EXTR_SKIP); /** @todo Use API instead of SELECTs. */ if ( $user_ID) { $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND (comment_approved = '1' OR ( user_id = %d AND comment_approved = '0' ) ) ORDER BY comment_date", $post->ID, $user_ID)); } else if ( empty($comment_author) ) { $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1' ORDER BY comment_date", $post->ID)); } else { $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND ( comment_approved = '1' OR ( comment_author = %s AND comment_author_email = %s AND comment_approved = '0' ) ) ORDER BY comment_date", $post->ID, $comment_author, $comment_author_email)); } // keep $comments for legacy's sake (remember $table*? ;) ) $comments = $wp_query->comments = apply_filters( 'comments_array', $comments, $post->ID ); $wp_query->comment_count = count($wp_query->comments); update_comment_cache($comments); define('COMMENTS_TEMPLATE', true); $include = apply_filters('comments_template', TEMPLATEPATH . $file ); if ( file_exists( $include ) ) require( $include ); else require( WP_CONTENT_DIR . '/themes/default/comments.php'); } /** * Displays the JS popup script to show a comment. * * If the $file parameter is empty, then the home page is assumed. The defaults * for the window are 400px by 400px. * * For the comment link popup to work, this function has to be called or the * normal comment link will be assumed. * * @since 0.71 * @global string $wpcommentspopupfile The URL to use for the popup window * @global int $wpcommentsjavascript Whether to use JavaScript or not. Set when function is called * * @param int $width Optional. The width of the popup window * @param int $height Optional. The height of the popup window * @param string $file Optional. Sets the location of the popup window */ function comments_popup_script($width=400, $height=400, $file='') { global $wpcommentspopupfile, $wpcommentsjavascript; if (empty ($file)) { $wpcommentspopupfile = ''; // Use the index. } else { $wpcommentspopupfile = $file; } $wpcommentsjavascript = 1; $javascript = "\n"; echo $javascript; } /** * Displays the link to the comments popup window for the current post ID. * * Is not meant to be displayed on single posts and pages. Should be used on the * lists of posts * * @since 0.71 * @uses $id * @uses $wpcommentspopupfile * @uses $wpcommentsjavascript * @uses $post * * @param string $zero The string to display when no comments * @param string $one The string to display when only one comment is available * @param string $more The string to display when there are more than one comment * @param string $css_class The CSS class to use for comments * @param string $none The string to display when comments have been turned off * @return null Returns null on single posts and pages. */ function comments_popup_link( $zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $css_class = '', $none = 'Comments Off' ) { global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post; if ( is_single() || is_page() ) return; $number = get_comments_number( $id ); if ( 0 == $number && 'closed' == $post->comment_status && 'closed' == $post->ping_status ) { echo '' . $none . ''; return; } if ( !empty($post->post_password) ) { // if there's a password if ( !isset($_COOKIE['wp-postpass_' . COOKIEHASH]) || $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password ) { // and it doesn't match the cookie echo __('Enter your password to view comments'); return; } } echo ''; comments_number( $zero, $one, $more, $number ); echo ''; } ?>wp/dev/wp-includes/deprecated.php0000644000106600010660000011125411034723004014243 0ustar posts */ $tableposts = $wpdb->posts; /** * The name of the Users table * @global string $tableusers * @deprecated Use $wpdb->users */ $tableusers = $wpdb->users; /** * The name of the Categories table * @global string $tablecategories * @deprecated Use $wpdb->categories */ $tablecategories = $wpdb->categories; /** * The name of the post to category table * @global string $tablepost2cat * @deprecated Use $wpdb->post2cat; */ $tablepost2cat = $wpdb->post2cat; /** * The name of the comments table * @global string $tablecomments * @deprecated Use $wpdb->comments; */ $tablecomments = $wpdb->comments; /** * The name of the links table * @global string $tablelinks * @deprecated Use $wpdb->links; */ $tablelinks = $wpdb->links; /** * @global string $tablelinkcategories * @deprecated Not used anymore; */ $tablelinkcategories = 'linkcategories_is_gone'; /** * The name of the options table * @global string $tableoptions * @deprecated Use $wpdb->options; */ $tableoptions = $wpdb->options; /** * The name of the postmeta table * @global string $tablepostmeta * @deprecated Use $wpdb->postmeta; */ $tablepostmeta = $wpdb->postmeta; /* * Deprecated functions come here to die. */ /** * get_postdata() - Entire Post data * * @since 0.71 * @deprecated Use get_post() * @see get_post() * * @param int $postid * @return array */ function get_postdata($postid) { _deprecated_function(__FUNCTION__, '0.0', 'get_post()'); $post = &get_post($postid); $postdata = array ( 'ID' => $post->ID, 'Author_ID' => $post->post_author, 'Date' => $post->post_date, 'Content' => $post->post_content, 'Excerpt' => $post->post_excerpt, 'Title' => $post->post_title, 'Category' => $post->post_category, 'post_status' => $post->post_status, 'comment_status' => $post->comment_status, 'ping_status' => $post->ping_status, 'post_password' => $post->post_password, 'to_ping' => $post->to_ping, 'pinged' => $post->pinged, 'post_type' => $post->post_type, 'post_name' => $post->post_name ); return $postdata; } /** * start_wp() - Sets up the WordPress Loop * * @since 1.0.1 * @deprecated Since 1.5 - {@link http://codex.wordpress.org/The_Loop Use new WordPress Loop} */ function start_wp() { global $wp_query, $post; _deprecated_function(__FUNCTION__, '1.5', __('new WordPress Loop') ); // Since the old style loop is being used, advance the query iterator here. $wp_query->next_post(); setup_postdata($post); } /** * the_category_ID() - Return or Print Category ID * * @since 0.71 * @deprecated use get_the_category() * @see get_the_category() * * @param bool $echo * @return null|int */ function the_category_ID($echo = true) { _deprecated_function(__FUNCTION__, '0.0', 'get_the_category()'); // Grab the first cat in the list. $categories = get_the_category(); $cat = $categories[0]->term_id; if ( $echo ) echo $cat; return $cat; } /** * the_category_head() - Print category with optional text before and after * * @since 0.71 * @deprecated use get_the_category_by_ID() * @see get_the_category_by_ID() * * @param string $before * @param string $after */ function the_category_head($before='', $after='') { global $currentcat, $previouscat; _deprecated_function(__FUNCTION__, '0.0', 'get_the_category_by_ID()'); // Grab the first cat in the list. $categories = get_the_category(); $currentcat = $categories[0]->category_id; if ( $currentcat != $previouscat ) { echo $before; echo get_the_category_by_ID($currentcat); echo $after; $previouscat = $currentcat; } } /** * previous_post() - Prints link to the previous post * * @since 1.5 * @deprecated Use previous_post_link() * @see previous_post_link() * * @param string $format * @param string $previous * @param string $title * @param string $in_same_cat * @param int $limitprev * @param string $excluded_categories */ function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') { _deprecated_function(__FUNCTION__, '0.0', 'previous_post_link()'); if ( empty($in_same_cat) || 'no' == $in_same_cat ) $in_same_cat = false; else $in_same_cat = true; $post = get_previous_post($in_same_cat, $excluded_categories); if ( !$post ) return; $string = ''.$previous; if ( 'yes' == $title ) $string .= apply_filters('the_title', $post->post_title, $post); $string .= ''; $format = str_replace('%', $string, $format); echo $format; } /** * next_post() - Prints link to the next post * * @since 0.71 * @deprecated Use next_post_link() * @see next_post_link() * * @param string $format * @param string $previous * @param string $title * @param string $in_same_cat * @param int $limitprev * @param string $excluded_categories */ function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') { _deprecated_function(__FUNCTION__, '0.0', 'next_post_link()'); if ( empty($in_same_cat) || 'no' == $in_same_cat ) $in_same_cat = false; else $in_same_cat = true; $post = get_next_post($in_same_cat, $excluded_categories); if ( !$post ) return; $string = ''.$next; if ( 'yes' == $title ) $string .= apply_filters('the_title', $post->post_title, $nextpost); $string .= ''; $format = str_replace('%', $string, $format); echo $format; } /** * user_can_create_post() - Whether user can create a post * * @since 1.5 * @deprecated Use current_user_can() * @see current_user_can() * * @param int $user_id * @param int $blog_id Not Used * @param int $category_id Not Used * @return bool */ function user_can_create_post($user_id, $blog_id = 1, $category_id = 'None') { _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); $author_data = get_userdata($user_id); return ($author_data->user_level > 1); } /** * user_can_create_draft() - Whether user can create a post * * @since 1.5 * @deprecated Use current_user_can() * @see current_user_can() * * @param int $user_id * @param int $blog_id Not Used * @param int $category_id Not Used * @return bool */ function user_can_create_draft($user_id, $blog_id = 1, $category_id = 'None') { _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); $author_data = get_userdata($user_id); return ($author_data->user_level >= 1); } /** * user_can_edit_post() - Whether user can edit a post * * @since 1.5 * @deprecated Use current_user_can() * @see current_user_can() * * @param int $user_id * @param int $post_id * @param int $blog_id Not Used * @return bool */ function user_can_edit_post($user_id, $post_id, $blog_id = 1) { _deprecated_function(__FUNCTION__, '0', 'current_user_can()'); $author_data = get_userdata($user_id); $post = get_post($post_id); $post_author_data = get_userdata($post->post_author); if ( (($user_id == $post_author_data->ID) && !($post->post_status == 'publish' && $author_data->user_level < 2)) || ($author_data->user_level > $post_author_data->user_level) || ($author_data->user_level >= 10) ) { return true; } else { return false; } } /** * user_can_delete_post() - Whether user can delete a post * * @since 1.5 * @deprecated Use current_user_can() * @see current_user_can() * * @param int $user_id * @param int $post_id * @param int $blog_id Not Used * @return bool */ function user_can_delete_post($user_id, $post_id, $blog_id = 1) { _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); // right now if one can edit, one can delete return user_can_edit_post($user_id, $post_id, $blog_id); } /** * user_can_set_post_date() - Whether user can set new posts' dates * * @since 1.5 * @deprecated Use current_user_can() * @see current_user_can() * * @param int $user_id * @param int $blog_id Not Used * @param int $category_id Not Used * @return bool */ function user_can_set_post_date($user_id, $blog_id = 1, $category_id = 'None') { _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); $author_data = get_userdata($user_id); return (($author_data->user_level > 4) && user_can_create_post($user_id, $blog_id, $category_id)); } /* returns true if $user_id can edit $post_id's date */ /** * user_can_edit_post_date() - Whether user can delete a post * * @since 1.5 * @deprecated Use current_user_can() * @see current_user_can() * * @param int $user_id * @param int $post_id * @param int $blog_id Not Used * @return bool */ function user_can_edit_post_date($user_id, $post_id, $blog_id = 1) { _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); $author_data = get_userdata($user_id); return (($author_data->user_level > 4) && user_can_edit_post($user_id, $post_id, $blog_id)); } /* returns true if $user_id can edit $post_id's comments */ /** * user_can_edit_post_comments() - Whether user can delete a post * * @since 1.5 * @deprecated Use current_user_can() * @see current_user_can() * * @param int $user_id * @param int $post_id * @param int $blog_id Not Used * @return bool */ function user_can_edit_post_comments($user_id, $post_id, $blog_id = 1) { _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); // right now if one can edit a post, one can edit comments made on it return user_can_edit_post($user_id, $post_id, $blog_id); } /* returns true if $user_id can delete $post_id's comments */ /** * user_can_delete_post_comments() - Whether user can delete a post * * @since 1.5 * @deprecated Use current_user_can() * @see current_user_can() * * @param int $user_id * @param int $post_id * @param int $blog_id Not Used * @return bool */ function user_can_delete_post_comments($user_id, $post_id, $blog_id = 1) { _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); // right now if one can edit comments, one can delete comments return user_can_edit_post_comments($user_id, $post_id, $blog_id); } /** * user_can_edit_user() - Can user can edit other user * * @since 1.5 * @deprecated Use current_user_can() * @see current_user_can() * * @param int $user_id * @param int $other_user * @return bool */ function user_can_edit_user($user_id, $other_user) { _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); $user = get_userdata($user_id); $other = get_userdata($other_user); if ( $user->user_level > $other->user_level || $user->user_level > 8 || $user->ID == $other->ID ) return true; else return false; } /** * get_linksbyname() - Gets the links associated with category $cat_name. * * @since 0.71 * @deprecated Use get_links() * @see get_links() * * @param string $cat_name Optional. The category name to use. If no match is found uses all. * @param string $before Optional. The html to output before the link. * @param string $after Optional. The html to output after the link. * @param string $between Optional. The html to output between the link/image and it's description. Not used if no image or $show_images is true. * @param bool $show_images Optional. Whether to show images (if defined). * @param string $orderby Optional. The order to output the links. E.g. 'id', 'name', 'url', 'description' or 'rating'. Or maybe owner. * If you start the name with an underscore the order will be reversed. You can also specify 'rand' as the order which will return links in a * random order. * @param bool $show_description Optional. Whether to show the description if show_images=false/not defined. * @param bool $show_rating Optional. Show rating stars/chars. * @param int $limit Optional. Limit to X entries. If not specified, all entries are shown. * @param int $show_updated Optional. Whether to show last updated timestamp */ function get_linksbyname($cat_name = "noname", $before = '', $after = '
    ', $between = " ", $show_images = true, $orderby = 'id', $show_description = true, $show_rating = false, $limit = -1, $show_updated = 0) { _deprecated_function(__FUNCTION__, '0.0', 'get_links()'); $cat_id = -1; $cat = get_term_by('name', $cat_name, 'link_category'); if ( $cat ) $cat_id = $cat->term_id; get_links($cat_id, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated); } /** * wp_get_linksbyname() - Gets the links associated with the named category. * * @since 1.0.1 * @deprecated Use wp_get_links() * @see wp_get_links() * * @param string $category The category to use. * @param string $args * @return bool|null */ function wp_get_linksbyname($category, $args = '') { _deprecated_function(__FUNCTION__, '0.0', 'wp_get_links()'); $cat = get_term_by('name', $category, 'link_category'); if ( !$cat ) return false; $cat_id = $cat->term_id; $args = add_query_arg('category', $cat_id, $args); wp_get_links($args); } /** * get_linkobjectsbyname() - Gets an array of link objects associated with category $cat_name. * * * $links = get_linkobjectsbyname('fred'); * foreach ($links as $link) { * echo '
  • '.$link->link_name.'
  • '; * } *
    * * @since 1.0.1 * @deprecated Use get_linkobjects() * @see get_linkobjects() * * @param string $cat_name The category name to use. If no match is found uses all. * @param string $orderby The order to output the links. E.g. 'id', 'name', 'url', 'description', or 'rating'. * Or maybe owner. If you start the name with an underscore the order will be reversed. You can also * specify 'rand' as the order which will return links in a random order. * @param int $limit Limit to X entries. If not specified, all entries are shown. * @return unknown */ function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit = -1) { _deprecated_function(__FUNCTION__, '0.0', 'get_linkobjects()'); $cat_id = -1; $cat = get_term_by('name', $cat_name, 'link_category'); if ( $cat ) $cat_id = $cat->term_id; return get_linkobjects($cat_id, $orderby, $limit); } /** * get_linkobjects() - Gets an array of link objects associated with category n. * * Usage: * * $links = get_linkobjects(1); * if ($links) { * foreach ($links as $link) { * echo '
  • '.$link->link_name.'
    '.$link->link_description.'
  • '; * } * } *
    * * Fields are: *
      *
    1. link_id
    2. *
    3. link_url
    4. *
    5. link_name
    6. *
    7. link_image
    8. *
    9. link_target
    10. *
    11. link_category
    12. *
    13. link_description
    14. *
    15. link_visible
    16. *
    17. link_owner
    18. *
    19. link_rating
    20. *
    21. link_updated
    22. *
    23. link_rel
    24. *
    25. link_notes
    26. *
    * * @since 1.0.1 * @deprecated Use get_bookmarks() * @see get_bookmarks() * * @param int $category The category to use. If no category supplied uses all * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url', * 'description', or 'rating'. Or maybe owner. If you start the name with an * underscore the order will be reversed. You can also specify 'rand' as the * order which will return links in a random order. * @param int $limit Limit to X entries. If not specified, all entries are shown. * @return unknown */ function get_linkobjects($category = 0, $orderby = 'name', $limit = 0) { _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); $links = get_bookmarks("category=$category&orderby=$orderby&limit=$limit"); $links_array = array(); foreach ($links as $link) $links_array[] = $link; return $links_array; } /** * get_linksbyname_withrating() - Gets the links associated with category 'cat_name' and display rating stars/chars. * * @since 0.71 * @deprecated Use get_bookmarks() * @see get_bookmarks() * * @param string $cat_name The category name to use. If no match is found uses all * @param string $before The html to output before the link * @param string $after The html to output after the link * @param string $between The html to output between the link/image and it's description. Not used if no image or show_images is true * @param bool $show_images Whether to show images (if defined). * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url', * 'description', or 'rating'. Or maybe owner. If you start the name with an * underscore the order will be reversed. You can also specify 'rand' as the * order which will return links in a random order. * @param bool $show_description Whether to show the description if show_images=false/not defined * @param int $limit Limit to X entries. If not specified, all entries are shown. * @param int $show_updated Whether to show last updated timestamp */ function get_linksbyname_withrating($cat_name = "noname", $before = '', $after = '
    ', $between = " ", $show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) { _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); get_linksbyname($cat_name, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated); } /** * get_links_withrating() - Gets the links associated with category n and display rating stars/chars. * * @since 0.71 * @deprecated Use get_bookmarks() * @see get_bookmarks() * * @param int $category The category to use. If no category supplied uses all * @param string $before The html to output before the link * @param string $after The html to output after the link * @param string $between The html to output between the link/image and it's description. Not used if no image or show_images == true * @param bool $show_images Whether to show images (if defined). * @param string $orderby The order to output the links. E.g. 'id', 'name', 'url', * 'description', or 'rating'. Or maybe owner. If you start the name with an * underscore the order will be reversed. You can also specify 'rand' as the * order which will return links in a random order. * @param bool $show_description Whether to show the description if show_images=false/not defined. * @param string $limit Limit to X entries. If not specified, all entries are shown. * @param int $show_updated Whether to show last updated timestamp */ function get_links_withrating($category = -1, $before = '', $after = '
    ', $between = " ", $show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) { _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated); } /** * get_autotoggle() - Gets the auto_toggle setting * * @since 0.71 * @deprecated No alternative function available * * @param int $id The category to get. If no category supplied uses 0 * @return int Only returns 0. */ function get_autotoggle($id = 0) { _deprecated_function(__FUNCTION__, '0.0' ); return 0; } /** * @since 0.71 * @deprecated Use wp_list_categories() * @see wp_list_categories() * * @param int $optionall * @param string $all * @param string $sort_column * @param string $sort_order * @param string $file * @param bool $list * @param int $optiondates * @param int $optioncount * @param int $hide_empty * @param int $use_desc_for_title * @param bool $children * @param int $child_of * @param int $categories * @param int $recurse * @param string $feed * @param string $feed_image * @param string $exclude * @param bool $hierarchical * @return unknown */ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=false, $child_of=0, $categories=0, $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=false) { _deprecated_function(__FUNCTION__, '0.0', 'wp_list_categories()'); $query = compact('optionall', 'all', 'sort_column', 'sort_order', 'file', 'list', 'optiondates', 'optioncount', 'hide_empty', 'use_desc_for_title', 'children', 'child_of', 'categories', 'recurse', 'feed', 'feed_image', 'exclude', 'hierarchical'); return wp_list_cats($query); } /** * @since 1.2 * @deprecated Use wp_list_categories() * @see wp_list_categories() * * @param string|array $args * @return unknown */ function wp_list_cats($args = '') { _deprecated_function(__FUNCTION__, '0.0', 'wp_list_categories()'); $r = wp_parse_args( $args ); // Map to new names. if ( isset($r['optionall']) && isset($r['all'])) $r['show_option_all'] = $r['all']; if ( isset($r['sort_column']) ) $r['orderby'] = $r['sort_column']; if ( isset($r['sort_order']) ) $r['order'] = $r['sort_order']; if ( isset($r['optiondates']) ) $r['show_last_update'] = $r['optiondates']; if ( isset($r['optioncount']) ) $r['show_count'] = $r['optioncount']; if ( isset($r['list']) ) $r['style'] = $r['list'] ? 'list' : 'break'; $r['title_li'] = ''; return wp_list_categories($r); } /** * @since 0.71 * @deprecated Use wp_dropdown_categories() * @see wp_dropdown_categories() * * @param int $optionall * @param string $all * @param string $orderby * @param string $order * @param int $show_last_update * @param int $show_count * @param int $hide_empty * @param bool $optionnone * @param int $selected * @param int $exclude * @return unknown */ function dropdown_cats($optionall = 1, $all = 'All', $orderby = 'ID', $order = 'asc', $show_last_update = 0, $show_count = 0, $hide_empty = 1, $optionnone = false, $selected = 0, $exclude = 0) { _deprecated_function(__FUNCTION__, '0.0', 'wp_dropdown_categories()'); $show_option_all = ''; if ( $optionall ) $show_option_all = $all; $show_option_none = ''; if ( $optionnone ) $show_option_none = __('None'); $vars = compact('show_option_all', 'show_option_none', 'orderby', 'order', 'show_last_update', 'show_count', 'hide_empty', 'selected', 'exclude'); $query = add_query_arg($vars, ''); return wp_dropdown_categories($query); } /** * @since 2.1 * @deprecated Use wp_print_scripts() or WP_Scripts. * @see wp_print_scripts() * @see WP_Scripts */ function tinymce_include() { _deprecated_function(__FUNCTION__, '0.0', 'wp_print_scripts()/WP_Scripts'); wp_print_script('wp_tiny_mce'); } /** * @since 1.2 * @deprecated Use wp_list_authors() * @see wp_list_authors() * * @param bool $optioncount * @param bool $exclude_admin * @param bool $show_fullname * @param bool $hide_empty * @param string $feed * @param string $feed_image * @return unknown */ function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') { _deprecated_function(__FUNCTION__, '0.0', 'wp_list_authors()'); $args = compact('optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image'); return wp_list_authors($args); } /** * @since 1.0.1 * @deprecated Use wp_get_post_categories() * @see wp_get_post_categories() * * @param int $blogid Not Used * @param int $post_ID * @return unknown */ function wp_get_post_cats($blogid = '1', $post_ID = 0) { _deprecated_function(__FUNCTION__, '0.0', 'wp_get_post_categories()'); return wp_get_post_categories($post_ID); } /** * wp_set_post_cats() - Sets the categories that the post id belongs to. * * @since 1.0.1 * @deprecated Use wp_set_post_categories() * @see wp_set_post_categories() * * @param int $blogid Not used * @param int $post_ID * @param array $post_categories * @return unknown */ function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) { _deprecated_function(__FUNCTION__, '0.0', 'wp_set_post_categories()'); return wp_set_post_categories($post_ID, $post_categories); } /** * @since 0.71 * @deprecated Use wp_get_archives() * @see wp_get_archives() * * @param string $type * @param string $limit * @param string $format * @param string $before * @param string $after * @param bool $show_post_count * @return unknown */ function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) { _deprecated_function(__FUNCTION__, '0.0', 'wp_get_archives()'); $args = compact('type', 'limit', 'format', 'before', 'after', 'show_post_count'); return wp_get_archives($args); } /** * get_author_link() - Returns or Prints link to the author's posts * * @since 1.2 * @deprecated Use get_author_posts_url() * @see get_author_posts_url() * * @param bool $echo Optional. * @param int $author_id Required. * @param string $author_nicename Optional. * @return string|null */ function get_author_link($echo = false, $author_id, $author_nicename = '') { _deprecated_function(__FUNCTION__, '0.0', 'get_author_posts_url()'); $link = get_author_posts_url($author_id, $author_nicename); if ( $echo ) echo $link; return $link; } /** * link_pages() - Print list of pages based on arguments * * @since 0.71 * @deprecated Use wp_link_pages() * @see wp_link_pages() * * @param string $before * @param string $after * @param string $next_or_number * @param string $nextpagelink * @param string $previouspagelink * @param string $pagelink * @param string $more_file * @return string */ function link_pages($before='
    ', $after='
    ', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page', $pagelink='%', $more_file='') { _deprecated_function(__FUNCTION__, '0.0', 'wp_link_pages()'); $args = compact('before', 'after', 'next_or_number', 'nextpagelink', 'previouspagelink', 'pagelink', 'more_file'); return wp_link_pages($args); } /** * get_settings() - Get value based on option * * @since 0.71 * @deprecated Use get_option() * @see get_option() * * @param string $option * @return string */ function get_settings($option) { _deprecated_function(__FUNCTION__, '0.0', 'get_option()'); return get_option($option); } /** * permalink_link() - Print the permalink of the current post in the loop * * @since 0.71 * @deprecated Use the_permalink() * @see the_permalink() */ function permalink_link() { _deprecated_function(__FUNCTION__, '0.0', 'the_permalink()'); the_permalink(); } /** * permalink_single_rss() - Print the permalink to the RSS feed * * @since 0.71 * @deprecated Use the_permalink_rss() * @see the_permalink_rss() * * @param string $file */ function permalink_single_rss($deprecated = '') { _deprecated_function(__FUNCTION__, '0.0', 'the_permalink_rss()'); the_permalink_rss(); } /** * wp_get_links() - Gets the links associated with category. * * @see get_links() for argument information that can be used in $args * @since 1.0.1 * @deprecated Use get_bookmarks() * @see get_bookmarks() * * @param string $args a query string * @return null|string */ function wp_get_links($args = '') { _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); if ( strpos( $args, '=' ) === false ) { $cat_id = $args; $args = add_query_arg( 'category', $cat_id, $args ); } $defaults = array( 'category' => -1, 'before' => '', 'after' => '
    ', 'between' => ' ', 'show_images' => true, 'orderby' => 'name', 'show_description' => true, 'show_rating' => false, 'limit' => -1, 'show_updated' => true, 'echo' => true ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); return get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated, $echo); } /** * get_links() - Gets the links associated with category by id. * * @since 0.71 * @deprecated Use get_bookmarks() * @see get_bookmarks() * * @param int $category The category to use. If no category supplied uses all * @param string $before the html to output before the link * @param string $after the html to output after the link * @param string $between the html to output between the link/image and its description. * Not used if no image or show_images == true * @param bool $show_images whether to show images (if defined). * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url', * 'description', or 'rating'. Or maybe owner. If you start the name with an * underscore the order will be reversed. You can also specify 'rand' as the order * which will return links in a random order. * @param bool $show_description whether to show the description if show_images=false/not defined. * @param bool $show_rating show rating stars/chars * @param int $limit Limit to X entries. If not specified, all entries are shown. * @param int $show_updated whether to show last updated timestamp * @param bool $echo whether to echo the results, or return them instead * @return null|string */ function get_links($category = -1, $before = '', $after = '
    ', $between = ' ', $show_images = true, $orderby = 'name', $show_description = true, $show_rating = false, $limit = -1, $show_updated = 1, $echo = true) { _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); $order = 'ASC'; if ( substr($orderby, 0, 1) == '_' ) { $order = 'DESC'; $orderby = substr($orderby, 1); } if ( $category == -1 ) //get_bookmarks uses '' to signify all categories $category = ''; $results = get_bookmarks("category=$category&orderby=$orderby&order=$order&show_updated=$show_updated&limit=$limit"); if ( !$results ) return; $output = ''; foreach ( (array) $results as $row ) { if ( !isset($row->recently_updated) ) $row->recently_updated = false; $output .= $before; if ( $show_updated && $row->recently_updated ) $output .= get_option('links_recently_updated_prepend'); $the_link = '#'; if ( !empty($row->link_url) ) $the_link = clean_url($row->link_url); $rel = $row->link_rel; if ( '' != $rel ) $rel = ' rel="' . $rel . '"'; $desc = attribute_escape(sanitize_bookmark_field('link_description', $row->link_description, $row->link_id, 'display')); $name = attribute_escape(sanitize_bookmark_field('link_name', $row->link_name, $row->link_id, 'display')); $title = $desc; if ( $show_updated ) if (substr($row->link_updated_f, 0, 2) != '00') $title .= ' ('.__('Last updated') . ' ' . date(get_option('links_updated_date_format'), $row->link_updated_f + (get_option('gmt_offset') * 3600)) . ')'; if ( '' != $title ) $title = ' title="' . $title . '"'; $alt = ' alt="' . $name . '"'; $target = $row->link_target; if ( '' != $target ) $target = ' target="' . $target . '"'; $output .= ''; if ( $row->link_image != null && $show_images ) { if ( strpos($row->link_image, 'http') !== false ) $output .= "link_image\" $alt $title />"; else // If it's a relative path $output .= "link_image\" $alt $title />"; } else { $output .= $name; } $output .= ''; if ( $show_updated && $row->recently_updated ) $output .= get_option('links_recently_updated_append'); if ( $show_description && '' != $desc ) $output .= $between . $desc; if ($show_rating) { $output .= $between . get_linkrating($row); } $output .= "$after\n"; } // end while if ( !$echo ) return $output; echo $output; } /** * get_links_list() - Output entire list of links by category * * Output a list of all links, listed by category, using the * settings in $wpdb->linkcategories and output it as a nested * HTML unordered list. * * @author Dougal * @since 1.0.1 * @deprecated Use wp_list_bookmarks() * @see wp_list_bookmarks() * * @param string $order Sort link categories by 'name' or 'id' * @param string $$deprecated Not Used */ function get_links_list($order = 'name', $deprecated = '') { _deprecated_function(__FUNCTION__, '0.0', 'wp_list_bookmarks()'); $order = strtolower($order); // Handle link category sorting $direction = 'ASC'; if ( '_' == substr($order,0,1) ) { $direction = 'DESC'; $order = substr($order,1); } if ( !isset($direction) ) $direction = ''; $cats = get_categories("type=link&orderby=$order&order=$direction&hierarchical=0"); // Display each category if ( $cats ) { foreach ( (array) $cats as $cat ) { // Handle each category. // Display the category name echo '
  • ' . apply_filters('link_category', $cat->name ) . "

    \n\t
      \n"; // Call get_links() with all the appropriate params get_links($cat->term_id, '
    • ', "
    • ", "\n", true, 'name', false); // Close the last category echo "\n\t
    \n
  • \n"; } } } /** * links_popup_script() - Show the link to the links popup and the number of links * * @author Fullo * @link http://sprite.csr.unibo.it/fullo/ * * @since 0.71 * @deprecated {@internal Use function instead is unknown}} * * @param string $text the text of the link * @param int $width the width of the popup window * @param int $height the height of the popup window * @param string $file the page to open in the popup window * @param bool $count the number of links in the db */ function links_popup_script($text = 'Links', $width=400, $height=400, $file='links.all.php', $count = true) { _deprecated_function(__FUNCTION__, '0.0' ); if ( $count ) $counts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links"); $javascript = ""; $javascript .= $text; if ( $count ) $javascript .= " ($counts)"; $javascript .= "\n\n"; echo $javascript; } /** * @since 1.0.1 * @deprecated Use sanitize_bookmark_field() * @see sanitize_bookmark_field() * * @param object $link * @return unknown */ function get_linkrating($link) { _deprecated_function(__FUNCTION__, '0.0', 'sanitize_bookmark_field()'); return sanitize_bookmark_field('link_rating', $link->link_rating, $link->link_id, 'display'); } /** * get_linkcatname() - Gets the name of category by id. * * @since 0.71 * @deprecated Use get_category() * @see get_category() * * @param int $id The category to get. If no category supplied uses 0 * @return string */ function get_linkcatname($id = 0) { _deprecated_function(__FUNCTION__, '0.0', 'get_category()'); $id = (int) $id; if ( empty($id) ) return ''; $cats = wp_get_link_cats($id); if ( empty($cats) || ! is_array($cats) ) return ''; $cat_id = (int) $cats[0]; // Take the first cat. $cat = get_category($cat_id); return $cat->name; } /** * comment_rss_link() - Print RSS comment feed link * * @since 1.0.1 * @deprecated Use post_comments_feed_link() * @see post_comments_feed_link() * * @param string $link_text * @param string $deprecated Not used */ function comments_rss_link($link_text = 'Comments RSS', $deprecated = '') { _deprecated_function(__FUNCTION__, '0.0', 'post_comments_feed_link()'); post_comments_feed_link($link_text); } /** * get_category_rss_link() - Print/Return link to category RSS2 feed * * @since 1.2 * @deprecated Use get_category_feed_link() * @see get_category_feed_link() * * @param bool $echo * @param int $cat_ID * @param string $deprecated Not used * @return string|null */ function get_category_rss_link($echo = false, $cat_ID = 1, $deprecated = '') { _deprecated_function(__FUNCTION__, '0.0', 'get_category_feed_link()'); $link = get_category_feed_link($cat_ID, 'rss2'); if ( $echo ) echo $link; return $link; } /** * get_author_rss_link() - Print/Return link to author RSS feed * * @since 1.2 * @deprecated Use get_author_feed_link() * @see get_author_feed_link() * * @param bool $echo * @param int $author_id * @param string $deprecated Not used * @return string|null */ function get_author_rss_link($echo = false, $author_id = 1, $deprecated = '') { _deprecated_function(__FUNCTION__, '0.0', 'get_author_feed_link()'); $link = get_author_feed_link($author_id); if ( $echo ) echo $link; return $link; } /** * comments_rss() - Return link to the post RSS feed * * @since 1.5 * @deprecated Use get_post_comments_feed_link() * @see get_post_comments_feed_link() * * @param string $deprecated Not used * @return string */ function comments_rss($deprecated = '') { _deprecated_function(__FUNCTION__, '2.2', 'get_post_comments_feed_link()'); return get_post_comments_feed_link(); } /** * create_user() - An alias of wp_create_user(). * @param string $username The user's username. * @param string $password The user's password. * @param string $email The user's email (optional). * @return int The new user's ID. * @deprecated Use wp_create_user() * @see wp_create_user() */ function create_user($username, $password, $email) { _deprecated_function( __FUNCTION__, '2.0', 'wp_create_user()' ); return wp_create_user($username, $password, $email); } /** * documentation_link() - Unused Admin function * @since 2.0 * @param string $deprecated Unknown * @deprecated 2.5 */ function documentation_link( $deprecated = '' ) { _deprecated_function( __FUNCTION__, '2.5', '' ); return; } /** * gzip_compression() - Unused function * * @deprecated 2.5 */ function gzip_compression() { return false; } ?>wp/dev/wp-includes/wp-db.php0000644000106600010660000005743211035536022013166 0ustar __construct($dbuser, $dbpassword, $dbname, $dbhost); } /** * Connects to the database server and selects a database * * PHP5 style constructor for compatibility with PHP5. Does * the actual setting up of the class properties and connection * to the database. * * @since 2.0.8 * * @param string $dbuser MySQL database user * @param string $dbpassword MySQL database password * @param string $dbname MySQL database name * @param string $dbhost MySQL database host */ function __construct($dbuser, $dbpassword, $dbname, $dbhost) { register_shutdown_function(array(&$this, "__destruct")); if ( defined('WP_DEBUG') and WP_DEBUG == true ) $this->show_errors(); if ( defined('DB_CHARSET') ) $this->charset = DB_CHARSET; if ( defined('DB_COLLATE') ) $this->collate = DB_COLLATE; $this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword, true); if (!$this->dbh) { $this->bail(sprintf(/*WP_I18N_DB_CONN_ERROR*/"

    Error establishing a database connection

    This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at %s. This could mean your host's database server is down.

    • Are you sure you have the correct username and password?
    • Are you sure that you have typed the correct hostname?
    • Are you sure that the database server is running?

    If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

    "/*/WP_I18N_DB_CONN_ERROR*/, $dbhost)); return; } $this->ready = true; if ( $this->supports_collation() ) { $collation_query = ''; if ( !empty($this->charset) ) { $collation_query = "SET NAMES '{$this->charset}'"; if (!empty($this->collate) ) $collation_query .= " COLLATE '{$this->collate}'"; } if ( !empty($collation_query) ) $this->query($collation_query); } $this->select($dbname); } /** * PHP5 style destructor and will run when database object is destroyed. * * @since 2.0.8 * * @return bool Always true */ function __destruct() { return true; } /** * Sets the table prefix for the WordPress tables. * * Also allows for the CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE to * override the WordPress users and usersmeta tables. * * @since 2.5.0 * * @param string $prefix Alphanumeric name for the new prefix. * @return string Old prefix */ function set_prefix($prefix) { if ( preg_match('|[^a-z0-9_]|i', $prefix) ) return new WP_Error('invalid_db_prefix', /*WP_I18N_DB_BAD_PREFIX*/'Invalid database prefix'/*/WP_I18N_DB_BAD_PREFIX*/); $old_prefix = $this->prefix; $this->prefix = $prefix; foreach ( $this->tables as $table ) $this->$table = $this->prefix . $table; if ( defined('CUSTOM_USER_TABLE') ) $this->users = CUSTOM_USER_TABLE; if ( defined('CUSTOM_USER_META_TABLE') ) $this->usermeta = CUSTOM_USER_META_TABLE; return $old_prefix; } /** * Selects a database using the current database connection. * * The database name will be changed based on the current database * connection. On failure, the execution will bail and display an DB error. * * @since 0.71 * * @param string $db MySQL database name * @return null Always null. */ function select($db) { if (!@mysql_select_db($db, $this->dbh)) { $this->ready = false; $this->bail(sprintf(/*WP_I18N_DB_SELECT_DB*/'

    Can’t select database

    We were able to connect to the database server (which means your username and password is okay) but not able to select the %1$s database.

    • Are you sure it exists?
    • Does the user %2$s have permission to use the %1$s database?
    • On some systems the name of your database is prefixed with your username, so it would be like username_wordpress. Could that be the problem?

    If you don\'t know how to setup a database you should contact your host. If all else fails you may find help at the WordPress Support Forums.

    '/*/WP_I18N_DB_SELECT_DB*/, $db, DB_USER)); return; } } /** * Escapes content for insertion into the database, for security * * @since 0.71 * * @param string $string * @return string query safe string */ function escape($string) { return addslashes( $string ); // Disable rest for now, causing problems /* if( !$this->dbh || version_compare( phpversion(), '4.3.0' ) == '-1' ) return mysql_escape_string( $string ); else return mysql_real_escape_string( $string, $this->dbh ); */ } /** * Escapes content by reference for insertion into the database, for security * * @since 2.3.0 * * @param string $s */ function escape_by_ref(&$s) { $s = $this->escape($s); } /** * Prepares a SQL query for safe use, using sprintf() syntax. * * @link http://php.net/sprintf See for syntax to use for query string. * @since 2.3.0 * * @param null|string $args If string, first parameter must be query statement * @param mixed $args,... If additional parameters, they will be set inserted into the query. * @return null|string Sanitized query string */ function prepare($args=null) { if ( is_null( $args ) ) return; $args = func_get_args(); $query = array_shift($args); $query = str_replace("'%s'", '%s', $query); // in case someone mistakenly already singlequoted it $query = str_replace('"%s"', '%s', $query); // doublequote unquoting $query = str_replace('%s', "'%s'", $query); // quote the strings array_walk($args, array(&$this, 'escape_by_ref')); return @vsprintf($query, $args); } /** * Print SQL/DB error. * * @since 0.71 * @global array $EZSQL_ERROR Stores error information of query and error string * * @param string $str The error to display * @return bool False if the showing of errors is disabled. */ function print_error($str = '') { global $EZSQL_ERROR; if (!$str) $str = mysql_error($this->dbh); $EZSQL_ERROR[] = array ('query' => $this->last_query, 'error_str' => $str); if ( $this->suppress_errors ) return false; if ( $caller = $this->get_caller() ) $error_str = sprintf(/*WP_I18N_DB_QUERY_ERROR_FULL*/'WordPress database error %1$s for query %2$s made by %3$s'/*/WP_I18N_DB_QUERY_ERROR_FULL*/, $str, $this->last_query, $caller); else $error_str = sprintf(/*WP_I18N_DB_QUERY_ERROR*/'WordPress database error %1$s for query %2$s'/*/WP_I18N_DB_QUERY_ERROR*/, $str, $this->last_query); $log_error = true; if ( ! function_exists('error_log') ) $log_error = false; $log_file = @ini_get('error_log'); if ( !empty($log_file) && ('syslog' != $log_file) && !is_writable($log_file) ) $log_error = false; if ( $log_error ) @error_log($error_str, 0); // Is error output turned on or not.. if ( !$this->show_errors ) return false; $str = htmlspecialchars($str, ENT_QUOTES); $query = htmlspecialchars($this->last_query, ENT_QUOTES); // If there is an error then take note of it print "

    WordPress database error: [$str]
    $query

    "; } /** * Enables showing of database errors. * * This function should be used only to enable showing of errors. * wpdb::hide_errors() should be used instead for hiding of errors. However, * this function can be used to enable and disable showing of database * errors. * * @since 0.71 * * @param bool $show Whether to show or hide errors * @return bool Old value for showing errors. */ function show_errors( $show = true ) { $errors = $this->show_errors; $this->show_errors = $show; return $errors; } /** * Disables showing of database errors. * * @since 0.71 * * @return bool Whether showing of errors was active or not */ function hide_errors() { $show = $this->show_errors; $this->show_errors = false; return $show; } /** * Whether to suppress database errors. * * @param unknown_type $suppress * @return unknown */ function suppress_errors( $suppress = true ) { $errors = $this->suppress_errors; $this->suppress_errors = $suppress; return $errors; } /** * Kill cached query results. * * @since 0.71 */ function flush() { $this->last_result = array(); $this->col_info = null; $this->last_query = null; } /** * Perform a MySQL database query, using current database connection. * * More information can be found on the codex page. * * @since 0.71 * * @param string $query * @return unknown */ function query($query) { if ( ! $this->ready ) return false; // filter the query, if filters are available // NOTE: some queries are made before the plugins have been loaded, and thus cannot be filtered with this method if ( function_exists('apply_filters') ) $query = apply_filters('query', $query); // initialise return $return_val = 0; $this->flush(); // Log how the function was called $this->func_call = "\$db->query(\"$query\")"; // Keep track of the last query for debug.. $this->last_query = $query; // Perform the query via std mysql_query function.. if ( defined('SAVEQUERIES') && SAVEQUERIES ) $this->timer_start(); $this->result = @mysql_query($query, $this->dbh); ++$this->num_queries; if ( defined('SAVEQUERIES') && SAVEQUERIES ) $this->queries[] = array( $query, $this->timer_stop(), $this->get_caller() ); // If there is an error then take note of it.. if ( $this->last_error = mysql_error($this->dbh) ) { $this->print_error(); return false; } if ( preg_match("/^\\s*(insert|delete|update|replace) /i",$query) ) { $this->rows_affected = mysql_affected_rows($this->dbh); // Take note of the insert_id if ( preg_match("/^\\s*(insert|replace) /i",$query) ) { $this->insert_id = mysql_insert_id($this->dbh); } // Return number of rows affected $return_val = $this->rows_affected; } else { $i = 0; while ($i < @mysql_num_fields($this->result)) { $this->col_info[$i] = @mysql_fetch_field($this->result); $i++; } $num_rows = 0; while ( $row = @mysql_fetch_object($this->result) ) { $this->last_result[$num_rows] = $row; $num_rows++; } @mysql_free_result($this->result); // Log number of rows the query returned $this->num_rows = $num_rows; // Return number of rows selected $return_val = $this->num_rows; } return $return_val; } /** * Insert an array of data into a table. * * @since 2.5.0 * * @param string $table WARNING: not sanitized! * @param array $data Should not already be SQL-escaped * @return mixed Results of $this->query() */ function insert($table, $data) { $data = add_magic_quotes($data); $fields = array_keys($data); return $this->query("INSERT INTO $table (`" . implode('`,`',$fields) . "`) VALUES ('".implode("','",$data)."')"); } /** * Update a row in the table with an array of data. * * @since 2.5.0 * * @param string $table WARNING: not sanitized! * @param array $data Should not already be SQL-escaped * @param array $where A named array of WHERE column => value relationships. Multiple member pairs will be joined with ANDs. WARNING: the column names are not currently sanitized! * @return mixed Results of $this->query() */ function update($table, $data, $where){ $data = add_magic_quotes($data); $bits = $wheres = array(); foreach ( array_keys($data) as $k ) $bits[] = "`$k` = '$data[$k]'"; if ( is_array( $where ) ) foreach ( $where as $c => $v ) $wheres[] = "$c = '" . $this->escape( $v ) . "'"; else return false; return $this->query( "UPDATE $table SET " . implode( ', ', $bits ) . ' WHERE ' . implode( ' AND ', $wheres ) ); } /** * Retrieve one variable from the database. * * This combines the functionality of wpdb::get_row() and wpdb::get_col(), * so both the column and row can be picked. * * It is possible to use this function without executing more queries. If * you already made a query, you can set the $query to 'null' value and just * retrieve either the column and row of the last query result. * * @since 0.71 * * @param string $query Can be null as well, for caching * @param int $x Column num to return * @param int $y Row num to return * @return mixed Database query results */ function get_var($query=null, $x = 0, $y = 0) { $this->func_call = "\$db->get_var(\"$query\",$x,$y)"; if ( $query ) $this->query($query); // Extract var out of cached results based x,y vals if ( !empty( $this->last_result[$y] ) ) { $values = array_values(get_object_vars($this->last_result[$y])); } // If there is a value return it else return null return (isset($values[$x]) && $values[$x]!=='') ? $values[$x] : null; } /** * Retrieve one row from the database. * * @since 0.71 * * @param string $query SQL query * @param string $output ARRAY_A | ARRAY_N | OBJECT * @param int $y Row num to return * @return mixed Database query results */ function get_row($query = null, $output = OBJECT, $y = 0) { $this->func_call = "\$db->get_row(\"$query\",$output,$y)"; if ( $query ) $this->query($query); else return null; if ( !isset($this->last_result[$y]) ) return null; if ( $output == OBJECT ) { return $this->last_result[$y] ? $this->last_result[$y] : null; } elseif ( $output == ARRAY_A ) { return $this->last_result[$y] ? get_object_vars($this->last_result[$y]) : null; } elseif ( $output == ARRAY_N ) { return $this->last_result[$y] ? array_values(get_object_vars($this->last_result[$y])) : null; } else { $this->print_error(/*WP_I18N_DB_GETROW_ERROR*/" \$db->get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N"/*/WP_I18N_DB_GETROW_ERROR*/); } } /** * Retrieve one column from the database. * * @since 0.71 * * @param string $query Can be null as well, for caching * @param int $x Col num to return. Starts from 0. * @return array Column results */ function get_col($query = null , $x = 0) { if ( $query ) $this->query($query); $new_array = array(); // Extract the column values for ( $i=0; $i < count($this->last_result); $i++ ) { $new_array[$i] = $this->get_var(null, $x, $i); } return $new_array; } /** * Retrieve an entire result set from the database. * * @since 0.71 * * @param string|null $query Can also be null to pull from the cache * @param string $output ARRAY_A | ARRAY_N | OBJECT_K | OBJECT * @return mixed Database query results */ function get_results($query = null, $output = OBJECT) { $this->func_call = "\$db->get_results(\"$query\", $output)"; if ( $query ) $this->query($query); else return null; if ( $output == OBJECT ) { // Return an integer-keyed array of row objects return $this->last_result; } elseif ( $output == OBJECT_K ) { // Return an array of row objects with keys from column 1 // (Duplicates are discarded) foreach ( $this->last_result as $row ) { $key = array_shift( get_object_vars( $row ) ); if ( !isset( $new_array[ $key ] ) ) $new_array[ $key ] = $row; } return $new_array; } elseif ( $output == ARRAY_A || $output == ARRAY_N ) { // Return an integer-keyed array of... if ( $this->last_result ) { $i = 0; foreach( $this->last_result as $row ) { if ( $output == ARRAY_N ) { // ...integer-keyed row arrays $new_array[$i] = array_values( get_object_vars( $row ) ); } else { // ...column name-keyed row arrays $new_array[$i] = get_object_vars( $row ); } ++$i; } return $new_array; } } } /** * Retrieve column metadata from the last query. * * @since 0.71 * * @param string $info_type one of name, table, def, max_length, not_null, primary_key, multiple_key, unique_key, numeric, blob, type, unsigned, zerofill * @param int $col_offset 0: col name. 1: which table the col's in. 2: col's max length. 3: if the col is numeric. 4: col's type * @return mixed Column Results */ function get_col_info($info_type = 'name', $col_offset = -1) { if ( $this->col_info ) { if ( $col_offset == -1 ) { $i = 0; foreach($this->col_info as $col ) { $new_array[$i] = $col->{$info_type}; $i++; } return $new_array; } else { return $this->col_info[$col_offset]->{$info_type}; } } } /** * Starts the timer, for debugging purposes. * * @since 1.5.0 * * @return bool Always returns true */ function timer_start() { $mtime = microtime(); $mtime = explode(' ', $mtime); $this->time_start = $mtime[1] + $mtime[0]; return true; } /** * Stops the debugging timer. * * @since 1.5.0 * * @return int Total time spent on the query, in milliseconds */ function timer_stop() { $mtime = microtime(); $mtime = explode(' ', $mtime); $time_end = $mtime[1] + $mtime[0]; $time_total = $time_end - $this->time_start; return $time_total; } /** * Wraps fatal errors in a nice header and footer and dies. * * @since 1.5.0 * * @param string $message * @return unknown */ function bail($message) { if ( !$this->show_errors ) { if ( class_exists('WP_Error') ) $this->error = new WP_Error('500', $message); else $this->error = $message; return false; } wp_die($message); } /** * Whether or not MySQL database is minimal required version. * * @since 2.5.0 * @uses $wp_version * * @return WP_Error */ function check_database_version() { global $wp_version; // Make sure the server has MySQL 4.0 $mysql_version = preg_replace('|[^0-9\.]|', '', @mysql_get_server_info($this->dbh)); if ( version_compare($mysql_version, '4.0.0', '<') ) return new WP_Error('database_version',sprintf(__('ERROR: WordPress %s requires MySQL 4.0.0 or higher'), $wp_version)); } /** * Whether of not the database version supports collation. * * Called when WordPress is generating the table scheme. * * @since 2.5.0 * * @return bool True if collation is supported, false if version does not */ function supports_collation() { return ( version_compare(mysql_get_server_info($this->dbh), '4.1.0', '>=') ); } /** * Retrieve the name of the function that called wpdb. * * Requires PHP 4.3 and searches up the list of functions until it reaches * the one that would most logically had called this method. * * @since 2.5.0 * * @return string The name of the calling function */ function get_caller() { // requires PHP 4.3+ if ( !is_callable('debug_backtrace') ) return ''; $bt = debug_backtrace(); $caller = ''; foreach ( $bt as $trace ) { if ( @$trace['class'] == __CLASS__ ) continue; elseif ( strtolower(@$trace['function']) == 'call_user_func_array' ) continue; elseif ( strtolower(@$trace['function']) == 'apply_filters' ) continue; elseif ( strtolower(@$trace['function']) == 'do_action' ) continue; $caller = $trace['function']; break; } return $caller; } } if ( ! isset($wpdb) ) { /** * WordPress Database Object, if it isn't set already in wp-content/wpdb.php * @global object $wpdb Creates a new wpdb object based on wp-config.php Constants for the database * @since 0.71 */ $wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST); } ?> wp/dev/wp-includes/compat.php0000644000106600010660000000520510763064023013433 0ustar $v ) { if ( $urlencode) $k = urlencode($k); if ( is_int($k) && $prefix != null ) $k = $prefix.$k; if ( !empty($key) ) $k = $key . '%5B' . $k . '%5D'; if ( $v === NULL ) continue; elseif ( $v === FALSE ) $v = '0'; if ( is_array($v) || is_object($v) ) array_push($ret,_http_build_query($v, '', $sep, $k, $urlencode)); elseif ( $urlencode ) array_push($ret, $k.'='.urlencode($v)); else array_push($ret, $k.'='.$v); } if ( NULL === $sep ) $sep = ini_get('arg_separator.output'); return implode($sep, $ret); } if ( !function_exists('_') ) { function _($string) { return $string; } } if (!function_exists('stripos')) { function stripos($haystack, $needle, $offset = 0) { return strpos(strtolower($haystack), strtolower($needle), $offset); } } if ( ! function_exists('hash_hmac') ): function hash_hmac($algo, $data, $key, $raw_output = false) { $packs = array('md5' => 'H32', 'sha1' => 'H40'); if ( !isset($packs[$algo]) ) return false; $pack = $packs[$algo]; if (strlen($key) > 64) $key = pack($pack, $algo($key)); else if (strlen($key) < 64) $key = str_pad($key, 64, chr(0)); $ipad = (substr($key, 0, 64) ^ str_repeat(chr(0x36), 64)); $opad = (substr($key, 0, 64) ^ str_repeat(chr(0x5C), 64)); return $algo($opad . pack($pack, $algo($ipad . $data))); } endif; if ( ! function_exists('mb_strcut') ): function mb_strcut( $str, $start, $length=null, $encoding=null ) { return _mb_strcut($str, $start, $length, $encoding); } endif; function _mb_strcut( $str, $start, $length=null, $encoding=null ) { // the solution below, works only for utf-8, so in case of a different // charset, just use built-in substr $charset = get_option( 'blog_charset' ); if ( !in_array( $charset, array('utf8', 'utf-8', 'UTF8', 'UTF-8') ) ) { return is_null( $length )? substr( $str, $start ) : substr( $str, $start, $length); } // use the regex unicode support to separate the UTF-8 characters into an array preg_match_all( '/./us', $str, $match ); $chars = is_null( $length )? array_slice( $match[0], $start ) : array_slice( $match[0], $start, $length ); return implode( '', $chars ); } ?> wp/dev/wp-includes/formatting.php0000644000106600010660000013246011035042013014312 0ustar |\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE); $stop = count($textarr); // if a plugin has provided an autocorrect array, use it if ( isset($wp_cockneyreplace) ) { $cockney = array_keys($wp_cockneyreplace); $cockneyreplace = array_values($wp_cockneyreplace); } else { $cockney = array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round","'cause"); $cockneyreplace = array("’tain’t","’twere","’twas","’tis","’twill","’til","’bout","’nuff","’round","’cause"); } $static_characters = array_merge(array('---', ' -- ', '--', 'xn–', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney); $static_replacements = array_merge(array('—', ' — ', '–', 'xn--', '…', '“', '’s', '”', ' ™'), $cockneyreplace); $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A)"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/'); $dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1“$2', '”$1', '’$1', '$1×$2'); for ( $i = 0; $i < $stop; $i++ ) { $curl = $textarr[$i]; if (isset($curl{0}) && '<' != $curl{0} && '[' != $curl{0} && $next && !$has_pre_parent) { // If it's not a tag // static strings $curl = str_replace($static_characters, $static_replacements, $curl); // regular expressions $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl); } elseif (strpos($curl, '') !== false) { $has_pre_parent = false; } else { $next = true; } $curl = preg_replace('/&([^#])(?![a-zA-Z1-4]{1,8};)/', '&$1', $curl); $output .= $curl; } return $output; } // Accepts matches array from preg_replace_callback in wpautop() // or a string function clean_pre($matches) { if ( is_array($matches) ) $text = $matches[1] . $matches[2] . ""; else $text = $matches; $text = str_replace('
    ', '', $text); $text = str_replace('

    ', "\n", $text); $text = str_replace('

    ', '', $text); return $text; } function wpautop($pee, $br = 1) { $pee = $pee . "\n"; // just to make things a little easier, pad the end $pee = preg_replace('|
    \s*
    |', "\n\n", $pee); // Space things out a little $allblocks = '(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr)'; $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee); $pee = preg_replace('!()!', "$1\n\n", $pee); $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines if ( strpos($pee, ']*)>\s*|', "", $pee); // no pee inside object/embed $pee = preg_replace('|\s*\s*|', '', $pee); } $pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates $pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "

    $1

    \n", $pee); // make paragraphs, including one at the end $pee = preg_replace('|

    \s*?

    |', '', $pee); // under certain strange conditions it could create a P of entirely whitespace $pee = preg_replace('!

    ([^<]+)\s*?(]*>)!', "

    $1

    $2", $pee); $pee = preg_replace( '|

    |', "$1

    ", $pee ); $pee = preg_replace('!

    \s*(]*>)\s*

    !', "$1", $pee); // don't pee all over a tag $pee = preg_replace("|

    (|", "$1", $pee); // problem with nested lists $pee = preg_replace('|

    ]*)>|i', "

    ", $pee); $pee = str_replace('

    ', '

    ', $pee); $pee = preg_replace('!

    \s*(]*>)!', "$1", $pee); $pee = preg_replace('!(]*>)\s*

    !', "$1", $pee); if ($br) { $pee = preg_replace_callback('/<(script|style).*?<\/\\1>/s', create_function('$matches', 'return str_replace("\n", "", $matches[0]);'), $pee); $pee = preg_replace('|(?)\s*\n|', "
    \n", $pee); // optionally make line breaks $pee = str_replace('', "\n", $pee); } $pee = preg_replace('!(]*>)\s*
    !', "$1", $pee); $pee = preg_replace('!
    (\s*]*>)!', '$1', $pee); if (strpos($pee, ')(.*?)!is', 'clean_pre', $pee ); $pee = preg_replace( "|\n

    $|", '

    ', $pee ); $pee = preg_replace('/

    \s*?(' . get_shortcode_regex() . ')\s*<\/p>/s', '$1', $pee); // don't auto-p wrap shortcodes that stand alone return $pee; } function seems_utf8($Str) { # by bmorel at ssi dot fr $length = strlen($Str); for ($i=0; $i < $length; $i++) { if (ord($Str[$i]) < 0x80) continue; # 0bbbbbbb elseif ((ord($Str[$i]) & 0xE0) == 0xC0) $n=1; # 110bbbbb elseif ((ord($Str[$i]) & 0xF0) == 0xE0) $n=2; # 1110bbbb elseif ((ord($Str[$i]) & 0xF8) == 0xF0) $n=3; # 11110bbb elseif ((ord($Str[$i]) & 0xFC) == 0xF8) $n=4; # 111110bb elseif ((ord($Str[$i]) & 0xFE) == 0xFC) $n=5; # 1111110b else return false; # Does not match any model for ($j=0; $j<$n; $j++) { # n bytes matching 10bbbbbb follow ? if ((++$i == $length) || ((ord($Str[$i]) & 0xC0) != 0x80)) return false; } } return true; } function wp_specialchars( $text, $quotes = 0 ) { // Like htmlspecialchars except don't double-encode HTML entities $text = str_replace('&&', '&&', $text); $text = str_replace('&&', '&&', $text); $text = preg_replace('/&(?:$|([^#])(?![a-z1-4]{1,8};))/', '&$1', $text); $text = str_replace('<', '<', $text); $text = str_replace('>', '>', $text); if ( 'double' === $quotes ) { $text = str_replace('"', '"', $text); } elseif ( 'single' === $quotes ) { $text = str_replace("'", ''', $text); } elseif ( $quotes ) { $text = str_replace('"', '"', $text); $text = str_replace("'", ''', $text); } return $text; } function utf8_uri_encode( $utf8_string, $length = 0 ) { $unicode = ''; $values = array(); $num_octets = 1; $unicode_length = 0; $string_length = strlen( $utf8_string ); for ($i = 0; $i < $string_length; $i++ ) { $value = ord( $utf8_string[ $i ] ); if ( $value < 128 ) { if ( $length && ( $unicode_length >= $length ) ) break; $unicode .= chr($value); $unicode_length++; } else { if ( count( $values ) == 0 ) $num_octets = ( $value < 224 ) ? 2 : 3; $values[] = $value; if ( $length && ( $unicode_length + ($num_octets * 3) ) > $length ) break; if ( count( $values ) == $num_octets ) { if ($num_octets == 3) { $unicode .= '%' . dechex($values[0]) . '%' . dechex($values[1]) . '%' . dechex($values[2]); $unicode_length += 9; } else { $unicode .= '%' . dechex($values[0]) . '%' . dechex($values[1]); $unicode_length += 6; } $values = array(); $num_octets = 1; } } } return $unicode; } function remove_accents($string) { if ( !preg_match('/[\x80-\xff]/', $string) ) return $string; if (seems_utf8($string)) { $chars = array( // Decompositions for Latin-1 Supplement chr(195).chr(128) => 'A', chr(195).chr(129) => 'A', chr(195).chr(130) => 'A', chr(195).chr(131) => 'A', chr(195).chr(132) => 'A', chr(195).chr(133) => 'A', chr(195).chr(135) => 'C', chr(195).chr(136) => 'E', chr(195).chr(137) => 'E', chr(195).chr(138) => 'E', chr(195).chr(139) => 'E', chr(195).chr(140) => 'I', chr(195).chr(141) => 'I', chr(195).chr(142) => 'I', chr(195).chr(143) => 'I', chr(195).chr(145) => 'N', chr(195).chr(146) => 'O', chr(195).chr(147) => 'O', chr(195).chr(148) => 'O', chr(195).chr(149) => 'O', chr(195).chr(150) => 'O', chr(195).chr(153) => 'U', chr(195).chr(154) => 'U', chr(195).chr(155) => 'U', chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y', chr(195).chr(159) => 's', chr(195).chr(160) => 'a', chr(195).chr(161) => 'a', chr(195).chr(162) => 'a', chr(195).chr(163) => 'a', chr(195).chr(164) => 'a', chr(195).chr(165) => 'a', chr(195).chr(167) => 'c', chr(195).chr(168) => 'e', chr(195).chr(169) => 'e', chr(195).chr(170) => 'e', chr(195).chr(171) => 'e', chr(195).chr(172) => 'i', chr(195).chr(173) => 'i', chr(195).chr(174) => 'i', chr(195).chr(175) => 'i', chr(195).chr(177) => 'n', chr(195).chr(178) => 'o', chr(195).chr(179) => 'o', chr(195).chr(180) => 'o', chr(195).chr(181) => 'o', chr(195).chr(182) => 'o', chr(195).chr(182) => 'o', chr(195).chr(185) => 'u', chr(195).chr(186) => 'u', chr(195).chr(187) => 'u', chr(195).chr(188) => 'u', chr(195).chr(189) => 'y', chr(195).chr(191) => 'y', // Decompositions for Latin Extended-A chr(196).chr(128) => 'A', chr(196).chr(129) => 'a', chr(196).chr(130) => 'A', chr(196).chr(131) => 'a', chr(196).chr(132) => 'A', chr(196).chr(133) => 'a', chr(196).chr(134) => 'C', chr(196).chr(135) => 'c', chr(196).chr(136) => 'C', chr(196).chr(137) => 'c', chr(196).chr(138) => 'C', chr(196).chr(139) => 'c', chr(196).chr(140) => 'C', chr(196).chr(141) => 'c', chr(196).chr(142) => 'D', chr(196).chr(143) => 'd', chr(196).chr(144) => 'D', chr(196).chr(145) => 'd', chr(196).chr(146) => 'E', chr(196).chr(147) => 'e', chr(196).chr(148) => 'E', chr(196).chr(149) => 'e', chr(196).chr(150) => 'E', chr(196).chr(151) => 'e', chr(196).chr(152) => 'E', chr(196).chr(153) => 'e', chr(196).chr(154) => 'E', chr(196).chr(155) => 'e', chr(196).chr(156) => 'G', chr(196).chr(157) => 'g', chr(196).chr(158) => 'G', chr(196).chr(159) => 'g', chr(196).chr(160) => 'G', chr(196).chr(161) => 'g', chr(196).chr(162) => 'G', chr(196).chr(163) => 'g', chr(196).chr(164) => 'H', chr(196).chr(165) => 'h', chr(196).chr(166) => 'H', chr(196).chr(167) => 'h', chr(196).chr(168) => 'I', chr(196).chr(169) => 'i', chr(196).chr(170) => 'I', chr(196).chr(171) => 'i', chr(196).chr(172) => 'I', chr(196).chr(173) => 'i', chr(196).chr(174) => 'I', chr(196).chr(175) => 'i', chr(196).chr(176) => 'I', chr(196).chr(177) => 'i', chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij', chr(196).chr(180) => 'J', chr(196).chr(181) => 'j', chr(196).chr(182) => 'K', chr(196).chr(183) => 'k', chr(196).chr(184) => 'k', chr(196).chr(185) => 'L', chr(196).chr(186) => 'l', chr(196).chr(187) => 'L', chr(196).chr(188) => 'l', chr(196).chr(189) => 'L', chr(196).chr(190) => 'l', chr(196).chr(191) => 'L', chr(197).chr(128) => 'l', chr(197).chr(129) => 'L', chr(197).chr(130) => 'l', chr(197).chr(131) => 'N', chr(197).chr(132) => 'n', chr(197).chr(133) => 'N', chr(197).chr(134) => 'n', chr(197).chr(135) => 'N', chr(197).chr(136) => 'n', chr(197).chr(137) => 'N', chr(197).chr(138) => 'n', chr(197).chr(139) => 'N', chr(197).chr(140) => 'O', chr(197).chr(141) => 'o', chr(197).chr(142) => 'O', chr(197).chr(143) => 'o', chr(197).chr(144) => 'O', chr(197).chr(145) => 'o', chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe', chr(197).chr(148) => 'R',chr(197).chr(149) => 'r', chr(197).chr(150) => 'R',chr(197).chr(151) => 'r', chr(197).chr(152) => 'R',chr(197).chr(153) => 'r', chr(197).chr(154) => 'S',chr(197).chr(155) => 's', chr(197).chr(156) => 'S',chr(197).chr(157) => 's', chr(197).chr(158) => 'S',chr(197).chr(159) => 's', chr(197).chr(160) => 'S', chr(197).chr(161) => 's', chr(197).chr(162) => 'T', chr(197).chr(163) => 't', chr(197).chr(164) => 'T', chr(197).chr(165) => 't', chr(197).chr(166) => 'T', chr(197).chr(167) => 't', chr(197).chr(168) => 'U', chr(197).chr(169) => 'u', chr(197).chr(170) => 'U', chr(197).chr(171) => 'u', chr(197).chr(172) => 'U', chr(197).chr(173) => 'u', chr(197).chr(174) => 'U', chr(197).chr(175) => 'u', chr(197).chr(176) => 'U', chr(197).chr(177) => 'u', chr(197).chr(178) => 'U', chr(197).chr(179) => 'u', chr(197).chr(180) => 'W', chr(197).chr(181) => 'w', chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y', chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z', chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z', chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z', chr(197).chr(190) => 'z', chr(197).chr(191) => 's', // Euro Sign chr(226).chr(130).chr(172) => 'E', // GBP (Pound) Sign chr(194).chr(163) => ''); $string = strtr($string, $chars); } else { // Assume ISO-8859-1 if not UTF-8 $chars['in'] = chr(128).chr(131).chr(138).chr(142).chr(154).chr(158) .chr(159).chr(162).chr(165).chr(181).chr(192).chr(193).chr(194) .chr(195).chr(196).chr(197).chr(199).chr(200).chr(201).chr(202) .chr(203).chr(204).chr(205).chr(206).chr(207).chr(209).chr(210) .chr(211).chr(212).chr(213).chr(214).chr(216).chr(217).chr(218) .chr(219).chr(220).chr(221).chr(224).chr(225).chr(226).chr(227) .chr(228).chr(229).chr(231).chr(232).chr(233).chr(234).chr(235) .chr(236).chr(237).chr(238).chr(239).chr(241).chr(242).chr(243) .chr(244).chr(245).chr(246).chr(248).chr(249).chr(250).chr(251) .chr(252).chr(253).chr(255); $chars['out'] = "EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy"; $string = strtr($string, $chars['in'], $chars['out']); $double_chars['in'] = array(chr(140), chr(156), chr(198), chr(208), chr(222), chr(223), chr(230), chr(240), chr(254)); $double_chars['out'] = array('OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th'); $string = str_replace($double_chars['in'], $double_chars['out'], $string); } return $string; } function sanitize_file_name( $name ) { // Like sanitize_title, but with periods $name = strtolower( $name ); $name = preg_replace('/&.+?;/', '', $name); // kill entities $name = str_replace( '_', '-', $name ); $name = preg_replace('/[^a-z0-9\s-.]/', '', $name); $name = preg_replace('/\s+/', '-', $name); $name = preg_replace('|-+|', '-', $name); $name = trim($name, '-'); return $name; } function sanitize_user( $username, $strict = false ) { $raw_username = $username; $username = strip_tags($username); // Kill octets $username = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '', $username); $username = preg_replace('/&.+?;/', '', $username); // Kill entities // If strict, reduce to ASCII for max portability. if ( $strict ) $username = preg_replace('|[^a-z0-9 _.\-@]|i', '', $username); return apply_filters('sanitize_user', $username, $raw_username, $strict); } function sanitize_title($title, $fallback_title = '') { $title = strip_tags($title); $title = apply_filters('sanitize_title', $title); if ( '' === $title || false === $title ) $title = $fallback_title; return $title; } function sanitize_title_with_dashes($title) { $title = strip_tags($title); // Preserve escaped octets. $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title); // Remove percent signs that are not part of an octet. $title = str_replace('%', '', $title); // Restore octets. $title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title); $title = remove_accents($title); if (seems_utf8($title)) { if (function_exists('mb_strtolower')) { $title = mb_strtolower($title, 'UTF-8'); } $title = utf8_uri_encode($title, 200); } $title = strtolower($title); $title = preg_replace('/&.+?;/', '', $title); // kill entities $title = preg_replace('/[^%a-z0-9 _-]/', '', $title); $title = preg_replace('/\s+/', '-', $title); $title = preg_replace('|-+|', '-', $title); $title = trim($title, '-'); return $title; } // ensures a string is a valid SQL order by clause like: post_name ASC, ID DESC // accepts one or more columns, with or without ASC/DESC, and also accepts RAND() function sanitize_sql_orderby( $orderby ){ preg_match('/^\s*([a-z0-9_]+(\s+(ASC|DESC))?(\s*,\s*|\s*$))+|^\s*RAND\(\s*\)\s*$/i', $orderby, $obmatches); if ( !$obmatches ) return false; return $orderby; } function convert_chars($content, $deprecated = '') { // Translation of invalid Unicode references range to valid range $wp_htmltranswinuni = array( '€' => '€', // the Euro sign '' => '', '‚' => '‚', // these are Windows CP1252 specific characters 'ƒ' => 'ƒ', // they would look weird on non-Windows browsers '„' => '„', '…' => '…', '†' => '†', '‡' => '‡', 'ˆ' => 'ˆ', '‰' => '‰', 'Š' => 'Š', '‹' => '‹', 'Œ' => 'Œ', '' => '', 'Ž' => 'ž', '' => '', '' => '', '‘' => '‘', '’' => '’', '“' => '“', '”' => '”', '•' => '•', '–' => '–', '—' => '—', '˜' => '˜', '™' => '™', 'š' => 'š', '›' => '›', 'œ' => 'œ', '' => '', 'ž' => '', 'Ÿ' => 'Ÿ' ); // Remove metadata tags $content = preg_replace('/(.+?)<\/title>/','',$content); $content = preg_replace('/<category>(.+?)<\/category>/','',$content); // Converts lone & characters into & (a.k.a. &) $content = preg_replace('/&([^#])(?![a-z1-4]{1,8};)/i', '&$1', $content); // Fix Word pasting $content = strtr($content, $wp_htmltranswinuni); // Just a little XHTML help $content = str_replace('<br>', '<br />', $content); $content = str_replace('<hr>', '<hr />', $content); return $content; } function funky_javascript_fix($text) { // Fixes for browsers' javascript bugs global $is_macIE, $is_winIE; if ( $is_winIE || $is_macIE ) $text = preg_replace("/\%u([0-9A-F]{4,4})/e", "'&#'.base_convert('\\1',16,10).';'", $text); return $text; } function balanceTags( $text, $force = false ) { if ( !$force && get_option('use_balanceTags') == 0 ) return $text; return force_balance_tags( $text ); } /* force_balance_tags Balances Tags of string using a modified stack. @param text Text to be balanced @param force Forces balancing, ignoring the value of the option @return Returns balanced text @author Leonard Lin (leonard@acm.org) @version v1.1 @date November 4, 2001 @license GPL v2.0 @notes @changelog --- Modified by Scott Reilly (coffee2code) 02 Aug 2004 1.2 ***TODO*** Make better - change loop condition to $text 1.1 Fixed handling of append/stack pop order of end text Added Cleaning Hooks 1.0 First Version */ function force_balance_tags( $text ) { $tagstack = array(); $stacksize = 0; $tagqueue = ''; $newtext = ''; $single_tags = array('br', 'hr', 'img', 'input'); //Known single-entity/self-closing tags $nestable_tags = array('blockquote', 'div', 'span'); //Tags that can be immediately nested within themselves # WP bug fix for comments - in case you REALLY meant to type '< !--' $text = str_replace('< !--', '< !--', $text); # WP bug fix for LOVE <3 (and other situations with '<' before a number) $text = preg_replace('#<([0-9]{1})#', '<$1', $text); while (preg_match("/<(\/?\w*)\s*([^>]*)>/",$text,$regex)) { $newtext .= $tagqueue; $i = strpos($text,$regex[0]); $l = strlen($regex[0]); // clear the shifter $tagqueue = ''; // Pop or Push if ($regex[1][0] == "/") { // End Tag $tag = strtolower(substr($regex[1],1)); // if too many closing tags if($stacksize <= 0) { $tag = ''; //or close to be safe $tag = '/' . $tag; } // if stacktop value = tag close value then pop else if ($tagstack[$stacksize - 1] == $tag) { // found closing tag $tag = '</' . $tag . '>'; // Close Tag // Pop array_pop ($tagstack); $stacksize--; } else { // closing tag not at top, search for it for ($j=$stacksize-1;$j>=0;$j--) { if ($tagstack[$j] == $tag) { // add tag to tagqueue for ($k=$stacksize-1;$k>=$j;$k--){ $tagqueue .= '</' . array_pop ($tagstack) . '>'; $stacksize--; } break; } } $tag = ''; } } else { // Begin Tag $tag = strtolower($regex[1]); // Tag Cleaning // If self-closing or '', don't do anything. if((substr($regex[2],-1) == '/') || ($tag == '')) { } // ElseIf it's a known single-entity tag but it doesn't close itself, do so elseif ( in_array($tag, $single_tags) ) { $regex[2] .= '/'; } else { // Push the tag onto the stack // If the top of the stack is the same as the tag we want to push, close previous tag if (($stacksize > 0) && !in_array($tag, $nestable_tags) && ($tagstack[$stacksize - 1] == $tag)) { $tagqueue = '</' . array_pop ($tagstack) . '>'; $stacksize--; } $stacksize = array_push ($tagstack, $tag); } // Attributes $attributes = $regex[2]; if($attributes) { $attributes = ' '.$attributes; } $tag = '<'.$tag.$attributes.'>'; //If already queuing a close tag, then put this tag on, too if ($tagqueue) { $tagqueue .= $tag; $tag = ''; } } $newtext .= substr($text,0,$i) . $tag; $text = substr($text,$i+$l); } // Clear Tag Queue $newtext .= $tagqueue; // Add Remaining text $newtext .= $text; // Empty Stack while($x = array_pop($tagstack)) { $newtext .= '</' . $x . '>'; // Add remaining tags to close } // WP fix for the bug with HTML comments $newtext = str_replace("< !--","<!--",$newtext); $newtext = str_replace("< !--","< !--",$newtext); return $newtext; } function format_to_edit($content, $richedit = false) { $content = apply_filters('format_to_edit', $content); if (! $richedit ) $content = htmlspecialchars($content); return $content; } function format_to_post($content) { $content = apply_filters('format_to_post', $content); return $content; } function zeroise($number,$threshold) { // function to add leading zeros when necessary return sprintf('%0'.$threshold.'s', $number); } function backslashit($string) { $string = preg_replace('/^([0-9])/', '\\\\\\\\\1', $string); $string = preg_replace('/([a-z])/i', '\\\\\1', $string); return $string; } function trailingslashit($string) { return untrailingslashit($string) . '/'; } function untrailingslashit($string) { return rtrim($string, '/'); } function addslashes_gpc($gpc) { global $wpdb; if (get_magic_quotes_gpc()) { $gpc = stripslashes($gpc); } return $wpdb->escape($gpc); } function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return $value; } function urlencode_deep($value) { $value = is_array($value) ? array_map('urlencode_deep', $value) : urlencode($value); return $value; } function antispambot($emailaddy, $mailto=0) { $emailNOSPAMaddy = ''; srand ((float) microtime() * 1000000); for ($i = 0; $i < strlen($emailaddy); $i = $i + 1) { $j = floor(rand(0, 1+$mailto)); if ($j==0) { $emailNOSPAMaddy .= '&#'.ord(substr($emailaddy,$i,1)).';'; } elseif ($j==1) { $emailNOSPAMaddy .= substr($emailaddy,$i,1); } elseif ($j==2) { $emailNOSPAMaddy .= '%'.zeroise(dechex(ord(substr($emailaddy, $i, 1))), 2); } } $emailNOSPAMaddy = str_replace('@','@',$emailNOSPAMaddy); return $emailNOSPAMaddy; } function _make_url_clickable_cb($matches) { $ret = ''; $url = $matches[2]; $url = clean_url($url); if ( empty($url) ) return $matches[0]; // removed trailing [.,;:] from URL if ( in_array(substr($url, -1), array('.', ',', ';', ':')) === true ) { $ret = substr($url, -1); $url = substr($url, 0, strlen($url)-1); } return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>" . $ret; } function _make_web_ftp_clickable_cb($matches) { $ret = ''; $dest = $matches[2]; $dest = 'http://' . $dest; $dest = clean_url($dest); if ( empty($dest) ) return $matches[0]; // removed trailing [,;:] from URL if ( in_array(substr($dest, -1), array('.', ',', ';', ':')) === true ) { $ret = substr($dest, -1); $dest = substr($dest, 0, strlen($dest)-1); } return $matches[1] . "<a href=\"$dest\" rel=\"nofollow\">$dest</a>" . $ret; } function _make_email_clickable_cb($matches) { $email = $matches[2] . '@' . $matches[3]; return $matches[1] . "<a href=\"mailto:$email\">$email</a>"; } function make_clickable($ret) { $ret = ' ' . $ret; // in testing, using arrays here was found to be faster $ret = preg_replace_callback('#([\s>])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is', '_make_url_clickable_cb', $ret); $ret = preg_replace_callback('#([\s>])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is', '_make_web_ftp_clickable_cb', $ret); $ret = preg_replace_callback('#([\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})#i', '_make_email_clickable_cb', $ret); // this one is not in an array because we need it to run last, for cleanup of accidental links within links $ret = preg_replace("#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i", "$1$3</a>", $ret); $ret = trim($ret); return $ret; } function wp_rel_nofollow( $text ) { global $wpdb; // This is a pre save filter, so text is already escaped. $text = stripslashes($text); $text = preg_replace_callback('|<a (.+?)>|i', 'wp_rel_nofollow_callback', $text); $text = $wpdb->escape($text); return $text; } function wp_rel_nofollow_callback( $matches ) { $text = $matches[1]; $text = str_replace(array(' rel="nofollow"', " rel='nofollow'"), '', $text); return "<a $text rel=\"nofollow\">"; } function convert_smilies($text) { global $wp_smiliessearch, $wp_smiliesreplace; $output = ''; if ( get_option('use_smilies') && !empty($wp_smiliessearch) && !empty($wp_smiliesreplace) ) { // HTML loop taken from texturize function, could possible be consolidated $textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between $stop = count($textarr);// loop stuff for ($i = 0; $i < $stop; $i++) { $content = $textarr[$i]; if ((strlen($content) > 0) && ('<' != $content{0})) { // If it's not a tag $content = preg_replace($wp_smiliessearch, $wp_smiliesreplace, $content); } $output .= $content; } } else { // return default text. $output = $text; } return $output; } function is_email($user_email) { $chars = "/^([a-z0-9+_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,6}\$/i"; if (strpos($user_email, '@') !== false && strpos($user_email, '.') !== false) { if (preg_match($chars, $user_email)) { return true; } else { return false; } } else { return false; } } // used by wp-mail to handle charsets in email subjects function wp_iso_descrambler($string) { /* this may only work with iso-8859-1, I'm afraid */ if (!preg_match('#\=\?(.+)\?Q\?(.+)\?\=#i', $string, $matches)) { return $string; } else { $subject = str_replace('_', ' ', $matches[2]); $subject = preg_replace('#\=([0-9a-f]{2})#ei', "chr(hexdec(strtolower('$1')))", $subject); return $subject; } } // give it a date, it will give you the same date as GMT function get_gmt_from_date($string) { // note: this only substracts $time_difference from the given date preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches); $string_time = gmmktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); $string_gmt = gmdate('Y-m-d H:i:s', $string_time - get_option('gmt_offset') * 3600); return $string_gmt; } // give it a GMT date, it will give you the same date with $time_difference added function get_date_from_gmt($string) { // note: this only adds $time_difference to the given date preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches); $string_time = gmmktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); $string_localtime = gmdate('Y-m-d H:i:s', $string_time + get_option('gmt_offset')*3600); return $string_localtime; } // computes an offset in seconds from an iso8601 timezone function iso8601_timezone_to_offset($timezone) { // $timezone is either 'Z' or '[+|-]hhmm' if ($timezone == 'Z') { $offset = 0; } else { $sign = (substr($timezone, 0, 1) == '+') ? 1 : -1; $hours = intval(substr($timezone, 1, 2)); $minutes = intval(substr($timezone, 3, 4)) / 60; $offset = $sign * 3600 * ($hours + $minutes); } return $offset; } // converts an iso8601 date to MySQL DateTime format used by post_date[_gmt] function iso8601_to_datetime($date_string, $timezone = USER) { if ($timezone == GMT) { preg_match('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', $date_string, $date_bits); if (!empty($date_bits[7])) { // we have a timezone, so let's compute an offset $offset = iso8601_timezone_to_offset($date_bits[7]); } else { // we don't have a timezone, so we assume user local timezone (not server's!) $offset = 3600 * get_option('gmt_offset'); } $timestamp = gmmktime($date_bits[4], $date_bits[5], $date_bits[6], $date_bits[2], $date_bits[3], $date_bits[1]); $timestamp -= $offset; return gmdate('Y-m-d H:i:s', $timestamp); } elseif ($timezone == USER) { return preg_replace('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', '$1-$2-$3 $4:$5:$6', $date_string); } } function popuplinks($text) { // Comment text in popup windows should be filtered through this. // Right now it's a moderately dumb function, ideally it would detect whether // a target or rel attribute was already there and adjust its actions accordingly. $text = preg_replace('/<a (.+?)>/i', "<a $1 target='_blank' rel='external'>", $text); return $text; } function sanitize_email($email) { return preg_replace('/[^a-z0-9+_.@-]/i', '', $email); } function human_time_diff( $from, $to = '' ) { if ( empty($to) ) $to = time(); $diff = (int) abs($to - $from); if ($diff <= 3600) { $mins = round($diff / 60); if ($mins <= 1) { $mins = 1; } $since = sprintf(__ngettext('%s min', '%s mins', $mins), $mins); } else if (($diff <= 86400) && ($diff > 3600)) { $hours = round($diff / 3600); if ($hours <= 1) { $hours = 1; } $since = sprintf(__ngettext('%s hour', '%s hours', $hours), $hours); } elseif ($diff >= 86400) { $days = round($diff / 86400); if ($days <= 1) { $days = 1; } $since = sprintf(__ngettext('%s day', '%s days', $days), $days); } return $since; } function wp_trim_excerpt($text) { // Fakes an excerpt if needed if ( '' == $text ) { $text = get_the_content(''); $text = strip_shortcodes( $text ); $text = apply_filters('the_content', $text); $text = str_replace(']]>', ']]>', $text); $text = strip_tags($text); $excerpt_length = 55; $words = explode(' ', $text, $excerpt_length + 1); if (count($words) > $excerpt_length) { array_pop($words); array_push($words, '[...]'); $text = implode(' ', $words); } } return $text; } function ent2ncr($text) { $to_ncr = array( '"' => '"', '&' => '&', '⁄' => '/', '<' => '<', '>' => '>', '|' => '|', ' ' => ' ', '¡' => '¡', '¢' => '¢', '£' => '£', '¤' => '¤', '¥' => '¥', '¦' => '¦', '&brkbar;' => '¦', '§' => '§', '¨' => '¨', '¨' => '¨', '©' => '©', 'ª' => 'ª', '«' => '«', '¬' => '¬', '­' => '­', '®' => '®', '¯' => '¯', '&hibar;' => '¯', '°' => '°', '±' => '±', '²' => '²', '³' => '³', '´' => '´', 'µ' => 'µ', '¶' => '¶', '·' => '·', '¸' => '¸', '¹' => '¹', 'º' => 'º', '»' => '»', '¼' => '¼', '½' => '½', '¾' => '¾', '¿' => '¿', 'À' => 'À', 'Á' => 'Á', 'Â' => 'Â', 'Ã' => 'Ã', 'Ä' => 'Ä', 'Å' => 'Å', 'Æ' => 'Æ', 'Ç' => 'Ç', 'È' => 'È', 'É' => 'É', 'Ê' => 'Ê', 'Ë' => 'Ë', 'Ì' => 'Ì', 'Í' => 'Í', 'Î' => 'Î', 'Ï' => 'Ï', 'Ð' => 'Ð', 'Ñ' => 'Ñ', 'Ò' => 'Ò', 'Ó' => 'Ó', 'Ô' => 'Ô', 'Õ' => 'Õ', 'Ö' => 'Ö', '×' => '×', 'Ø' => 'Ø', 'Ù' => 'Ù', 'Ú' => 'Ú', 'Û' => 'Û', 'Ü' => 'Ü', 'Ý' => 'Ý', 'Þ' => 'Þ', 'ß' => 'ß', 'à' => 'à', 'á' => 'á', 'â' => 'â', 'ã' => 'ã', 'ä' => 'ä', 'å' => 'å', 'æ' => 'æ', 'ç' => 'ç', 'è' => 'è', 'é' => 'é', 'ê' => 'ê', 'ë' => 'ë', 'ì' => 'ì', 'í' => 'í', 'î' => 'î', 'ï' => 'ï', 'ð' => 'ð', 'ñ' => 'ñ', 'ò' => 'ò', 'ó' => 'ó', 'ô' => 'ô', 'õ' => 'õ', 'ö' => 'ö', '÷' => '÷', 'ø' => 'ø', 'ù' => 'ù', 'ú' => 'ú', 'û' => 'û', 'ü' => 'ü', 'ý' => 'ý', 'þ' => 'þ', 'ÿ' => 'ÿ', 'Œ' => 'Œ', 'œ' => 'œ', 'Š' => 'Š', 'š' => 'š', 'Ÿ' => 'Ÿ', 'ƒ' => 'ƒ', 'ˆ' => 'ˆ', '˜' => '˜', 'Α' => 'Α', 'Β' => 'Β', 'Γ' => 'Γ', 'Δ' => 'Δ', 'Ε' => 'Ε', 'Ζ' => 'Ζ', 'Η' => 'Η', 'Θ' => 'Θ', 'Ι' => 'Ι', 'Κ' => 'Κ', 'Λ' => 'Λ', 'Μ' => 'Μ', 'Ν' => 'Ν', 'Ξ' => 'Ξ', 'Ο' => 'Ο', 'Π' => 'Π', 'Ρ' => 'Ρ', 'Σ' => 'Σ', 'Τ' => 'Τ', 'Υ' => 'Υ', 'Φ' => 'Φ', 'Χ' => 'Χ', 'Ψ' => 'Ψ', 'Ω' => 'Ω', 'α' => 'α', 'β' => 'β', 'γ' => 'γ', 'δ' => 'δ', 'ε' => 'ε', 'ζ' => 'ζ', 'η' => 'η', 'θ' => 'θ', 'ι' => 'ι', 'κ' => 'κ', 'λ' => 'λ', 'μ' => 'μ', 'ν' => 'ν', 'ξ' => 'ξ', 'ο' => 'ο', 'π' => 'π', 'ρ' => 'ρ', 'ς' => 'ς', 'σ' => 'σ', 'τ' => 'τ', 'υ' => 'υ', 'φ' => 'φ', 'χ' => 'χ', 'ψ' => 'ψ', 'ω' => 'ω', 'ϑ' => 'ϑ', 'ϒ' => 'ϒ', 'ϖ' => 'ϖ', ' ' => ' ', ' ' => ' ', ' ' => ' ', '‌' => '‌', '‍' => '‍', '‎' => '‎', '‏' => '‏', '–' => '–', '—' => '—', '‘' => '‘', '’' => '’', '‚' => '‚', '“' => '“', '”' => '”', '„' => '„', '†' => '†', '‡' => '‡', '•' => '•', '…' => '…', '‰' => '‰', '′' => '′', '″' => '″', '‹' => '‹', '›' => '›', '‾' => '‾', '⁄' => '⁄', '€' => '€', 'ℑ' => 'ℑ', '℘' => '℘', 'ℜ' => 'ℜ', '™' => '™', 'ℵ' => 'ℵ', '↵' => '↵', '⇐' => '⇐', '⇑' => '⇑', '⇒' => '⇒', '⇓' => '⇓', '⇔' => '⇔', '∀' => '∀', '∂' => '∂', '∃' => '∃', '∅' => '∅', '∇' => '∇', '∈' => '∈', '∉' => '∉', '∋' => '∋', '∏' => '∏', '∑' => '∑', '−' => '−', '∗' => '∗', '√' => '√', '∝' => '∝', '∞' => '∞', '∠' => '∠', '∧' => '∧', '∨' => '∨', '∩' => '∩', '∪' => '∪', '∫' => '∫', '∴' => '∴', '∼' => '∼', '≅' => '≅', '≈' => '≈', '≠' => '≠', '≡' => '≡', '≤' => '≤', '≥' => '≥', '⊂' => '⊂', '⊃' => '⊃', '⊄' => '⊄', '⊆' => '⊆', '⊇' => '⊇', '⊕' => '⊕', '⊗' => '⊗', '⊥' => '⊥', '⋅' => '⋅', '⌈' => '⌈', '⌉' => '⌉', '⌊' => '⌊', '⌋' => '⌋', '⟨' => '〈', '⟩' => '〉', '←' => '←', '↑' => '↑', '→' => '→', '↓' => '↓', '↔' => '↔', '◊' => '◊', '♠' => '♠', '♣' => '♣', '♥' => '♥', '♦' => '♦' ); return str_replace( array_keys($to_ncr), array_values($to_ncr), $text ); } function wp_richedit_pre($text) { // Filtering a blank results in an annoying <br />\n if ( empty($text) ) return apply_filters('richedit_pre', ''); $output = convert_chars($text); $output = wpautop($output); $output = htmlspecialchars($output, ENT_NOQUOTES); return apply_filters('richedit_pre', $output); } function wp_htmledit_pre($output) { if ( !empty($output) ) $output = htmlspecialchars($output, ENT_NOQUOTES); // convert only < > & return apply_filters('htmledit_pre', $output); } function clean_url( $url, $protocols = null, $context = 'display' ) { $original_url = $url; if ('' == $url) return $url; $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@()]|i', '', $url); $strip = array('%0d', '%0a'); $url = str_replace($strip, '', $url); $url = str_replace(';//', '://', $url); /* If the URL doesn't appear to contain a scheme, we * presume it needs http:// appended (unless a relative * link starting with / or a php file). */ if ( strpos($url, ':') === false && substr( $url, 0, 1 ) != '/' && !preg_match('/^[a-z0-9-]+?\.php/i', $url) ) $url = 'http://' . $url; // Replace ampersands ony when displaying. if ( 'display' == $context ) $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url); if ( !is_array($protocols) ) $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet'); if ( wp_kses_bad_protocol( $url, $protocols ) != $url ) return ''; return apply_filters('clean_url', $url, $original_url, $context); } function sanitize_url( $url, $protocols = null ) { return clean_url( $url, $protocols, 'db'); } // Borrowed from the PHP Manual user notes. Convert entities, while // preserving already-encoded entities: function htmlentities2($myHTML) { $translation_table=get_html_translation_table (HTML_ENTITIES,ENT_QUOTES); $translation_table[chr(38)] = '&'; return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&" , strtr($myHTML, $translation_table)); } // Escape single quotes, specialchar double quotes, and fix line endings. function js_escape($text) { $safe_text = wp_specialchars($text, 'double'); $safe_text = preg_replace('/&#(x)?0*(?(1)27|39);?/i', "'", stripslashes($safe_text)); $safe_text = preg_replace("/\r?\n/", "\\n", addslashes($safe_text)); return apply_filters('js_escape', $safe_text, $text); } // Escaping for HTML attributes function attribute_escape($text) { $safe_text = wp_specialchars($text, true); return apply_filters('attribute_escape', $safe_text, $text); } // Escape a HTML tag name function tag_escape($tag_name) { $safe_tag = strtolower( preg_replace('[^a-zA-Z_:]', '', $tag_name) ); return apply_filters('tag_escape', $safe_tag, $tag_name); } /** * Escapes text for SQL LIKE special characters % and _ * * @param string text the text to be escaped * @return string text, safe for inclusion in LIKE query */ function like_escape($text) { return str_replace(array("%", "_"), array("\\%", "\\_"), $text); } function wp_make_link_relative( $link ) { return preg_replace('|https?://[^/]+(/.*)|i', '$1', $link ); } function sanitize_option($option, $value) { // Remember to call stripslashes! switch ($option) { case 'admin_email': $value = sanitize_email($value); break; case 'default_post_edit_rows': case 'mailserver_port': case 'comment_max_links': case 'page_on_front': case 'rss_excerpt_length': case 'default_category': case 'default_email_category': case 'default_link_category': $value = abs((int) $value); break; case 'posts_per_page': case 'posts_per_rss': $value = (int) $value; if ( empty($value) ) $value = 1; if ( $value < -1 ) $value = abs($value); break; case 'default_ping_status': case 'default_comment_status': // Options that if not there have 0 value but need to be something like "closed" if ( $value == '0' || $value == '') $value = 'closed'; break; case 'blogdescription': case 'blogname': $value = addslashes($value); $value = wp_filter_post_kses( $value ); // calls stripslashes then addslashes $value = stripslashes($value); $value = wp_specialchars( $value ); break; case 'blog_charset': $value = preg_replace('/[^a-zA-Z0-9_-]/', '', $value); // strips slashes break; case 'date_format': case 'time_format': case 'mailserver_url': case 'mailserver_login': case 'mailserver_pass': case 'ping_sites': case 'upload_path': $value = strip_tags($value); $value = addslashes($value); $value = wp_filter_kses($value); // calls stripslashes then addslashes $value = stripslashes($value); break; case 'gmt_offset': $value = preg_replace('/[^0-9:.-]/', '', $value); // strips slashes break; case 'siteurl': case 'home': $value = stripslashes($value); $value = clean_url($value); break; default : $value = apply_filters("sanitize_option_{$option}", $value, $option); break; } return $value; } function wp_parse_str( $string, &$array ) { parse_str( $string, $array ); if ( get_magic_quotes_gpc() ) $array = stripslashes_deep( $array ); // parse_str() adds slashes if magicquotes is on. See: http://php.net/parse_str $array = apply_filters( 'wp_parse_str', $array ); } // Convert lone less than signs. KSES already converts lone greater than signs. function wp_pre_kses_less_than( $text ) { return preg_replace_callback('%<[^>]*?((?=<)|>|$)%', 'wp_pre_kses_less_than_callback', $text); } function wp_pre_kses_less_than_callback( $matches ) { if ( false === strpos($matches[0], '>') ) return wp_specialchars($matches[0]); return $matches[0]; } /** * wp_sprintf() - sprintf() with filters */ function wp_sprintf( $pattern ) { $args = func_get_args( ); $len = strlen($pattern); $start = 0; $result = ''; $arg_index = 0; while ( $len > $start ) { // Last character: append and break if ( strlen($pattern) - 1 == $start ) { $result .= substr($pattern, -1); break; } // Literal %: append and continue if ( substr($pattern, $start, 2) == '%%' ) { $start += 2; $result .= '%'; continue; } // Get fragment before next % $end = strpos($pattern, '%', $start + 1); if ( false === $end ) $end = $len; $fragment = substr($pattern, $start, $end - $start); // Fragment has a specifier if ( $pattern{$start} == '%' ) { // Find numbered arguments or take the next one in order if ( preg_match('/^%(\d+)\$/', $fragment, $matches) ) { $arg = isset($args[$matches[1]]) ? $args[$matches[1]] : ''; $fragment = str_replace("%{$matches[1]}$", '%', $fragment); } else { ++$arg_index; $arg = isset($args[$arg_index]) ? $args[$arg_index] : ''; } // Apply filters OR sprintf $_fragment = apply_filters( 'wp_sprintf', $fragment, $arg ); if ( $_fragment != $fragment ) $fragment = $_fragment; else $fragment = sprintf($fragment, strval($arg) ); } // Append to result and move to next fragment $result .= $fragment; $start = $end; } return $result; } /** * wp_sprintf_l - List specifier %l for wp_sprintf * * @param unknown_type $pattern * @param unknown_type $args * @return unknown */ function wp_sprintf_l($pattern, $args) { // Not a match if ( substr($pattern, 0, 2) != '%l' ) return $pattern; // Nothing to work with if ( empty($args) ) return ''; // Translate and filter the delimiter set (avoid ampersands and entities here) $l = apply_filters('wp_sprintf_l', array( 'between' => _c(', |between list items'), 'between_last_two' => _c(', and |between last two list items'), 'between_only_two' => _c(' and |between only two list items'), )); $args = (array) $args; $result = array_shift($args); if ( count($args) == 1 ) $result .= $l['between_only_two'] . array_shift($args); // Loop when more than two args while ( count($args) ) { $arg = array_shift($args); if ( $i == 1 ) $result .= $l['between_last_two'] . $arg; else $result .= $l['between'] . $arg; } return $result . substr($pattern, 2); } /** * Safely extracts not more than the first $count characters from html string * * UTF-8, tags and entities safe prefix extraction. Entities inside will *NOT* be * counted as one character. For example & will be counted as 4, < as 3, etc. * * @param integer $str String to get the excerpt from * @param integer $count Maximum number of characters to take * @eaturn string the excerpt */ function wp_html_excerpt( $str, $count ) { $str = strip_tags( $str ); $str = mb_strcut( $str, 0, $count ); // remove part of an entity at the end $str = preg_replace( '/&[^;\s]{0,6}$/', '', $str ); return $str; } ?> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/Text/����������������������������������������������������������������������������0000755�0001066�0001066�00000000000�11051167752�012365� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/Text/Diff/�����������������������������������������������������������������������0000755�0001066�0001066�00000000000�11051167752�013235� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/Text/Diff/Engine/����������������������������������������������������������������0000755�0001066�0001066�00000000000�11051167752�014442� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/Text/Diff/Engine/xdiff.php�������������������������������������������������������0000644�0001066�0001066�00000004267�11002230355�016246� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Class used internally by Diff to actually compute the diffs. * * This class uses the xdiff PECL package (http://pecl.php.net/package/xdiff) * to compute the differences between the two input arrays. * * $Horde: framework/Text_Diff/Diff/Engine/xdiff.php,v 1.6 2008/01/04 10:07:50 jan Exp $ * * Copyright 2004-2008 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you did * not receive this file, see http://opensource.org/licenses/lgpl-license.php. * * @author Jon Parise <jon@horde.org> * @package Text_Diff */ class Text_Diff_Engine_xdiff { /** */ function diff($from_lines, $to_lines) { array_walk($from_lines, array('Text_Diff', 'trimNewlines')); array_walk($to_lines, array('Text_Diff', 'trimNewlines')); /* Convert the two input arrays into strings for xdiff processing. */ $from_string = implode("\n", $from_lines); $to_string = implode("\n", $to_lines); /* Diff the two strings and convert the result to an array. */ $diff = xdiff_string_diff($from_string, $to_string, count($to_lines)); $diff = explode("\n", $diff); /* Walk through the diff one line at a time. We build the $edits * array of diff operations by reading the first character of the * xdiff output (which is in the "unified diff" format). * * Note that we don't have enough information to detect "changed" * lines using this approach, so we can't add Text_Diff_Op_changed * instances to the $edits array. The result is still perfectly * valid, albeit a little less descriptive and efficient. */ $edits = array(); foreach ($diff as $line) { switch ($line[0]) { case ' ': $edits[] = &new Text_Diff_Op_copy(array(substr($line, 1))); break; case '+': $edits[] = &new Text_Diff_Op_add(array(substr($line, 1))); break; case '-': $edits[] = &new Text_Diff_Op_delete(array(substr($line, 1))); break; } } return $edits; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/Text/Diff/Engine/shell.php�������������������������������������������������������0000644�0001066�0001066�00000012216�11002230355�016246� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Class used internally by Diff to actually compute the diffs. * * This class uses the Unix `diff` program via shell_exec to compute the * differences between the two input arrays. * * $Horde: framework/Text_Diff/Diff/Engine/shell.php,v 1.8 2008/01/04 10:07:50 jan Exp $ * * Copyright 2007-2008 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you did * not receive this file, see http://opensource.org/licenses/lgpl-license.php. * * @author Milian Wolff <mail@milianw.de> * @package Text_Diff * @since 0.3.0 */ class Text_Diff_Engine_shell { /** * Path to the diff executable * * @var string */ var $_diffCommand = 'diff'; /** * Returns the array of differences. * * @param array $from_lines lines of text from old file * @param array $to_lines lines of text from new file * * @return array all changes made (array with Text_Diff_Op_* objects) */ function diff($from_lines, $to_lines) { array_walk($from_lines, array('Text_Diff', 'trimNewlines')); array_walk($to_lines, array('Text_Diff', 'trimNewlines')); $temp_dir = Text_Diff::_getTempDir(); // Execute gnu diff or similar to get a standard diff file. $from_file = tempnam($temp_dir, 'Text_Diff'); $to_file = tempnam($temp_dir, 'Text_Diff'); $fp = fopen($from_file, 'w'); fwrite($fp, implode("\n", $from_lines)); fclose($fp); $fp = fopen($to_file, 'w'); fwrite($fp, implode("\n", $to_lines)); fclose($fp); $diff = shell_exec($this->_diffCommand . ' ' . $from_file . ' ' . $to_file); unlink($from_file); unlink($to_file); if (is_null($diff)) { // No changes were made return array(new Text_Diff_Op_copy($from_lines)); } $from_line_no = 1; $to_line_no = 1; $edits = array(); // Get changed lines by parsing something like: // 0a1,2 // 1,2c4,6 // 1,5d6 preg_match_all('#^(\d+)(?:,(\d+))?([adc])(\d+)(?:,(\d+))?$#m', $diff, $matches, PREG_SET_ORDER); foreach ($matches as $match) { if (!isset($match[5])) { // This paren is not set every time (see regex). $match[5] = false; } if ($match[3] == 'a') { $from_line_no--; } if ($match[3] == 'd') { $to_line_no--; } if ($from_line_no < $match[1] || $to_line_no < $match[4]) { // copied lines assert('$match[1] - $from_line_no == $match[4] - $to_line_no'); array_push($edits, new Text_Diff_Op_copy( $this->_getLines($from_lines, $from_line_no, $match[1] - 1), $this->_getLines($to_lines, $to_line_no, $match[4] - 1))); } switch ($match[3]) { case 'd': // deleted lines array_push($edits, new Text_Diff_Op_delete( $this->_getLines($from_lines, $from_line_no, $match[2]))); $to_line_no++; break; case 'c': // changed lines array_push($edits, new Text_Diff_Op_change( $this->_getLines($from_lines, $from_line_no, $match[2]), $this->_getLines($to_lines, $to_line_no, $match[5]))); break; case 'a': // added lines array_push($edits, new Text_Diff_Op_add( $this->_getLines($to_lines, $to_line_no, $match[5]))); $from_line_no++; break; } } if (!empty($from_lines)) { // Some lines might still be pending. Add them as copied array_push($edits, new Text_Diff_Op_copy( $this->_getLines($from_lines, $from_line_no, $from_line_no + count($from_lines) - 1), $this->_getLines($to_lines, $to_line_no, $to_line_no + count($to_lines) - 1))); } return $edits; } /** * Get lines from either the old or new text * * @access private * * @param array &$text_lines Either $from_lines or $to_lines * @param int &$line_no Current line number * @param int $end Optional end line, when we want to chop more * than one line. * * @return array The chopped lines */ function _getLines(&$text_lines, &$line_no, $end = false) { if (!empty($end)) { $lines = array(); // We can shift even more while ($line_no <= $end) { array_push($lines, array_shift($text_lines)); $line_no++; } } else { $lines = array(array_shift($text_lines)); $line_no++; } return $lines; } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/Text/Diff/Engine/string.php������������������������������������������������������0000644�0001066�0001066�00000017355�11002230355�016456� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Parses unified or context diffs output from eg. the diff utility. * * Example: * <code> * $patch = file_get_contents('example.patch'); * $diff = new Text_Diff('string', array($patch)); * $renderer = new Text_Diff_Renderer_inline(); * echo $renderer->render($diff); * </code> * * $Horde: framework/Text_Diff/Diff/Engine/string.php,v 1.7 2008/01/04 10:07:50 jan Exp $ * * Copyright 2005 rjan Persson <o@42mm.org> * Copyright 2005-2008 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you did * not receive this file, see http://opensource.org/licenses/lgpl-license.php. * * @author rjan Persson <o@42mm.org> * @package Text_Diff * @since 0.2.0 */ class Text_Diff_Engine_string { /** * Parses a unified or context diff. * * First param contains the whole diff and the second can be used to force * a specific diff type. If the second parameter is 'autodetect', the * diff will be examined to find out which type of diff this is. * * @param string $diff The diff content. * @param string $mode The diff mode of the content in $diff. One of * 'context', 'unified', or 'autodetect'. * * @return array List of all diff operations. */ function diff($diff, $mode = 'autodetect') { if ($mode != 'autodetect' && $mode != 'context' && $mode != 'unified') { return PEAR::raiseError('Type of diff is unsupported'); } if ($mode == 'autodetect') { $context = strpos($diff, '***'); $unified = strpos($diff, '---'); if ($context === $unified) { return PEAR::raiseError('Type of diff could not be detected'); } elseif ($context === false || $context === false) { $mode = $context !== false ? 'context' : 'unified'; } else { $mode = $context < $unified ? 'context' : 'unified'; } } // split by new line and remove the diff header $diff = explode("\n", $diff); array_shift($diff); array_shift($diff); if ($mode == 'context') { return $this->parseContextDiff($diff); } else { return $this->parseUnifiedDiff($diff); } } /** * Parses an array containing the unified diff. * * @param array $diff Array of lines. * * @return array List of all diff operations. */ function parseUnifiedDiff($diff) { $edits = array(); $end = count($diff) - 1; for ($i = 0; $i < $end;) { $diff1 = array(); switch (substr($diff[$i], 0, 1)) { case ' ': do { $diff1[] = substr($diff[$i], 1); } while (++$i < $end && substr($diff[$i], 0, 1) == ' '); $edits[] = &new Text_Diff_Op_copy($diff1); break; case '+': // get all new lines do { $diff1[] = substr($diff[$i], 1); } while (++$i < $end && substr($diff[$i], 0, 1) == '+'); $edits[] = &new Text_Diff_Op_add($diff1); break; case '-': // get changed or removed lines $diff2 = array(); do { $diff1[] = substr($diff[$i], 1); } while (++$i < $end && substr($diff[$i], 0, 1) == '-'); while ($i < $end && substr($diff[$i], 0, 1) == '+') { $diff2[] = substr($diff[$i++], 1); } if (count($diff2) == 0) { $edits[] = &new Text_Diff_Op_delete($diff1); } else { $edits[] = &new Text_Diff_Op_change($diff1, $diff2); } break; default: $i++; break; } } return $edits; } /** * Parses an array containing the context diff. * * @param array $diff Array of lines. * * @return array List of all diff operations. */ function parseContextDiff(&$diff) { $edits = array(); $i = $max_i = $j = $max_j = 0; $end = count($diff) - 1; while ($i < $end && $j < $end) { while ($i >= $max_i && $j >= $max_j) { // Find the boundaries of the diff output of the two files for ($i = $j; $i < $end && substr($diff[$i], 0, 3) == '***'; $i++); for ($max_i = $i; $max_i < $end && substr($diff[$max_i], 0, 3) != '---'; $max_i++); for ($j = $max_i; $j < $end && substr($diff[$j], 0, 3) == '---'; $j++); for ($max_j = $j; $max_j < $end && substr($diff[$max_j], 0, 3) != '***'; $max_j++); } // find what hasn't been changed $array = array(); while ($i < $max_i && $j < $max_j && strcmp($diff[$i], $diff[$j]) == 0) { $array[] = substr($diff[$i], 2); $i++; $j++; } while ($i < $max_i && ($max_j-$j) <= 1) { if ($diff[$i] != '' && substr($diff[$i], 0, 1) != ' ') { break; } $array[] = substr($diff[$i++], 2); } while ($j < $max_j && ($max_i-$i) <= 1) { if ($diff[$j] != '' && substr($diff[$j], 0, 1) != ' ') { break; } $array[] = substr($diff[$j++], 2); } if (count($array) > 0) { $edits[] = &new Text_Diff_Op_copy($array); } if ($i < $max_i) { $diff1 = array(); switch (substr($diff[$i], 0, 1)) { case '!': $diff2 = array(); do { $diff1[] = substr($diff[$i], 2); if ($j < $max_j && substr($diff[$j], 0, 1) == '!') { $diff2[] = substr($diff[$j++], 2); } } while (++$i < $max_i && substr($diff[$i], 0, 1) == '!'); $edits[] = &new Text_Diff_Op_change($diff1, $diff2); break; case '+': do { $diff1[] = substr($diff[$i], 2); } while (++$i < $max_i && substr($diff[$i], 0, 1) == '+'); $edits[] = &new Text_Diff_Op_add($diff1); break; case '-': do { $diff1[] = substr($diff[$i], 2); } while (++$i < $max_i && substr($diff[$i], 0, 1) == '-'); $edits[] = &new Text_Diff_Op_delete($diff1); break; } } if ($j < $max_j) { $diff2 = array(); switch (substr($diff[$j], 0, 1)) { case '+': do { $diff2[] = substr($diff[$j++], 2); } while ($j < $max_j && substr($diff[$j], 0, 1) == '+'); $edits[] = &new Text_Diff_Op_add($diff2); break; case '-': do { $diff2[] = substr($diff[$j++], 2); } while ($j < $max_j && substr($diff[$j], 0, 1) == '-'); $edits[] = &new Text_Diff_Op_delete($diff2); break; } } } return $edits; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/Text/Diff/Engine/native.php������������������������������������������������������0000644�0001066�0001066�00000037077�11002230355�016441� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * $Horde: framework/Text_Diff/Diff/Engine/native.php,v 1.10 2008/01/04 10:27:53 jan Exp $ * * Class used internally by Text_Diff to actually compute the diffs. This * class is implemented using native PHP code. * * The algorithm used here is mostly lifted from the perl module * Algorithm::Diff (version 1.06) by Ned Konz, which is available at: * http://www.perl.com/CPAN/authors/id/N/NE/NEDKONZ/Algorithm-Diff-1.06.zip * * More ideas are taken from: http://www.ics.uci.edu/~eppstein/161/960229.html * * Some ideas (and a bit of code) are taken from analyze.c, of GNU * diffutils-2.7, which can be found at: * ftp://gnudist.gnu.org/pub/gnu/diffutils/diffutils-2.7.tar.gz * * Some ideas (subdivision by NCHUNKS > 2, and some optimizations) are from * Geoffrey T. Dairiki <dairiki@dairiki.org>. The original PHP version of this * code was written by him, and is used/adapted with his permission. * * Copyright 2004-2008 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you did * not receive this file, see http://opensource.org/licenses/lgpl-license.php. * * @author Geoffrey T. Dairiki <dairiki@dairiki.org> * @package Text_Diff */ class Text_Diff_Engine_native { function diff($from_lines, $to_lines) { array_walk($from_lines, array('Text_Diff', 'trimNewlines')); array_walk($to_lines, array('Text_Diff', 'trimNewlines')); $n_from = count($from_lines); $n_to = count($to_lines); $this->xchanged = $this->ychanged = array(); $this->xv = $this->yv = array(); $this->xind = $this->yind = array(); unset($this->seq); unset($this->in_seq); unset($this->lcs); // Skip leading common lines. for ($skip = 0; $skip < $n_from && $skip < $n_to; $skip++) { if ($from_lines[$skip] !== $to_lines[$skip]) { break; } $this->xchanged[$skip] = $this->ychanged[$skip] = false; } // Skip trailing common lines. $xi = $n_from; $yi = $n_to; for ($endskip = 0; --$xi > $skip && --$yi > $skip; $endskip++) { if ($from_lines[$xi] !== $to_lines[$yi]) { break; } $this->xchanged[$xi] = $this->ychanged[$yi] = false; } // Ignore lines which do not exist in both files. for ($xi = $skip; $xi < $n_from - $endskip; $xi++) { $xhash[$from_lines[$xi]] = 1; } for ($yi = $skip; $yi < $n_to - $endskip; $yi++) { $line = $to_lines[$yi]; if (($this->ychanged[$yi] = empty($xhash[$line]))) { continue; } $yhash[$line] = 1; $this->yv[] = $line; $this->yind[] = $yi; } for ($xi = $skip; $xi < $n_from - $endskip; $xi++) { $line = $from_lines[$xi]; if (($this->xchanged[$xi] = empty($yhash[$line]))) { continue; } $this->xv[] = $line; $this->xind[] = $xi; } // Find the LCS. $this->_compareseq(0, count($this->xv), 0, count($this->yv)); // Merge edits when possible. $this->_shiftBoundaries($from_lines, $this->xchanged, $this->ychanged); $this->_shiftBoundaries($to_lines, $this->ychanged, $this->xchanged); // Compute the edit operations. $edits = array(); $xi = $yi = 0; while ($xi < $n_from || $yi < $n_to) { assert($yi < $n_to || $this->xchanged[$xi]); assert($xi < $n_from || $this->ychanged[$yi]); // Skip matching "snake". $copy = array(); while ($xi < $n_from && $yi < $n_to && !$this->xchanged[$xi] && !$this->ychanged[$yi]) { $copy[] = $from_lines[$xi++]; ++$yi; } if ($copy) { $edits[] = &new Text_Diff_Op_copy($copy); } // Find deletes & adds. $delete = array(); while ($xi < $n_from && $this->xchanged[$xi]) { $delete[] = $from_lines[$xi++]; } $add = array(); while ($yi < $n_to && $this->ychanged[$yi]) { $add[] = $to_lines[$yi++]; } if ($delete && $add) { $edits[] = &new Text_Diff_Op_change($delete, $add); } elseif ($delete) { $edits[] = &new Text_Diff_Op_delete($delete); } elseif ($add) { $edits[] = &new Text_Diff_Op_add($add); } } return $edits; } /** * Divides the Largest Common Subsequence (LCS) of the sequences (XOFF, * XLIM) and (YOFF, YLIM) into NCHUNKS approximately equally sized * segments. * * Returns (LCS, PTS). LCS is the length of the LCS. PTS is an array of * NCHUNKS+1 (X, Y) indexes giving the diving points between sub * sequences. The first sub-sequence is contained in (X0, X1), (Y0, Y1), * the second in (X1, X2), (Y1, Y2) and so on. Note that (X0, Y0) == * (XOFF, YOFF) and (X[NCHUNKS], Y[NCHUNKS]) == (XLIM, YLIM). * * This function assumes that the first lines of the specified portions of * the two files do not match, and likewise that the last lines do not * match. The caller must trim matching lines from the beginning and end * of the portions it is going to specify. */ function _diag ($xoff, $xlim, $yoff, $ylim, $nchunks) { $flip = false; if ($xlim - $xoff > $ylim - $yoff) { /* Things seems faster (I'm not sure I understand why) when the * shortest sequence is in X. */ $flip = true; list ($xoff, $xlim, $yoff, $ylim) = array($yoff, $ylim, $xoff, $xlim); } if ($flip) { for ($i = $ylim - 1; $i >= $yoff; $i--) { $ymatches[$this->xv[$i]][] = $i; } } else { for ($i = $ylim - 1; $i >= $yoff; $i--) { $ymatches[$this->yv[$i]][] = $i; } } $this->lcs = 0; $this->seq[0]= $yoff - 1; $this->in_seq = array(); $ymids[0] = array(); $numer = $xlim - $xoff + $nchunks - 1; $x = $xoff; for ($chunk = 0; $chunk < $nchunks; $chunk++) { if ($chunk > 0) { for ($i = 0; $i <= $this->lcs; $i++) { $ymids[$i][$chunk - 1] = $this->seq[$i]; } } $x1 = $xoff + (int)(($numer + ($xlim - $xoff) * $chunk) / $nchunks); for (; $x < $x1; $x++) { $line = $flip ? $this->yv[$x] : $this->xv[$x]; if (empty($ymatches[$line])) { continue; } $matches = $ymatches[$line]; reset($matches); while (list(, $y) = each($matches)) { if (empty($this->in_seq[$y])) { $k = $this->_lcsPos($y); assert($k > 0); $ymids[$k] = $ymids[$k - 1]; break; } } while (list(, $y) = each($matches)) { if ($y > $this->seq[$k - 1]) { assert($y <= $this->seq[$k]); /* Optimization: this is a common case: next match is * just replacing previous match. */ $this->in_seq[$this->seq[$k]] = false; $this->seq[$k] = $y; $this->in_seq[$y] = 1; } elseif (empty($this->in_seq[$y])) { $k = $this->_lcsPos($y); assert($k > 0); $ymids[$k] = $ymids[$k - 1]; } } } } $seps[] = $flip ? array($yoff, $xoff) : array($xoff, $yoff); $ymid = $ymids[$this->lcs]; for ($n = 0; $n < $nchunks - 1; $n++) { $x1 = $xoff + (int)(($numer + ($xlim - $xoff) * $n) / $nchunks); $y1 = $ymid[$n] + 1; $seps[] = $flip ? array($y1, $x1) : array($x1, $y1); } $seps[] = $flip ? array($ylim, $xlim) : array($xlim, $ylim); return array($this->lcs, $seps); } function _lcsPos($ypos) { $end = $this->lcs; if ($end == 0 || $ypos > $this->seq[$end]) { $this->seq[++$this->lcs] = $ypos; $this->in_seq[$ypos] = 1; return $this->lcs; } $beg = 1; while ($beg < $end) { $mid = (int)(($beg + $end) / 2); if ($ypos > $this->seq[$mid]) { $beg = $mid + 1; } else { $end = $mid; } } assert($ypos != $this->seq[$end]); $this->in_seq[$this->seq[$end]] = false; $this->seq[$end] = $ypos; $this->in_seq[$ypos] = 1; return $end; } /** * Finds LCS of two sequences. * * The results are recorded in the vectors $this->{x,y}changed[], by * storing a 1 in the element for each line that is an insertion or * deletion (ie. is not in the LCS). * * The subsequence of file 0 is (XOFF, XLIM) and likewise for file 1. * * Note that XLIM, YLIM are exclusive bounds. All line numbers are * origin-0 and discarded lines are not counted. */ function _compareseq ($xoff, $xlim, $yoff, $ylim) { /* Slide down the bottom initial diagonal. */ while ($xoff < $xlim && $yoff < $ylim && $this->xv[$xoff] == $this->yv[$yoff]) { ++$xoff; ++$yoff; } /* Slide up the top initial diagonal. */ while ($xlim > $xoff && $ylim > $yoff && $this->xv[$xlim - 1] == $this->yv[$ylim - 1]) { --$xlim; --$ylim; } if ($xoff == $xlim || $yoff == $ylim) { $lcs = 0; } else { /* This is ad hoc but seems to work well. $nchunks = * sqrt(min($xlim - $xoff, $ylim - $yoff) / 2.5); $nchunks = * max(2,min(8,(int)$nchunks)); */ $nchunks = min(7, $xlim - $xoff, $ylim - $yoff) + 1; list($lcs, $seps) = $this->_diag($xoff, $xlim, $yoff, $ylim, $nchunks); } if ($lcs == 0) { /* X and Y sequences have no common subsequence: mark all * changed. */ while ($yoff < $ylim) { $this->ychanged[$this->yind[$yoff++]] = 1; } while ($xoff < $xlim) { $this->xchanged[$this->xind[$xoff++]] = 1; } } else { /* Use the partitions to split this problem into subproblems. */ reset($seps); $pt1 = $seps[0]; while ($pt2 = next($seps)) { $this->_compareseq ($pt1[0], $pt2[0], $pt1[1], $pt2[1]); $pt1 = $pt2; } } } /** * Adjusts inserts/deletes of identical lines to join changes as much as * possible. * * We do something when a run of changed lines include a line at one end * and has an excluded, identical line at the other. We are free to * choose which identical line is included. `compareseq' usually chooses * the one at the beginning, but usually it is cleaner to consider the * following identical line to be the "change". * * This is extracted verbatim from analyze.c (GNU diffutils-2.7). */ function _shiftBoundaries($lines, &$changed, $other_changed) { $i = 0; $j = 0; assert('count($lines) == count($changed)'); $len = count($lines); $other_len = count($other_changed); while (1) { /* Scan forward to find the beginning of another run of * changes. Also keep track of the corresponding point in the * other file. * * Throughout this code, $i and $j are adjusted together so that * the first $i elements of $changed and the first $j elements of * $other_changed both contain the same number of zeros (unchanged * lines). * * Furthermore, $j is always kept so that $j == $other_len or * $other_changed[$j] == false. */ while ($j < $other_len && $other_changed[$j]) { $j++; } while ($i < $len && ! $changed[$i]) { assert('$j < $other_len && ! $other_changed[$j]'); $i++; $j++; while ($j < $other_len && $other_changed[$j]) { $j++; } } if ($i == $len) { break; } $start = $i; /* Find the end of this run of changes. */ while (++$i < $len && $changed[$i]) { continue; } do { /* Record the length of this run of changes, so that we can * later determine whether the run has grown. */ $runlength = $i - $start; /* Move the changed region back, so long as the previous * unchanged line matches the last changed one. This merges * with previous changed regions. */ while ($start > 0 && $lines[$start - 1] == $lines[$i - 1]) { $changed[--$start] = 1; $changed[--$i] = false; while ($start > 0 && $changed[$start - 1]) { $start--; } assert('$j > 0'); while ($other_changed[--$j]) { continue; } assert('$j >= 0 && !$other_changed[$j]'); } /* Set CORRESPONDING to the end of the changed run, at the * last point where it corresponds to a changed run in the * other file. CORRESPONDING == LEN means no such point has * been found. */ $corresponding = $j < $other_len ? $i : $len; /* Move the changed region forward, so long as the first * changed line matches the following unchanged one. This * merges with following changed regions. Do this second, so * that if there are no merges, the changed region is moved * forward as far as possible. */ while ($i < $len && $lines[$start] == $lines[$i]) { $changed[$start++] = false; $changed[$i++] = 1; while ($i < $len && $changed[$i]) { $i++; } assert('$j < $other_len && ! $other_changed[$j]'); $j++; if ($j < $other_len && $other_changed[$j]) { $corresponding = $i; while ($j < $other_len && $other_changed[$j]) { $j++; } } } } while ($runlength != $i - $start); /* If possible, move the fully-merged run of changes back to a * corresponding run in the other file. */ while ($corresponding < $i) { $changed[--$start] = 1; $changed[--$i] = 0; assert('$j > 0'); while ($other_changed[--$j]) { continue; } assert('$j >= 0 && !$other_changed[$j]'); } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/Text/Diff/Renderer/��������������������������������������������������������������0000755�0001066�0001066�00000000000�11051167752�015003� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/Text/Diff/Renderer/inline.php����������������������������������������������������0000644�0001066�0001066�00000011230�11046661417�016770� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * "Inline" diff renderer. * * $Horde: framework/Text_Diff/Diff/Renderer/inline.php,v 1.21 2008/01/04 10:07:51 jan Exp $ * * Copyright 2004-2008 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you did * not receive this file, see http://opensource.org/licenses/lgpl-license.php. * * @author Ciprian Popovici * @package Text_Diff */ /** Text_Diff_Renderer */ // WP #7391 require_once dirname(dirname(__FILE__)) . '/Renderer.php'; /** * "Inline" diff renderer. * * This class renders diffs in the Wiki-style "inline" format. * * @author Ciprian Popovici * @package Text_Diff */ class Text_Diff_Renderer_inline extends Text_Diff_Renderer { /** * Number of leading context "lines" to preserve. */ var $_leading_context_lines = 10000; /** * Number of trailing context "lines" to preserve. */ var $_trailing_context_lines = 10000; /** * Prefix for inserted text. */ var $_ins_prefix = '<ins>'; /** * Suffix for inserted text. */ var $_ins_suffix = '</ins>'; /** * Prefix for deleted text. */ var $_del_prefix = '<del>'; /** * Suffix for deleted text. */ var $_del_suffix = '</del>'; /** * Header for each change block. */ var $_block_header = ''; /** * What are we currently splitting on? Used to recurse to show word-level * changes. */ var $_split_level = 'lines'; function _blockHeader($xbeg, $xlen, $ybeg, $ylen) { return $this->_block_header; } function _startBlock($header) { return $header; } function _lines($lines, $prefix = ' ', $encode = true) { if ($encode) { array_walk($lines, array(&$this, '_encode')); } if ($this->_split_level == 'words') { return implode('', $lines); } else { return implode("\n", $lines) . "\n"; } } function _added($lines) { array_walk($lines, array(&$this, '_encode')); $lines[0] = $this->_ins_prefix . $lines[0]; $lines[count($lines) - 1] .= $this->_ins_suffix; return $this->_lines($lines, ' ', false); } function _deleted($lines, $words = false) { array_walk($lines, array(&$this, '_encode')); $lines[0] = $this->_del_prefix . $lines[0]; $lines[count($lines) - 1] .= $this->_del_suffix; return $this->_lines($lines, ' ', false); } function _changed($orig, $final) { /* If we've already split on words, don't try to do so again - just * display. */ if ($this->_split_level == 'words') { $prefix = ''; while ($orig[0] !== false && $final[0] !== false && substr($orig[0], 0, 1) == ' ' && substr($final[0], 0, 1) == ' ') { $prefix .= substr($orig[0], 0, 1); $orig[0] = substr($orig[0], 1); $final[0] = substr($final[0], 1); } return $prefix . $this->_deleted($orig) . $this->_added($final); } $text1 = implode("\n", $orig); $text2 = implode("\n", $final); /* Non-printing newline marker. */ $nl = "\0"; /* We want to split on word boundaries, but we need to * preserve whitespace as well. Therefore we split on words, * but include all blocks of whitespace in the wordlist. */ $diff = new Text_Diff($this->_splitOnWords($text1, $nl), $this->_splitOnWords($text2, $nl)); /* Get the diff in inline format. */ $renderer = new Text_Diff_Renderer_inline(array_merge($this->getParams(), array('split_level' => 'words'))); /* Run the diff and get the output. */ return str_replace($nl, "\n", $renderer->render($diff)) . "\n"; } function _splitOnWords($string, $newlineEscape = "\n") { // Ignore \0; otherwise the while loop will never finish. $string = str_replace("\0", '', $string); $words = array(); $length = strlen($string); $pos = 0; while ($pos < $length) { // Eat a word with any preceding whitespace. $spaces = strspn(substr($string, $pos), " \n"); $nextpos = strcspn(substr($string, $pos + $spaces), " \n"); $words[] = str_replace("\n", $newlineEscape, substr($string, $pos, $spaces + $nextpos)); $pos += $spaces + $nextpos; } return $words; } function _encode(&$string) { $string = htmlspecialchars($string); } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/Text/Diff/Renderer.php�����������������������������������������������������������0000644�0001066�0001066�00000015176�11002230355�015510� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * A class to render Diffs in different formats. * * This class renders the diff in classic diff format. It is intended that * this class be customized via inheritance, to obtain fancier outputs. * * $Horde: framework/Text_Diff/Diff/Renderer.php,v 1.21 2008/01/04 10:07:50 jan Exp $ * * Copyright 2004-2008 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you did * not receive this file, see http://opensource.org/licenses/lgpl-license.php. * * @package Text_Diff */ class Text_Diff_Renderer { /** * Number of leading context "lines" to preserve. * * This should be left at zero for this class, but subclasses may want to * set this to other values. */ var $_leading_context_lines = 0; /** * Number of trailing context "lines" to preserve. * * This should be left at zero for this class, but subclasses may want to * set this to other values. */ var $_trailing_context_lines = 0; /** * Constructor. */ function Text_Diff_Renderer($params = array()) { foreach ($params as $param => $value) { $v = '_' . $param; if (isset($this->$v)) { $this->$v = $value; } } } /** * Get any renderer parameters. * * @return array All parameters of this renderer object. */ function getParams() { $params = array(); foreach (get_object_vars($this) as $k => $v) { if ($k[0] == '_') { $params[substr($k, 1)] = $v; } } return $params; } /** * Renders a diff. * * @param Text_Diff $diff A Text_Diff object. * * @return string The formatted output. */ function render($diff) { $xi = $yi = 1; $block = false; $context = array(); $nlead = $this->_leading_context_lines; $ntrail = $this->_trailing_context_lines; $output = $this->_startDiff(); $diffs = $diff->getDiff(); foreach ($diffs as $i => $edit) { /* If these are unchanged (copied) lines, and we want to keep * leading or trailing context lines, extract them from the copy * block. */ if (is_a($edit, 'Text_Diff_Op_copy')) { /* Do we have any diff blocks yet? */ if (is_array($block)) { /* How many lines to keep as context from the copy * block. */ $keep = $i == count($diffs) - 1 ? $ntrail : $nlead + $ntrail; if (count($edit->orig) <= $keep) { /* We have less lines in the block than we want for * context => keep the whole block. */ $block[] = $edit; } else { if ($ntrail) { /* Create a new block with as many lines as we need * for the trailing context. */ $context = array_slice($edit->orig, 0, $ntrail); $block[] = &new Text_Diff_Op_copy($context); } /* @todo */ $output .= $this->_block($x0, $ntrail + $xi - $x0, $y0, $ntrail + $yi - $y0, $block); $block = false; } } /* Keep the copy block as the context for the next block. */ $context = $edit->orig; } else { /* Don't we have any diff blocks yet? */ if (!is_array($block)) { /* Extract context lines from the preceding copy block. */ $context = array_slice($context, count($context) - $nlead); $x0 = $xi - count($context); $y0 = $yi - count($context); $block = array(); if ($context) { $block[] = &new Text_Diff_Op_copy($context); } } $block[] = $edit; } if ($edit->orig) { $xi += count($edit->orig); } if ($edit->final) { $yi += count($edit->final); } } if (is_array($block)) { $output .= $this->_block($x0, $xi - $x0, $y0, $yi - $y0, $block); } return $output . $this->_endDiff(); } function _block($xbeg, $xlen, $ybeg, $ylen, &$edits) { $output = $this->_startBlock($this->_blockHeader($xbeg, $xlen, $ybeg, $ylen)); foreach ($edits as $edit) { switch (strtolower(get_class($edit))) { case 'text_diff_op_copy': $output .= $this->_context($edit->orig); break; case 'text_diff_op_add': $output .= $this->_added($edit->final); break; case 'text_diff_op_delete': $output .= $this->_deleted($edit->orig); break; case 'text_diff_op_change': $output .= $this->_changed($edit->orig, $edit->final); break; } } return $output . $this->_endBlock(); } function _startDiff() { return ''; } function _endDiff() { return ''; } function _blockHeader($xbeg, $xlen, $ybeg, $ylen) { if ($xlen > 1) { $xbeg .= ',' . ($xbeg + $xlen - 1); } if ($ylen > 1) { $ybeg .= ',' . ($ybeg + $ylen - 1); } // this matches the GNU Diff behaviour if ($xlen && !$ylen) { $ybeg--; } elseif (!$xlen) { $xbeg--; } return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg; } function _startBlock($header) { return $header . "\n"; } function _endBlock() { return ''; } function _lines($lines, $prefix = ' ') { return $prefix . implode("\n$prefix", $lines) . "\n"; } function _context($lines) { return $this->_lines($lines, ' '); } function _added($lines) { return $this->_lines($lines, '> '); } function _deleted($lines) { return $this->_lines($lines, '< '); } function _changed($orig, $final) { return $this->_deleted($orig) . "---\n" . $this->_added($final); } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/Text/Diff.php��������������������������������������������������������������������0000644�0001066�0001066�00000025466�11046661417�013764� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * General API for generating and formatting diffs - the differences between * two sequences of strings. * * The original PHP version of this code was written by Geoffrey T. Dairiki * <dairiki@dairiki.org>, and is used/adapted with his permission. * * $Horde: framework/Text_Diff/Diff.php,v 1.26 2008/01/04 10:07:49 jan Exp $ * * Copyright 2004 Geoffrey T. Dairiki <dairiki@dairiki.org> * Copyright 2004-2008 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you did * not receive this file, see http://opensource.org/licenses/lgpl-license.php. * * @package Text_Diff * @author Geoffrey T. Dairiki <dairiki@dairiki.org> */ class Text_Diff { /** * Array of changes. * * @var array */ var $_edits; /** * Computes diffs between sequences of strings. * * @param string $engine Name of the diffing engine to use. 'auto' * will automatically select the best. * @param array $params Parameters to pass to the diffing engine. * Normally an array of two arrays, each * containing the lines from a file. */ function Text_Diff($engine, $params) { // Backward compatibility workaround. if (!is_string($engine)) { $params = array($engine, $params); $engine = 'auto'; } if ($engine == 'auto') { $engine = extension_loaded('xdiff') ? 'xdiff' : 'native'; } else { $engine = basename($engine); } // WP #7391 require_once dirname(__FILE__).'/Diff/Engine/' . $engine . '.php'; $class = 'Text_Diff_Engine_' . $engine; $diff_engine = new $class(); $this->_edits = call_user_func_array(array($diff_engine, 'diff'), $params); } /** * Returns the array of differences. */ function getDiff() { return $this->_edits; } /** * Computes a reversed diff. * * Example: * <code> * $diff = new Text_Diff($lines1, $lines2); * $rev = $diff->reverse(); * </code> * * @return Text_Diff A Diff object representing the inverse of the * original diff. Note that we purposely don't return a * reference here, since this essentially is a clone() * method. */ function reverse() { if (version_compare(zend_version(), '2', '>')) { $rev = clone($this); } else { $rev = $this; } $rev->_edits = array(); foreach ($this->_edits as $edit) { $rev->_edits[] = $edit->reverse(); } return $rev; } /** * Checks for an empty diff. * * @return boolean True if two sequences were identical. */ function isEmpty() { foreach ($this->_edits as $edit) { if (!is_a($edit, 'Text_Diff_Op_copy')) { return false; } } return true; } /** * Computes the length of the Longest Common Subsequence (LCS). * * This is mostly for diagnostic purposes. * * @return integer The length of the LCS. */ function lcs() { $lcs = 0; foreach ($this->_edits as $edit) { if (is_a($edit, 'Text_Diff_Op_copy')) { $lcs += count($edit->orig); } } return $lcs; } /** * Gets the original set of lines. * * This reconstructs the $from_lines parameter passed to the constructor. * * @return array The original sequence of strings. */ function getOriginal() { $lines = array(); foreach ($this->_edits as $edit) { if ($edit->orig) { array_splice($lines, count($lines), 0, $edit->orig); } } return $lines; } /** * Gets the final set of lines. * * This reconstructs the $to_lines parameter passed to the constructor. * * @return array The sequence of strings. */ function getFinal() { $lines = array(); foreach ($this->_edits as $edit) { if ($edit->final) { array_splice($lines, count($lines), 0, $edit->final); } } return $lines; } /** * Removes trailing newlines from a line of text. This is meant to be used * with array_walk(). * * @param string $line The line to trim. * @param integer $key The index of the line in the array. Not used. */ function trimNewlines(&$line, $key) { $line = str_replace(array("\n", "\r"), '', $line); } /** * Determines the location of the system temporary directory. * * @static * * @access protected * * @return string A directory name which can be used for temp files. * Returns false if one could not be found. */ function _getTempDir() { $tmp_locations = array('/tmp', '/var/tmp', 'c:\WUTemp', 'c:\temp', 'c:\windows\temp', 'c:\winnt\temp'); /* Try PHP's upload_tmp_dir directive. */ $tmp = ini_get('upload_tmp_dir'); /* Otherwise, try to determine the TMPDIR environment variable. */ if (!strlen($tmp)) { $tmp = getenv('TMPDIR'); } /* If we still cannot determine a value, then cycle through a list of * preset possibilities. */ while (!strlen($tmp) && count($tmp_locations)) { $tmp_check = array_shift($tmp_locations); if (@is_dir($tmp_check)) { $tmp = $tmp_check; } } /* If it is still empty, we have failed, so return false; otherwise * return the directory determined. */ return strlen($tmp) ? $tmp : false; } /** * Checks a diff for validity. * * This is here only for debugging purposes. */ function _check($from_lines, $to_lines) { if (serialize($from_lines) != serialize($this->getOriginal())) { trigger_error("Reconstructed original doesn't match", E_USER_ERROR); } if (serialize($to_lines) != serialize($this->getFinal())) { trigger_error("Reconstructed final doesn't match", E_USER_ERROR); } $rev = $this->reverse(); if (serialize($to_lines) != serialize($rev->getOriginal())) { trigger_error("Reversed original doesn't match", E_USER_ERROR); } if (serialize($from_lines) != serialize($rev->getFinal())) { trigger_error("Reversed final doesn't match", E_USER_ERROR); } $prevtype = null; foreach ($this->_edits as $edit) { if ($prevtype == get_class($edit)) { trigger_error("Edit sequence is non-optimal", E_USER_ERROR); } $prevtype = get_class($edit); } return true; } } /** * @package Text_Diff * @author Geoffrey T. Dairiki <dairiki@dairiki.org> */ class Text_MappedDiff extends Text_Diff { /** * Computes a diff between sequences of strings. * * This can be used to compute things like case-insensitve diffs, or diffs * which ignore changes in white-space. * * @param array $from_lines An array of strings. * @param array $to_lines An array of strings. * @param array $mapped_from_lines This array should have the same size * number of elements as $from_lines. The * elements in $mapped_from_lines and * $mapped_to_lines are what is actually * compared when computing the diff. * @param array $mapped_to_lines This array should have the same number * of elements as $to_lines. */ function Text_MappedDiff($from_lines, $to_lines, $mapped_from_lines, $mapped_to_lines) { assert(count($from_lines) == count($mapped_from_lines)); assert(count($to_lines) == count($mapped_to_lines)); parent::Text_Diff($mapped_from_lines, $mapped_to_lines); $xi = $yi = 0; for ($i = 0; $i < count($this->_edits); $i++) { $orig = &$this->_edits[$i]->orig; if (is_array($orig)) { $orig = array_slice($from_lines, $xi, count($orig)); $xi += count($orig); } $final = &$this->_edits[$i]->final; if (is_array($final)) { $final = array_slice($to_lines, $yi, count($final)); $yi += count($final); } } } } /** * @package Text_Diff * @author Geoffrey T. Dairiki <dairiki@dairiki.org> * * @access private */ class Text_Diff_Op { var $orig; var $final; function &reverse() { trigger_error('Abstract method', E_USER_ERROR); } function norig() { return $this->orig ? count($this->orig) : 0; } function nfinal() { return $this->final ? count($this->final) : 0; } } /** * @package Text_Diff * @author Geoffrey T. Dairiki <dairiki@dairiki.org> * * @access private */ class Text_Diff_Op_copy extends Text_Diff_Op { function Text_Diff_Op_copy($orig, $final = false) { if (!is_array($final)) { $final = $orig; } $this->orig = $orig; $this->final = $final; } function &reverse() { $reverse = &new Text_Diff_Op_copy($this->final, $this->orig); return $reverse; } } /** * @package Text_Diff * @author Geoffrey T. Dairiki <dairiki@dairiki.org> * * @access private */ class Text_Diff_Op_delete extends Text_Diff_Op { function Text_Diff_Op_delete($lines) { $this->orig = $lines; $this->final = false; } function &reverse() { $reverse = &new Text_Diff_Op_add($this->orig); return $reverse; } } /** * @package Text_Diff * @author Geoffrey T. Dairiki <dairiki@dairiki.org> * * @access private */ class Text_Diff_Op_add extends Text_Diff_Op { function Text_Diff_Op_add($lines) { $this->final = $lines; $this->orig = false; } function &reverse() { $reverse = &new Text_Diff_Op_delete($this->final); return $reverse; } } /** * @package Text_Diff * @author Geoffrey T. Dairiki <dairiki@dairiki.org> * * @access private */ class Text_Diff_Op_change extends Text_Diff_Op { function Text_Diff_Op_change($orig, $final) { $this->orig = $orig; $this->final = $final; } function &reverse() { $reverse = &new Text_Diff_Op_change($this->final, $this->orig); return $reverse; } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/version.php����������������������������������������������������������������������0000644�0001066�0001066�00000000566�11051141702�013631� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * This holds the version number in a separate file so we can bump it without cluttering the SVN */ /** * The WordPress version string * * @global string $wp_version */ $wp_version = '2.6.1'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * * @global int $wp_db_version */ $wp_db_version = 8204; ?> ������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/class.wp-scripts.php�������������������������������������������������������������0000644�0001066�0001066�00000005161�11035172124�015363� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php class WP_Scripts extends WP_Dependencies { var $base_url; // Full URL with trailing slash var $default_version; function __construct() { do_action_ref_array( 'wp_default_scripts', array(&$this) ); } /** * Prints scripts * * Prints the scripts passed to it or the print queue. Also prints all necessary dependencies. * * @param mixed handles (optional) Scripts to be printed. (void) prints queue, (string) prints that script, (array of strings) prints those scripts. * @return array Scripts that have been printed */ function print_scripts( $handles = false ) { return $this->do_items( $handles ); } function print_scripts_l10n( $handle ) { if ( empty($this->registered[$handle]->extra['l10n']) || empty($this->registered[$handle]->extra['l10n'][0]) || !is_array($this->registered[$handle]->extra['l10n'][1]) ) return false; $object_name = $this->registered[$handle]->extra['l10n'][0]; echo "<script type='text/javascript'>\n"; echo "/* <![CDATA[ */\n"; echo "\t$object_name = {\n"; $eol = ''; foreach ( $this->registered[$handle]->extra['l10n'][1] as $var => $val ) { echo "$eol\t\t$var: \"" . js_escape( $val ) . '"'; $eol = ",\n"; } echo "\n\t}\n"; echo "/* ]]> */\n"; echo "</script>\n"; return true; } function do_item( $handle ) { if ( !parent::do_item($handle) ) return false; $ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version; if ( isset($this->args[$handle]) ) $ver .= '&' . $this->args[$handle]; $src = $this->registered[$handle]->src; if ( !preg_match('|^https?://|', $src) && !preg_match('|^' . preg_quote(WP_CONTENT_URL) . '|', $src) ) { $src = $this->base_url . $src; } $src = add_query_arg('ver', $ver, $src); $src = clean_url(apply_filters( 'script_loader_src', $src, $handle )); $this->print_scripts_l10n( $handle ); echo "<script type='text/javascript' src='$src'></script>\n"; return true; } /** * Localizes a script * * Localizes only if script has already been added * * @param string handle Script name * @param string object_name Name of JS object to hold l10n info * @param array l10n Array of JS var name => localized string * @return bool Successful localization */ function localize( $handle, $object_name, $l10n ) { if ( !$object_name || !$l10n ) return false; return $this->add_data( $handle, 'l10n', array( $object_name, $l10n ) ); } function all_deps( $handles, $recursion = false ) { $r = parent::all_deps( $handles, $recursion ); if ( !$recursion ) $this->to_do = apply_filters( 'print_scripts_array', $this->to_do ); return $r; } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/update.php�����������������������������������������������������������������������0000644�0001066�0001066�00000013155�11044674500�013435� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * A simple set of functions to check our version 1.0 update service * * @package WordPress * @since 2.3 */ /** * wp_version_check() - Check WordPress version against the newest version. * * The WordPress version, PHP version, and Locale is sent. Checks against the WordPress server at * api.wordpress.org. Will only check if PHP has fsockopen enabled and WordPress isn't installing. * * @package WordPress * @since 2.3 * @uses $wp_version Used to check against the newest WordPress version. * * @return mixed Returns null if update is unsupported. Returns false if check is too soon. */ function wp_version_check() { if ( !function_exists('fsockopen') || defined('WP_INSTALLING') ) return; global $wp_version; $php_version = phpversion(); $current = get_option( 'update_core' ); $locale = get_locale(); if ( isset( $current->last_checked ) && 43200 > ( time() - $current->last_checked ) && $current->version_checked == $wp_version ) return false; $new_option = ''; $new_option->last_checked = time(); // this gets set whether we get a response or not, so if something is down or misconfigured it won't delay the page load for more than 3 seconds, twice a day $new_option->version_checked = $wp_version; $http_request = "GET /core/version-check/1.1/?version=$wp_version&php=$php_version&locale=$locale HTTP/1.0\r\n"; $http_request .= "Host: api.wordpress.org\r\n"; $http_request .= 'Content-Type: application/x-www-form-urlencoded; charset=' . get_option('blog_charset') . "\r\n"; $http_request .= 'User-Agent: WordPress/' . $wp_version . '; ' . get_bloginfo('url') . "\r\n"; $http_request .= "\r\n"; $response = ''; if ( false !== ( $fs = @fsockopen( 'api.wordpress.org', 80, $errno, $errstr, 3 ) ) && is_resource($fs) ) { fwrite( $fs, $http_request ); while ( !feof( $fs ) ) $response .= fgets( $fs, 1160 ); // One TCP-IP packet fclose( $fs ); $response = explode("\r\n\r\n", $response, 2); if ( !preg_match( '|HTTP/.*? 200|', $response[0] ) ) return false; $body = trim( $response[1] ); $body = str_replace(array("\r\n", "\r"), "\n", $body); $returns = explode("\n", $body); $new_option->response = attribute_escape( $returns[0] ); if ( isset( $returns[1] ) ) $new_option->url = clean_url( $returns[1] ); if ( isset( $returns[2] ) ) $new_option->current = attribute_escape( $returns[2] ); } update_option( 'update_core', $new_option ); } add_action( 'init', 'wp_version_check' ); /** * wp_update_plugins() - Check plugin versions against the latest versions hosted on WordPress.org. * * The WordPress version, PHP version, and Locale is sent along with a list of all plugins installed. * Checks against the WordPress server at api.wordpress.org. * Will only check if PHP has fsockopen enabled and WordPress isn't installing. * * @package WordPress * @since 2.3 * @uses $wp_version Used to notidy the WordPress version. * * @return mixed Returns null if update is unsupported. Returns false if check is too soon. */ function wp_update_plugins() { global $wp_version; if ( !function_exists('fsockopen') || defined('WP_INSTALLING') ) return false; // If running blog-side, bail unless we've not checked in the last 12 hours if ( !function_exists( 'get_plugins' ) ) require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); $plugins = get_plugins(); $active = get_option( 'active_plugins' ); $current = get_option( 'update_plugins' ); $new_option = ''; $new_option->last_checked = time(); $time_not_changed = isset( $current->last_checked ) && 43200 > ( time() - $current->last_checked ); $plugin_changed = false; foreach ( $plugins as $file => $p ) { $new_option->checked[ $file ] = $p['Version']; if ( !isset( $current->checked[ $file ] ) ) { $plugin_changed = true; continue; } if ( strval($current->checked[ $file ]) !== strval($p['Version']) ) $plugin_changed = true; } foreach ( (array) $current->response as $plugin_file => $update_details ) { if ( ! isset($plugins[ $plugin_file ]) ) { $plugin_changed = true; } } // Bail if we've checked in the last 12 hours and if nothing has changed if ( $time_not_changed && !$plugin_changed ) return false; $to_send->plugins = $plugins; $to_send->active = $active; $send = serialize( $to_send ); $request = 'plugins=' . urlencode( $send ); $http_request = "POST /plugins/update-check/1.0/ HTTP/1.0\r\n"; $http_request .= "Host: api.wordpress.org\r\n"; $http_request .= "Content-Type: application/x-www-form-urlencoded; charset=" . get_option('blog_charset') . "\r\n"; $http_request .= "Content-Length: " . strlen($request) . "\r\n"; $http_request .= 'User-Agent: WordPress/' . $wp_version . '; ' . get_bloginfo('url') . "\r\n"; $http_request .= "\r\n"; $http_request .= $request; $response = ''; if( false != ( $fs = @fsockopen( 'api.wordpress.org', 80, $errno, $errstr, 3) ) && is_resource($fs) ) { fwrite($fs, $http_request); while ( !feof($fs) ) $response .= fgets($fs, 1160); // One TCP-IP packet fclose($fs); $response = explode("\r\n\r\n", $response, 2); } $response = unserialize( $response[1] ); if ( $response ) $new_option->response = $response; update_option( 'update_plugins', $new_option ); } function _maybe_update_plugins() { $current = get_option( 'update_plugins' ); if ( isset( $current->last_checked ) && 43200 > ( time() - $current->last_checked ) ) return; wp_update_plugins(); } add_action( 'load-plugins.php', 'wp_update_plugins' ); add_action( 'admin_init', '_maybe_update_plugins' ); add_action( 'wp_update_plugins', 'wp_update_plugins' ); if ( !wp_next_scheduled('wp_update_plugins') ) wp_schedule_event(time(), 'twicedaily', 'wp_update_plugins'); ?> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/functions.wp-scripts.php���������������������������������������������������������0000644�0001066�0001066�00000003747�11014734564�016307� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Prints script tags in document head * * Called by admin-header.php and by wp_head hook. Since it is called by wp_head on every page load, * the function does not instantiate the WP_Scripts object unless script names are explicitly passed. * Does make use of already instantiated $wp_scripts if present. * Use provided wp_print_scripts hook to register/enqueue new scripts. * * @see WP_Scripts::print_scripts() */ function wp_print_scripts( $handles = false ) { do_action( 'wp_print_scripts' ); if ( '' === $handles ) // for wp_head $handles = false; global $wp_scripts; if ( !is_a($wp_scripts, 'WP_Scripts') ) { if ( !$handles ) return array(); // No need to instantiate if nothing's there. else $wp_scripts = new WP_Scripts(); } return $wp_scripts->do_items( $handles ); } function wp_register_script( $handle, $src, $deps = array(), $ver = false ) { global $wp_scripts; if ( !is_a($wp_scripts, 'WP_Scripts') ) $wp_scripts = new WP_Scripts(); $wp_scripts->add( $handle, $src, $deps, $ver ); } /** * Localizes a script * * Localizes only if script has already been added * * @see WP_Script::localize() */ function wp_localize_script( $handle, $object_name, $l10n ) { global $wp_scripts; if ( !is_a($wp_scripts, 'WP_Scripts') ) return false; return $wp_scripts->localize( $handle, $object_name, $l10n ); } function wp_deregister_script( $handle ) { global $wp_scripts; if ( !is_a($wp_scripts, 'WP_Scripts') ) $wp_scripts = new WP_Scripts(); $wp_scripts->remove( $handle ); } /** * Equeues script * * Registers the script if src provided (does NOT overwrite) and enqueues. * * @see WP_Script::add(), WP_Script::enqueue() */ function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false ) { global $wp_scripts; if ( !is_a($wp_scripts, 'WP_Scripts') ) $wp_scripts = new WP_Scripts(); if ( $src ) { $_handle = explode('?', $handle); $wp_scripts->add( $_handle[0], $src, $deps, $ver ); } $wp_scripts->enqueue( $handle ); } �������������������������wp/dev/wp-includes/bookmark-template.php������������������������������������������������������������0000644�0001066�0001066�00000021365�11042700714�015566� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Bookmark Template Functions for usage in Themes * * @package WordPress * @subpackage Template */ /** * The formatted output of a list of bookmarks * * The $bookmarks array must contain bookmark objects and will be iterated over * to retrieve the bookmark to be used in the output. * * The output is formatted as HTML with no way to change that format. However, * what is between, before, and after can be changed. The link itself will be * HTML. * * This function is used internally by wp_list_bookmarks() and should not be * used by themes. * * The defaults for overwriting are: * 'show_updated' - Default is 0 (integer). Will show the time of when the * bookmark was last updated. * 'show_description' - Default is 0 (integer). Whether to show the description * of the bookmark. * 'show_images' - Default is 1 (integer). Whether to show link image if * available. * 'before' - Default is '<li>' (string). The html or text to prepend to each * bookmarks. * 'after' - Default is '</li>' (string). The html or text to append to each * bookmarks. * 'between' - Default is '\n' (string). The string for use in between the link, * description, and image. * 'show_rating' - Default is 0 (integer). Whether to show the link rating. * * @since 2.1 * @access private * @usedby wp_list_bookmarks() * * @param array $bookmarks List of bookmarks to traverse * @param string|array $args Optional. Overwrite the defaults. * @return string Formatted output in HTML */ function _walk_bookmarks($bookmarks, $args = '' ) { $defaults = array( 'show_updated' => 0, 'show_description' => 0, 'show_images' => 1, 'before' => '<li>', 'after' => '</li>', 'between' => "\n", 'show_rating' => 0 ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); $output = ''; // Blank string to start with. foreach ( (array) $bookmarks as $bookmark ) { if ( !isset($bookmark->recently_updated) ) $bookmark->recently_updated = false; $output .= $before; if ( $show_updated && $bookmark->recently_updated ) $output .= get_option('links_recently_updated_prepend'); $the_link = '#'; if ( !empty($bookmark->link_url) ) $the_link = clean_url($bookmark->link_url); $rel = $bookmark->link_rel; if ( '' != $rel ) $rel = ' rel="' . $rel . '"'; $desc = attribute_escape(sanitize_bookmark_field('link_description', $bookmark->link_description, $bookmark->link_id, 'display')); $name = attribute_escape(sanitize_bookmark_field('link_name', $bookmark->link_name, $bookmark->link_id, 'display')); $title = $desc; if ( $show_updated ) if ( '00' != substr($bookmark->link_updated_f, 0, 2) ) { $title .= ' ('; $title .= sprintf(__('Last updated: %s'), date(get_option('links_updated_date_format'), $bookmark->link_updated_f + (get_option('gmt_offset') * 3600))); $title .= ')'; } if ( '' != $title ) $title = ' title="' . $title . '"'; $alt = ' alt="' . $name . '"'; $target = $bookmark->link_target; if ( '' != $target ) $target = ' target="' . $target . '"'; $output .= '<a href="' . $the_link . '"' . $rel . $title . $target. '>'; if ( $bookmark->link_image != null && $show_images ) { if ( strpos($bookmark->link_image, 'http') !== false ) $output .= "<img src=\"$bookmark->link_image\" $alt $title />"; else // If it's a relative path $output .= "<img src=\"" . get_option('siteurl') . "$bookmark->link_image\" $alt $title />"; } else { $output .= $name; } $output .= '</a>'; if ( $show_updated && $bookmark->recently_updated ) $output .= get_option('links_recently_updated_append'); if ( $show_description && '' != $desc ) $output .= $between . $desc; if ($show_rating) { $output .= $between . get_linkrating($bookmark); } $output .= "$after\n"; } // end while return $output; } /** * Retrieve or echo all of the bookmarks * * List of default arguments are as follows: * 'orderby' - Default is 'name' (string). How to order the links by. String is * based off of the bookmark scheme. * 'order' - Default is 'ASC' (string). Either 'ASC' or 'DESC'. Orders in either * ascending or descending order. * 'limit' - Default is -1 (integer) or show all. The amount of bookmarks to * display. * 'category' - Default is empty string (string). Include the links in what * category ID(s). * 'category_name' - Default is empty string (string). Get links by category * name. * 'hide_invisible' - Default is 1 (integer). Whether to show (default) or hide * links marked as 'invisible'. * 'show_updated' - Default is 0 (integer). Will show the time of when the * bookmark was last updated. * 'echo' - Default is 1 (integer). Whether to echo (default) or return the * formatted bookmarks. * 'categorize' - Default is 1 (integer). Whether to show links listed by * category (default) or show links in one column. * * These options define how the Category name will appear before the category * links are displayed, if 'categorize' is 1. If 'categorize' is 0, then it will * display for only the 'title_li' string and only if 'title_li' is not empty. * 'title_li' - Default is 'Bookmarks' (translatable string). What to show * before the links appear. * 'title_before' - Default is '<h2>' (string). The HTML or text to show before * the 'title_li' string. * 'title_after' - Default is '</h2>' (string). The HTML or text to show after * the 'title_li' string. * 'class' - Default is 'linkcat' (string). The CSS class to use for the * 'title_li'. * * 'category_before' - Default is '<li id="%id" class="%class">'. String must * contain '%id' and '%class' to get * the id of the category and the 'class' argument. These are used for * formatting in themes. * Argument will be displayed before the 'title_before' argument. * 'category_after' - Default is '</li>' (string). The HTML or text that will * appear after the list of links. * * These are only used if 'categorize' is set to 1 or true. * 'category_orderby' - Default is 'name'. How to order the bookmark category * based on term scheme. * 'category_order' - Default is 'ASC'. Set the order by either ASC (ascending) * or DESC (descending). * * @see _walk_bookmarks() For other arguments that can be set in this function * and passed to _walk_bookmarks(). * @see get_bookmarks() For other arguments that can be set in this function and * passed to get_bookmarks(). * @link http://codex.wordpress.org/Template_Tags/wp_list_bookmarks * * @since 2.1 * @uses _list_bookmarks() Used to iterate over all of the bookmarks and return * the html * @uses get_terms() Gets all of the categories that are for links. * * @param string|array $args Optional. Overwrite the defaults of the function * @return string|null Will only return if echo option is set to not echo. * Default is not return anything. */ function wp_list_bookmarks($args = '') { $defaults = array( 'orderby' => 'name', 'order' => 'ASC', 'limit' => -1, 'category' => '', 'exclude_category' => '', 'category_name' => '', 'hide_invisible' => 1, 'show_updated' => 0, 'echo' => 1, 'categorize' => 1, 'title_li' => __('Bookmarks'), 'title_before' => '<h2>', 'title_after' => '</h2>', 'category_orderby' => 'name', 'category_order' => 'ASC', 'class' => 'linkcat', 'category_before' => '<li id="%id" class="%class">', 'category_after' => '</li>' ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); $output = ''; if ( $categorize ) { //Split the bookmarks into ul's for each category $cats = get_terms('link_category', array('name__like' => $category_name, 'include' => $category, 'exclude' => $exclude_category, 'orderby' => $category_orderby, 'order' => $category_order, 'hierarchical' => 0)); foreach ( (array) $cats as $cat ) { $params = array_merge($r, array('category'=>$cat->term_id)); $bookmarks = get_bookmarks($params); if ( empty($bookmarks) ) continue; $output .= str_replace(array('%id', '%class'), array("linkcat-$cat->term_id", $class), $category_before); $catname = apply_filters( "link_category", $cat->name ); $output .= "$title_before$catname$title_after\n\t<ul class='xoxo blogroll'>\n"; $output .= _walk_bookmarks($bookmarks, $r); $output .= "\n\t</ul>\n$category_after\n"; } } else { //output one single list using title_li for the title $bookmarks = get_bookmarks($r); if ( !empty($bookmarks) ) { if ( !empty( $title_li ) ){ $output .= str_replace(array('%id', '%class'), array("linkcat-$category", $class), $category_before); $output .= "$title_before$title_li$title_after\n\t<ul class='xoxo blogroll'>\n"; $output .= _walk_bookmarks($bookmarks, $r); $output .= "\n\t</ul>\n$category_after\n"; } else { $output .= _walk_bookmarks($bookmarks, $r); } } } $output = apply_filters( 'wp_list_bookmarks', $output ); if ( !$echo ) return $output; echo $output; } ?>���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/streams.php����������������������������������������������������������������������0000644�0001066�0001066�00000010523�11041677352�013632� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * PHP-Gettext External Library: StreamReader classes * * @package External * @subpackage PHP-gettext * * @internal Copyright (c) 2003, 2005 Danilo Segan <danilo@kvota.net>. This file is part of PHP-gettext. PHP-gettext is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. PHP-gettext 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 General Public License for more details. You should have received a copy of the GNU General Public License along with PHP-gettext; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // Simple class to wrap file streams, string streams, etc. // seek is essential, and it should be byte stream class StreamReader { // should return a string [FIXME: perhaps return array of bytes?] function read($bytes) { return false; } // should return new position function seekto($position) { return false; } // returns current position function currentpos() { return false; } // returns length of entire stream (limit for seekto()s) function length() { return false; } } class StringReader { var $_pos; var $_str; function StringReader($str='') { $this->_str = $str; $this->_pos = 0; // If string functions are overloaded, we need to use the mb versions $this->is_overloaded = ((ini_get("mbstring.func_overload") & 2) != 0) && function_exists('mb_substr'); } function _substr($string, $start, $length) { if ($this->is_overloaded) { return mb_substr($string,$start,$length,'ascii'); } else { return substr($string,$start,$length); } } function _strlen($string) { if ($this->is_overloaded) { return mb_strlen($string,'ascii'); } else { return strlen($string); } } function read($bytes) { $data = $this->_substr($this->_str, $this->_pos, $bytes); $this->_pos += $bytes; if ($this->_strlen($this->_str)<$this->_pos) $this->_pos = $this->_strlen($this->_str); return $data; } function seekto($pos) { $this->_pos = $pos; if ($this->_strlen($this->_str)<$this->_pos) $this->_pos = $this->_strlen($this->_str); return $this->_pos; } function currentpos() { return $this->_pos; } function length() { return $this->_strlen($this->_str); } } class FileReader { var $_pos; var $_fd; var $_length; function FileReader($filename) { if (file_exists($filename)) { $this->_length=filesize($filename); $this->_pos = 0; $this->_fd = fopen($filename,'rb'); if (!$this->_fd) { $this->error = 3; // Cannot read file, probably permissions return false; } } else { $this->error = 2; // File doesn't exist return false; } } function read($bytes) { if ($bytes) { fseek($this->_fd, $this->_pos); // PHP 5.1.1 does not read more than 8192 bytes in one fread() // the discussions at PHP Bugs suggest it's the intended behaviour while ($bytes > 0) { $chunk = fread($this->_fd, $bytes); $data .= $chunk; $bytes -= strlen($chunk); } $this->_pos = ftell($this->_fd); return $data; } else return ''; } function seekto($pos) { fseek($this->_fd, $pos); $this->_pos = ftell($this->_fd); return $this->_pos; } function currentpos() { return $this->_pos; } function length() { return $this->_length; } function close() { fclose($this->_fd); } } // Preloads entire file in memory first, then creates a StringReader // over it (it assumes knowledge of StringReader internals) class CachedFileReader extends StringReader { function CachedFileReader($filename) { parent::StringReader(); if (file_exists($filename)) { $length=filesize($filename); $fd = fopen($filename,'rb'); if (!$fd) { $this->error = 3; // Cannot read file, probably permissions return false; } $this->_str = fread($fd, $length); fclose($fd); } else { $this->error = 2; // File doesn't exist return false; } } } ?> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/class-snoopy.php�����������������������������������������������������������������0000644�0001066�0001066�00000112001�11024771575�014603� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Snoopy - the PHP net client * @author Monte Ohrt <monte@ispi.net> * @copyright 1999-2000 ispi, all rights reserved * @version 1.01 * @license GNU Lesser GPL * @link http://snoopy.sourceforge.net/ * @package Snoopy */ if ( !in_array('Snoopy', get_declared_classes() ) ) : /** * Snoopy - the PHP net client * * @author Monte Ohrt <monte@ispi.net> * @copyright (c): 1999-2000 ispi, all rights reserved * @version 1.01 * * 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 * * You may contact the author of Snoopy by e-mail at: * monte@ispi.net * * Or, write to: * Monte Ohrt * CTO, ispi * 237 S. 70th suite 220 * Lincoln, NE 68510 * * @link http://snoopy.sourceforge.net/ The latest version of Snoopy can be * obtained */ class Snoopy { /**** Public variables ****/ /* user definable vars */ var $host = "www.php.net"; // host name we are connecting to var $port = 80; // port we are connecting to var $proxy_host = ""; // proxy host to use var $proxy_port = ""; // proxy port to use var $proxy_user = ""; // proxy user to use var $proxy_pass = ""; // proxy password to use var $agent = "Snoopy v1.2.3"; // agent we masquerade as var $referer = ""; // referer info to pass var $cookies = array(); // array of cookies to pass // $cookies["username"]="joe"; var $rawheaders = array(); // array of raw headers to send // $rawheaders["Content-type"]="text/html"; var $maxredirs = 5; // http redirection depth maximum. 0 = disallow var $lastredirectaddr = ""; // contains address of last redirected address var $offsiteok = true; // allows redirection off-site var $maxframes = 0; // frame content depth maximum. 0 = disallow var $expandlinks = true; // expand links to fully qualified URLs. // this only applies to fetchlinks() // submitlinks(), and submittext() var $passcookies = true; // pass set cookies back through redirects // NOTE: this currently does not respect // dates, domains or paths. var $user = ""; // user for http authentication var $pass = ""; // password for http authentication // http accept types var $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*"; var $results = ""; // where the content is put var $error = ""; // error messages sent here var $response_code = ""; // response code returned from server var $headers = array(); // headers returned from server sent here var $maxlength = 8192; // max return data length (body) var $read_timeout = 0; // timeout on read operations, in seconds // supported only since PHP 4 Beta 4 // set to 0 to disallow timeouts var $timed_out = false; // if a read operation timed out var $status = 0; // http request status var $temp_dir = "/tmp"; // temporary directory that the webserver // has permission to write to. // under Windows, this should be C:\temp var $curl_path = "/usr/local/bin/curl"; // Snoopy will use cURL for fetching // SSL content if a full system path to // the cURL binary is supplied here. // set to false if you do not have // cURL installed. See http://curl.haxx.se // for details on installing cURL. // Snoopy does *not* use the cURL // library functions built into php, // as these functions are not stable // as of this Snoopy release. /**** Private variables ****/ var $_maxlinelen = 4096; // max line length (headers) var $_httpmethod = "GET"; // default http request method var $_httpversion = "HTTP/1.0"; // default http request version var $_submit_method = "POST"; // default submit method var $_submit_type = "application/x-www-form-urlencoded"; // default submit type var $_mime_boundary = ""; // MIME boundary for multipart/form-data submit type var $_redirectaddr = false; // will be set if page fetched is a redirect var $_redirectdepth = 0; // increments on an http redirect var $_frameurls = array(); // frame src urls var $_framedepth = 0; // increments on frame depth var $_isproxy = false; // set if using a proxy server var $_fp_timeout = 30; // timeout for socket connection /*======================================================================*\ Function: fetch Purpose: fetch the contents of a web page (and possibly other protocols in the future like ftp, nntp, gopher, etc.) Input: $URI the location of the page to fetch Output: $this->results the output text from the fetch \*======================================================================*/ function fetch($URI) { //preg_match("|^([^:]+)://([^:/]+)(:[\d]+)*(.*)|",$URI,$URI_PARTS); $URI_PARTS = parse_url($URI); if (!empty($URI_PARTS["user"])) $this->user = $URI_PARTS["user"]; if (!empty($URI_PARTS["pass"])) $this->pass = $URI_PARTS["pass"]; if (empty($URI_PARTS["query"])) $URI_PARTS["query"] = ''; if (empty($URI_PARTS["path"])) $URI_PARTS["path"] = ''; switch(strtolower($URI_PARTS["scheme"])) { case "http": $this->host = $URI_PARTS["host"]; if(!empty($URI_PARTS["port"])) $this->port = $URI_PARTS["port"]; if($this->_connect($fp)) { if($this->_isproxy) { // using proxy, send entire URI $this->_httprequest($URI,$fp,$URI,$this->_httpmethod); } else { $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : ""); // no proxy, send only the path $this->_httprequest($path, $fp, $URI, $this->_httpmethod); } $this->_disconnect($fp); if($this->_redirectaddr) { /* url was redirected, check if we've hit the max depth */ if($this->maxredirs > $this->_redirectdepth) { // only follow redirect if it's on this site, or offsiteok is true if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok) { /* follow the redirect */ $this->_redirectdepth++; $this->lastredirectaddr=$this->_redirectaddr; $this->fetch($this->_redirectaddr); } } } if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0) { $frameurls = $this->_frameurls; $this->_frameurls = array(); while(list(,$frameurl) = each($frameurls)) { if($this->_framedepth < $this->maxframes) { $this->fetch($frameurl); $this->_framedepth++; } else break; } } } else { return false; } return true; break; case "https": if(!$this->curl_path) return false; if(function_exists("is_executable")) if (!is_executable($this->curl_path)) return false; $this->host = $URI_PARTS["host"]; if(!empty($URI_PARTS["port"])) $this->port = $URI_PARTS["port"]; if($this->_isproxy) { // using proxy, send entire URI $this->_httpsrequest($URI,$URI,$this->_httpmethod); } else { $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : ""); // no proxy, send only the path $this->_httpsrequest($path, $URI, $this->_httpmethod); } if($this->_redirectaddr) { /* url was redirected, check if we've hit the max depth */ if($this->maxredirs > $this->_redirectdepth) { // only follow redirect if it's on this site, or offsiteok is true if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok) { /* follow the redirect */ $this->_redirectdepth++; $this->lastredirectaddr=$this->_redirectaddr; $this->fetch($this->_redirectaddr); } } } if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0) { $frameurls = $this->_frameurls; $this->_frameurls = array(); while(list(,$frameurl) = each($frameurls)) { if($this->_framedepth < $this->maxframes) { $this->fetch($frameurl); $this->_framedepth++; } else break; } } return true; break; default: // not a valid protocol $this->error = 'Invalid protocol "'.$URI_PARTS["scheme"].'"\n'; return false; break; } return true; } /*======================================================================*\ Function: submit Purpose: submit an http form Input: $URI the location to post the data $formvars the formvars to use. format: $formvars["var"] = "val"; $formfiles an array of files to submit format: $formfiles["var"] = "/dir/filename.ext"; Output: $this->results the text output from the post \*======================================================================*/ function submit($URI, $formvars="", $formfiles="") { unset($postdata); $postdata = $this->_prepare_post_body($formvars, $formfiles); $URI_PARTS = parse_url($URI); if (!empty($URI_PARTS["user"])) $this->user = $URI_PARTS["user"]; if (!empty($URI_PARTS["pass"])) $this->pass = $URI_PARTS["pass"]; if (empty($URI_PARTS["query"])) $URI_PARTS["query"] = ''; if (empty($URI_PARTS["path"])) $URI_PARTS["path"] = ''; switch(strtolower($URI_PARTS["scheme"])) { case "http": $this->host = $URI_PARTS["host"]; if(!empty($URI_PARTS["port"])) $this->port = $URI_PARTS["port"]; if($this->_connect($fp)) { if($this->_isproxy) { // using proxy, send entire URI $this->_httprequest($URI,$fp,$URI,$this->_submit_method,$this->_submit_type,$postdata); } else { $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : ""); // no proxy, send only the path $this->_httprequest($path, $fp, $URI, $this->_submit_method, $this->_submit_type, $postdata); } $this->_disconnect($fp); if($this->_redirectaddr) { /* url was redirected, check if we've hit the max depth */ if($this->maxredirs > $this->_redirectdepth) { if(!preg_match("|^".$URI_PARTS["scheme"]."://|", $this->_redirectaddr)) $this->_redirectaddr = $this->_expandlinks($this->_redirectaddr,$URI_PARTS["scheme"]."://".$URI_PARTS["host"]); // only follow redirect if it's on this site, or offsiteok is true if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok) { /* follow the redirect */ $this->_redirectdepth++; $this->lastredirectaddr=$this->_redirectaddr; if( strpos( $this->_redirectaddr, "?" ) > 0 ) $this->fetch($this->_redirectaddr); // the redirect has changed the request method from post to get else $this->submit($this->_redirectaddr,$formvars, $formfiles); } } } if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0) { $frameurls = $this->_frameurls; $this->_frameurls = array(); while(list(,$frameurl) = each($frameurls)) { if($this->_framedepth < $this->maxframes) { $this->fetch($frameurl); $this->_framedepth++; } else break; } } } else { return false; } return true; break; case "https": if(!$this->curl_path) return false; if(function_exists("is_executable")) if (!is_executable($this->curl_path)) return false; $this->host = $URI_PARTS["host"]; if(!empty($URI_PARTS["port"])) $this->port = $URI_PARTS["port"]; if($this->_isproxy) { // using proxy, send entire URI $this->_httpsrequest($URI, $URI, $this->_submit_method, $this->_submit_type, $postdata); } else { $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : ""); // no proxy, send only the path $this->_httpsrequest($path, $URI, $this->_submit_method, $this->_submit_type, $postdata); } if($this->_redirectaddr) { /* url was redirected, check if we've hit the max depth */ if($this->maxredirs > $this->_redirectdepth) { if(!preg_match("|^".$URI_PARTS["scheme"]."://|", $this->_redirectaddr)) $this->_redirectaddr = $this->_expandlinks($this->_redirectaddr,$URI_PARTS["scheme"]."://".$URI_PARTS["host"]); // only follow redirect if it's on this site, or offsiteok is true if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok) { /* follow the redirect */ $this->_redirectdepth++; $this->lastredirectaddr=$this->_redirectaddr; if( strpos( $this->_redirectaddr, "?" ) > 0 ) $this->fetch($this->_redirectaddr); // the redirect has changed the request method from post to get else $this->submit($this->_redirectaddr,$formvars, $formfiles); } } } if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0) { $frameurls = $this->_frameurls; $this->_frameurls = array(); while(list(,$frameurl) = each($frameurls)) { if($this->_framedepth < $this->maxframes) { $this->fetch($frameurl); $this->_framedepth++; } else break; } } return true; break; default: // not a valid protocol $this->error = 'Invalid protocol "'.$URI_PARTS["scheme"].'"\n'; return false; break; } return true; } /*======================================================================*\ Function: fetchlinks Purpose: fetch the links from a web page Input: $URI where you are fetching from Output: $this->results an array of the URLs \*======================================================================*/ function fetchlinks($URI) { if ($this->fetch($URI)) { if($this->lastredirectaddr) $URI = $this->lastredirectaddr; if(is_array($this->results)) { for($x=0;$x<count($this->results);$x++) $this->results[$x] = $this->_striplinks($this->results[$x]); } else $this->results = $this->_striplinks($this->results); if($this->expandlinks) $this->results = $this->_expandlinks($this->results, $URI); return true; } else return false; } /*======================================================================*\ Function: fetchform Purpose: fetch the form elements from a web page Input: $URI where you are fetching from Output: $this->results the resulting html form \*======================================================================*/ function fetchform($URI) { if ($this->fetch($URI)) { if(is_array($this->results)) { for($x=0;$x<count($this->results);$x++) $this->results[$x] = $this->_stripform($this->results[$x]); } else $this->results = $this->_stripform($this->results); return true; } else return false; } /*======================================================================*\ Function: fetchtext Purpose: fetch the text from a web page, stripping the links Input: $URI where you are fetching from Output: $this->results the text from the web page \*======================================================================*/ function fetchtext($URI) { if($this->fetch($URI)) { if(is_array($this->results)) { for($x=0;$x<count($this->results);$x++) $this->results[$x] = $this->_striptext($this->results[$x]); } else $this->results = $this->_striptext($this->results); return true; } else return false; } /*======================================================================*\ Function: submitlinks Purpose: grab links from a form submission Input: $URI where you are submitting from Output: $this->results an array of the links from the post \*======================================================================*/ function submitlinks($URI, $formvars="", $formfiles="") { if($this->submit($URI,$formvars, $formfiles)) { if($this->lastredirectaddr) $URI = $this->lastredirectaddr; if(is_array($this->results)) { for($x=0;$x<count($this->results);$x++) { $this->results[$x] = $this->_striplinks($this->results[$x]); if($this->expandlinks) $this->results[$x] = $this->_expandlinks($this->results[$x],$URI); } } else { $this->results = $this->_striplinks($this->results); if($this->expandlinks) $this->results = $this->_expandlinks($this->results,$URI); } return true; } else return false; } /*======================================================================*\ Function: submittext Purpose: grab text from a form submission Input: $URI where you are submitting from Output: $this->results the text from the web page \*======================================================================*/ function submittext($URI, $formvars = "", $formfiles = "") { if($this->submit($URI,$formvars, $formfiles)) { if($this->lastredirectaddr) $URI = $this->lastredirectaddr; if(is_array($this->results)) { for($x=0;$x<count($this->results);$x++) { $this->results[$x] = $this->_striptext($this->results[$x]); if($this->expandlinks) $this->results[$x] = $this->_expandlinks($this->results[$x],$URI); } } else { $this->results = $this->_striptext($this->results); if($this->expandlinks) $this->results = $this->_expandlinks($this->results,$URI); } return true; } else return false; } /*======================================================================*\ Function: set_submit_multipart Purpose: Set the form submission content type to multipart/form-data \*======================================================================*/ function set_submit_multipart() { $this->_submit_type = "multipart/form-data"; } /*======================================================================*\ Function: set_submit_normal Purpose: Set the form submission content type to application/x-www-form-urlencoded \*======================================================================*/ function set_submit_normal() { $this->_submit_type = "application/x-www-form-urlencoded"; } /*======================================================================*\ Private functions \*======================================================================*/ /*======================================================================*\ Function: _striplinks Purpose: strip the hyperlinks from an html document Input: $document document to strip. Output: $match an array of the links \*======================================================================*/ function _striplinks($document) { preg_match_all("'<\s*a\s.*?href\s*=\s* # find <a href= ([\"\'])? # find single or double quote (?(1) (.*?)\\1 | ([^\s\>]+)) # if quote found, match up to next matching # quote, otherwise match up to next space 'isx",$document,$links); // catenate the non-empty matches from the conditional subpattern while(list($key,$val) = each($links[2])) { if(!empty($val)) $match[] = $val; } while(list($key,$val) = each($links[3])) { if(!empty($val)) $match[] = $val; } // return the links return $match; } /*======================================================================*\ Function: _stripform Purpose: strip the form elements from an html document Input: $document document to strip. Output: $match an array of the links \*======================================================================*/ function _stripform($document) { preg_match_all("'<\/?(FORM|INPUT|SELECT|TEXTAREA|(OPTION))[^<>]*>(?(2)(.*(?=<\/?(option|select)[^<>]*>[\r\n]*)|(?=[\r\n]*))|(?=[\r\n]*))'Usi",$document,$elements); // catenate the matches $match = implode("\r\n",$elements[0]); // return the links return $match; } /*======================================================================*\ Function: _striptext Purpose: strip the text from an html document Input: $document document to strip. Output: $text the resulting text \*======================================================================*/ function _striptext($document) { // I didn't use preg eval (//e) since that is only available in PHP 4.0. // so, list your entities one by one here. I included some of the // more common ones. $search = array("'<script[^>]*?>.*?</script>'si", // strip out javascript "'<[\/\!]*?[^<>]*?>'si", // strip out html tags "'([\r\n])[\s]+'", // strip out white space "'&(quot|#34|#034|#x22);'i", // replace html entities "'&(amp|#38|#038|#x26);'i", // added hexadecimal values "'&(lt|#60|#060|#x3c);'i", "'&(gt|#62|#062|#x3e);'i", "'&(nbsp|#160|#xa0);'i", "'&(iexcl|#161);'i", "'&(cent|#162);'i", "'&(pound|#163);'i", "'&(copy|#169);'i", "'&(reg|#174);'i", "'&(deg|#176);'i", "'&(#39|#039|#x27);'", "'&(euro|#8364);'i", // europe "'&a(uml|UML);'", // german "'&o(uml|UML);'", "'&u(uml|UML);'", "'&A(uml|UML);'", "'&O(uml|UML);'", "'&U(uml|UML);'", "'ß'i", ); $replace = array( "", "", "\\1", "\"", "&", "<", ">", " ", chr(161), chr(162), chr(163), chr(169), chr(174), chr(176), chr(39), chr(128), "ä", "ö", "ü", "Ä", "Ö", "Ü", "ß", ); $text = preg_replace($search,$replace,$document); return $text; } /*======================================================================*\ Function: _expandlinks Purpose: expand each link into a fully qualified URL Input: $links the links to qualify $URI the full URI to get the base from Output: $expandedLinks the expanded links \*======================================================================*/ function _expandlinks($links,$URI) { preg_match("/^[^\?]+/",$URI,$match); $match = preg_replace("|/[^\/\.]+\.[^\/\.]+$|","",$match[0]); $match = preg_replace("|/$|","",$match); $match_part = parse_url($match); $match_root = $match_part["scheme"]."://".$match_part["host"]; $search = array( "|^http://".preg_quote($this->host)."|i", "|^(\/)|i", "|^(?!http://)(?!mailto:)|i", "|/\./|", "|/[^\/]+/\.\./|" ); $replace = array( "", $match_root."/", $match."/", "/", "/" ); $expandedLinks = preg_replace($search,$replace,$links); return $expandedLinks; } /*======================================================================*\ Function: _httprequest Purpose: go get the http data from the server Input: $url the url to fetch $fp the current open file pointer $URI the full URI $body body contents to send if any (POST) Output: \*======================================================================*/ function _httprequest($url,$fp,$URI,$http_method,$content_type="",$body="") { $cookie_headers = ''; if($this->passcookies && $this->_redirectaddr) $this->setcookies(); $URI_PARTS = parse_url($URI); if(empty($url)) $url = "/"; $headers = $http_method." ".$url." ".$this->_httpversion."\r\n"; if(!empty($this->agent)) $headers .= "User-Agent: ".$this->agent."\r\n"; if(!empty($this->host) && !isset($this->rawheaders['Host'])) { $headers .= "Host: ".$this->host; if(!empty($this->port) && $this->port != 80) $headers .= ":".$this->port; $headers .= "\r\n"; } if(!empty($this->accept)) $headers .= "Accept: ".$this->accept."\r\n"; if(!empty($this->referer)) $headers .= "Referer: ".$this->referer."\r\n"; if(!empty($this->cookies)) { if(!is_array($this->cookies)) $this->cookies = (array)$this->cookies; reset($this->cookies); if ( count($this->cookies) > 0 ) { $cookie_headers .= 'Cookie: '; foreach ( $this->cookies as $cookieKey => $cookieVal ) { $cookie_headers .= $cookieKey."=".urlencode($cookieVal)."; "; } $headers .= substr($cookie_headers,0,-2) . "\r\n"; } } if(!empty($this->rawheaders)) { if(!is_array($this->rawheaders)) $this->rawheaders = (array)$this->rawheaders; while(list($headerKey,$headerVal) = each($this->rawheaders)) $headers .= $headerKey.": ".$headerVal."\r\n"; } if(!empty($content_type)) { $headers .= "Content-type: $content_type"; if ($content_type == "multipart/form-data") $headers .= "; boundary=".$this->_mime_boundary; $headers .= "\r\n"; } if(!empty($body)) $headers .= "Content-length: ".strlen($body)."\r\n"; if(!empty($this->user) || !empty($this->pass)) $headers .= "Authorization: Basic ".base64_encode($this->user.":".$this->pass)."\r\n"; //add proxy auth headers if(!empty($this->proxy_user)) $headers .= 'Proxy-Authorization: ' . 'Basic ' . base64_encode($this->proxy_user . ':' . $this->proxy_pass)."\r\n"; $headers .= "\r\n"; // set the read timeout if needed if ($this->read_timeout > 0) socket_set_timeout($fp, $this->read_timeout); $this->timed_out = false; fwrite($fp,$headers.$body,strlen($headers.$body)); $this->_redirectaddr = false; unset($this->headers); while($currentHeader = fgets($fp,$this->_maxlinelen)) { if ($this->read_timeout > 0 && $this->_check_timeout($fp)) { $this->status=-100; return false; } if($currentHeader == "\r\n") break; // if a header begins with Location: or URI:, set the redirect if(preg_match("/^(Location:|URI:)/i",$currentHeader)) { // get URL portion of the redirect preg_match("/^(Location:|URI:)[ ]+(.*)/i",chop($currentHeader),$matches); // look for :// in the Location header to see if hostname is included if(!preg_match("|\:\/\/|",$matches[2])) { // no host in the path, so prepend $this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host.":".$this->port; // eliminate double slash if(!preg_match("|^/|",$matches[2])) $this->_redirectaddr .= "/".$matches[2]; else $this->_redirectaddr .= $matches[2]; } else $this->_redirectaddr = $matches[2]; } if(preg_match("|^HTTP/|",$currentHeader)) { if(preg_match("|^HTTP/[^\s]*\s(.*?)\s|",$currentHeader, $status)) { $this->status= $status[1]; } $this->response_code = $currentHeader; } $this->headers[] = $currentHeader; } $results = ''; do { $_data = fread($fp, $this->maxlength); if (strlen($_data) == 0) { break; } $results .= $_data; } while(true); if ($this->read_timeout > 0 && $this->_check_timeout($fp)) { $this->status=-100; return false; } // check if there is a a redirect meta tag if(preg_match("'<meta[\s]*http-equiv[^>]*?content[\s]*=[\s]*[\"\']?\d+;[\s]*URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match)) { $this->_redirectaddr = $this->_expandlinks($match[1],$URI); } // have we hit our frame depth and is there frame src to fetch? if(($this->_framedepth < $this->maxframes) && preg_match_all("'<frame\s+.*src[\s]*=[\'\"]?([^\'\"\>]+)'i",$results,$match)) { $this->results[] = $results; for($x=0; $x<count($match[1]); $x++) $this->_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS["scheme"]."://".$this->host); } // have we already fetched framed content? elseif(is_array($this->results)) $this->results[] = $results; // no framed content else $this->results = $results; return true; } /*======================================================================*\ Function: _httpsrequest Purpose: go get the https data from the server using curl Input: $url the url to fetch $URI the full URI $body body contents to send if any (POST) Output: \*======================================================================*/ function _httpsrequest($url,$URI,$http_method,$content_type="",$body="") { if($this->passcookies && $this->_redirectaddr) $this->setcookies(); $headers = array(); $URI_PARTS = parse_url($URI); if(empty($url)) $url = "/"; // GET ... header not needed for curl //$headers[] = $http_method." ".$url." ".$this->_httpversion; if(!empty($this->agent)) $headers[] = "User-Agent: ".$this->agent; if(!empty($this->host)) if(!empty($this->port)) $headers[] = "Host: ".$this->host.":".$this->port; else $headers[] = "Host: ".$this->host; if(!empty($this->accept)) $headers[] = "Accept: ".$this->accept; if(!empty($this->referer)) $headers[] = "Referer: ".$this->referer; if(!empty($this->cookies)) { if(!is_array($this->cookies)) $this->cookies = (array)$this->cookies; reset($this->cookies); if ( count($this->cookies) > 0 ) { $cookie_str = 'Cookie: '; foreach ( $this->cookies as $cookieKey => $cookieVal ) { $cookie_str .= $cookieKey."=".urlencode($cookieVal)."; "; } $headers[] = substr($cookie_str,0,-2); } } if(!empty($this->rawheaders)) { if(!is_array($this->rawheaders)) $this->rawheaders = (array)$this->rawheaders; while(list($headerKey,$headerVal) = each($this->rawheaders)) $headers[] = $headerKey.": ".$headerVal; } if(!empty($content_type)) { if ($content_type == "multipart/form-data") $headers[] = "Content-type: $content_type; boundary=".$this->_mime_boundary; else $headers[] = "Content-type: $content_type"; } if(!empty($body)) $headers[] = "Content-length: ".strlen($body); if(!empty($this->user) || !empty($this->pass)) $headers[] = "Authorization: BASIC ".base64_encode($this->user.":".$this->pass); for($curr_header = 0; $curr_header < count($headers); $curr_header++) { $safer_header = strtr( $headers[$curr_header], "\"", " " ); $cmdline_params .= " -H \"".$safer_header."\""; } if(!empty($body)) $cmdline_params .= " -d \"$body\""; if($this->read_timeout > 0) $cmdline_params .= " -m ".$this->read_timeout; $headerfile = tempnam($temp_dir, "sno"); $safer_URI = strtr( $URI, "\"", " " ); // strip quotes from the URI to avoid shell access exec(escapeshellcmd($this->curl_path." -D \"$headerfile\"".$cmdline_params." \"".$safer_URI."\""),$results,$return); if($return) { $this->error = "Error: cURL could not retrieve the document, error $return."; return false; } $results = implode("\r\n",$results); $result_headers = file("$headerfile"); $this->_redirectaddr = false; unset($this->headers); for($currentHeader = 0; $currentHeader < count($result_headers); $currentHeader++) { // if a header begins with Location: or URI:, set the redirect if(preg_match("/^(Location: |URI: )/i",$result_headers[$currentHeader])) { // get URL portion of the redirect preg_match("/^(Location: |URI:)\s+(.*)/",chop($result_headers[$currentHeader]),$matches); // look for :// in the Location header to see if hostname is included if(!preg_match("|\:\/\/|",$matches[2])) { // no host in the path, so prepend $this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host.":".$this->port; // eliminate double slash if(!preg_match("|^/|",$matches[2])) $this->_redirectaddr .= "/".$matches[2]; else $this->_redirectaddr .= $matches[2]; } else $this->_redirectaddr = $matches[2]; } if(preg_match("|^HTTP/|",$result_headers[$currentHeader])) $this->response_code = $result_headers[$currentHeader]; $this->headers[] = $result_headers[$currentHeader]; } // check if there is a a redirect meta tag if(preg_match("'<meta[\s]*http-equiv[^>]*?content[\s]*=[\s]*[\"\']?\d+;[\s]*URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match)) { $this->_redirectaddr = $this->_expandlinks($match[1],$URI); } // have we hit our frame depth and is there frame src to fetch? if(($this->_framedepth < $this->maxframes) && preg_match_all("'<frame\s+.*src[\s]*=[\'\"]?([^\'\"\>]+)'i",$results,$match)) { $this->results[] = $results; for($x=0; $x<count($match[1]); $x++) $this->_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS["scheme"]."://".$this->host); } // have we already fetched framed content? elseif(is_array($this->results)) $this->results[] = $results; // no framed content else $this->results = $results; unlink("$headerfile"); return true; } /*======================================================================*\ Function: setcookies() Purpose: set cookies for a redirection \*======================================================================*/ function setcookies() { for($x=0; $x<count($this->headers); $x++) { if(preg_match('/^set-cookie:[\s]+([^=]+)=([^;]+)/i', $this->headers[$x],$match)) $this->cookies[$match[1]] = urldecode($match[2]); } } /*======================================================================*\ Function: _check_timeout Purpose: checks whether timeout has occurred Input: $fp file pointer \*======================================================================*/ function _check_timeout($fp) { if ($this->read_timeout > 0) { $fp_status = socket_get_status($fp); if ($fp_status["timed_out"]) { $this->timed_out = true; return true; } } return false; } /*======================================================================*\ Function: _connect Purpose: make a socket connection Input: $fp file pointer \*======================================================================*/ function _connect(&$fp) { if(!empty($this->proxy_host) && !empty($this->proxy_port)) { $this->_isproxy = true; $host = $this->proxy_host; $port = $this->proxy_port; } else { $host = $this->host; $port = $this->port; } $this->status = 0; if($fp = fsockopen( $host, $port, $errno, $errstr, $this->_fp_timeout )) { // socket connection succeeded return true; } else { // socket connection failed $this->status = $errno; switch($errno) { case -3: $this->error="socket creation failed (-3)"; case -4: $this->error="dns lookup failure (-4)"; case -5: $this->error="connection refused or timed out (-5)"; default: $this->error="connection failed (".$errno.")"; } return false; } } /*======================================================================*\ Function: _disconnect Purpose: disconnect a socket connection Input: $fp file pointer \*======================================================================*/ function _disconnect($fp) { return(fclose($fp)); } /*======================================================================*\ Function: _prepare_post_body Purpose: Prepare post body according to encoding type Input: $formvars - form variables $formfiles - form upload files Output: post body \*======================================================================*/ function _prepare_post_body($formvars, $formfiles) { settype($formvars, "array"); settype($formfiles, "array"); $postdata = ''; if (count($formvars) == 0 && count($formfiles) == 0) return; switch ($this->_submit_type) { case "application/x-www-form-urlencoded": reset($formvars); while(list($key,$val) = each($formvars)) { if (is_array($val) || is_object($val)) { while (list($cur_key, $cur_val) = each($val)) { $postdata .= urlencode($key)."[]=".urlencode($cur_val)."&"; } } else $postdata .= urlencode($key)."=".urlencode($val)."&"; } break; case "multipart/form-data": $this->_mime_boundary = "Snoopy".md5(uniqid(microtime())); reset($formvars); while(list($key,$val) = each($formvars)) { if (is_array($val) || is_object($val)) { while (list($cur_key, $cur_val) = each($val)) { $postdata .= "--".$this->_mime_boundary."\r\n"; $postdata .= "Content-Disposition: form-data; name=\"$key\[\]\"\r\n\r\n"; $postdata .= "$cur_val\r\n"; } } else { $postdata .= "--".$this->_mime_boundary."\r\n"; $postdata .= "Content-Disposition: form-data; name=\"$key\"\r\n\r\n"; $postdata .= "$val\r\n"; } } reset($formfiles); while (list($field_name, $file_names) = each($formfiles)) { settype($file_names, "array"); while (list(, $file_name) = each($file_names)) { if (!is_readable($file_name)) continue; $fp = fopen($file_name, "r"); while (!feof($fp)) { $file_content .= fread($fp, filesize($file_name)); } fclose($fp); $base_name = basename($file_name); $postdata .= "--".$this->_mime_boundary."\r\n"; $postdata .= "Content-Disposition: form-data; name=\"$field_name\"; filename=\"$base_name\"\r\n\r\n"; $postdata .= "$file_content\r\n"; } } $postdata .= "--".$this->_mime_boundary."--\r\n"; break; } return $postdata; } } endif; ?> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/wlwmanifest.xml������������������������������������������������������������������0000644�0001066�0001066�00000001765�10702510511�014517� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" encoding="utf-8" ?> <manifest xmlns="http://schemas.microsoft.com/wlw/manifest/weblog"> <options> <clientType>WordPress</clientType> <supportsKeywords>Yes</supportsKeywords> </options> <weblog> <serviceName>WordPress</serviceName> <imageUrl>images/wlw/wp-icon.png</imageUrl> <watermarkImageUrl>images/wlw/wp-watermark.png</watermarkImageUrl> <homepageLinkText>View site</homepageLinkText> <adminLinkText>Dashboard</adminLinkText> <adminUrl> <![CDATA[ {blog-postapi-url}/../wp-admin/ ]]> </adminUrl> <postEditingUrl> <![CDATA[ {blog-postapi-url}/../wp-admin/post.php?action=edit&post={post-id} ]]> </postEditingUrl> </weblog> <buttons> <button> <id>0</id> <text>Manage Comments</text> <imageUrl>images/wlw/wp-comments.png</imageUrl> <clickUrl> <![CDATA[ {blog-postapi-url}/../wp-admin/edit-comments.php ]]> </clickUrl> </button> </buttons> </manifest> �����������wp/dev/wp-includes/pluggable.php��������������������������������������������������������������������0000644�0001066�0001066�00000144046�11046661417�014126� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * These functions can be replaced via plugins. If plugins do not redefine these * functions, then these will be used instead. * * @package WordPress */ if ( !function_exists('set_current_user') ) : /** * Changes the current user by ID or name. * * Set $id to null and specify a name if you do not know a user's ID. * * @since 2.0.1 * @see wp_set_current_user() An alias of wp_set_current_user() * * @param int|null $id User ID. * @param string $name Optional. The user's username * @return object returns wp_set_current_user() */ function set_current_user($id, $name = '') { return wp_set_current_user($id, $name); } endif; if ( !function_exists('wp_set_current_user') ) : /** * Changes the current user by ID or name. * * Set $id to null and specify a name if you do not know a user's ID. * * Some WordPress functionality is based on the current user and not based on * the signed in user. Therefore, it opens the ability to edit and perform * actions on users who aren't signed in. * * @since 2.0.4 * @global object $current_user The current user object which holds the user data. * @uses do_action() Calls 'set_current_user' hook after setting the current user. * * @param int $id User ID * @param string $name User's username * @return WP_User Current user User object */ function wp_set_current_user($id, $name = '') { global $current_user; if ( isset($current_user) && ($id == $current_user->ID) ) return $current_user; $current_user = new WP_User($id, $name); setup_userdata($current_user->ID); do_action('set_current_user'); return $current_user; } endif; if ( !function_exists('wp_get_current_user') ) : /** * Retrieve the current user object. * * @since 2.0.4 * * @return WP_User Current user WP_User object */ function wp_get_current_user() { global $current_user; get_currentuserinfo(); return $current_user; } endif; if ( !function_exists('get_currentuserinfo') ) : /** * Populate global variables with information about the currently logged in user. * * Will set the current user, if the current user is not set. The current user * will be set to the logged in person. If no user is logged in, then it will * set the current user to 0, which is invalid and won't have any permissions. * * @since 0.71 * @uses $current_user Checks if the current user is set * @uses wp_validate_auth_cookie() Retrieves current logged in user. * * @return bool|null False on XMLRPC Request and invalid auth cookie. Null when current user set */ function get_currentuserinfo() { global $current_user; if ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST ) return false; if ( ! empty($current_user) ) return; if ( ! $user = wp_validate_auth_cookie() ) { if ( empty($_COOKIE[LOGGED_IN_COOKIE]) || !$user = wp_validate_auth_cookie($_COOKIE[LOGGED_IN_COOKIE], 'logged_in') ) { wp_set_current_user(0); return false; } } wp_set_current_user($user); } endif; if ( !function_exists('get_userdata') ) : /** * Retrieve user info by user ID. * * @since 0.71 * * @param int $user_id User ID * @return bool|object False on failure, User DB row object */ function get_userdata( $user_id ) { global $wpdb; $user_id = absint($user_id); if ( $user_id == 0 ) return false; $user = wp_cache_get($user_id, 'users'); if ( $user ) return $user; if ( !$user = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->users WHERE ID = %d LIMIT 1", $user_id)) ) return false; _fill_user($user); return $user; } endif; if ( !function_exists('update_user_cache') ) : /** * Updates a users cache when overridden by a plugin. * * Core function does nothing. * * @since 1.5 * * @return bool Only returns true */ function update_user_cache() { return true; } endif; if ( !function_exists('get_userdatabylogin') ) : /** * Retrieve user info by login name. * * @since 0.71 * * @param string $user_login User's username * @return bool|object False on failure, User DB row object */ function get_userdatabylogin($user_login) { global $wpdb; $user_login = sanitize_user( $user_login ); if ( empty( $user_login ) ) return false; $user_id = wp_cache_get($user_login, 'userlogins'); $user = false; if ( false !== $user_id ) $user = wp_cache_get($user_id, 'users'); if ( false !== $user ) return $user; if ( !$user = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->users WHERE user_login = %s", $user_login)) ) return false; _fill_user($user); return $user; } endif; if ( !function_exists('get_user_by_email') ) : /** * Retrieve user info by email. * * @since 2.5 * * @param string $email User's email address * @return bool|object False on failure, User DB row object */ function get_user_by_email($email) { global $wpdb; $user_id = wp_cache_get($email, 'useremail'); $user = false; if ( false !== $user_id ) $user = wp_cache_get($user_id, 'users'); if ( false !== $user ) return $user; if ( !$user = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->users WHERE user_email = %s", $email)) ) return false; _fill_user($user); return $user; } endif; if ( !function_exists( 'wp_mail' ) ) : /** * Send mail, similar to PHP's mail * * A true return value does not automatically mean that the user received the * email successfully. It just only means that the method used was able to * process the request without any errors. * * Using the two 'wp_mail_from' and 'wp_mail_from_name' hooks allow from * creating a from address like 'Name <email@address.com>' when both are set. If * just 'wp_mail_from' is set, then just the email address will be used with no * name. * * The default content type is 'text/plain' which does not allow using HTML. * However, you can set the content type of the email by using the * 'wp_mail_content_type' filter. * * The default charset is based on the charset used on the blog. The charset can * be set using the 'wp_mail_charset' filter. * * @since 1.2.1 * @uses apply_filters() Calls 'wp_mail' hook on an array of all of the parameters. * @uses apply_filters() Calls 'wp_mail_from' hook to get the from email address. * @uses apply_filters() Calls 'wp_mail_from_name' hook to get the from address name. * @uses apply_filters() Calls 'wp_mail_content_type' hook to get the email content type. * @uses apply_filters() Calls 'wp_mail_charset' hook to get the email charset * @uses do_action_ref_array() Calls 'phpmailer_init' hook on the reference to * phpmailer object. * @uses PHPMailer * @ * * @param string $to Email address to send message * @param string $subject Email subject * @param string $message Message contents * @param string|array $headers Optional. Additional headers. * @return bool Whether the email contents were sent successfully. */ function wp_mail( $to, $subject, $message, $headers = '' ) { // Compact the input, apply the filters, and extract them back out extract( apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers' ) ) ); global $phpmailer; // (Re)create it, if it's gone missing if ( !is_object( $phpmailer ) || !is_a( $phpmailer, 'PHPMailer' ) ) { require_once ABSPATH . WPINC . '/class-phpmailer.php'; require_once ABSPATH . WPINC . '/class-smtp.php'; $phpmailer = new PHPMailer(); } // Headers if ( empty( $headers ) ) { $headers = array(); } elseif ( !is_array( $headers ) ) { // Explode the headers out, so this function can take both // string headers and an array of headers. $tempheaders = (array) explode( "\n", $headers ); $headers = array(); // If it's actually got contents if ( !empty( $tempheaders ) ) { // Iterate through the raw headers foreach ( $tempheaders as $header ) { if ( strpos($header, ':') === false ) continue; // Explode them out list( $name, $content ) = explode( ':', trim( $header ), 2 ); // Cleanup crew $name = trim( $name ); $content = trim( $content ); // Mainly for legacy -- process a From: header if it's there if ( 'from' == strtolower($name) ) { if ( strpos($content, '<' ) !== false ) { // So... making my life hard again? $from_name = substr( $content, 0, strpos( $content, '<' ) - 1 ); $from_name = str_replace( '"', '', $from_name ); $from_name = trim( $from_name ); $from_email = substr( $content, strpos( $content, '<' ) + 1 ); $from_email = str_replace( '>', '', $from_email ); $from_email = trim( $from_email ); } else { $from_name = trim( $content ); } } elseif ( 'content-type' == strtolower($name) ) { if ( strpos( $content,';' ) !== false ) { list( $type, $charset ) = explode( ';', $content ); $content_type = trim( $type ); $charset = trim( str_replace( array( 'charset=', '"' ), '', $charset ) ); } else { $content_type = trim( $content ); } } elseif ( 'cc' == strtolower($name) ) { $cc = explode(",", $content); } elseif ( 'bcc' == strtolower($name) ) { $bcc = explode(",", $content); } else { // Add it to our grand headers array $headers[trim( $name )] = trim( $content ); } } } } // Empty out the values that may be set $phpmailer->ClearAddresses(); $phpmailer->ClearAllRecipients(); $phpmailer->ClearAttachments(); $phpmailer->ClearBCCs(); $phpmailer->ClearCCs(); $phpmailer->ClearCustomHeaders(); $phpmailer->ClearReplyTos(); // From email and name // If we don't have a name from the input headers if ( !isset( $from_name ) ) { $from_name = 'WordPress'; } // If we don't have an email from the input headers if ( !isset( $from_email ) ) { // Get the site domain and get rid of www. $sitename = strtolower( $_SERVER['SERVER_NAME'] ); if ( substr( $sitename, 0, 4 ) == 'www.' ) { $sitename = substr( $sitename, 4 ); } $from_email = 'wordpress@' . $sitename; } // Set the from name and email $phpmailer->From = apply_filters( 'wp_mail_from', $from_email ); $phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name ); // Set destination address $phpmailer->AddAddress( $to ); // Set mail's subject and body $phpmailer->Subject = $subject; $phpmailer->Body = $message; // Add any CC and BCC recipients if ( !empty($cc) ) { foreach ($cc as $recipient) { $phpmailer->AddCc( trim($recipient) ); } } if ( !empty($bcc) ) { foreach ($bcc as $recipient) { $phpmailer->AddBcc( trim($recipient) ); } } // Set to use PHP's mail() $phpmailer->IsMail(); // Set Content-Type and charset // If we don't have a content-type from the input headers if ( !isset( $content_type ) ) { $content_type = 'text/plain'; } $content_type = apply_filters( 'wp_mail_content_type', $content_type ); // Set whether it's plaintext or not, depending on $content_type if ( $content_type == 'text/html' ) { $phpmailer->IsHTML( true ); } else { $phpmailer->IsHTML( false ); } // If we don't have a charset from the input headers if ( !isset( $charset ) ) { $charset = get_bloginfo( 'charset' ); } // Set the content-type and charset $phpmailer->CharSet = apply_filters( 'wp_mail_charset', $charset ); // Set custom headers if ( !empty( $headers ) ) { foreach ( $headers as $name => $content ) { $phpmailer->AddCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) ); } } do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) ); // Send! $result = @$phpmailer->Send(); return $result; } endif; /** * Checks a user's login information and logs them in if it checks out. * * @since 2.5 * * @param string $username User's username * @param string $password User's password * @return WP_Error|WP_User WP_User object if login successful, otherwise WP_Error object. */ if ( !function_exists('wp_authenticate') ) : function wp_authenticate($username, $password) { $username = sanitize_user($username); if ( '' == $username ) return new WP_Error('empty_username', __('<strong>ERROR</strong>: The username field is empty.')); if ( '' == $password ) return new WP_Error('empty_password', __('<strong>ERROR</strong>: The password field is empty.')); $user = get_userdatabylogin($username); if ( !$user || ($user->user_login != $username) ) { do_action( 'wp_login_failed', $username ); return new WP_Error('invalid_username', __('<strong>ERROR</strong>: Invalid username.')); } $user = apply_filters('wp_authenticate_user', $user, $password); if ( is_wp_error($user) ) { do_action( 'wp_login_failed', $username ); return $user; } if ( !wp_check_password($password, $user->user_pass, $user->ID) ) { do_action( 'wp_login_failed', $username ); return new WP_Error('incorrect_password', __('<strong>ERROR</strong>: Incorrect password.')); } return new WP_User($user->ID); } endif; /** * Log the current user out. * * @since 2.5 */ if ( !function_exists('wp_logout') ) : function wp_logout() { wp_clear_auth_cookie(); do_action('wp_logout'); } endif; if ( !function_exists('wp_validate_auth_cookie') ) : /** * Validates authentication cookie. * * The checks include making sure that the authentication cookie is set and * pulling in the contents (if $cookie is not used). * * Makes sure the cookie is not expired. Verifies the hash in cookie is what is * should be and compares the two. * * @since 2.5 * * @param string $cookie Optional. If used, will validate contents instead of cookie's * @param string $scheme Optional. The cookie scheme to use: auth, secure_auth, or logged_in * @return bool|int False if invalid cookie, User ID if valid. */ function wp_validate_auth_cookie($cookie = '', $scheme = 'auth') { if ( empty($cookie) ) { if ( is_ssl() ) { $cookie_name = SECURE_AUTH_COOKIE; $scheme = 'secure_auth'; } else { $cookie_name = AUTH_COOKIE; $scheme = 'auth'; } if ( empty($_COOKIE[$cookie_name]) ) return false; $cookie = $_COOKIE[$cookie_name]; } $cookie_elements = explode('|', $cookie); if ( count($cookie_elements) != 3 ) return false; list($username, $expiration, $hmac) = $cookie_elements; $expired = $expiration; // Allow a grace period for POST and AJAX requests if ( defined('DOING_AJAX') || 'POST' == $_SERVER['REQUEST_METHOD'] ) $expired += 3600; // Quick check to see if an honest cookie has expired if ( $expired < time() ) return false; $key = wp_hash($username . '|' . $expiration, $scheme); $hash = hash_hmac('md5', $username . '|' . $expiration, $key); if ( $hmac != $hash ) return false; $user = get_userdatabylogin($username); if ( ! $user ) return false; return $user->ID; } endif; if ( !function_exists('wp_generate_auth_cookie') ) : /** * Generate authentication cookie contents. * * @since 2.5 * @uses apply_filters() Calls 'auth_cookie' hook on $cookie contents, User ID * and expiration of cookie. * * @param int $user_id User ID * @param int $expiration Cookie expiration in seconds * @param string $scheme Optional. The cookie scheme to use: auth, secure_auth, or logged_in * @return string Authentication cookie contents */ function wp_generate_auth_cookie($user_id, $expiration, $scheme = 'auth') { $user = get_userdata($user_id); $key = wp_hash($user->user_login . '|' . $expiration, $scheme); $hash = hash_hmac('md5', $user->user_login . '|' . $expiration, $key); $cookie = $user->user_login . '|' . $expiration . '|' . $hash; return apply_filters('auth_cookie', $cookie, $user_id, $expiration, $scheme); } endif; if ( !function_exists('wp_set_auth_cookie') ) : /** * Sets the authentication cookies based User ID. * * The $remember parameter increases the time that the cookie will be kept. The * default the cookie is kept without remembering is two days. When $remember is * set, the cookies will be kept for 14 days or two weeks. * * @since 2.5 * * @param int $user_id User ID * @param bool $remember Whether to remember the user or not */ function wp_set_auth_cookie($user_id, $remember = false, $secure = '') { if ( $remember ) { $expiration = $expire = time() + 1209600; } else { $expiration = time() + 172800; $expire = 0; } if ( '' === $secure ) $secure = is_ssl() ? true : false; if ( $secure ) { $auth_cookie_name = SECURE_AUTH_COOKIE; $scheme = 'secure_auth'; } else { $auth_cookie_name = AUTH_COOKIE; $scheme = 'auth'; } $auth_cookie = wp_generate_auth_cookie($user_id, $expiration, $scheme); $logged_in_cookie = wp_generate_auth_cookie($user_id, $expiration, 'logged_in'); do_action('set_auth_cookie', $auth_cookie, $expire, $expiration, $user_id, $scheme); do_action('set_logged_in_cookie', $logged_in_cookie, $expire, $expiration, $user_id, 'logged_in'); setcookie($auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN, $secure); setcookie($auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, $secure); setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN); if ( COOKIEPATH != SITECOOKIEPATH ) setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN); } endif; if ( !function_exists('wp_clear_auth_cookie') ) : /** * Removes all of the cookies associated with authentication. * * @since 2.5 */ function wp_clear_auth_cookie() { setcookie(AUTH_COOKIE, ' ', time() - 31536000, ADMIN_COOKIE_PATH, COOKIE_DOMAIN); setcookie(SECURE_AUTH_COOKIE, ' ', time() - 31536000, ADMIN_COOKIE_PATH, COOKIE_DOMAIN); setcookie(AUTH_COOKIE, ' ', time() - 31536000, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN); setcookie(SECURE_AUTH_COOKIE, ' ', time() - 31536000, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN); setcookie(LOGGED_IN_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN); setcookie(LOGGED_IN_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN); // Old cookies setcookie(AUTH_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN); setcookie(AUTH_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN); setcookie(SECURE_AUTH_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN); setcookie(SECURE_AUTH_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN); // Even older cookies setcookie(USER_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN); setcookie(PASS_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN); setcookie(USER_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN); setcookie(PASS_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN); } endif; if ( !function_exists('is_user_logged_in') ) : /** * Checks if the current visitor is a logged in user. * * @since 2.0.0 * * @return bool True if user is logged in, false if not logged in. */ function is_user_logged_in() { $user = wp_get_current_user(); if ( $user->id == 0 ) return false; return true; } endif; if ( !function_exists('auth_redirect') ) : /** * Checks if a user is logged in, if not it redirects them to the login page. * * @since 1.5 */ function auth_redirect() { // Checks if a user is logged in, if not redirects them to the login page if ( is_ssl() || force_ssl_admin() ) $secure = true; else $secure = false; // If https is required and request is http, redirect if ( $secure && !is_ssl() ) { if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) { wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI'])); exit(); } else { wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); exit(); } } if ( wp_validate_auth_cookie() ) return; // The cookie is good so we're done // The cookie is no good so force login nocache_headers(); if ( is_ssl() ) $proto = 'https://'; else $proto = 'http://'; $login_url = site_url( 'wp-login.php?redirect_to=' . urlencode($proto . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']), 'login' ); wp_redirect($login_url); exit(); } endif; if ( !function_exists('check_admin_referer') ) : /** * Makes sure that a user was referred from another admin page. * * To avoid security exploits. * * @since 1.2.0 * @uses do_action() Calls 'check_admin_referer' on $action. * * @param string $action Action nonce * @param string $query_arg where to look for nonce in $_REQUEST (since 2.5) */ function check_admin_referer($action = -1, $query_arg = '_wpnonce') { $adminurl = strtolower(admin_url()); $referer = strtolower(wp_get_referer()); $result = wp_verify_nonce($_REQUEST[$query_arg], $action); if ( !$result && !(-1 == $action && strpos($referer, $adminurl) !== false) ) { wp_nonce_ays($action); die(); } do_action('check_admin_referer', $action, $result); return $result; }endif; if ( !function_exists('check_ajax_referer') ) : /** * Verifies the AJAX request to prevent processing requests external of the blog. * * @since 2.0.4 * * @param string $action Action nonce * @param string $query_arg where to look for nonce in $_REQUEST (since 2.5) */ function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) { if ( $query_arg ) $nonce = $_REQUEST[$query_arg]; else $nonce = $_REQUEST['_ajax_nonce'] ? $_REQUEST['_ajax_nonce'] : $_REQUEST['_wpnonce']; $result = wp_verify_nonce( $nonce, $action ); if ( $die && false == $result ) die('-1'); do_action('check_ajax_referer', $action, $result); return $result; } endif; if ( !function_exists('wp_redirect') ) : /** * Redirects to another page, with a workaround for the IIS Set-Cookie bug. * * @link http://support.microsoft.com/kb/q176113/ * @since 1.5.1 * @uses apply_filters() Calls 'wp_redirect' hook on $location and $status. * * @param string $location The path to redirect to * @param int $status Status code to use * @return bool False if $location is not set */ function wp_redirect($location, $status = 302) { global $is_IIS; $location = apply_filters('wp_redirect', $location, $status); $status = apply_filters('wp_redirect_status', $status, $location); if ( !$location ) // allows the wp_redirect filter to cancel a redirect return false; $location = wp_sanitize_redirect($location); if ( $is_IIS ) { header("Refresh: 0;url=$location"); } else { if ( php_sapi_name() != 'cgi-fcgi' ) status_header($status); // This causes problems on IIS and some FastCGI setups header("Location: $location"); } } endif; if ( !function_exists('wp_sanitize_redirect') ) : /** * Sanitizes a URL for use in a redirect. * * @since 2.3 * * @return string redirect-sanitized URL **/ function wp_sanitize_redirect($location) { $location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $location); $location = wp_kses_no_null($location); // remove %0d and %0a from location $strip = array('%0d', '%0a'); $found = true; while($found) { $found = false; foreach($strip as $val) { while(strpos($location, $val) !== false) { $found = true; $location = str_replace($val, '', $location); } } } return $location; } endif; if ( !function_exists('wp_safe_redirect') ) : /** * Performs a safe (local) redirect, using wp_redirect(). * * Checks whether the $location is using an allowed host, if it has an absolute * path. A plugin can therefore set or remove allowed host(s) to or from the * list. * * If the host is not allowed, then the redirect is to wp-admin on the siteurl * instead. This prevents malicious redirects which redirect to another host, * but only used in a few places. * * @since 2.3 * @uses apply_filters() Calls 'allowed_redirect_hosts' on an array containing * WordPress host string and $location host string. * * @return void Does not return anything **/ function wp_safe_redirect($location, $status = 302) { // Need to look at the URL the way it will end up in wp_redirect() $location = wp_sanitize_redirect($location); // browsers will assume 'http' is your protocol, and will obey a redirect to a URL starting with '//' if ( substr($location, 0, 2) == '//' ) $location = 'http:' . $location; // In php 5 parse_url may fail if the URL query part contains http://, bug #38143 $test = ( $cut = strpos($location, '?') ) ? substr( $location, 0, $cut ) : $location; $lp = parse_url($test); $wpp = parse_url(get_option('home')); $allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : ''); if ( isset($lp['host']) && ( !in_array($lp['host'], $allowed_hosts) && $lp['host'] != strtolower($wpp['host'])) ) $location = admin_url(); wp_redirect($location, $status); } endif; if ( ! function_exists('wp_notify_postauthor') ) : /** * Notify an author of a comment/trackback/pingback to one of their posts. * * @since 1.0.0 * * @param int $comment_id Comment ID * @param string $comment_type Optional. The comment type either 'comment' (default), 'trackback', or 'pingback' * @return bool False if user email does not exist. True on completion. */ function wp_notify_postauthor($comment_id, $comment_type='') { $comment = get_comment($comment_id); $post = get_post($comment->comment_post_ID); $user = get_userdata( $post->post_author ); if ('' == $user->user_email) return false; // If there's no email to send the comment to $comment_author_domain = @gethostbyaddr($comment->comment_author_IP); $blogname = get_option('blogname'); if ( empty( $comment_type ) ) $comment_type = 'comment'; if ('comment' == $comment_type) { $notify_message = sprintf( __('New comment on your post #%1$s "%2$s"'), $comment->comment_post_ID, $post->post_title ) . "\r\n"; $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n"; $notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "\r\n"; $notify_message .= sprintf( __('Whois : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n"; $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n"; $notify_message .= __('You can see all comments on this post here: ') . "\r\n"; $subject = sprintf( __('[%1$s] Comment: "%2$s"'), $blogname, $post->post_title ); } elseif ('trackback' == $comment_type) { $notify_message = sprintf( __('New trackback on your post #%1$s "%2$s"'), $comment->comment_post_ID, $post->post_title ) . "\r\n"; $notify_message .= sprintf( __('Website: %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; $notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "\r\n"; $notify_message .= __('Excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n"; $notify_message .= __('You can see all trackbacks on this post here: ') . "\r\n"; $subject = sprintf( __('[%1$s] Trackback: "%2$s"'), $blogname, $post->post_title ); } elseif ('pingback' == $comment_type) { $notify_message = sprintf( __('New pingback on your post #%1$s "%2$s"'), $comment->comment_post_ID, $post->post_title ) . "\r\n"; $notify_message .= sprintf( __('Website: %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; $notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "\r\n"; $notify_message .= __('Excerpt: ') . "\r\n" . sprintf('[...] %s [...]', $comment->comment_content ) . "\r\n\r\n"; $notify_message .= __('You can see all pingbacks on this post here: ') . "\r\n"; $subject = sprintf( __('[%1$s] Pingback: "%2$s"'), $blogname, $post->post_title ); } $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n"; $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=cdc&c=$comment_id") ) . "\r\n"; $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=cdc&dt=spam&c=$comment_id") ) . "\r\n"; $wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])); if ( '' == $comment->comment_author ) { $from = "From: \"$blogname\" <$wp_email>"; if ( '' != $comment->comment_author_email ) $reply_to = "Reply-To: $comment->comment_author_email"; } else { $from = "From: \"$comment->comment_author\" <$wp_email>"; if ( '' != $comment->comment_author_email ) $reply_to = "Reply-To: \"$comment->comment_author_email\" <$comment->comment_author_email>"; } $message_headers = "$from\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; if ( isset($reply_to) ) $message_headers .= $reply_to . "\n"; $notify_message = apply_filters('comment_notification_text', $notify_message, $comment_id); $subject = apply_filters('comment_notification_subject', $subject, $comment_id); $message_headers = apply_filters('comment_notification_headers', $message_headers, $comment_id); @wp_mail($user->user_email, $subject, $notify_message, $message_headers); return true; } endif; if ( !function_exists('wp_notify_moderator') ) : /** * Notifies the moderator of the blog about a new comment that is awaiting approval. * * @since 1.0 * @uses $wpdb * * @param int $comment_id Comment ID * @return bool Always returns true */ function wp_notify_moderator($comment_id) { global $wpdb; if( get_option( "moderation_notify" ) == 0 ) return true; $comment = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_ID=%d LIMIT 1", $comment_id)); $post = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID=%d LIMIT 1", $comment->comment_post_ID)); $comment_author_domain = @gethostbyaddr($comment->comment_author_IP); $comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'"); switch ($comment->comment_type) { case 'trackback': $notify_message = sprintf( __('A new trackback on the post #%1$s "%2$s" is waiting for your approval'), $post->ID, $post->post_title ) . "\r\n"; $notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n"; $notify_message .= sprintf( __('Website : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; $notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "\r\n"; $notify_message .= __('Trackback excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n"; break; case 'pingback': $notify_message = sprintf( __('A new pingback on the post #%1$s "%2$s" is waiting for your approval'), $post->ID, $post->post_title ) . "\r\n"; $notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n"; $notify_message .= sprintf( __('Website : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; $notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "\r\n"; $notify_message .= __('Pingback excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n"; break; default: //Comments $notify_message = sprintf( __('A new comment on the post #%1$s "%2$s" is waiting for your approval'), $post->ID, $post->post_title ) . "\r\n"; $notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n"; $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n"; $notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "\r\n"; $notify_message .= sprintf( __('Whois : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n"; $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n"; break; } $notify_message .= sprintf( __('Approve it: %s'), admin_url("comment.php?action=mac&c=$comment_id") ) . "\r\n"; $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=cdc&c=$comment_id") ) . "\r\n"; $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=cdc&dt=spam&c=$comment_id") ) . "\r\n"; $notify_message .= sprintf( __ngettext('Currently %s comment is waiting for approval. Please visit the moderation panel:', 'Currently %s comments are waiting for approval. Please visit the moderation panel:', $comments_waiting), number_format_i18n($comments_waiting) ) . "\r\n"; $notify_message .= admin_url("edit-comments.php?comment_status=moderated") . "\r\n"; $subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), get_option('blogname'), $post->post_title ); $admin_email = get_option('admin_email'); $notify_message = apply_filters('comment_moderation_text', $notify_message, $comment_id); $subject = apply_filters('comment_moderation_subject', $subject, $comment_id); @wp_mail($admin_email, $subject, $notify_message); return true; } endif; if ( !function_exists('wp_new_user_notification') ) : /** * Notify the blog admin of a new user, normally via email. * * @since 2.0 * * @param int $user_id User ID * @param string $plaintext_pass Optional. The user's plaintext password */ function wp_new_user_notification($user_id, $plaintext_pass = '') { $user = new WP_User($user_id); $user_login = stripslashes($user->user_login); $user_email = stripslashes($user->user_email); $message = sprintf(__('New user registration on your blog %s:'), get_option('blogname')) . "\r\n\r\n"; $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n"; $message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n"; @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), get_option('blogname')), $message); if ( empty($plaintext_pass) ) return; $message = sprintf(__('Username: %s'), $user_login) . "\r\n"; $message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n"; $message .= site_url("wp-login.php", 'login') . "\r\n"; wp_mail($user_email, sprintf(__('[%s] Your username and password'), get_option('blogname')), $message); } endif; if ( !function_exists('wp_nonce_tick') ) : /** * Get the time-dependent variable for nonce creation. * * A nonce has a lifespan of two ticks. Nonces in their second tick may be * updated, e.g. by autosave. * * @since 2.5 * * @return int */ function wp_nonce_tick() { $nonce_life = apply_filters('nonce_life', 86400); return ceil(time() / ( $nonce_life / 2 )); } endif; if ( !function_exists('wp_verify_nonce') ) : /** * Verify that correct nonce was used with time limit. * * The user is given an amount of time to use the token, so therefore, since the * UID and $action remain the same, the independent variable is the time. * * @since 2.0.4 * * @param string $nonce Nonce that was used in the form to verify * @param string|int $action Should give context to what is taking place and be the same when nonce was created. * @return bool Whether the nonce check passed or failed. */ function wp_verify_nonce($nonce, $action = -1) { $user = wp_get_current_user(); $uid = (int) $user->id; $i = wp_nonce_tick(); // Nonce generated 0-12 hours ago if ( substr(wp_hash($i . $action . $uid), -12, 10) == $nonce ) return 1; // Nonce generated 12-24 hours ago if ( substr(wp_hash(($i - 1) . $action . $uid), -12, 10) == $nonce ) return 2; // Invalid nonce return false; } endif; if ( !function_exists('wp_create_nonce') ) : /** * Creates a random, one time use token. * * @since 2.0.4 * * @param string|int $action Scalar value to add context to the nonce. * @return string The one use form token */ function wp_create_nonce($action = -1) { $user = wp_get_current_user(); $uid = (int) $user->id; $i = wp_nonce_tick(); return substr(wp_hash($i . $action . $uid), -12, 10); } endif; if ( !function_exists('wp_salt') ) : /** * Get salt to add to hashes to help prevent attacks. * * The secret key is located in two places: the database in case the secret key * isn't defined in the second place, which is in the wp-config.php file. If you * are going to set the secret key, then you must do so in the wp-config.php * file. * * The secret key in the database is randomly generated and will be appended to * the secret key that is in wp-config.php file in some instances. It is * important to have the secret key defined or changed in wp-config.php. * * If you have installed WordPress 2.5 or later, then you will have the * SECRET_KEY defined in the wp-config.php already. You will want to change the * value in it because hackers will know what it is. If you have upgraded to * WordPress 2.5 or later version from a version before WordPress 2.5, then you * should add the constant to your wp-config.php file. * * Below is an example of how the SECRET_KEY constant is defined with a value. * You must not copy the below example and paste into your wp-config.php. If you * need an example, then you can have a * {@link http://api.wordpress.org/secret-key/1.0/ secret key created} for you. * * <code> * define('SECRET_KEY', 'mAry1HadA15|\/|b17w55w1t3asSn09w'); * </code> * * Salting passwords helps against tools which has stored hashed values of * common dictionary strings. The added values makes it harder to crack if given * salt string is not weak. * * @since 2.5 * @link http://api.wordpress.org/secret-key/1.0/ Create a Secret Key for wp-config.php * * @return string Salt value from either 'SECRET_KEY' or 'secret' option */ function wp_salt($scheme = 'auth') { global $wp_default_secret_key; $secret_key = ''; if ( defined('SECRET_KEY') && ('' != SECRET_KEY) && ( $wp_default_secret_key != SECRET_KEY) ) $secret_key = SECRET_KEY; if ( 'auth' == $scheme ) { if ( defined('AUTH_KEY') && ('' != AUTH_KEY) && ( $wp_default_secret_key != AUTH_KEY) ) $secret_key = AUTH_KEY; if ( defined('AUTH_SALT') ) { $salt = AUTH_SALT; } elseif ( defined('SECRET_SALT') ) { $salt = SECRET_SALT; } else { $salt = get_option('auth_salt'); if ( empty($salt) ) { $salt = wp_generate_password(); update_option('auth_salt', $salt); } } } elseif ( 'secure_auth' == $scheme ) { if ( defined('SECURE_AUTH_KEY') && ('' != SECURE_AUTH_KEY) && ( $wp_default_secret_key != SECURE_AUTH_KEY) ) $secret_key = SECURE_AUTH_KEY; if ( defined('SECURE_AUTH_SALT') ) { $salt = SECRET_AUTH_SALT; } else { $salt = get_option('secure_auth_salt'); if ( empty($salt) ) { $salt = wp_generate_password(); update_option('secure_auth_salt', $salt); } } } elseif ( 'logged_in' == $scheme ) { if ( defined('LOGGED_IN_KEY') && ('' != LOGGED_IN_KEY) && ( $wp_default_secret_key != LOGGED_IN_KEY) ) $secret_key = LOGGED_IN_KEY; if ( defined('LOGGED_IN_SALT') ) { $salt = LOGGED_IN_SALT; } else { $salt = get_option('logged_in_salt'); if ( empty($salt) ) { $salt = wp_generate_password(); update_option('logged_in_salt', $salt); } } } return apply_filters('salt', $secret_key . $salt, $scheme); } endif; if ( !function_exists('wp_hash') ) : /** * Get hash of given string. * * @since 2.0.4 * @uses wp_salt() Get WordPress salt * * @param string $data Plain text to hash * @return string Hash of $data */ function wp_hash($data, $scheme = 'auth') { $salt = wp_salt($scheme); return hash_hmac('md5', $data, $salt); } endif; if ( !function_exists('wp_hash_password') ) : /** * Create a hash (encrypt) of a plain text password. * * For integration with other applications, this function can be overwritten to * instead use the other package password checking algorithm. * * @since 2.5 * @global object $wp_hasher PHPass object * @uses PasswordHash::HashPassword * * @param string $password Plain text user password to hash * @return string The hash string of the password */ function wp_hash_password($password) { global $wp_hasher; if ( empty($wp_hasher) ) { require_once( ABSPATH . 'wp-includes/class-phpass.php'); // By default, use the portable hash from phpass $wp_hasher = new PasswordHash(8, TRUE); } return $wp_hasher->HashPassword($password); } endif; if ( !function_exists('wp_check_password') ) : /** * Checks the plaintext password against the encrypted Password. * * Maintains compatibility between old version and the new cookie authentication * protocol using PHPass library. The $hash parameter is the encrypted password * and the function compares the plain text password when encypted similarly * against the already encrypted password to see if they match. * * For integration with other applications, this function can be overwritten to * instead use the other package password checking algorithm. * * @since 2.5 * @global object $wp_hasher PHPass object used for checking the password * against the $hash + $password * @uses PasswordHash::CheckPassword * * @param string $password Plaintext user's password * @param string $hash Hash of the user's password to check against. * @return bool False, if the $password does not match the hashed password */ function wp_check_password($password, $hash, $user_id = '') { global $wp_hasher; // If the hash is still md5... if ( strlen($hash) <= 32 ) { $check = ( $hash == md5($password) ); if ( $check && $user_id ) { // Rehash using new hash. wp_set_password($password, $user_id); $hash = wp_hash_password($password); } return apply_filters('check_password', $check, $password, $hash, $user_id); } // If the stored hash is longer than an MD5, presume the // new style phpass portable hash. if ( empty($wp_hasher) ) { require_once( ABSPATH . 'wp-includes/class-phpass.php'); // By default, use the portable hash from phpass $wp_hasher = new PasswordHash(8, TRUE); } $check = $wp_hasher->CheckPassword($password, $hash); return apply_filters('check_password', $check, $password, $hash, $user_id); } endif; if ( !function_exists('wp_generate_password') ) : /** * Generates a random password drawn from the defined set of characters. * * @since 2.5 * * @return string The random password **/ function wp_generate_password($length = 12, $special_chars = true) { $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; if ( $special_chars ) $chars .= '!@#$%^&*()'; $password = ''; for ( $i = 0; $i < $length; $i++ ) $password .= substr($chars, mt_rand(0, strlen($chars) - 1), 1); return $password; } endif; if ( !function_exists('wp_set_password') ) : /** * Updates the user's password with a new encrypted one. * * For integration with other applications, this function can be overwritten to * instead use the other package password checking algorithm. * * @since 2.5 * @uses $wpdb WordPress database object for queries * @uses wp_hash_password() Used to encrypt the user's password before passing to the database * * @param string $password The plaintext new user password * @param int $user_id User ID */ function wp_set_password( $password, $user_id ) { global $wpdb; $hash = wp_hash_password($password); $query = $wpdb->prepare("UPDATE $wpdb->users SET user_pass = %s, user_activation_key = '' WHERE ID = %d", $hash, $user_id); $wpdb->query($query); wp_cache_delete($user_id, 'users'); } endif; if ( !function_exists( 'get_avatar' ) ) : /** * Retrieve the avatar for a user who provided a user ID or email address. * * @since 2.5 * @param int|string|object $id_or_email A user ID, email address, or comment object * @param int $size Size of the avatar image * @param string $default URL to a default image to use if no avatar is available * @return string <img> tag for the user's avatar */ function get_avatar( $id_or_email, $size = '96', $default = '' ) { if ( ! get_option('show_avatars') ) return false; if ( !is_numeric($size) ) $size = '96'; $email = ''; if ( is_numeric($id_or_email) ) { $id = (int) $id_or_email; $user = get_userdata($id); if ( $user ) $email = $user->user_email; } elseif ( is_object($id_or_email) ) { if ( !empty($id_or_email->user_id) ) { $id = (int) $id_or_email->user_id; $user = get_userdata($id); if ( $user) $email = $user->user_email; } elseif ( !empty($id_or_email->comment_author_email) ) { $email = $id_or_email->comment_author_email; } } else { $email = $id_or_email; } if ( empty($default) ) { $avatar_default = get_option('avatar_default'); if ( empty($avatar_default) ) $default = 'mystery'; else $default = $avatar_default; } if ( 'custom' == $default ) $default = add_query_arg( 's', $size, $defaults[$avatar_default][1] ); elseif ( 'mystery' == $default ) $default = "http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s={$size}"; // ad516503a11cd5ca435acc9bb6523536 == md5('unknown@gravatar.com') elseif ( 'blank' == $default ) $default = includes_url('images/blank.gif'); elseif ( !empty($email) && 'gravatar_default' == $default ) $default = ''; elseif ( 'gravatar_default' == $default ) $default = "http://www.gravatar.com/avatar/s={$size}"; elseif ( empty($email) ) $default = "http://www.gravatar.com/avatar/?d=$default&s={$size}"; if ( !empty($email) ) { $out = 'http://www.gravatar.com/avatar/'; $out .= md5( strtolower( $email ) ); $out .= '?s='.$size; $out .= '&d=' . urlencode( $default ); $rating = get_option('avatar_rating'); if ( !empty( $rating ) ) $out .= "&r={$rating}"; $avatar = "<img alt='' src='{$out}' class='avatar avatar-{$size}' height='{$size}' width='{$size}' />"; } else { $avatar = "<img alt='' src='{$default}' class='avatar avatar-{$size} avatar-default' height='{$size}' width='{$size}' />"; } return apply_filters('get_avatar', $avatar, $id_or_email, $size, $default); } endif; if ( !function_exists('wp_setcookie') ) : /** * Sets a cookie for a user who just logged in. * * @since 1.5 * @deprecated Use wp_set_auth_cookie() * @see wp_set_auth_cookie() * * @param string $username The user's username * @param string $password Optional. The user's password * @param bool $already_md5 Optional. Whether the password has already been through MD5 * @param string $home Optional. Will be used instead of COOKIEPATH if set * @param string $siteurl Optional. Will be used instead of SITECOOKIEPATH if set * @param bool $remember Optional. Remember that the user is logged in */ function wp_setcookie($username, $password = '', $already_md5 = false, $home = '', $siteurl = '', $remember = false) { _deprecated_function( __FUNCTION__, '2.5', 'wp_set_auth_cookie()' ); $user = get_userdatabylogin($username); wp_set_auth_cookie($user->ID, $remember); } endif; if ( !function_exists('wp_clearcookie') ) : /** * Clears the authentication cookie, logging the user out. * * @since 1.5 * @deprecated Use wp_clear_auth_cookie() * @see wp_clear_auth_cookie() */ function wp_clearcookie() { _deprecated_function( __FUNCTION__, '2.5', 'wp_clear_auth_cookie()' ); wp_clear_auth_cookie(); } endif; if ( !function_exists('wp_get_cookie_login') ): /** * Gets the user cookie login. * * This function is deprecated and should no longer be extended as it won't be * used anywhere in WordPress. Also, plugins shouldn't use it either. * * @since 2.0.4 * @deprecated No alternative * * @return bool Always returns false */ function wp_get_cookie_login() { _deprecated_function( __FUNCTION__, '2.5', '' ); return false; } endif; if ( !function_exists('wp_login') ) : /** * Checks a users login information and logs them in if it checks out. * * Use the global $error to get the reason why the login failed. If the username * is blank, no error will be set, so assume blank username on that case. * * Plugins extending this function should also provide the global $error and set * what the error is, so that those checking the global for why there was a * failure can utilize it later. * * @since 1.2.2 * @deprecated Use wp_signon() * @global string $error Error when false is returned * * @param string $username User's username * @param string $password User's password * @param bool $deprecated Not used * @return bool False on login failure, true on successful check */ function wp_login($username, $password, $deprecated = '') { global $error; $user = wp_authenticate($username, $password); if ( ! is_wp_error($user) ) return true; $error = $user->get_error_message(); return false; } endif; if ( !function_exists( 'wp_text_diff' ) ) : /** * Displays a human readable HTML representation of the difference between two strings. * * The Diff is available for getting the changes between versions. The output is * HTML, so the primary use is for displaying the changes. If the two strings * are equivalent, then an empty string will be returned. * * The arguments supported and can be changed are listed below. * * 'title' : Default is an empty string. Titles the diff in a manner compatible * with the output. * 'title_left' : Default is an empty string. Change the HTML to the left of the * title. * 'title_right' : Default is an empty string. Change the HTML to the right of * the title. * * @since 2.6 * @see wp_parse_args() Used to change defaults to user defined settings. * @uses Text_Diff * @uses WP_Text_Diff_Renderer_Table * * @param string $left_string "old" (left) version of string * @param string $right_string "new" (right) version of string * @param string|array $args Optional. Change 'title', 'title_left', and 'title_right' defaults. * @return string Empty string if strings are equivalent or HTML with differences. */ function wp_text_diff( $left_string, $right_string, $args = null ) { $defaults = array( 'title' => '', 'title_left' => '', 'title_right' => '' ); $args = wp_parse_args( $args, $defaults ); if ( !class_exists( 'WP_Text_Diff_Renderer_Table' ) ) require( ABSPATH . WPINC . '/wp-diff.php' ); // Normalize whitespace $left_string = trim($left_string); $right_string = trim($right_string); $left_string = str_replace("\r", "\n", $left_string); $right_string = str_replace("\r", "\n", $right_string); $left_string = preg_replace( array( '/\n+/', '/[ \t]+/' ), array( "\n", ' ' ), $left_string ); $right_string = preg_replace( array( '/\n+/', '/[ \t]+/' ), array( "\n", ' ' ), $right_string ); $left_lines = split("\n", $left_string); $right_lines = split("\n", $right_string); $text_diff = new Text_Diff($left_lines, $right_lines); $renderer = new WP_Text_Diff_Renderer_Table(); $diff = $renderer->render($text_diff); if ( !$diff ) return ''; $r = "<table class='diff'>\n"; $r .= "<col class='ltype' /><col class='content' /><col class='ltype' /><col class='content' />"; if ( $args['title'] || $args['title_left'] || $args['title_right'] ) $r .= "<thead>"; if ( $args['title'] ) $r .= "<tr class='diff-title'><th colspan='4'>$args[title]</th></tr>\n"; if ( $args['title_left'] || $args['title_right'] ) { $r .= "<tr class='diff-sub-title'>\n"; $r .= "\t<td></td><th>$args[title_left]</th>\n"; $r .= "\t<td></td><th>$args[title_right]</th>\n"; $r .= "</tr>\n"; } if ( $args['title'] || $args['title_left'] || $args['title_right'] ) $r .= "</thead>\n"; $r .= "<tbody>\n$diff\n</tbody>\n"; $r .= "</table>"; return $r; } endif; ?>������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/taxonomy.php���������������������������������������������������������������������0000644�0001066�0001066�00000207244�11046147301�014031� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * @package WordPress * @subpackage Taxonomy * @since 2.3 */ // // Taxonomy Registration // /** * Default Taxonomy Objects * @since 2.3 * @global array $wp_taxonomies */ $wp_taxonomies = array(); $wp_taxonomies['category'] = (object) array('name' => 'category', 'object_type' => 'post', 'hierarchical' => true, 'update_count_callback' => '_update_post_term_count'); $wp_taxonomies['post_tag'] = (object) array('name' => 'post_tag', 'object_type' => 'post', 'hierarchical' => false, 'update_count_callback' => '_update_post_term_count'); $wp_taxonomies['link_category'] = (object) array('name' => 'link_category', 'object_type' => 'link', 'hierarchical' => false); /** * Return all of the taxonomy names that are of $object_type. * * It appears that this function can be used to find all of the names inside of * $wp_taxonomies global variable. * * <code><?php $taxonomies = get_object_taxonomies('post'); ?></code> Should * result in <code>Array('category', 'post_tag')</code> * * @package WordPress * @subpackage Taxonomy * @since 2.3 * * @uses $wp_taxonomies * * @param array|string|object $object Name of the type of taxonomy object, or an object (row from posts) * @return array The names of all taxonomy of $object_type. */ function get_object_taxonomies($object) { global $wp_taxonomies; if ( is_object($object) ) { if ( $object->post_type == 'attachment' ) return get_attachment_taxonomies($object); $object = $object->post_type; } $object = (array) $object; $taxonomies = array(); foreach ( $wp_taxonomies as $taxonomy ) { if ( array_intersect($object, (array) $taxonomy->object_type) ) $taxonomies[] = $taxonomy->name; } return $taxonomies; } /** * Retrieves the taxonomy object of $taxonomy. * * The get_taxonomy function will first check that the parameter string given * is a taxonomy object and if it is, it will return it. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * * @uses $wp_taxonomies * @uses is_taxonomy() Checks whether taxonomy exists * * @param string $taxonomy Name of taxonomy object to return * @return object|bool The Taxonomy Object or false if $taxonomy doesn't exist */ function get_taxonomy( $taxonomy ) { global $wp_taxonomies; if ( ! is_taxonomy($taxonomy) ) return false; return $wp_taxonomies[$taxonomy]; } /** * Checks that the taxonomy name exists. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * * @uses $wp_taxonomies * * @param string $taxonomy Name of taxonomy object * @return bool Whether the taxonomy exists or not. */ function is_taxonomy( $taxonomy ) { global $wp_taxonomies; return isset($wp_taxonomies[$taxonomy]); } /** * Whether the taxonomy object is hierarchical. * * Checks to make sure that the taxonomy is an object first. Then Gets the * object, and finally returns the hierarchical value in the object. * * A false return value might also mean that the taxonomy does not exist. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * * @uses is_taxonomy() Checks whether taxonomy exists * @uses get_taxonomy() Used to get the taxonomy object * * @param string $taxonomy Name of taxonomy object * @return bool Whether the taxonomy is hierarchical */ function is_taxonomy_hierarchical($taxonomy) { if ( ! is_taxonomy($taxonomy) ) return false; $taxonomy = get_taxonomy($taxonomy); return $taxonomy->hierarchical; } /** * Create or modify a taxonomy object. Do not use before init. * * A simple function for creating or modifying a taxonomy object based on the * parameters given. The function will accept an array (third optional * parameter), along with strings for the taxonomy name and another string for * the object type. * * Nothing is returned, so expect error maybe or use is_taxonomy() to check * whether taxonomy exists. * * Optional $args contents: * * hierarachical - has some defined purpose at other parts of the API and is a * boolean value. * * update_count_callback - works much like a hook, in that it will be called * when the count is updated. * * rewrite - false to prevent rewrite, or array('slug'=>$slug) to customize * permastruct; default will use $taxonomy as slug. * * query_var - false to prevent queries, or string to customize query var * (?$query_var=$term); default will use $taxonomy as query var. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * @uses $wp_taxonomies Inserts new taxonomy object into the list * @uses $wp_rewrite Adds rewrite tags and permastructs * @uses $wp Adds query vars * * @param string $taxonomy Name of taxonomy object * @param array|string $object_type Name of the object type for the taxonomy object. * @param array|string $args See above description for the two keys values. */ function register_taxonomy( $taxonomy, $object_type, $args = array() ) { global $wp_taxonomies, $wp_rewrite, $wp; $defaults = array('hierarchical' => false, 'update_count_callback' => '', 'rewrite' => true, 'query_var' => true); $args = wp_parse_args($args, $defaults); if ( false !== $args['query_var'] && !empty($wp) ) { if ( true === $args['query_var'] ) $args['query_var'] = $taxonomy; $args['query_var'] = sanitize_title_with_dashes($args['query_var']); $wp->add_query_var($args['query_var']); } if ( false !== $args['rewrite'] && !empty($wp_rewrite) ) { if ( !is_array($args['rewrite']) ) $args['rewrite'] = array(); if ( !isset($args['rewrite']['slug']) ) $args['rewrite']['slug'] = sanitize_title_with_dashes($taxonomy); $wp_rewrite->add_rewrite_tag("%$taxonomy%", '([^/]+)', $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term=$term"); $wp_rewrite->add_permastruct($taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%"); } $args['name'] = $taxonomy; $args['object_type'] = $object_type; $wp_taxonomies[$taxonomy] = (object) $args; } // // Term API // /** * Retrieve object_ids of valid taxonomy and term. * * The strings of $taxonomies must exist before this function will continue. On * failure of finding a valid taxonomy, it will return an WP_Error class, kind * of like Exceptions in PHP 5, except you can't catch them. Even so, you can * still test for the WP_Error class and get the error message. * * The $terms aren't checked the same as $taxonomies, but still need to exist * for $object_ids to be returned. * * It is possible to change the order that object_ids is returned by either * using PHP sort family functions or using the database by using $args with * either ASC or DESC array. The value should be in the key named 'order'. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * * @uses $wpdb * @uses wp_parse_args() Creates an array from string $args. * * @param string|array $terms String of term or array of string values of terms that will be used * @param string|array $taxonomies String of taxonomy name or Array of string values of taxonomy names * @param array|string $args Change the order of the object_ids, either ASC or DESC * @return WP_Error|array If the taxonomy does not exist, then WP_Error will be returned. On success * the array can be empty meaning that there are no $object_ids found or it will return the $object_ids found. */ function get_objects_in_term( $terms, $taxonomies, $args = array() ) { global $wpdb; if ( !is_array( $terms) ) $terms = array($terms); if ( !is_array($taxonomies) ) $taxonomies = array($taxonomies); foreach ( $taxonomies as $taxonomy ) { if ( ! is_taxonomy($taxonomy) ) return new WP_Error('invalid_taxonomy', __('Invalid Taxonomy')); } $defaults = array('order' => 'ASC'); $args = wp_parse_args( $args, $defaults ); extract($args, EXTR_SKIP); $order = ( 'desc' == strtolower($order) ) ? 'DESC' : 'ASC'; $terms = array_map('intval', $terms); $taxonomies = "'" . implode("', '", $taxonomies) . "'"; $terms = "'" . implode("', '", $terms) . "'"; $object_ids = $wpdb->get_col("SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ($taxonomies) AND tt.term_id IN ($terms) ORDER BY tr.object_id $order"); if ( ! $object_ids ) return array(); return $object_ids; } /** * Get all Term data from database by Term ID. * * The usage of the get_term function is to apply filters to a term object. It * is possible to get a term object from the database before applying the * filters. * * $term ID must be part of $taxonomy, to get from the database. Failure, might * be able to be captured by the hooks. Failure would be the same value as $wpdb * returns for the get_row method. * * There are two hooks, one is specifically for each term, named 'get_term', and * the second is for the taxonomy name, 'term_$taxonomy'. Both hooks gets the * term object, and the taxonomy name as parameters. Both hooks are expected to * return a Term object. * * 'get_term' hook - Takes two parameters the term Object and the taxonomy name. * Must return term object. Used in get_term() as a catch-all filter for every * $term. * * 'get_$taxonomy' hook - Takes two parameters the term Object and the taxonomy * name. Must return term object. $taxonomy will be the taxonomy name, so for * example, if 'category', it would be 'get_category' as the filter name. Useful * for custom taxonomies or plugging into default taxonomies. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * * @uses $wpdb * @uses sanitize_term() Cleanses the term based on $filter context before returning. * @see sanitize_term_field() The $context param lists the available values for get_term_by() $filter param. * * @param int|object $term If integer, will get from database. If object will apply filters and return $term. * @param string $taxonomy Taxonomy name that $term is part of. * @param string $output Constant OBJECT, ARRAY_A, or ARRAY_N * @param string $filter Optional, default is raw or no WordPress defined filter will applied. * @return mixed|null|WP_Error Term Row from database. Will return null if $term is empty. If taxonomy does not * exist then WP_Error will be returned. */ function &get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') { global $wpdb; if ( empty($term) ) return null; if ( ! is_taxonomy($taxonomy) ) return new WP_Error('invalid_taxonomy', __('Invalid Taxonomy')); if ( is_object($term) ) { wp_cache_add($term->term_id, $term, $taxonomy); $_term = $term; } else { $term = (int) $term; if ( ! $_term = wp_cache_get($term, $taxonomy) ) { $_term = $wpdb->get_row( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = %s AND t.term_id = %s LIMIT 1", $taxonomy, $term) ); wp_cache_add($term, $_term, $taxonomy); } } $_term = apply_filters('get_term', $_term, $taxonomy); $_term = apply_filters("get_$taxonomy", $_term, $taxonomy); $_term = sanitize_term($_term, $taxonomy, $filter); if ( $output == OBJECT ) { return $_term; } elseif ( $output == ARRAY_A ) { return get_object_vars($_term); } elseif ( $output == ARRAY_N ) { return array_values(get_object_vars($_term)); } else { return $_term; } } /** * Get all Term data from database by Term field and data. * * Warning: $value is not escaped for 'name' $field. You must do it yourself, if * required. * * The default $field is 'id', therefore it is possible to also use null for * field, but not recommended that you do so. * * If $value does not exist, the return value will be false. If $taxonomy exists * and $field and $value combinations exist, the Term will be returned. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * * @uses $wpdb * @uses sanitize_term() Cleanses the term based on $filter context before returning. * @see sanitize_term_field() The $context param lists the available values for get_term_by() $filter param. * * @param string $field Either 'slug', 'name', or 'id' * @param string|int $value Search for this term value * @param string $taxonomy Taxonomy Name * @param string $output Constant OBJECT, ARRAY_A, or ARRAY_N * @param string $filter Optional, default is raw or no WordPress defined filter will applied. * @return mixed Term Row from database. Will return false if $taxonomy does not exist or $term was not found. */ function get_term_by($field, $value, $taxonomy, $output = OBJECT, $filter = 'raw') { global $wpdb; if ( ! is_taxonomy($taxonomy) ) return false; if ( 'slug' == $field ) { $field = 't.slug'; $value = sanitize_title($value); if ( empty($value) ) return false; } else if ( 'name' == $field ) { // Assume already escaped $field = 't.name'; } else { $field = 't.term_id'; $value = (int) $value; } $term = $wpdb->get_row( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = %s AND $field = %s LIMIT 1", $taxonomy, $value) ); if ( !$term ) return false; wp_cache_add($term->term_id, $term, $taxonomy); $term = sanitize_term($term, $taxonomy, $filter); if ( $output == OBJECT ) { return $term; } elseif ( $output == ARRAY_A ) { return get_object_vars($term); } elseif ( $output == ARRAY_N ) { return array_values(get_object_vars($term)); } else { return $term; } } /** * Merge all term children into a single array. * * This recursive function will merge all of the children of $term into the same * array. Only useful for taxonomies which are hierarchical. * * Will return an empty array if $term does not exist in $taxonomy. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * * @uses $wpdb * @uses _get_term_hierarchy() * @uses get_term_children() Used to get the children of both $taxonomy and the parent $term * * @param string $term Name of Term to get children * @param string $taxonomy Taxonomy Name * @return array|WP_Error List of Term Objects. WP_Error returned if $taxonomy does not exist */ function get_term_children( $term, $taxonomy ) { if ( ! is_taxonomy($taxonomy) ) return new WP_Error('invalid_taxonomy', __('Invalid Taxonomy')); $terms = _get_term_hierarchy($taxonomy); if ( ! isset($terms[$term]) ) return array(); $children = $terms[$term]; foreach ( $terms[$term] as $child ) { if ( isset($terms[$child]) ) $children = array_merge($children, get_term_children($child, $taxonomy)); } return $children; } /** * Get sanitized Term field. * * Does checks for $term, based on the $taxonomy. The function is for contextual * reasons and for simplicity of usage. See sanitize_term_field() for more * information. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * * @uses sanitize_term_field() Passes the return value in sanitize_term_field on success. * * @param string $field Term field to fetch * @param int $term Term ID * @param string $taxonomy Taxonomy Name * @param string $context Optional, default is display. Look at sanitize_term_field() for available options. * @return mixed Will return an empty string if $term is not an object or if $field is not set in $term. */ function get_term_field( $field, $term, $taxonomy, $context = 'display' ) { $term = (int) $term; $term = get_term( $term, $taxonomy ); if ( is_wp_error($term) ) return $term; if ( !is_object($term) ) return ''; if ( !isset($term->$field) ) return ''; return sanitize_term_field($field, $term->$field, $term->term_id, $taxonomy, $context); } /** * Sanitizes Term for editing. * * Return value is sanitize_term() and usage is for sanitizing the term for * editing. Function is for contextual and simplicity. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * * @uses sanitize_term() Passes the return value on success * * @param int|object $id Term ID or Object * @param string $taxonomy Taxonomy Name * @return mixed|null|WP_Error Will return empty string if $term is not an object. */ function get_term_to_edit( $id, $taxonomy ) { $term = get_term( $id, $taxonomy ); if ( is_wp_error($term) ) return $term; if ( !is_object($term) ) return ''; return sanitize_term($term, $taxonomy, 'edit'); } /** * Retrieve the terms in taxonomy or list of taxonomies. * * You can fully inject any customizations to the query before it is sent, as * well as control the output with a filter. * * The 'get_terms' filter will be called when the cache has the term and will * pass the found term along with the array of $taxonomies and array of $args. * This filter is also called before the array of terms is passed and will pass * the array of terms, along with the $taxonomies and $args. * * The 'list_terms_exclusions' filter passes the compiled exclusions along with * the $args. * * The list that $args can contain, which will overwrite the defaults. * * orderby - Default is 'name'. Can be name, count, or nothing (will use * term_id). * * order - Default is ASC. Can use DESC. * hide_empty - Default is true. Will not return empty $terms. * fields - Default is all. * slug - Any terms that has this value. Default is empty string. * hierarchical - Whether to return hierarchical taxonomy. Default is true. * name__like - Default is empty string. * * The argument 'pad_counts' will count all of the children along with the * $terms. * * The 'get' argument allows for overwriting 'hide_empty' and 'child_of', which * can be done by setting the value to 'all', instead of its default empty * string value. * * The 'child_of' argument will be used if you use multiple taxonomy or the * first $taxonomy isn't hierarchical or 'parent' isn't used. The default is 0, * which will be translated to a false value. If 'child_of' is set, then * 'child_of' value will be tested against $taxonomy to see if 'child_of' is * contained within. Will return an empty array if test fails. * * If 'parent' is set, then it will be used to test against the first taxonomy. * Much like 'child_of'. Will return an empty array if the test fails. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * * @uses $wpdb * @uses wp_parse_args() Merges the defaults with those defined by $args and allows for strings. * * @param string|array Taxonomy name or list of Taxonomy names * @param string|array $args The values of what to search for when returning terms * @return array|WP_Error List of Term Objects and their children. Will return WP_Error, if any of $taxonomies do not exist. */ function &get_terms($taxonomies, $args = '') { global $wpdb; $empty_array = array(); $single_taxonomy = false; if ( !is_array($taxonomies) ) { $single_taxonomy = true; $taxonomies = array($taxonomies); } foreach ( $taxonomies as $taxonomy ) { if ( ! is_taxonomy($taxonomy) ) return new WP_Error('invalid_taxonomy', __('Invalid Taxonomy')); } $in_taxonomies = "'" . implode("', '", $taxonomies) . "'"; $defaults = array('orderby' => 'name', 'order' => 'ASC', 'hide_empty' => true, 'exclude' => '', 'include' => '', 'number' => '', 'fields' => 'all', 'slug' => '', 'parent' => '', 'hierarchical' => true, 'child_of' => 0, 'get' => '', 'name__like' => '', 'pad_counts' => false, 'offset' => '', 'search' => ''); $args = wp_parse_args( $args, $defaults ); $args['number'] = absint( $args['number'] ); $args['offset'] = absint( $args['offset'] ); if ( !$single_taxonomy || !is_taxonomy_hierarchical($taxonomies[0]) || '' != $args['parent'] ) { $args['child_of'] = 0; $args['hierarchical'] = false; $args['pad_counts'] = false; } if ( 'all' == $args['get'] ) { $args['child_of'] = 0; $args['hide_empty'] = 0; $args['hierarchical'] = false; $args['pad_counts'] = false; } extract($args, EXTR_SKIP); if ( $child_of ) { $hierarchy = _get_term_hierarchy($taxonomies[0]); if ( !isset($hierarchy[$child_of]) ) return $empty_array; } if ( $parent ) { $hierarchy = _get_term_hierarchy($taxonomies[0]); if ( !isset($hierarchy[$parent]) ) return $empty_array; } // $args can be whatever, only use the args defined in defaults to compute the key $filter_key = ( has_filter('list_terms_exclusions') ) ? serialize($GLOBALS['wp_filter']['list_terms_exclusions']) : ''; $key = md5( serialize( compact(array_keys($defaults)) ) . serialize( $taxonomies ) . $filter_key ); if ( $cache = wp_cache_get( 'get_terms', 'terms' ) ) { if ( isset( $cache[ $key ] ) ) return apply_filters('get_terms', $cache[$key], $taxonomies, $args); } if ( 'count' == $orderby ) $orderby = 'tt.count'; else if ( 'name' == $orderby ) $orderby = 't.name'; else if ( 'slug' == $orderby ) $orderby = 't.slug'; else if ( 'term_group' == $orderby ) $orderby = 't.term_group'; else $orderby = 't.term_id'; $where = ''; $inclusions = ''; if ( !empty($include) ) { $exclude = ''; $interms = preg_split('/[\s,]+/',$include); if ( count($interms) ) { foreach ( $interms as $interm ) { if (empty($inclusions)) $inclusions = ' AND ( t.term_id = ' . intval($interm) . ' '; else $inclusions .= ' OR t.term_id = ' . intval($interm) . ' '; } } } if ( !empty($inclusions) ) $inclusions .= ')'; $where .= $inclusions; $exclusions = ''; if ( !empty($exclude) ) { $exterms = preg_split('/[\s,]+/',$exclude); if ( count($exterms) ) { foreach ( $exterms as $exterm ) { if (empty($exclusions)) $exclusions = ' AND ( t.term_id <> ' . intval($exterm) . ' '; else $exclusions .= ' AND t.term_id <> ' . intval($exterm) . ' '; } } } if ( !empty($exclusions) ) $exclusions .= ')'; $exclusions = apply_filters('list_terms_exclusions', $exclusions, $args ); $where .= $exclusions; if ( !empty($slug) ) { $slug = sanitize_title($slug); $where .= " AND t.slug = '$slug'"; } if ( !empty($name__like) ) $where .= " AND t.name LIKE '{$name__like}%'"; if ( '' != $parent ) { $parent = (int) $parent; $where .= " AND tt.parent = '$parent'"; } if ( $hide_empty && !$hierarchical ) $where .= ' AND tt.count > 0'; if ( !empty($number) ) { if( $offset ) $number = 'LIMIT ' . $offset . ',' . $number; else $number = 'LIMIT ' . $number; } else $number = ''; if ( !empty($search) ) { $search = like_escape($search); $where .= " AND (t.name LIKE '%$search%')"; } $select_this = ''; if ( 'all' == $fields ) $select_this = 't.*, tt.*'; else if ( 'ids' == $fields ) $select_this = 't.term_id'; else if ( 'names' == $fields ) $select_this = 't.name'; $query = "SELECT $select_this FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ($in_taxonomies) $where ORDER BY $orderby $order $number"; if ( 'all' == $fields ) { $terms = $wpdb->get_results($query); update_term_cache($terms); } else if ( ('ids' == $fields) || ('names' == $fields) ) { $terms = $wpdb->get_col($query); } if ( empty($terms) ) { $cache[ $key ] = array(); wp_cache_set( 'get_terms', $cache, 'terms' ); return apply_filters('get_terms', array(), $taxonomies, $args); } if ( $child_of || $hierarchical ) { $children = _get_term_hierarchy($taxonomies[0]); if ( ! empty($children) ) $terms = & _get_term_children($child_of, $terms, $taxonomies[0]); } // Update term counts to include children. if ( $pad_counts ) _pad_term_counts($terms, $taxonomies[0]); // Make sure we show empty categories that have children. if ( $hierarchical && $hide_empty ) { foreach ( $terms as $k => $term ) { if ( ! $term->count ) { $children = _get_term_children($term->term_id, $terms, $taxonomies[0]); foreach ( $children as $child ) if ( $child->count ) continue 2; // It really is empty unset($terms[$k]); } } } reset ( $terms ); $cache[ $key ] = $terms; wp_cache_set( 'get_terms', $cache, 'terms' ); $terms = apply_filters('get_terms', $terms, $taxonomies, $args); return $terms; } /** * Check if Term exists. * * Returns the index of a defined term, or 0 (false) if the term doesn't exist. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * * @uses $wpdb * * @param int|string $term The term to check * @param string $taxonomy The taxonomy name to use * @return mixed Get the term id or Term Object, if exists. */ function is_term($term, $taxonomy = '') { global $wpdb; $select = "SELECT term_id FROM $wpdb->terms as t WHERE "; $tax_select = "SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE "; if ( is_int($term) ) { if ( 0 == $term ) return 0; $where = 't.term_id = %d'; if ( !empty($taxonomy) ) return $wpdb->get_row( $wpdb->prepare( $tax_select . $where . " AND tt.taxonomy = %s", $term, $taxonomy ), ARRAY_A ); else return $wpdb->get_var( $wpdb->prepare( $select . $where, $term ) ); } if ( '' === $slug = sanitize_title($term) ) return 0; $where = 't.slug = %s'; $else_where = 't.name = %s'; if ( !empty($taxonomy) ) { if ( $result = $wpdb->get_row( $wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s", $slug, $taxonomy), ARRAY_A) ) return $result; return $wpdb->get_row( $wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $else_where AND tt.taxonomy = %s", $term, $taxonomy), ARRAY_A); } if ( $result = $wpdb->get_var( $wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $where", $slug) ) ) return $result; return $wpdb->get_var( $wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $else_where", $term) ); } /** * Sanitize Term all fields. * * Relys on sanitize_term_field() to sanitize the term. The difference is that * this function will sanitize <strong>all</strong> fields. The context is based * on sanitize_term_field(). * * The $term is expected to be either an array or an object. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * * @uses sanitize_term_field Used to sanitize all fields in a term * * @param array|object $term The term to check * @param string $taxonomy The taxonomy name to use * @param string $context Default is 'display'. * @return array|object Term with all fields sanitized */ function sanitize_term($term, $taxonomy, $context = 'display') { if ( 'raw' == $context ) return $term; $fields = array('term_id', 'name', 'description', 'slug', 'count', 'parent', 'term_group'); $do_object = false; if ( is_object($term) ) $do_object = true; foreach ( $fields as $field ) { if ( $do_object ) $term->$field = sanitize_term_field($field, $term->$field, $term->term_id, $taxonomy, $context); else $term[$field] = sanitize_term_field($field, $term[$field], $term['term_id'], $taxonomy, $context); } return $term; } /** * Cleanse the field value in the term based on the context. * * Passing a term field value through the function should be assumed to have * cleansed the value for whatever context the term field is going to be used. * * If no context or an unsupported context is given, then default filters will * be applied. * * There are enough filters for each context to support a custom filtering * without creating your own filter function. Simply create a function that * hooks into the filter you need. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * * @uses $wpdb * * @param string $field Term field to sanitize * @param string $value Search for this term value * @param int $term_id Term ID * @param string $taxonomy Taxonomy Name * @param string $context Either edit, db, display, attribute, or js. * @return mixed sanitized field */ function sanitize_term_field($field, $value, $term_id, $taxonomy, $context) { if ( 'parent' == $field || 'term_id' == $field || 'count' == $field || 'term_group' == $field ) { $value = (int) $value; if ( $value < 0 ) $value = 0; } if ( 'raw' == $context ) return $value; if ( 'edit' == $context ) { $value = apply_filters("edit_term_$field", $value, $term_id, $taxonomy); $value = apply_filters("edit_${taxonomy}_$field", $value, $term_id); if ( 'description' == $field ) $value = format_to_edit($value); else $value = attribute_escape($value); } else if ( 'db' == $context ) { $value = apply_filters("pre_term_$field", $value, $taxonomy); $value = apply_filters("pre_${taxonomy}_$field", $value); // Back compat filters if ( 'slug' == $field ) $value = apply_filters('pre_category_nicename', $value); } else if ( 'rss' == $context ) { $value = apply_filters("term_${field}_rss", $value, $taxonomy); $value = apply_filters("${taxonomy}_${field}_rss", $value); } else { // Use display filters by default. $value = apply_filters("term_$field", $value, $term_id, $taxonomy, $context); $value = apply_filters("${taxonomy}_$field", $value, $term_id, $context); } if ( 'attribute' == $context ) $value = attribute_escape($value); else if ( 'js' == $context ) $value = js_escape($value); return $value; } /** * Count how many terms are in Taxonomy. * * Default $args is 'ignore_empty' which can be <code>'ignore_empty=true'</code> * or <code>array('ignore_empty' => true);</code>. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * * @uses $wpdb * @uses wp_parse_args() Turns strings into arrays and merges defaults into an array. * * @param string $taxonomy Taxonomy name * @param array|string $args Overwrite defaults * @return int How many terms are in $taxonomy */ function wp_count_terms( $taxonomy, $args = array() ) { global $wpdb; $defaults = array('ignore_empty' => false); $args = wp_parse_args($args, $defaults); extract($args, EXTR_SKIP); $where = ''; if ( $ignore_empty ) $where = 'AND count > 0'; return $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE taxonomy = %s $where", $taxonomy) ); } /** * Will unlink the term from the taxonomy. * * Will remove the term's relationship to the taxonomy, not the term or taxonomy * itself. The term and taxonomy will still exist. Will require the term's * object ID to perform the operation. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * @uses $wpdb * * @param int $object_id The term Object Id that refers to the term * @param string|array $taxonomy List of Taxonomy Names or single Taxonomy name. */ function wp_delete_object_term_relationships( $object_id, $taxonomies ) { global $wpdb; $object_id = (int) $object_id; if ( !is_array($taxonomies) ) $taxonomies = array($taxonomies); foreach ( $taxonomies as $taxonomy ) { $terms = wp_get_object_terms($object_id, $taxonomy, 'fields=tt_ids'); $in_terms = "'" . implode("', '", $terms) . "'"; $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_terms)", $object_id) ); wp_update_term_count($terms, $taxonomy); } } /** * Removes a term from the database. * * If the term is a parent of other terms, then the children will be updated to * that term's parent. * * The $args 'default' will only override the terms found, if there is only one * term found. Any other and the found terms are used. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * * @uses $wpdb * @uses do_action() Calls both 'delete_term' and 'delete_$taxonomy' action * hooks, passing term object, term id. 'delete_term' gets an additional * parameter with the $taxonomy parameter. * * @param int $term Term ID * @param string $taxonomy Taxonomy Name * @param array|string $args Optional. Change 'default' term id and override found term ids. * @return bool|WP_Error Returns false if not term; true if completes delete action. */ function wp_delete_term( $term, $taxonomy, $args = array() ) { global $wpdb; $term = (int) $term; if ( ! $ids = is_term($term, $taxonomy) ) return false; if ( is_wp_error( $ids ) ) return $ids; $tt_id = $ids['term_taxonomy_id']; $defaults = array(); $args = wp_parse_args($args, $defaults); extract($args, EXTR_SKIP); if ( isset($default) ) { $default = (int) $default; if ( ! is_term($default, $taxonomy) ) unset($default); } // Update children to point to new parent if ( is_taxonomy_hierarchical($taxonomy) ) { $term_obj = get_term($term, $taxonomy); if ( is_wp_error( $term_obj ) ) return $term_obj; $parent = $term_obj->parent; $wpdb->update( $wpdb->term_taxonomy, compact( 'parent' ), array( 'parent' => $term_obj->term_id) + compact( 'taxonomy' ) ); } $objects = $wpdb->get_col( $wpdb->prepare( "SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $tt_id ) ); foreach ( (array) $objects as $object ) { $terms = wp_get_object_terms($object, $taxonomy, 'fields=ids'); if ( 1 == count($terms) && isset($default) ) $terms = array($default); else $terms = array_diff($terms, array($term)); $terms = array_map('intval', $terms); wp_set_object_terms($object, $terms, $taxonomy); } $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = %d", $tt_id ) ); // Delete the term if no taxonomies use it. if ( !$wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE term_id = %d", $term) ) ) $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->terms WHERE term_id = %d", $term) ); clean_term_cache($term, $taxonomy); do_action('delete_term', $term, $tt_id, $taxonomy); do_action("delete_$taxonomy", $term, $tt_id); return true; } /** * Retrieves the terms associated with the given object(s), in the supplied taxonomies. * * The following information has to do the $args parameter and for what can be * contained in the string or array of that parameter, if it exists. * * The first argument is called, 'orderby' and has the default value of 'name'. * The other value that is supported is 'count'. * * The second argument is called, 'order' and has the default value of 'ASC'. * The only other value that will be acceptable is 'DESC'. * * The final argument supported is called, 'fields' and has the default value of * 'all'. There are multiple other options that can be used instead. Supported * values are as follows: 'all', 'ids', 'names', and finally * 'all_with_object_id'. * * The fields argument also decides what will be returned. If 'all' or * 'all_with_object_id' is choosen or the default kept intact, then all matching * terms objects will be returned. If either 'ids' or 'names' is used, then an * array of all matching term ids or term names will be returned respectively. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * @uses $wpdb * * @param int|array $object_id The id of the object(s) to retrieve. * @param string|array $taxonomies The taxonomies to retrieve terms from. * @param array|string $args Change what is returned * @return array|WP_Error The requested term data or empty array if no terms found. WP_Error if $taxonomy does not exist. */ function wp_get_object_terms($object_ids, $taxonomies, $args = array()) { global $wpdb; if ( !is_array($taxonomies) ) $taxonomies = array($taxonomies); foreach ( $taxonomies as $taxonomy ) { if ( ! is_taxonomy($taxonomy) ) return new WP_Error('invalid_taxonomy', __('Invalid Taxonomy')); } if ( !is_array($object_ids) ) $object_ids = array($object_ids); $object_ids = array_map('intval', $object_ids); $defaults = array('orderby' => 'name', 'order' => 'ASC', 'fields' => 'all'); $args = wp_parse_args( $args, $defaults ); $terms = array(); if ( count($taxonomies) > 1 ) { foreach ( $taxonomies as $index => $taxonomy ) { $t = get_taxonomy($taxonomy); if ( isset($t->args) && is_array($t->args) && $args != array_merge($args, $t->args) ) { unset($taxonomies[$index]); $terms = array_merge($terms, wp_get_object_terms($object_ids, $taxonomy, array_merge($args, $t->args))); } } } else { $t = get_taxonomy($taxonomies[0]); if ( isset($t->args) && is_array($t->args) ) $args = array_merge($args, $t->args); } extract($args, EXTR_SKIP); if ( 'count' == $orderby ) $orderby = 'tt.count'; else if ( 'name' == $orderby ) $orderby = 't.name'; else if ( 'slug' == $orderby ) $orderby = 't.slug'; else if ( 'term_group' == $orderby ) $orderby = 't.term_group'; else if ( 'term_order' == $orderby ) $orderby = 'tr.term_order'; else $orderby = 't.term_id'; $taxonomies = "'" . implode("', '", $taxonomies) . "'"; $object_ids = implode(', ', $object_ids); $select_this = ''; if ( 'all' == $fields ) $select_this = 't.*, tt.*'; else if ( 'ids' == $fields ) $select_this = 't.term_id'; else if ( 'names' == $fields ) $select_this = 't.name'; else if ( 'all_with_object_id' == $fields ) $select_this = 't.*, tt.*, tr.object_id'; $query = "SELECT $select_this FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN $wpdb->term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ($taxonomies) AND tr.object_id IN ($object_ids) ORDER BY $orderby $order"; if ( 'all' == $fields || 'all_with_object_id' == $fields ) { $terms = array_merge($terms, $wpdb->get_results($query)); update_term_cache($terms); } else if ( 'ids' == $fields || 'names' == $fields ) { $terms = array_merge($terms, $wpdb->get_col($query)); } else if ( 'tt_ids' == $fields ) { $terms = $wpdb->get_col("SELECT tr.term_taxonomy_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tr.object_id IN ($object_ids) AND tt.taxonomy IN ($taxonomies) ORDER BY tr.term_taxonomy_id $order"); } if ( ! $terms ) return array(); return $terms; } /** * Adds a new term to the database. Optionally marks it as an alias of an existing term. * * Error handling is assigned for the nonexistance of the $taxonomy and $term * parameters before inserting. If both the term id and taxonomy exist * previously, then an array will be returned that contains the term id and the * contents of what is returned. The keys of the array are 'term_id' and * 'term_taxonomy_id' containing numeric values. * * It is assumed that the term does not yet exist or the above will apply. The * term will be first added to the term table and then related to the taxonomy * if everything is well. If everything is correct, then several actions will be * run prior to a filter and then several actions will be run after the filter * is run. * * The arguments decide how the term is handled based on the $args parameter. * The following is a list of the available overrides and the defaults. * * 'alias_of'. There is no default, but if added, expected is the slug that the * term will be an alias of. Expected to be a string. * * 'description'. There is no default. If exists, will be added to the database * along with the term. Expected to be a string. * * 'parent'. Expected to be numeric and default is 0 (zero). Will assign value * of 'parent' to the term. * * 'slug'. Expected to be a string. There is no default. * * If 'slug' argument exists then the slug will be checked to see if it is not * a valid term. If that check succeeds (it is not a valid term), then it is * added and the term id is given. If it fails, then a check is made to whether * the taxonomy is hierarchical and the parent argument is not empty. If the * second check succeeds, the term will be inserted and the term id will be * given. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * @uses $wpdb * * @uses do_action() Calls 'create_term' hook with the term id and taxonomy id as parameters. * @uses do_action() Calls 'create_$taxonomy' hook with term id and taxonomy id as parameters. * @uses apply_filters() Calls 'term_id_filter' hook with term id and taxonomy id as parameters. * @uses do_action() Calls 'created_term' hook with the term id and taxonomy id as parameters. * @uses do_action() Calls 'created_$taxonomy' hook with term id and taxonomy id as parameters. * * @param int|string $term The term to add or update. * @param string $taxonomy The taxonomy to which to add the term * @param array|string $args Change the values of the inserted term * @return array|WP_Error The Term ID and Term Taxonomy ID */ function wp_insert_term( $term, $taxonomy, $args = array() ) { global $wpdb; if ( ! is_taxonomy($taxonomy) ) return new WP_Error('invalid_taxonomy', __('Invalid taxonomy')); if ( is_int($term) && 0 == $term ) return new WP_Error('invalid_term_id', __('Invalid term ID')); if ( '' == trim($term) ) return new WP_Error('empty_term_name', __('A name is required for this term')); $defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => ''); $args = wp_parse_args($args, $defaults); $args['name'] = $term; $args['taxonomy'] = $taxonomy; $args = sanitize_term($args, $taxonomy, 'db'); extract($args, EXTR_SKIP); // expected_slashed ($name) $name = stripslashes($name); $description = stripslashes($description); if ( empty($slug) ) $slug = sanitize_title($name); $term_group = 0; if ( $alias_of ) { $alias = $wpdb->get_row( $wpdb->prepare( "SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $alias_of) ); if ( $alias->term_group ) { // The alias we want is already in a group, so let's use that one. $term_group = $alias->term_group; } else { // The alias isn't in a group, so let's create a new one and firstly add the alias term to it. $term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms") + 1; $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->terms SET term_group = %d WHERE term_id = %d", $term_group, $alias->term_id ) ); } } if ( ! $term_id = is_term($slug) ) { if ( false === $wpdb->insert( $wpdb->terms, compact( 'name', 'slug', 'term_group' ) ) ) return new WP_Error('db_insert_error', __('Could not insert term into the database'), $wpdb->last_error); $term_id = (int) $wpdb->insert_id; } else if ( is_taxonomy_hierarchical($taxonomy) && !empty($parent) ) { // If the taxonomy supports hierarchy and the term has a parent, make the slug unique // by incorporating parent slugs. $slug = wp_unique_term_slug($slug, (object) $args); if ( false === $wpdb->insert( $wpdb->terms, compact( 'name', 'slug', 'term_group' ) ) ) return new WP_Error('db_insert_error', __('Could not insert term into the database'), $wpdb->last_error); $term_id = (int) $wpdb->insert_id; } if ( empty($slug) ) { $slug = sanitize_title($slug, $term_id); $wpdb->update( $wpdb->terms, compact( 'slug' ), compact( 'term_id' ) ); } $tt_id = $wpdb->get_var( $wpdb->prepare( "SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.term_id = %d", $taxonomy, $term_id ) ); if ( !empty($tt_id) ) return array('term_id' => $term_id, 'term_taxonomy_id' => $tt_id); $wpdb->insert( $wpdb->term_taxonomy, compact( 'term_id', 'taxonomy', 'description', 'parent') + array( 'count' => 0 ) ); $tt_id = (int) $wpdb->insert_id; do_action("create_term", $term_id, $tt_id); do_action("create_$taxonomy", $term_id, $tt_id); $term_id = apply_filters('term_id_filter', $term_id, $tt_id); clean_term_cache($term_id, $taxonomy); do_action("created_term", $term_id, $tt_id); do_action("created_$taxonomy", $term_id, $tt_id); return array('term_id' => $term_id, 'term_taxonomy_id' => $tt_id); } /** * Create Term and Taxonomy Relationships. * * Relates an object (post, link etc) to a term and taxonomy type. Creates the * term and taxonomy relationship if it doesn't already exist. Creates a term if * it doesn't exist (using the slug). * * A relationship means that the term is grouped in or belongs to the taxonomy. * A term has no meaning until it is given context by defining which taxonomy it * exists under. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * @uses $wpdb * * @param int $object_id The object to relate to. * @param array|int|string $term The slug or id of the term. * @param array|string $taxonomy The context in which to relate the term to the object. * @param bool $append If false will delete difference of terms. * @return array|WP_Error Affected Term IDs */ function wp_set_object_terms($object_id, $terms, $taxonomy, $append = false) { global $wpdb; $object_id = (int) $object_id; if ( ! is_taxonomy($taxonomy) ) return new WP_Error('invalid_taxonomy', __('Invalid Taxonomy')); if ( !is_array($terms) ) $terms = array($terms); if ( ! $append ) $old_terms = wp_get_object_terms($object_id, $taxonomy, 'fields=tt_ids'); $tt_ids = array(); $term_ids = array(); foreach ($terms as $term) { if ( !strlen(trim($term)) ) continue; if ( !$id = is_term($term, $taxonomy) ) $id = wp_insert_term($term, $taxonomy); if ( is_wp_error($id) ) return $id; $term_ids[] = $id['term_id']; $id = $id['term_taxonomy_id']; $tt_ids[] = $id; if ( $wpdb->get_var( $wpdb->prepare( "SELECT term_taxonomy_id FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id = %d", $object_id, $id ) ) ) continue; $wpdb->insert( $wpdb->term_relationships, array( 'object_id' => $object_id, 'term_taxonomy_id' => $id ) ); } wp_update_term_count($tt_ids, $taxonomy); if ( ! $append ) { $delete_terms = array_diff($old_terms, $tt_ids); if ( $delete_terms ) { $in_delete_terms = "'" . implode("', '", $delete_terms) . "'"; $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_delete_terms)", $object_id) ); wp_update_term_count($delete_terms, $taxonomy); } } $t = get_taxonomy($taxonomy); if ( ! $append && isset($t->sort) && $t->sort ) { $values = array(); $term_order = 0; $final_tt_ids = wp_get_object_terms($object_id, $taxonomy, 'fields=tt_ids'); foreach ( $tt_ids as $tt_id ) if ( in_array($tt_id, $final_tt_ids) ) $values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $tt_id, ++$term_order); if ( $values ) $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join(',', $values) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)"); } return $tt_ids; } /** * Will make slug unique, if it isn't already. * * The $slug has to be unique global to every taxonomy, meaning that one * taxonomy term can't have a matching slug with another taxonomy term. Each * slug has to be globally unique for every taxonomy. * * The way this works is that if the taxonomy that the term belongs to is * heirarchical and has a parent, it will append that parent to the $slug. * * If that still doesn't return an unique slug, then it try to append a number * until it finds a number that is truely unique. * * The only purpose for $term is for appending a parent, if one exists. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * @uses $wpdb * * @param string $slug The string that will be tried for a unique slug * @param object $term The term object that the $slug will belong too * @return string Will return a true unique slug. */ function wp_unique_term_slug($slug, $term) { global $wpdb; // If the taxonomy supports hierarchy and the term has a parent, make the slug unique // by incorporating parent slugs. if ( is_taxonomy_hierarchical($term->taxonomy) && !empty($term->parent) ) { $the_parent = $term->parent; while ( ! empty($the_parent) ) { $parent_term = get_term($the_parent, $term->taxonomy); if ( is_wp_error($parent_term) || empty($parent_term) ) break; $slug .= '-' . $parent_term->slug; if ( empty($parent_term->parent) ) break; $the_parent = $parent_term->parent; } } // If we didn't get a unique slug, try appending a number to make it unique. if ( !empty($args['term_id']) ) $query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s AND term_id != %d", $slug, $args['term_id'] ); else $query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s", $slug ); if ( $wpdb->get_var( $query ) ) { $num = 2; do { $alt_slug = $slug . "-$num"; $num++; $slug_check = $wpdb->get_var( $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s", $alt_slug ) ); } while ( $slug_check ); $slug = $alt_slug; } return $slug; } /** * Update term based on arguments provided. * * The $args will indiscriminately override all values with the same field name. * Care must be taken to not override important information need to update or * update will fail (or perhaps create a new term, neither would be acceptable). * * Defaults will set 'alias_of', 'description', 'parent', and 'slug' if not * defined in $args already. * * 'alias_of' will create a term group, if it doesn't already exist, and update * it for the $term. * * If the 'slug' argument in $args is missing, then the 'name' in $args will be * used. It should also be noted that if you set 'slug' and it isn't unique then * a WP_Error will be passed back. If you don't pass any slug, then a unique one * will be created for you. * * For what can be overrode in $args, check the term scheme can contain and stay * away from the term keys. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * * @uses $wpdb * @uses do_action() Will call both 'edit_term' and 'edit_$taxonomy' twice. * @uses apply_filters() Will call the 'term_id_filter' filter and pass the term * id and taxonomy id. * * @param int $term The ID of the term * @param string $taxonomy The context in which to relate the term to the object. * @param array|string $args Overwrite term field values * @return array|WP_Error Returns Term ID and Taxonomy Term ID */ function wp_update_term( $term, $taxonomy, $args = array() ) { global $wpdb; if ( ! is_taxonomy($taxonomy) ) return new WP_Error('invalid_taxonomy', __('Invalid taxonomy')); $term_id = (int) $term; // First, get all of the original args $term = get_term ($term_id, $taxonomy, ARRAY_A); // Escape data pulled from DB. $term = add_magic_quotes($term); // Merge old and new args with new args overwriting old ones. $args = array_merge($term, $args); $defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => ''); $args = wp_parse_args($args, $defaults); $args = sanitize_term($args, $taxonomy, 'db'); extract($args, EXTR_SKIP); // expected_slashed ($name) $name = stripslashes($name); $description = stripslashes($description); if ( '' == trim($name) ) return new WP_Error('empty_term_name', __('A name is required for this term')); $empty_slug = false; if ( empty($slug) ) { $empty_slug = true; $slug = sanitize_title($name); } if ( $alias_of ) { $alias = $wpdb->get_row( $wpdb->prepare( "SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $alias_of) ); if ( $alias->term_group ) { // The alias we want is already in a group, so let's use that one. $term_group = $alias->term_group; } else { // The alias isn't in a group, so let's create a new one and firstly add the alias term to it. $term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms") + 1; $wpdb->update( $wpdb->terms, compact('term_group'), array( 'term_id' => $alias->term_id ) ); } } // Check for duplicate slug $id = $wpdb->get_var( $wpdb->prepare( "SELECT term_id FROM $wpdb->terms WHERE slug = %s", $slug ) ); if ( $id && ($id != $term_id) ) { // If an empty slug was passed or the parent changed, reset the slug to something unique. // Otherwise, bail. if ( $empty_slug || ( $parent != $term->parent) ) $slug = wp_unique_term_slug($slug, (object) $args); else return new WP_Error('duplicate_term_slug', sprintf(__('The slug "%s" is already in use by another term'), $slug)); } $wpdb->update($wpdb->terms, compact( 'name', 'slug', 'term_group' ), compact( 'term_id' ) ); if ( empty($slug) ) { $slug = sanitize_title($name, $term_id); $wpdb->update( $wpdb->terms, compact( 'slug' ), compact( 'term_id' ) ); } $tt_id = $wpdb->get_var( $wpdb->prepare( "SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.term_id = %d", $taxonomy, $term_id) ); $wpdb->update( $wpdb->term_taxonomy, compact( 'term_id', 'taxonomy', 'description', 'parent' ), array( 'term_taxonomy_id' => $tt_id ) ); do_action("edit_term", $term_id, $tt_id); do_action("edit_$taxonomy", $term_id, $tt_id); $term_id = apply_filters('term_id_filter', $term_id, $tt_id); clean_term_cache($term_id, $taxonomy); do_action("edited_term", $term_id, $tt_id); do_action("edited_$taxonomy", $term_id, $tt_id); return array('term_id' => $term_id, 'term_taxonomy_id' => $tt_id); } /** * Enable or disable term counting. * * @since 2.6 * * @param bool $defer Optional. * @return bool */ function wp_defer_term_counting($defer=NULL) { static $_defer = false; if ( is_bool($defer) ) { $_defer = $defer; // flush any deferred counts if ( !$defer ) wp_update_term_count( NULL, NULL, true ); } return $_defer; } /** * Updates the amount of terms in taxonomy. * * If there is a taxonomy callback applyed, then it will be called for updating * the count. * * The default action is to count what the amount of terms have the relationship * of term ID. Once that is done, then update the database. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * @uses $wpdb * * @param int|array $terms The ID of the terms * @param string $taxonomy The context of the term. * @return bool If no terms will return false, and if successful will return true. */ function wp_update_term_count( $terms, $taxonomy, $do_deferred=false ) { static $_deferred = array(); if ( $do_deferred ) { foreach ( array_keys($_deferred) as $tax ) { wp_update_term_count_now( $_deferred[$tax], $tax ); unset( $_deferred[$tax] ); } } if ( empty($terms) ) return false; if ( !is_array($terms) ) $terms = array($terms); if ( wp_defer_term_counting() ) { if ( !isset($_deferred[$taxonomy]) ) $_deferred[$taxonomy] = array(); $_deferred[$taxonomy] = array_unique( array_merge($_deferred[$taxonomy], $terms) ); return true; } return wp_update_term_count_now( $terms, $taxonomy ); } /** * Perform term count update immediately. * * @since 2.6 * * @param array $terms IDs of Terms to update. * @param string $taxonomy The context of the term. * @return bool Always true when complete. */ function wp_update_term_count_now( $terms, $taxonomy ) { global $wpdb; $terms = array_map('intval', $terms); $taxonomy = get_taxonomy($taxonomy); if ( !empty($taxonomy->update_count_callback) ) { call_user_func($taxonomy->update_count_callback, $terms); } else { // Default count updater foreach ($terms as $term) { $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $term) ); $wpdb->update( $wpdb->term_taxonomy, compact( 'count' ), array( 'term_taxonomy_id' => $term ) ); } } clean_term_cache($terms); return true; } // // Cache // /** * Removes the taxonomy relationship to terms from the cache. * * Will remove the entire taxonomy relationship containing term $object_id. The * term IDs have to exist within the taxonomy $object_type for the deletion to * take place. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * * @see get_object_taxonomies() for more on $object_type * @uses do_action() Will call action hook named, 'clean_object_term_cache' after completion. * Passes, function params in same order. * * @param int|array $object_ids Single or list of term object ID(s) * @param array|string $object_type The taxonomy object type */ function clean_object_term_cache($object_ids, $object_type) { if ( !is_array($object_ids) ) $object_ids = array($object_ids); foreach ( $object_ids as $id ) foreach ( get_object_taxonomies($object_type) as $taxonomy ) wp_cache_delete($id, "{$taxonomy}_relationships"); do_action('clean_object_term_cache', $object_ids, $object_type); } /** * Will remove all of the term ids from the cache. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * @uses $wpdb * * @param int|array $ids Single or list of Term IDs * @param string $taxonomy Can be empty and will assume tt_ids, else will use for context. */ function clean_term_cache($ids, $taxonomy = '') { global $wpdb; if ( !is_array($ids) ) $ids = array($ids); $taxonomies = array(); // If no taxonomy, assume tt_ids. if ( empty($taxonomy) ) { $tt_ids = implode(', ', $ids); $terms = $wpdb->get_results("SELECT term_id, taxonomy FROM $wpdb->term_taxonomy WHERE term_taxonomy_id IN ($tt_ids)"); foreach ( (array) $terms as $term ) { $taxonomies[] = $term->taxonomy; wp_cache_delete($term->term_id, $term->taxonomy); } $taxonomies = array_unique($taxonomies); } else { foreach ( $ids as $id ) { wp_cache_delete($id, $taxonomy); } $taxonomies = array($taxonomy); } foreach ( $taxonomies as $taxonomy ) { wp_cache_delete('all_ids', $taxonomy); wp_cache_delete('get', $taxonomy); delete_option("{$taxonomy}_children"); } wp_cache_delete('get_terms', 'terms'); do_action('clean_term_cache', $ids, $taxonomy); } /** * Retrieves the taxonomy relationship to the term object id. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * * @uses wp_cache_get() Retrieves taxonomy relationship from cache * * @param int|array $id Term object ID * @param string $taxonomy Taxonomy Name * @return bool|array Empty array if $terms found, but not $taxonomy. False if nothing is in cache for $taxonomy and $id. */ function &get_object_term_cache($id, $taxonomy) { $cache = wp_cache_get($id, "{$taxonomy}_relationships"); return $cache; } /** * Updates the cache for Term ID(s). * * Will only update the cache for terms not already cached. * * The $object_ids expects that the ids be separated by commas, if it is a * string. * * It should be noted that update_object_term_cache() is very time extensive. It * is advised that the function is not called very often or at least not for a * lot of terms that exist in a lot of taxonomies. The amount of time increases * for each term and it also increases for each taxonomy the term belongs to. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * @uses wp_get_object_terms() Used to get terms from the database to update * * @param string|array $object_ids Single or list of term object ID(s) * @param array|string $object_type The taxonomy object type * @return null|bool Null value is given with empty $object_ids. False if */ function update_object_term_cache($object_ids, $object_type) { if ( empty($object_ids) ) return; if ( !is_array($object_ids) ) $object_ids = explode(',', $object_ids); $object_ids = array_map('intval', $object_ids); $taxonomies = get_object_taxonomies($object_type); $ids = array(); foreach ( (array) $object_ids as $id ) { foreach ( $taxonomies as $taxonomy ) { if ( false === wp_cache_get($id, "{$taxonomy}_relationships") ) { $ids[] = $id; break; } } } if ( empty( $ids ) ) return false; $terms = wp_get_object_terms($ids, $taxonomies, 'fields=all_with_object_id'); $object_terms = array(); foreach ( (array) $terms as $term ) $object_terms[$term->object_id][$term->taxonomy][$term->term_id] = $term; foreach ( $ids as $id ) { foreach ( $taxonomies as $taxonomy ) { if ( ! isset($object_terms[$id][$taxonomy]) ) { if ( !isset($object_terms[$id]) ) $object_terms[$id] = array(); $object_terms[$id][$taxonomy] = array(); } } } foreach ( $object_terms as $id => $value ) { foreach ( $value as $taxonomy => $terms ) { wp_cache_set($id, $terms, "{$taxonomy}_relationships"); } } } /** * Updates Terms to Taxonomy in cache. * * @package WordPress * @subpackage Taxonomy * @since 2.3 * * @param array $terms List of Term objects to change * @param string $taxonomy Optional. Update Term to this taxonomy in cache */ function update_term_cache($terms, $taxonomy = '') { foreach ( $terms as $term ) { $term_taxonomy = $taxonomy; if ( empty($term_taxonomy) ) $term_taxonomy = $term->taxonomy; wp_cache_add($term->term_id, $term, $term_taxonomy); } } // // Private // /** * Retrieves children of taxonomy. * * @package WordPress * @subpackage Taxonomy * @access private * @since 2.3 * * @uses update_option() Stores all of the children in "$taxonomy_children" * option. That is the name of the taxonomy, immediately followed by '_children'. * * @param string $taxonomy Taxonomy Name * @return array Empty if $taxonomy isn't hierarachical or returns children. */ function _get_term_hierarchy($taxonomy) { if ( !is_taxonomy_hierarchical($taxonomy) ) return array(); $children = get_option("{$taxonomy}_children"); if ( is_array($children) ) return $children; $children = array(); $terms = get_terms($taxonomy, 'get=all'); foreach ( $terms as $term ) { if ( $term->parent > 0 ) $children[$term->parent][] = $term->term_id; } update_option("{$taxonomy}_children", $children); return $children; } /** * Get array of child terms. * * If $terms is an array of objects, then objects will returned from the * function. If $terms is an array of IDs, then an array of ids of children will * be returned. * * @package WordPress * @subpackage Taxonomy * @access private * @since 2.3 * * @param int $term_id Look for this Term ID in $terms * @param array $terms List of Term IDs * @param string $taxonomy Term Context * @return array Empty if $terms is empty else returns full list of child terms. */ function &_get_term_children($term_id, $terms, $taxonomy) { $empty_array = array(); if ( empty($terms) ) return $empty_array; $term_list = array(); $has_children = _get_term_hierarchy($taxonomy); if ( ( 0 != $term_id ) && ! isset($has_children[$term_id]) ) return $empty_array; foreach ( $terms as $term ) { $use_id = false; if ( !is_object($term) ) { $term = get_term($term, $taxonomy); if ( is_wp_error( $term ) ) return $term; $use_id = true; } if ( $term->term_id == $term_id ) continue; if ( $term->parent == $term_id ) { if ( $use_id ) $term_list[] = $term->term_id; else $term_list[] = $term; if ( !isset($has_children[$term->term_id]) ) continue; if ( $children = _get_term_children($term->term_id, $terms, $taxonomy) ) $term_list = array_merge($term_list, $children); } } return $term_list; } /** * Add count of children to parent count. * * Recalculates term counts by including items from child terms. Assumes all * relevant children are already in the $terms argument. * * @package WordPress * @subpackage Taxonomy * @access private * @since 2.3 * @uses $wpdb * * @param array $terms List of Term IDs * @param string $taxonomy Term Context * @return null Will break from function if conditions are not met. */ function _pad_term_counts(&$terms, $taxonomy) { global $wpdb; // This function only works for post categories. if ( 'category' != $taxonomy ) return; $term_hier = _get_term_hierarchy($taxonomy); if ( empty($term_hier) ) return; $term_items = array(); foreach ( $terms as $key => $term ) { $terms_by_id[$term->term_id] = & $terms[$key]; $term_ids[$term->term_taxonomy_id] = $term->term_id; } // Get the object and term ids and stick them in a lookup table $results = $wpdb->get_results("SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships INNER JOIN $wpdb->posts ON object_id = ID WHERE term_taxonomy_id IN (".join(',', array_keys($term_ids)).") AND post_type = 'post' AND post_status = 'publish'"); foreach ( $results as $row ) { $id = $term_ids[$row->term_taxonomy_id]; ++$term_items[$id][$row->object_id]; } // Touch every ancestor's lookup row for each post in each term foreach ( $term_ids as $term_id ) { $child = $term_id; while ( $parent = $terms_by_id[$child]->parent ) { if ( !empty($term_items[$term_id]) ) foreach ( $term_items[$term_id] as $item_id => $touches ) ++$term_items[$parent][$item_id]; $child = $parent; } } // Transfer the touched cells foreach ( (array) $term_items as $id => $items ) if ( isset($terms_by_id[$id]) ) $terms_by_id[$id]->count = count($items); } // // Default callbacks // /** * Will update term count based on posts. * * Private function for the default callback for post_tag and category * taxonomies. * * @package WordPress * @subpackage Taxonomy * @access private * @since 2.3 * @uses $wpdb * * @param array $terms List of Term IDs */ function _update_post_term_count( $terms ) { global $wpdb; foreach ( $terms as $term ) { $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND post_status = 'publish' AND post_type = 'post' AND term_taxonomy_id = %d", $term ) ); $wpdb->update( $wpdb->term_taxonomy, compact( 'count' ), array( 'term_taxonomy_id' => $term ) ); } } /** * Generates a permalink for a taxonomy term archive. * * @since 2.6 * * @param object|int|string $term * @param string $taxonomy * @return string HTML link to taxonomy term archive */ function get_term_link( $term, $taxonomy ) { global $wp_rewrite; // use legacy functions for core taxonomies until they are fully plugged in if ( $taxonomy == 'category' ) return get_category_link($term); if ( $taxonomy == 'post_tag' ) return get_tag_link($term); $termlink = $wp_rewrite->get_extra_permastruct($taxonomy); if ( !is_object($term) ) { if ( is_int($term) ) { $term = &get_term($term, $taxonomy); } else { $term = &get_term_by('slug', $term, $taxonomy); } } if ( is_wp_error( $term ) ) return $term; $slug = $term->slug; if ( empty($termlink) ) { $file = get_option('home') . '/'; $t = get_taxonomy($taxonomy); if ( $t->query_var ) $termlink = "$file?$t->query_var=$slug"; else $termlink = "$file?taxonomy=$taxonomy&term=$slug"; } else { $termlink = str_replace("%$taxonomy%", $slug, $termlink); $termlink = get_option('home') . user_trailingslashit($termlink, 'category'); } return apply_filters('term_link', $termlink, $term, $taxonomy); } /** * Display the taxonomies of a post with available options. * * This function can be used within the loop to display the taxonomies for a * post without specifying the Post ID. You can also use it outside the Loop to * display the taxonomies for a specific post. * * The available defaults are: * 'post' : default is 0. The post ID to get taxonomies of. * 'before' : default is empty string. Display before taxonomies list. * 'sep' : default is empty string. Separate every taxonomy with value in this. * 'after' : default is empty string. Display this after the taxonomies list. * * @since 2.6 * @uses get_the_taxonomies() * * @param array $args Override the defaults. */ function the_taxonomies($args = array()) { $defaults = array( 'post' => 0, 'before' => '', 'sep' => ' ', 'after' => '', ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); echo $before . join($sep, get_the_taxonomies($post)) . $after; } /** * Retrieve all taxonomies associated with a post. * * This function can be used within the loop. It will also return an array of * the taxonomies with links to the taxonomy and name. * * @since 2.6 * * @param int $post Optional. Post ID or will use Global Post ID (in loop). * @return array */ function get_the_taxonomies($post = 0) { if ( is_int($post) ) $post =& get_post($post); elseif ( !is_object($post) ) $post =& $GLOBALS['post']; $taxonomies = array(); if ( !$post ) return $taxonomies; $template = apply_filters('taxonomy_template', '%s: %l.'); foreach ( get_object_taxonomies($post) as $taxonomy ) { $t = (array) get_taxonomy($taxonomy); if ( empty($t['label']) ) $t['label'] = $taxonomy; if ( empty($t['args']) ) $t['args'] = array(); if ( empty($t['template']) ) $t['template'] = $template; $terms = get_object_term_cache($post->ID, $taxonomy); if ( empty($terms) ) $terms = wp_get_object_terms($post->ID, $taxonomy, $t['args']); $links = array(); foreach ( $terms as $term ) $links[] = "<a href='" . attribute_escape(get_term_link($term, $taxonomy)) . "'>$term->name</a>"; if ( $links ) $taxonomies[$taxonomy] = wp_sprintf($t['template'], $t['label'], $links, $terms); } return $taxonomies; } /** * Retrieve all taxonomies of a post with just the names. * * @since 2.6 * @uses get_object_taxonomies() * * @param int $post Optional. Post ID * @return array */ function get_post_taxonomies($post = 0) { $post =& get_post($post); return get_object_taxonomies($post); } ?>������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/query.php������������������������������������������������������������������������0000644�0001066�0001066�00000141250�11046147301�013312� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* * The Big Query. */ function get_query_var($var) { global $wp_query; return $wp_query->get($var); } function set_query_var($var, $value) { global $wp_query; return $wp_query->set($var, $value); } function &query_posts($query) { unset($GLOBALS['wp_query']); $GLOBALS['wp_query'] =& new WP_Query(); return $GLOBALS['wp_query']->query($query); } function wp_reset_query() { unset($GLOBALS['wp_query']); $GLOBALS['wp_query'] =& $GLOBALS['wp_the_query']; global $wp_query; if ( !empty($wp_query->post) ) { $GLOBALS['post'] = $wp_query->post; setup_postdata($wp_query->post); } } /* * Query type checks. */ function is_admin () { if ( defined('WP_ADMIN') ) return WP_ADMIN; return false; } function is_archive () { global $wp_query; return $wp_query->is_archive; } function is_attachment () { global $wp_query; return $wp_query->is_attachment; } function is_author ($author = '') { global $wp_query; if ( !$wp_query->is_author ) return false; if ( empty($author) ) return true; $author_obj = $wp_query->get_queried_object(); $author = (array) $author; if ( in_array( $author_obj->ID, $author ) ) return true; elseif ( in_array( $author_obj->nickname, $author ) ) return true; elseif ( in_array( $author_obj->user_nicename, $author ) ) return true; return false; } function is_category ($category = '') { global $wp_query; if ( !$wp_query->is_category ) return false; if ( empty($category) ) return true; $cat_obj = $wp_query->get_queried_object(); $category = (array) $category; if ( in_array( $cat_obj->term_id, $category ) ) return true; elseif ( in_array( $cat_obj->name, $category ) ) return true; elseif ( in_array( $cat_obj->slug, $category ) ) return true; return false; } function is_tag( $slug = '' ) { global $wp_query; if ( !$wp_query->is_tag ) return false; if ( empty( $slug ) ) return true; $tag_obj = $wp_query->get_queried_object(); $slug = (array) $slug; if ( in_array( $tag_obj->slug, $slug ) ) return true; return false; } function is_tax( $slug = '' ) { global $wp_query; if ( !$wp_query->is_tax ) return false; if ( empty($slug) ) return true; $term = $wp_query->get_queried_object(); $slug = (array) $slug; if ( in_array( $term->slug, $slug ) ) return true; return false; } function is_comments_popup () { global $wp_query; return $wp_query->is_comments_popup; } function is_date () { global $wp_query; return $wp_query->is_date; } function is_day () { global $wp_query; return $wp_query->is_day; } function is_feed () { global $wp_query; return $wp_query->is_feed; } /** * is_front_page() - Is it the front of the site, whether blog view or a WP Page? * * @since 2.5 * @uses is_home * @uses get_option * * @return bool True if front of site */ function is_front_page () { // most likely case if ( 'posts' == get_option('show_on_front') && is_home() ) return true; elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') && is_page(get_option('page_on_front')) ) return true; else return false; } /** * is_home() - Is it the blog view homepage? * * @since 2.1 * @global object $wp_query * * @return bool True if blog view homepage */ function is_home () { global $wp_query; return $wp_query->is_home; } function is_month () { global $wp_query; return $wp_query->is_month; } function is_page ($page = '') { global $wp_query; if ( !$wp_query->is_page ) return false; if ( empty($page) ) return true; $page_obj = $wp_query->get_queried_object(); $page = (array) $page; if ( in_array( $page_obj->ID, $page ) ) return true; elseif ( in_array( $page_obj->post_title, $page ) ) return true; else if ( in_array( $page_obj->post_name, $page ) ) return true; return false; } function is_paged () { global $wp_query; return $wp_query->is_paged; } function is_plugin_page() { global $plugin_page; if ( isset($plugin_page) ) return true; return false; } function is_preview() { global $wp_query; return $wp_query->is_preview; } function is_robots() { global $wp_query; return $wp_query->is_robots; } function is_search () { global $wp_query; return $wp_query->is_search; } function is_single ($post = '') { global $wp_query; if ( !$wp_query->is_single ) return false; if ( empty( $post) ) return true; $post_obj = $wp_query->get_queried_object(); $post = (array) $post; if ( in_array( $post_obj->ID, $post ) ) return true; elseif ( in_array( $post_obj->post_title, $post ) ) return true; elseif ( in_array( $post_obj->post_name, $post ) ) return true; return false; } function is_singular() { global $wp_query; return $wp_query->is_singular; } function is_time () { global $wp_query; return $wp_query->is_time; } function is_trackback () { global $wp_query; return $wp_query->is_trackback; } function is_year () { global $wp_query; return $wp_query->is_year; } function is_404 () { global $wp_query; return $wp_query->is_404; } /* * The Loop. Post loop control. */ function have_posts() { global $wp_query; return $wp_query->have_posts(); } function in_the_loop() { global $wp_query; return $wp_query->in_the_loop; } function rewind_posts() { global $wp_query; return $wp_query->rewind_posts(); } function the_post() { global $wp_query; $wp_query->the_post(); } /* * Comments loop. */ function have_comments() { global $wp_query; return $wp_query->have_comments(); } function the_comment() { global $wp_query; return $wp_query->the_comment(); } /* * WP_Query */ class WP_Query { var $query; var $query_vars = array(); var $queried_object; var $queried_object_id; var $request; var $posts; var $post_count = 0; var $current_post = -1; var $in_the_loop = false; var $post; var $comments; var $comment_count = 0; var $current_comment = -1; var $comment; var $found_posts = 0; var $max_num_pages = 0; var $is_single = false; var $is_preview = false; var $is_page = false; var $is_archive = false; var $is_date = false; var $is_year = false; var $is_month = false; var $is_day = false; var $is_time = false; var $is_author = false; var $is_category = false; var $is_tag = false; var $is_tax = false; var $is_search = false; var $is_feed = false; var $is_comment_feed = false; var $is_trackback = false; var $is_home = false; var $is_404 = false; var $is_comments_popup = false; var $is_admin = false; var $is_attachment = false; var $is_singular = false; var $is_robots = false; var $is_posts_page = false; function init_query_flags() { $this->is_single = false; $this->is_page = false; $this->is_archive = false; $this->is_date = false; $this->is_year = false; $this->is_month = false; $this->is_day = false; $this->is_time = false; $this->is_author = false; $this->is_category = false; $this->is_tag = false; $this->is_tax = false; $this->is_search = false; $this->is_feed = false; $this->is_comment_feed = false; $this->is_trackback = false; $this->is_home = false; $this->is_404 = false; $this->is_paged = false; $this->is_admin = false; $this->is_attachment = false; $this->is_singular = false; $this->is_robots = false; $this->is_posts_page = false; } function init () { unset($this->posts); unset($this->query); $this->query_vars = array(); unset($this->queried_object); unset($this->queried_object_id); $this->post_count = 0; $this->current_post = -1; $this->in_the_loop = false; $this->init_query_flags(); } // Reparse the query vars. function parse_query_vars() { $this->parse_query(''); } function fill_query_vars($array) { $keys = array( 'error' , 'm' , 'p' , 'post_parent' , 'subpost' , 'subpost_id' , 'attachment' , 'attachment_id' , 'name' , 'hour' , 'static' , 'pagename' , 'page_id' , 'second' , 'minute' , 'hour' , 'day' , 'monthnum' , 'year' , 'w' , 'category_name' , 'tag' , 'tag_id' , 'author_name' , 'feed' , 'tb' , 'paged' , 'comments_popup' , 'meta_key' , 'meta_value' , 'preview' ); foreach ($keys as $key) { if ( !isset($array[$key])) $array[$key] = ''; } $array_keys = array('category__in', 'category__not_in', 'category__and', 'post__in', 'post__not_in', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and'); foreach ( $array_keys as $key ) { if ( !isset($array[$key])) $array[$key] = array(); } return $array; } // Parse a query string and set query type booleans. function parse_query ($query) { if ( !empty($query) || !isset($this->query) ) { $this->init(); if ( is_array($query) ) $this->query_vars = $query; else parse_str($query, $this->query_vars); $this->query = $query; } $this->query_vars = $this->fill_query_vars($this->query_vars); $qv = &$this->query_vars; if ( ! empty($qv['robots']) ) $this->is_robots = true; $qv['p'] = absint($qv['p']); $qv['page_id'] = absint($qv['page_id']); $qv['year'] = absint($qv['year']); $qv['monthnum'] = absint($qv['monthnum']); $qv['day'] = absint($qv['day']); $qv['w'] = absint($qv['w']); $qv['m'] = absint($qv['m']); $qv['cat'] = preg_replace( '|[^0-9,-]|', '', $qv['cat'] ); // comma separated list of positive or negative integers if ( '' !== $qv['hour'] ) $qv['hour'] = absint($qv['hour']); if ( '' !== $qv['minute'] ) $qv['minute'] = absint($qv['minute']); if ( '' !== $qv['second'] ) $qv['second'] = absint($qv['second']); // Compat. Map subpost to attachment. if ( '' != $qv['subpost'] ) $qv['attachment'] = $qv['subpost']; if ( '' != $qv['subpost_id'] ) $qv['attachment_id'] = $qv['subpost_id']; $qv['attachment_id'] = absint($qv['attachment_id']); if ( ('' != $qv['attachment']) || !empty($qv['attachment_id']) ) { $this->is_single = true; $this->is_attachment = true; } elseif ( '' != $qv['name'] ) { $this->is_single = true; } elseif ( $qv['p'] ) { $this->is_single = true; } elseif ( ('' !== $qv['hour']) && ('' !== $qv['minute']) &&('' !== $qv['second']) && ('' != $qv['year']) && ('' != $qv['monthnum']) && ('' != $qv['day']) ) { // If year, month, day, hour, minute, and second are set, a single // post is being queried. $this->is_single = true; } elseif ( '' != $qv['static'] || '' != $qv['pagename'] || !empty($qv['page_id']) ) { $this->is_page = true; $this->is_single = false; } elseif ( !empty($qv['s']) ) { $this->is_search = true; } else { // Look for archive queries. Dates, categories, authors. if ( '' !== $qv['second'] ) { $this->is_time = true; $this->is_date = true; } if ( '' !== $qv['minute'] ) { $this->is_time = true; $this->is_date = true; } if ( '' !== $qv['hour'] ) { $this->is_time = true; $this->is_date = true; } if ( $qv['day'] ) { if (! $this->is_date) { $this->is_day = true; $this->is_date = true; } } if ( $qv['monthnum'] ) { if (! $this->is_date) { $this->is_month = true; $this->is_date = true; } } if ( $qv['year'] ) { if (! $this->is_date) { $this->is_year = true; $this->is_date = true; } } if ( $qv['m'] ) { $this->is_date = true; if (strlen($qv['m']) > 9) { $this->is_time = true; } else if (strlen($qv['m']) > 7) { $this->is_day = true; } else if (strlen($qv['m']) > 5) { $this->is_month = true; } else { $this->is_year = true; } } if ('' != $qv['w']) { $this->is_date = true; } if ( empty($qv['cat']) || ($qv['cat'] == '0') ) { $this->is_category = false; } else { if (strpos($qv['cat'], '-') !== false) { $this->is_category = false; } else { $this->is_category = true; } } if ( '' != $qv['category_name'] ) { $this->is_category = true; } if ( !is_array($qv['category__in']) || empty($qv['category__in']) ) { $qv['category__in'] = array(); } else { $qv['category__in'] = array_map('absint', $qv['category__in']); $this->is_category = true; } if ( !is_array($qv['category__not_in']) || empty($qv['category__not_in']) ) { $qv['category__not_in'] = array(); } else { $qv['category__not_in'] = array_map('absint', $qv['category__not_in']); } if ( !is_array($qv['category__and']) || empty($qv['category__and']) ) { $qv['category__and'] = array(); } else { $qv['category__and'] = array_map('absint', $qv['category__and']); $this->is_category = true; } if ( '' != $qv['tag'] ) $this->is_tag = true; $qv['tag_id'] = absint($qv['tag_id']); if ( !empty($qv['tag_id']) ) $this->is_tag = true; if ( !is_array($qv['tag__in']) || empty($qv['tag__in']) ) { $qv['tag__in'] = array(); } else { $qv['tag__in'] = array_map('absint', $qv['tag__in']); $this->is_tag = true; } if ( !is_array($qv['tag__not_in']) || empty($qv['tag__not_in']) ) { $qv['tag__not_in'] = array(); } else { $qv['tag__not_in'] = array_map('absint', $qv['tag__not_in']); } if ( !is_array($qv['tag__and']) || empty($qv['tag__and']) ) { $qv['tag__and'] = array(); } else { $qv['tag__and'] = array_map('absint', $qv['tag__and']); $this->is_category = true; } if ( !is_array($qv['tag_slug__in']) || empty($qv['tag_slug__in']) ) { $qv['tag_slug__in'] = array(); } else { $qv['tag_slug__in'] = array_map('sanitize_title', $qv['tag_slug__in']); $this->is_tag = true; } if ( !is_array($qv['tag_slug__and']) || empty($qv['tag_slug__and']) ) { $qv['tag_slug__and'] = array(); } else { $qv['tag_slug__and'] = array_map('sanitize_title', $qv['tag_slug__and']); $this->is_tag = true; } if ( empty($qv['taxonomy']) || empty($qv['term']) ) { $this->is_tax = false; foreach ( $GLOBALS['wp_taxonomies'] as $t ) { if ( isset($t->query_var) && '' != $qv[$t->query_var] ) { $this->is_tax = true; break; } } } else { $this->is_tax = true; } if ( empty($qv['author']) || ($qv['author'] == '0') ) { $this->is_author = false; } else { $this->is_author = true; } if ( '' != $qv['author_name'] ) { $this->is_author = true; } if ( ($this->is_date || $this->is_author || $this->is_category || $this->is_tag ) ) $this->is_archive = true; } if ( '' != $qv['feed'] ) $this->is_feed = true; if ( '' != $qv['tb'] ) $this->is_trackback = true; if ( '' != $qv['paged'] ) $this->is_paged = true; if ( '' != $qv['comments_popup'] ) $this->is_comments_popup = true; // if we're previewing inside the write screen if ('' != $qv['preview']) $this->is_preview = true; if ( is_admin() ) $this->is_admin = true; if ( false !== strpos($qv['feed'], 'comments-') ) { $qv['feed'] = str_replace('comments-', '', $qv['feed']); $qv['withcomments'] = 1; } $this->is_singular = $this->is_single || $this->is_page || $this->is_attachment; if ( $this->is_feed && ( !empty($qv['withcomments']) || ( empty($qv['withoutcomments']) && $this->is_singular ) ) ) $this->is_comment_feed = true; if ( !( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed || $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_comments_popup ) ) $this->is_home = true; // Correct is_* for page_on_front and page_for_posts if ( $this->is_home && ( empty($this->query) || $qv['preview'] == 'true' ) && 'page' == get_option('show_on_front') && get_option('page_on_front') ) { $this->is_page = true; $this->is_home = false; $qv['page_id'] = get_option('page_on_front'); } if ( '' != $qv['pagename'] ) { $this->queried_object =& get_page_by_path($qv['pagename']); if ( !empty($this->queried_object) ) $this->queried_object_id = (int) $this->queried_object->ID; else unset($this->queried_object); if ( 'page' == get_option('show_on_front') && isset($this->queried_object_id) && $this->queried_object_id == get_option('page_for_posts') ) { $this->is_page = false; $this->is_home = true; $this->is_posts_page = true; } } if ( $qv['page_id'] ) { if ( 'page' == get_option('show_on_front') && $qv['page_id'] == get_option('page_for_posts') ) { $this->is_page = false; $this->is_home = true; $this->is_posts_page = true; } } if ( !empty($qv['post_type']) ) $qv['post_type'] = sanitize_user($qv['post_type'], true); if ( !empty($qv['post_status']) ) $qv['post_status'] = preg_replace('|[^a-z0-9_,-]|', '', $qv['post_status']); if ( $this->is_posts_page && !$qv['withcomments'] ) $this->is_comment_feed = false; $this->is_singular = $this->is_single || $this->is_page || $this->is_attachment; // Done correcting is_* for page_on_front and page_for_posts if ('404' == $qv['error']) $this->set_404(); if ( !empty($query) ) do_action_ref_array('parse_query', array(&$this)); } function set_404() { $is_feed = $this->is_feed; $this->init_query_flags(); $this->is_404 = true; $this->is_feed = $is_feed; } function get($query_var) { if (isset($this->query_vars[$query_var])) { return $this->query_vars[$query_var]; } return ''; } function set($query_var, $value) { $this->query_vars[$query_var] = $value; } function &get_posts() { global $wpdb, $user_ID; do_action_ref_array('pre_get_posts', array(&$this)); // Shorthand. $q = &$this->query_vars; $q = $this->fill_query_vars($q); // First let's clear some variables $distinct = ''; $whichcat = ''; $whichauthor = ''; $whichmimetype = ''; $where = ''; $limits = ''; $join = ''; $search = ''; $groupby = ''; $post_status_join = false; if ( !isset($q['post_type']) ) { if ( $this->is_search ) $q['post_type'] = 'any'; else $q['post_type'] = 'post'; } $post_type = $q['post_type']; if ( !isset($q['posts_per_page']) || $q['posts_per_page'] == 0 ) $q['posts_per_page'] = get_option('posts_per_page'); if ( isset($q['showposts']) && $q['showposts'] ) { $q['showposts'] = (int) $q['showposts']; $q['posts_per_page'] = $q['showposts']; } if ( (isset($q['posts_per_archive_page']) && $q['posts_per_archive_page'] != 0) && ($this->is_archive || $this->is_search) ) $q['posts_per_page'] = $q['posts_per_archive_page']; if ( !isset($q['nopaging']) ) { if ($q['posts_per_page'] == -1) { $q['nopaging'] = true; } else { $q['nopaging'] = false; } } if ( $this->is_feed ) { $q['posts_per_page'] = get_option('posts_per_rss'); $q['nopaging'] = false; } $q['posts_per_page'] = (int) $q['posts_per_page']; if ( $q['posts_per_page'] < -1 ) $q['posts_per_page'] = abs($q['posts_per_page']); else if ( $q['posts_per_page'] == 0 ) $q['posts_per_page'] = 1; if ( $this->is_home && (empty($this->query) || $q['preview'] == 'true') && ( 'page' == get_option('show_on_front') ) && get_option('page_on_front') ) { $this->is_page = true; $this->is_home = false; $q['page_id'] = get_option('page_on_front'); } if (isset($q['page'])) { $q['page'] = trim($q['page'], '/'); $q['page'] = absint($q['page']); } // If a month is specified in the querystring, load that month if ( $q['m'] ) { $q['m'] = '' . preg_replace('|[^0-9]|', '', $q['m']); $where .= " AND YEAR($wpdb->posts.post_date)=" . substr($q['m'], 0, 4); if (strlen($q['m'])>5) $where .= " AND MONTH($wpdb->posts.post_date)=" . substr($q['m'], 4, 2); if (strlen($q['m'])>7) $where .= " AND DAYOFMONTH($wpdb->posts.post_date)=" . substr($q['m'], 6, 2); if (strlen($q['m'])>9) $where .= " AND HOUR($wpdb->posts.post_date)=" . substr($q['m'], 8, 2); if (strlen($q['m'])>11) $where .= " AND MINUTE($wpdb->posts.post_date)=" . substr($q['m'], 10, 2); if (strlen($q['m'])>13) $where .= " AND SECOND($wpdb->posts.post_date)=" . substr($q['m'], 12, 2); } if ( '' !== $q['hour'] ) $where .= " AND HOUR($wpdb->posts.post_date)='" . $q['hour'] . "'"; if ( '' !== $q['minute'] ) $where .= " AND MINUTE($wpdb->posts.post_date)='" . $q['minute'] . "'"; if ( '' !== $q['second'] ) $where .= " AND SECOND($wpdb->posts.post_date)='" . $q['second'] . "'"; if ( $q['year'] ) $where .= " AND YEAR($wpdb->posts.post_date)='" . $q['year'] . "'"; if ( $q['monthnum'] ) $where .= " AND MONTH($wpdb->posts.post_date)='" . $q['monthnum'] . "'"; if ( $q['day'] ) $where .= " AND DAYOFMONTH($wpdb->posts.post_date)='" . $q['day'] . "'"; if ('' != $q['name']) { $q['name'] = sanitize_title($q['name']); $where .= " AND $wpdb->posts.post_name = '" . $q['name'] . "'"; } else if ('' != $q['pagename']) { if ( isset($this->queried_object_id) ) $reqpage = $this->queried_object_id; else { $reqpage = get_page_by_path($q['pagename']); if ( !empty($reqpage) ) $reqpage = $reqpage->ID; else $reqpage = 0; } $page_for_posts = get_option('page_for_posts'); if ( ('page' != get_option('show_on_front') ) || empty($page_for_posts) || ( $reqpage != $page_for_posts ) ) { $q['pagename'] = str_replace('%2F', '/', urlencode(urldecode($q['pagename']))); $page_paths = '/' . trim($q['pagename'], '/'); $q['pagename'] = sanitize_title(basename($page_paths)); $q['name'] = $q['pagename']; $where .= " AND ($wpdb->posts.ID = '$reqpage')"; $reqpage_obj = get_page($reqpage); if ( 'attachment' == $reqpage_obj->post_type ) { $this->is_attachment = true; $this->is_page = true; $q['attachment_id'] = $reqpage; } } } elseif ('' != $q['attachment']) { $q['attachment'] = str_replace('%2F', '/', urlencode(urldecode($q['attachment']))); $attach_paths = '/' . trim($q['attachment'], '/'); $q['attachment'] = sanitize_title(basename($attach_paths)); $q['name'] = $q['attachment']; $where .= " AND $wpdb->posts.post_name = '" . $q['attachment'] . "'"; } if ( $q['w'] ) $where .= " AND WEEK($wpdb->posts.post_date, 1)='" . $q['w'] . "'"; if ( intval($q['comments_popup']) ) $q['p'] = absint($q['comments_popup']); // If an attachment is requested by number, let it supercede any post number. if ( $q['attachment_id'] ) $q['p'] = absint($q['attachment_id']); // If a post number is specified, load that post if ( $q['p'] ) { $where .= " AND {$wpdb->posts}.ID = " . $q['p']; } elseif ( $q['post__in'] ) { $post__in = implode(',', array_map( 'absint', $q['post__in'] )); $where .= " AND {$wpdb->posts}.ID IN ($post__in)"; } elseif ( $q['post__not_in'] ) { $post__not_in = implode(',', array_map( 'absint', $q['post__not_in'] )); $where .= " AND {$wpdb->posts}.ID NOT IN ($post__not_in)"; } if ( $q['post_parent'] ) $where .= $wpdb->prepare( " AND $wpdb->posts.post_parent = %d ", $q['post_parent'] ); if ( $q['page_id'] ) { if ( ('page' != get_option('show_on_front') ) || ( $q['page_id'] != get_option('page_for_posts') ) ) { $q['p'] = $q['page_id']; $where = " AND {$wpdb->posts}.ID = " . $q['page_id']; } } // If a search pattern is specified, load the posts that match if ( !empty($q['s']) ) { // added slashes screw with quote grouping when done early, so done later $q['s'] = stripslashes($q['s']); if ($q['sentence']) { $q['search_terms'] = array($q['s']); } else { preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $q[s], $matches); $q['search_terms'] = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]); } $n = ($q['exact']) ? '' : '%'; $searchand = ''; foreach((array)$q['search_terms'] as $term) { $term = addslashes_gpc($term); $search .= "{$searchand}(($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}'))"; $searchand = ' AND '; } $term = $wpdb->escape($q['s']); if (!$q['sentence'] && count($q['search_terms']) > 1 && $q['search_terms'][0] != $q['s'] ) $search .= " OR ($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}')"; if ( !empty($search) ) $search = " AND ({$search}) "; } // Category stuff if ( empty($q['cat']) || ($q['cat'] == '0') || // Bypass cat checks if fetching specific posts $this->is_singular ) { $whichcat = ''; } else { $q['cat'] = ''.urldecode($q['cat']).''; $q['cat'] = addslashes_gpc($q['cat']); $cat_array = preg_split('/[,\s]+/', $q['cat']); $q['cat'] = ''; $req_cats = array(); foreach ( $cat_array as $cat ) { $cat = intval($cat); $req_cats[] = $cat; $in = ($cat > 0); $cat = abs($cat); if ( $in ) { $q['category__in'][] = $cat; $q['category__in'] = array_merge($q['category__in'], get_term_children($cat, 'category')); } else { $q['category__not_in'][] = $cat; $q['category__not_in'] = array_merge($q['category__not_in'], get_term_children($cat, 'category')); } } $q['cat'] = implode(',', $req_cats); } if ( !empty($q['category__in']) || !empty($q['category__not_in']) || !empty($q['category__and']) ) { $groupby = "{$wpdb->posts}.ID"; } if ( !empty($q['category__in']) ) { $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) "; $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'category' "; $include_cats = "'" . implode("', '", $q['category__in']) . "'"; $whichcat .= " AND $wpdb->term_taxonomy.term_id IN ($include_cats) "; } if ( !empty($q['category__not_in']) ) { $ids = get_objects_in_term($q['category__not_in'], 'category'); if ( is_wp_error( $ids ) ) return $ids; if ( is_array($ids) && count($ids > 0) ) { $out_posts = "'" . implode("', '", $ids) . "'"; $whichcat .= " AND $wpdb->posts.ID NOT IN ($out_posts)"; } } // Category stuff for nice URLs if ( '' != $q['category_name'] && !$this->is_singular ) { $reqcat = get_category_by_path($q['category_name']); $q['category_name'] = str_replace('%2F', '/', urlencode(urldecode($q['category_name']))); $cat_paths = '/' . trim($q['category_name'], '/'); $q['category_name'] = sanitize_title(basename($cat_paths)); $cat_paths = '/' . trim(urldecode($q['category_name']), '/'); $q['category_name'] = sanitize_title(basename($cat_paths)); $cat_paths = explode('/', $cat_paths); $cat_path = ''; foreach ( (array) $cat_paths as $pathdir ) $cat_path .= ( $pathdir != '' ? '/' : '' ) . sanitize_title($pathdir); //if we don't match the entire hierarchy fallback on just matching the nicename if ( empty($reqcat) ) $reqcat = get_category_by_path($q['category_name'], false); if ( !empty($reqcat) ) $reqcat = $reqcat->term_id; else $reqcat = 0; $q['cat'] = $reqcat; $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) "; $whichcat = " AND $wpdb->term_taxonomy.taxonomy = 'category' "; $in_cats = array($q['cat']); $in_cats = array_merge($in_cats, get_term_children($q['cat'], 'category')); $in_cats = "'" . implode("', '", $in_cats) . "'"; $whichcat .= "AND $wpdb->term_taxonomy.term_id IN ($in_cats)"; $groupby = "{$wpdb->posts}.ID"; } // Tags if ( '' != $q['tag'] ) { if ( strpos($q['tag'], ',') !== false ) { $tags = preg_split('/[,\s]+/', $q['tag']); foreach ( (array) $tags as $tag ) { $tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db'); $q['tag_slug__in'][] = $tag; } } else if ( preg_match('/[+\s]+/', $q['tag']) ) { $tags = preg_split('/[+\s]+/', $q['tag']); foreach ( (array) $tags as $tag ) { $tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db'); $q['tag_slug__and'][] = $tag; } } else { $q['tag'] = sanitize_term_field('slug', $q['tag'], 0, 'post_tag', 'db'); $q['tag_slug__in'][] = $q['tag']; } } if ( !empty($q['tag__in']) || !empty($q['tag__not_in']) || !empty($q['tag__and']) || !empty($q['tag_slug__in']) || !empty($q['tag_slug__and']) ) { $groupby = "{$wpdb->posts}.ID"; } if ( !empty($q['tag__in']) ) { $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) "; $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'post_tag' "; $include_tags = "'" . implode("', '", $q['tag__in']) . "'"; $whichcat .= " AND $wpdb->term_taxonomy.term_id IN ($include_tags) "; $reqtag = is_term( $q['tag__in'][0], 'post_tag' ); if ( !empty($reqtag) ) $q['tag_id'] = $reqtag['term_id']; } if ( !empty($q['tag_slug__in']) ) { $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) INNER JOIN $wpdb->terms ON ($wpdb->term_taxonomy.term_id = $wpdb->terms.term_id) "; $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'post_tag' "; $include_tags = "'" . implode("', '", $q['tag_slug__in']) . "'"; $whichcat .= " AND $wpdb->terms.slug IN ($include_tags) "; $reqtag = get_term_by( 'slug', $q['tag_slug__in'][0], 'post_tag' ); if ( !empty($reqtag) ) $q['tag_id'] = $reqtag->term_id; } if ( !empty($q['tag__not_in']) ) { $ids = get_objects_in_term($q['tag__not_in'], 'post_tag'); if ( is_array($ids) && count($ids > 0) ) { $out_posts = "'" . implode("', '", $ids) . "'"; $whichcat .= " AND $wpdb->posts.ID NOT IN ($out_posts)"; } } // Tag and slug intersections. $intersections = array('category__and' => 'category', 'tag__and' => 'post_tag', 'tag_slug__and' => 'post_tag'); foreach ($intersections as $item => $taxonomy) { if ( empty($q[$item]) ) continue; if ( $item != 'category__and' ) { $reqtag = is_term( $q[$item][0], 'post_tag' ); if ( !empty($reqtag) ) $q['tag_id'] = $reqtag['term_id']; } $taxonomy_field = $item == 'tag_slug__and' ? 'slug' : 'term_id'; $q[$item] = array_unique($q[$item]); $tsql = "SELECT p.ID FROM $wpdb->posts p INNER JOIN $wpdb->term_relationships tr ON (p.ID = tr.object_id) INNER JOIN $wpdb->term_taxonomy tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) INNER JOIN $wpdb->terms t ON (tt.term_id = t.term_id)"; $tsql .= " WHERE tt.taxonomy = '$taxonomy' AND t.$taxonomy_field IN ('" . implode("', '", $q[$item]) . "')"; $tsql .= " GROUP BY p.ID HAVING count(p.ID) = " . count($q[$item]); $post_ids = $wpdb->get_col($tsql); if ( count($post_ids) ) $whichcat .= " AND $wpdb->posts.ID IN (" . implode(', ', $post_ids) . ") "; else { $whichcat = " AND 0 = 1"; break; } } // Taxonomies if ( $this->is_tax ) { if ( '' != $q['taxonomy'] ) { $taxonomy = $q['taxonomy']; $tt[$taxonomy] = $q['term']; $terms = get_terms($q['taxonomy'], array('slug'=>$q['term'])); } else { foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) { if ( isset($t->query_var) && '' != $q[$t->query_var] ) { $terms = get_terms($taxonomy, array('slug'=>$q[$t->query_var])); if ( !is_wp_error($terms) ) break; } } } if ( is_wp_error($terms) || empty($terms) ) { $whichcat = " AND 0 "; } else { foreach ( $terms as $term ) $term_ids[] = $term->term_id; $post_ids = get_objects_in_term($term_ids, $taxonomy); if ( !is_wp_error($post_ids) && count($post_ids) ) { $whichcat .= " AND $wpdb->posts.ID IN (" . implode(', ', $post_ids) . ") "; $post_type = 'any'; $q['post_status'] = 'publish'; $post_status_join = true; } else { $whichcat = " AND 0 "; } } } // Author/user stuff if ( empty($q['author']) || ($q['author'] == '0') ) { $whichauthor=''; } else { $q['author'] = ''.urldecode($q['author']).''; $q['author'] = addslashes_gpc($q['author']); if (strpos($q['author'], '-') !== false) { $eq = '!='; $andor = 'AND'; $q['author'] = explode('-', $q['author']); $q['author'] = '' . absint($q['author'][1]); } else { $eq = '='; $andor = 'OR'; } $author_array = preg_split('/[,\s]+/', $q['author']); $whichauthor .= " AND ($wpdb->posts.post_author ".$eq.' '.absint($author_array[0]); for ($i = 1; $i < (count($author_array)); $i = $i + 1) { $whichauthor .= ' '.$andor." $wpdb->posts.post_author ".$eq.' '.absint($author_array[$i]); } $whichauthor .= ')'; } // Author stuff for nice URLs if ('' != $q['author_name']) { if (strpos($q['author_name'], '/') !== false) { $q['author_name'] = explode('/',$q['author_name']); if ($q['author_name'][count($q['author_name'])-1]) { $q['author_name'] = $q['author_name'][count($q['author_name'])-1];#no trailing slash } else { $q['author_name'] = $q['author_name'][count($q['author_name'])-2];#there was a trailling slash } } $q['author_name'] = sanitize_title($q['author_name']); $q['author'] = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE user_nicename='".$q['author_name']."'"); $whichauthor .= " AND ($wpdb->posts.post_author = ".absint($q['author']).')'; } // MIME-Type stuff for attachment browsing if ( isset($q['post_mime_type']) && '' != $q['post_mime_type'] ) $whichmimetype = wp_post_mime_type_where($q['post_mime_type']); $where .= $search.$whichcat.$whichauthor.$whichmimetype; if ( empty($q['order']) || ((strtoupper($q['order']) != 'ASC') && (strtoupper($q['order']) != 'DESC')) ) $q['order'] = 'DESC'; // Order by if ( empty($q['orderby']) ) { $q['orderby'] = "$wpdb->posts.post_date ".$q['order']; } else { // Used to filter values $allowed_keys = array('author', 'date', 'category', 'title', 'modified', 'menu_order', 'parent', 'ID', 'rand'); $q['orderby'] = urldecode($q['orderby']); $q['orderby'] = addslashes_gpc($q['orderby']); $orderby_array = explode(' ',$q['orderby']); if ( empty($orderby_array) ) $orderby_array[] = $q['orderby']; $q['orderby'] = ''; for ($i = 0; $i < count($orderby_array); $i++) { // Only allow certain values for safety $orderby = $orderby_array[$i]; switch ($orderby) { case 'menu_order': break; case 'ID': $orderby = "$wpdb->posts.ID"; break; case 'rand': $orderby = 'RAND()'; break; default: $orderby = "$wpdb->posts.post_" . $orderby; } if ( in_array($orderby_array[$i], $allowed_keys) ) $q['orderby'] .= (($i == 0) ? '' : ',') . $orderby; } // append ASC or DESC at the end if ( !empty($q['orderby'])) $q['orderby'] .= " {$q['order']}"; if ( empty($q['orderby']) ) $q['orderby'] = "$wpdb->posts.post_date ".$q['order']; } if ( $this->is_attachment ) { $where .= " AND $wpdb->posts.post_type = 'attachment'"; } elseif ($this->is_page) { $where .= " AND $wpdb->posts.post_type = 'page'"; } elseif ($this->is_single) { $where .= " AND $wpdb->posts.post_type = 'post'"; } elseif ( 'any' == $post_type ) { $where .= ''; } else { $where .= " AND $wpdb->posts.post_type = '$post_type'"; } if ( isset($q['post_status']) && '' != $q['post_status'] ) { $statuswheres = array(); $q_status = explode(',', $q['post_status']); $r_status = array(); $p_status = array(); if ( in_array( 'draft' , $q_status ) ) $r_status[] = "$wpdb->posts.post_status = 'draft'"; if ( in_array( 'pending', $q_status ) ) $r_status[] = "$wpdb->posts.post_status = 'pending'"; if ( in_array( 'future' , $q_status ) ) $r_status[] = "$wpdb->posts.post_status = 'future'"; if ( in_array( 'inherit' , $q_status ) ) $r_status[] = "$wpdb->posts.post_status = 'inherit'"; if ( in_array( 'private', $q_status ) ) $p_status[] = "$wpdb->posts.post_status = 'private'"; if ( in_array( 'publish', $q_status ) ) $r_status[] = "$wpdb->posts.post_status = 'publish'"; if ( empty($q['perm'] ) || 'readable' != $q['perm'] ) { $r_status = array_merge($r_status, $p_status); unset($p_status); } if ( !empty($r_status) ) { if ( !empty($q['perm'] ) && 'editable' == $q['perm'] && !current_user_can("edit_others_{$post_type}s") ) $statuswheres[] = "($wpdb->posts.post_author = $user_ID " . "AND (" . join( ' OR ', $r_status ) . "))"; else $statuswheres[] = "(" . join( ' OR ', $r_status ) . ")"; } if ( !empty($p_status) ) { if ( !empty($q['perm'] ) && 'readable' == $q['perm'] && !current_user_can("read_private_{$post_type}s") ) $statuswheres[] = "($wpdb->posts.post_author = $user_ID " . "AND (" . join( ' OR ', $p_status ) . "))"; else $statuswheres[] = "(" . join( ' OR ', $p_status ) . ")"; } if ( $post_status_join ) { $join .= " LEFT JOIN $wpdb->posts AS p2 ON ($wpdb->posts.post_parent = p2.ID) "; foreach ( $statuswheres as $index => $statuswhere ) $statuswheres[$index] = "($statuswhere OR ($wpdb->posts.post_status = 'inherit' AND " . str_replace($wpdb->posts, 'p2', $statuswhere) . "))"; } foreach ( $statuswheres as $statuswhere ) $where .= " AND $statuswhere"; } elseif ( !$this->is_singular ) { $where .= " AND ($wpdb->posts.post_status = 'publish'"; if ( is_admin() ) $where .= " OR $wpdb->posts.post_status = 'future' OR $wpdb->posts.post_status = 'draft' OR $wpdb->posts.post_status = 'pending'"; if ( is_user_logged_in() ) { $where .= current_user_can( "read_private_{$post_type}s" ) ? " OR $wpdb->posts.post_status = 'private'" : " OR $wpdb->posts.post_author = $user_ID AND $wpdb->posts.post_status = 'private'"; } $where .= ')'; } // postmeta queries if ( ! empty($q['meta_key']) || ! empty($q['meta_value']) ) $join .= " LEFT JOIN $wpdb->postmeta ON ($wpdb->posts.ID = $wpdb->postmeta.post_id) "; if ( ! empty($q['meta_key']) ) $where .= $wpdb->prepare("AND $wpdb->postmeta.meta_key = %s ", $q['meta_key']); if ( ! empty($q['meta_value']) ) $where .= $wpdb->prepare("AND $wpdb->postmeta.meta_value = %s ", $q['meta_value']); // Apply filters on where and join prior to paging so that any // manipulations to them are reflected in the paging by day queries. $where = apply_filters('posts_where', $where); $join = apply_filters('posts_join', $join); // Paging if ( empty($q['nopaging']) && !$this->is_singular ) { $page = absint($q['paged']); if (empty($page)) { $page = 1; } if ( empty($q['offset']) ) { $pgstrt = ''; $pgstrt = ($page - 1) * $q['posts_per_page'] . ', '; $limits = 'LIMIT '.$pgstrt.$q['posts_per_page']; } else { // we're ignoring $page and using 'offset' $q['offset'] = absint($q['offset']); $pgstrt = $q['offset'] . ', '; $limits = 'LIMIT ' . $pgstrt . $q['posts_per_page']; } } // Comments feeds if ( $this->is_comment_feed && ( $this->is_archive || $this->is_search || !$this->is_singular ) ) { if ( $this->is_archive || $this->is_search ) { $cjoin = "LEFT JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) $join "; $cwhere = "WHERE comment_approved = '1' $where"; $cgroupby = "GROUP BY $wpdb->comments.comment_id"; } else { // Other non singular e.g. front $cjoin = "LEFT JOIN $wpdb->posts ON ( $wpdb->comments.comment_post_ID = $wpdb->posts.ID )"; $cwhere = "WHERE post_status = 'publish' AND comment_approved = '1'"; $cgroupby = ''; } $cjoin = apply_filters('comment_feed_join', $cjoin); $cwhere = apply_filters('comment_feed_where', $cwhere); $cgroupby = apply_filters('comment_feed_groupby', $cgroupby); $this->comments = (array) $wpdb->get_results("SELECT $distinct $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby ORDER BY comment_date_gmt DESC LIMIT " . get_option('posts_per_rss')); $this->comment_count = count($this->comments); $post_ids = array(); foreach ($this->comments as $comment) $post_ids[] = (int) $comment->comment_post_ID; $post_ids = join(',', $post_ids); $join = ''; if ( $post_ids ) $where = "AND $wpdb->posts.ID IN ($post_ids) "; else $where = "AND 0"; } // Apply post-paging filters on where and join. Only plugins that // manipulate paging queries should use these hooks. $where = apply_filters('posts_where_paged', $where); $groupby = apply_filters('posts_groupby', $groupby); $join = apply_filters('posts_join_paged', $join); $orderby = apply_filters('posts_orderby', $q['orderby']); $distinct = apply_filters('posts_distinct', $distinct); $fields = apply_filters('posts_fields', "$wpdb->posts.*"); $limits = apply_filters( 'post_limits', $limits ); // Announce current selection parameters. For use by caching plugins. do_action( 'posts_selection', $where . $groupby . $orderby . $limits . $join ); // Filter again for the benefit of caching plugins. Regular plugins should use the hooks above. $where = apply_filters('posts_where_request', $where); $groupby = apply_filters('posts_groupby_request', $groupby); $join = apply_filters('posts_join_request', $join); $orderby = apply_filters('posts_orderby_request', $orderby); $distinct = apply_filters('posts_distinct_request', $distinct); $fields = apply_filters('posts_fields_request', $fields); $limits = apply_filters( 'post_limits_request', $limits ); if ( ! empty($groupby) ) $groupby = 'GROUP BY ' . $groupby; if ( !empty( $orderby ) ) $orderby = 'ORDER BY ' . $orderby; $found_rows = ''; if ( !empty($limits) ) $found_rows = 'SQL_CALC_FOUND_ROWS'; $request = " SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits"; $this->request = apply_filters('posts_request', $request); $this->posts = $wpdb->get_results($this->request); // Raw results filter. Prior to status checks. $this->posts = apply_filters('posts_results', $this->posts); if ( !empty($this->posts) && $this->is_comment_feed && $this->is_singular ) { $cjoin = apply_filters('comment_feed_join', ''); $cwhere = apply_filters('comment_feed_where', "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'"); $comments_request = "SELECT $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere ORDER BY comment_date_gmt DESC LIMIT " . get_option('posts_per_rss'); $this->comments = $wpdb->get_results($comments_request); $this->comment_count = count($this->comments); } if ( !empty($limits) ) { $found_posts_query = apply_filters( 'found_posts_query', 'SELECT FOUND_ROWS()' ); $this->found_posts = $wpdb->get_var( $found_posts_query ); $this->found_posts = apply_filters( 'found_posts', $this->found_posts ); $this->max_num_pages = ceil($this->found_posts / $q['posts_per_page']); } // Check post status to determine if post should be displayed. if ( !empty($this->posts) && ($this->is_single || $this->is_page) ) { $status = get_post_status($this->posts[0]); //$type = get_post_type($this->posts[0]); if ( ('publish' != $status) ) { if ( ! is_user_logged_in() ) { // User must be logged in to view unpublished posts. $this->posts = array(); } else { if (in_array($status, array('draft', 'pending')) ) { // User must have edit permissions on the draft to preview. if (! current_user_can('edit_post', $this->posts[0]->ID)) { $this->posts = array(); } else { $this->is_preview = true; $this->posts[0]->post_date = current_time('mysql'); } } else if ('future' == $status) { $this->is_preview = true; if (!current_user_can('edit_post', $this->posts[0]->ID)) { $this->posts = array ( ); } } else { if (! current_user_can('read_post', $this->posts[0]->ID)) $this->posts = array(); } } } } $this->posts = apply_filters('the_posts', $this->posts); update_post_caches($this->posts); $this->post_count = count($this->posts); if ($this->post_count > 0) { $this->post = $this->posts[0]; } return $this->posts; } function next_post() { $this->current_post++; $this->post = $this->posts[$this->current_post]; return $this->post; } function the_post() { global $post; $this->in_the_loop = true; $post = $this->next_post(); setup_postdata($post); if ( $this->current_post == 0 ) // loop has just started do_action('loop_start'); } function have_posts() { if ($this->current_post + 1 < $this->post_count) { return true; } elseif ($this->current_post + 1 == $this->post_count && $this->post_count > 0) { do_action('loop_end'); // Do some cleaning up after the loop $this->rewind_posts(); } $this->in_the_loop = false; return false; } function rewind_posts() { $this->current_post = -1; if ($this->post_count > 0) { $this->post = $this->posts[0]; } } function next_comment() { $this->current_comment++; $this->comment = $this->comments[$this->current_comment]; return $this->comment; } function the_comment() { global $comment; $comment = $this->next_comment(); if ($this->current_comment == 0) { do_action('comment_loop_start'); } } function have_comments() { if ($this->current_comment + 1 < $this->comment_count) { return true; } elseif ($this->current_comment + 1 == $this->comment_count) { $this->rewind_comments(); } return false; } function rewind_comments() { $this->current_comment = -1; if ($this->comment_count > 0) { $this->comment = $this->comments[0]; } } function &query($query) { $this->parse_query($query); return $this->get_posts(); } function get_queried_object() { if (isset($this->queried_object)) { return $this->queried_object; } $this->queried_object = NULL; $this->queried_object_id = 0; if ($this->is_category) { $cat = $this->get('cat'); $category = &get_category($cat); $this->queried_object = &$category; $this->queried_object_id = (int) $cat; } else if ($this->is_tag) { $tag_id = $this->get('tag_id'); $tag = &get_term($tag_id, 'post_tag'); if ( is_wp_error( $tag ) ) return $tag; $this->queried_object = &$tag; $this->queried_object_id = (int) $tag_id; } else if ($this->is_tax) { $tax = $this->get('taxonomy'); $slug = $this->get('term'); $term = &get_terms($tax, array('slug'=>$slug)); if ( is_wp_error($term) || empty($term) ) return $term; $term = $term[0]; $this->queried_object = $term; $this->queried_object_id = $term->term_id; } else if ($this->is_posts_page) { $this->queried_object = & get_page(get_option('page_for_posts')); $this->queried_object_id = (int) $this->queried_object->ID; } else if ($this->is_single) { $this->queried_object = $this->post; $this->queried_object_id = (int) $this->post->ID; } else if ($this->is_page) { $this->queried_object = $this->post; $this->queried_object_id = (int) $this->post->ID; } else if ($this->is_author) { $author_id = (int) $this->get('author'); $author = get_userdata($author_id); $this->queried_object = $author; $this->queried_object_id = $author_id; } return $this->queried_object; } function get_queried_object_id() { $this->get_queried_object(); if (isset($this->queried_object_id)) { return $this->queried_object_id; } return 0; } function WP_Query ($query = '') { if (! empty($query)) { $this->query($query); } } } // Redirect old slugs function wp_old_slug_redirect () { global $wp_query; if ( is_404() && '' != $wp_query->query_vars['name'] ) : global $wpdb; $query = "SELECT post_id FROM $wpdb->postmeta, $wpdb->posts WHERE ID = post_id AND meta_key = '_wp_old_slug' AND meta_value='" . $wp_query->query_vars['name'] . "'"; // if year, monthnum, or day have been specified, make our query more precise // just in case there are multiple identical _wp_old_slug values if ( '' != $wp_query->query_vars['year'] ) $query .= " AND YEAR(post_date) = '{$wp_query->query_vars['year']}'"; if ( '' != $wp_query->query_vars['monthnum'] ) $query .= " AND MONTH(post_date) = '{$wp_query->query_vars['monthnum']}'"; if ( '' != $wp_query->query_vars['day'] ) $query .= " AND DAYOFMONTH(post_date) = '{$wp_query->query_vars['day']}'"; $id = (int) $wpdb->get_var($query); if ( !$id ) return; $link = get_permalink($id); if ( !$link ) return; wp_redirect($link, '301'); // Permanent redirect exit; endif; } // // Private helper functions // // Setup global post data. function setup_postdata($post) { global $id, $authordata, $day, $currentmonth, $page, $pages, $multipage, $more, $numpages; $id = (int) $post->ID; $authordata = get_userdata($post->post_author); $day = mysql2date('d.m.y', $post->post_date); $currentmonth = mysql2date('m', $post->post_date); $numpages = 1; $page = get_query_var('page'); if ( !$page ) $page = 1; if ( is_single() || is_page() || is_feed() ) $more = 1; $content = $post->post_content; if ( preg_match('/<!--nextpage-->/', $content) ) { if ( $page > 1 ) $more = 1; $multipage = 1; $content = str_replace("\n<!--nextpage-->\n", '<!--nextpage-->', $content); $content = str_replace("\n<!--nextpage-->", '<!--nextpage-->', $content); $content = str_replace("<!--nextpage-->\n", '<!--nextpage-->', $content); $pages = explode('<!--nextpage-->', $content); $numpages = count($pages); } else { $pages[0] = $post->post_content; $multipage = 0; } return true; } ?> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/registration.php�����������������������������������������������������������������0000644�0001066�0001066�00000021247�10767000430�014662� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * User Registration API * * @package WordPress */ /** * username_exists() - Checks whether the given username exists. * * @since 2.0.0 * * @param string $username Username. * @return null|int The user's ID on success, and null on failure. */ function username_exists( $username ) { if ( $user = get_userdatabylogin( $username ) ) { return $user->ID; } else { return null; } } /** * email_exists() - Checks whether the given email exists. * * @since 2.1.0 * @uses $wpdb * * @param string $email Email. * @return bool|int The user's ID on success, and false on failure. */ function email_exists( $email ) { if ( $user = get_user_by_email($email) ) return $user->ID; return false; } /** * validate_username() - Checks whether an username is valid. * * @since 2.0.1 * @uses apply_filters() Calls 'validate_username' hook on $valid check and $username as parameters * * @param string $username Username. * @return bool Whether username given is valid */ function validate_username( $username ) { $sanitized = sanitize_user( $username, true ); $valid = ( $sanitized == $username ); return apply_filters( 'validate_username', $valid, $username ); } /** * wp_insert_user() - Insert an user into the database. * * Can update a current user or insert a new user based on whether * the user's ID is present. * * Can be used to update the user's info (see below), set the user's * role, and set the user's preference on whether they want the rich * editor on. * * Most of the $userdata array fields have filters associated with * the values. The exceptions are 'rich_editing', 'role', 'jabber', * 'aim', 'yim', 'user_registered', and 'ID'. The filters have the * prefix 'pre_user_' followed by the field name. An example using * 'description' would have the filter called, 'pre_user_description' * that can be hooked into. * * The $userdata array can contain the following fields: * 'ID' - An integer that will be used for updating an existing user. * 'user_pass' - A string that contains the plain text password for the user. * 'user_login' - A string that contains the user's username for logging in. * 'user_nicename' - A string that contains a nicer looking name for the user. * The default is the user's username. * 'user_url' - A string containing the user's URL for the user's web site. * 'user_email' - A string containing the user's email address. * 'display_name' - A string that will be shown on the site. Defaults to user's username. * It is likely that you will want to change this, for both appearance and security * through obscurity (that is if you don't use and delete the default 'admin' user). * 'nickname' - The user's nickname, defaults to the user's username. * 'first_name' - The user's first name. * 'last_name' - The user's last name. * 'description' - A string containing content about the user. * 'rich_editing' - A string for whether to enable the rich editor or not. False if not * empty. * 'user_registered' - The date the user registered. Format is 'Y-m-d H:i:s'. * 'role' - A string used to set the user's role. * 'jabber' - User's Jabber account. * 'aim' - User's AOL IM account. * 'yim' - User's Yahoo IM account. * * @since 2.0.0 * @uses $wpdb WordPress database layer. * @uses apply_filters() Calls filters for most of the $userdata fields with the prefix 'pre_user'. See note above. * @uses do_action() Calls 'profile_update' hook when updating giving the user's ID * @uses do_action() Calls 'user_register' hook when creating a new user giving the user's ID * * @param array $userdata An array of user data. * @return int The newly created user's ID. */ function wp_insert_user($userdata) { global $wpdb; extract($userdata, EXTR_SKIP); // Are we updating or creating? if ( !empty($ID) ) { $ID = (int) $ID; $update = true; } else { $update = false; // Hash the password $user_pass = wp_hash_password($user_pass); } $user_login = sanitize_user($user_login, true); $user_login = apply_filters('pre_user_login', $user_login); if ( empty($user_nicename) ) $user_nicename = sanitize_title( $user_login ); $user_nicename = apply_filters('pre_user_nicename', $user_nicename); if ( empty($user_url) ) $user_url = ''; $user_url = apply_filters('pre_user_url', $user_url); if ( empty($user_email) ) $user_email = ''; $user_email = apply_filters('pre_user_email', $user_email); if ( empty($display_name) ) $display_name = $user_login; $display_name = apply_filters('pre_user_display_name', $display_name); if ( empty($nickname) ) $nickname = $user_login; $nickname = apply_filters('pre_user_nickname', $nickname); if ( empty($first_name) ) $first_name = ''; $first_name = apply_filters('pre_user_first_name', $first_name); if ( empty($last_name) ) $last_name = ''; $last_name = apply_filters('pre_user_last_name', $last_name); if ( empty($description) ) $description = ''; $description = apply_filters('pre_user_description', $description); if ( empty($rich_editing) ) $rich_editing = 'true'; if ( empty($admin_color) ) $admin_color = 'fresh'; $admin_color = preg_replace('|[^a-z0-9 _.\-@]|i', '', $admin_color); if ( empty($user_registered) ) $user_registered = gmdate('Y-m-d H:i:s'); $data = compact( 'user_pass', 'user_email', 'user_url', 'user_nicename', 'display_name', 'user_registered' ); $data = stripslashes_deep( $data ); if ( $update ) { $wpdb->update( $wpdb->users, $data, compact( 'ID' ) ); $user_id = (int) $ID; } else { $wpdb->insert( $wpdb->users, $data + compact( 'user_login' ) ); $user_id = (int) $wpdb->insert_id; } update_usermeta( $user_id, 'first_name', $first_name); update_usermeta( $user_id, 'last_name', $last_name); update_usermeta( $user_id, 'nickname', $nickname ); update_usermeta( $user_id, 'description', $description ); update_usermeta( $user_id, 'jabber', $jabber ); update_usermeta( $user_id, 'aim', $aim ); update_usermeta( $user_id, 'yim', $yim ); update_usermeta( $user_id, 'rich_editing', $rich_editing); update_usermeta( $user_id, 'admin_color', $admin_color); if ( $update && isset($role) ) { $user = new WP_User($user_id); $user->set_role($role); } if ( !$update ) { $user = new WP_User($user_id); $user->set_role(get_option('default_role')); } wp_cache_delete($user_id, 'users'); wp_cache_delete($user_login, 'userlogins'); if ( $update ) do_action('profile_update', $user_id); else do_action('user_register', $user_id); return $user_id; } /** * wp_update_user() - Update an user in the database * * It is possible to update a user's password by specifying the * 'user_pass' value in the $userdata parameter array. * * If $userdata does not contain an 'ID' key, then a new user * will be created and the new user's ID will be returned. * * If current user's password is being updated, then the cookies * will be cleared. * * @since 2.0.0 * @see wp_insert_user() For what fields can be set in $userdata * @uses wp_insert_user() Used to update existing user or add new one if user doesn't exist already * * @param array $userdata An array of user data. * @return int The updated user's ID. */ function wp_update_user($userdata) { $ID = (int) $userdata['ID']; // First, get all of the original fields $user = get_userdata($ID); // Escape data pulled from DB. $user = add_magic_quotes(get_object_vars($user)); // If password is changing, hash it now. if ( ! empty($userdata['user_pass']) ) { $plaintext_pass = $userdata['user_pass']; $userdata['user_pass'] = wp_hash_password($userdata['user_pass']); } // Merge old and new fields with new fields overwriting old ones. $userdata = array_merge($user, $userdata); $user_id = wp_insert_user($userdata); // Update the cookies if the password changed. $current_user = wp_get_current_user(); if ( $current_user->id == $ID ) { if ( isset($plaintext_pass) ) { wp_clear_auth_cookie(); wp_set_auth_cookie($ID); } } return $user_id; } /** * wp_create_user() - A simpler way of inserting an user into the database. * * Creates a new user with just the username, password, and email. For a more * detail creation of a user, use wp_insert_user() to specify more infomation. * * @since 2.0.0 * @see wp_insert_user() More complete way to create a new user * @uses $wpdb Escapes $username and $email parameters * * @param string $username The user's username. * @param string $password The user's password. * @param string $email The user's email (optional). * @return int The new user's ID. */ function wp_create_user($username, $password, $email = '') { global $wpdb; $user_login = $wpdb->escape($username); $user_email = $wpdb->escape($email); $user_pass = $password; $userdata = compact('user_login', 'user_email', 'user_pass'); return wp_insert_user($userdata); } ?> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/cron.php�������������������������������������������������������������������������0000644�0001066�0001066�00000012073�11044674500�013112� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php function wp_schedule_single_event( $timestamp, $hook, $args = array()) { $crons = _get_cron_array(); $key = md5(serialize($args)); $crons[$timestamp][$hook][$key] = array( 'schedule' => false, 'args' => $args ); uksort( $crons, "strnatcasecmp" ); _set_cron_array( $crons ); } function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array()) { $crons = _get_cron_array(); $schedules = wp_get_schedules(); $key = md5(serialize($args)); if ( !isset( $schedules[$recurrence] ) ) return false; $crons[$timestamp][$hook][$key] = array( 'schedule' => $recurrence, 'args' => $args, 'interval' => $schedules[$recurrence]['interval'] ); uksort( $crons, "strnatcasecmp" ); _set_cron_array( $crons ); } function wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array()) { $crons = _get_cron_array(); $schedules = wp_get_schedules(); $key = md5(serialize($args)); $interval = 0; // First we try to get it from the schedule if ( 0 == $interval ) $interval = $schedules[$recurrence]['interval']; // Now we try to get it from the saved interval in case the schedule disappears if ( 0 == $interval ) $interval = $crons[$timestamp][$hook][$key]['interval']; // Now we assume something is wrong and fail to schedule if ( 0 == $interval ) return false; while ( $timestamp < time() + 1 ) $timestamp += $interval; wp_schedule_event( $timestamp, $recurrence, $hook, $args ); } function wp_unschedule_event( $timestamp, $hook, $args = array() ) { $crons = _get_cron_array(); $key = md5(serialize($args)); unset( $crons[$timestamp][$hook][$key] ); if ( empty($crons[$timestamp][$hook]) ) unset( $crons[$timestamp][$hook] ); if ( empty($crons[$timestamp]) ) unset( $crons[$timestamp] ); _set_cron_array( $crons ); } function wp_clear_scheduled_hook( $hook ) { $args = array_slice( func_get_args(), 1 ); while ( $timestamp = wp_next_scheduled( $hook, $args ) ) wp_unschedule_event( $timestamp, $hook, $args ); } function wp_next_scheduled( $hook, $args = array() ) { $crons = _get_cron_array(); $key = md5(serialize($args)); if ( empty($crons) ) return false; foreach ( $crons as $timestamp => $cron ) { if ( isset( $cron[$hook][$key] ) ) return $timestamp; } return false; } function spawn_cron() { $crons = _get_cron_array(); if ( !is_array($crons) ) return; $keys = array_keys( $crons ); if ( array_shift( $keys ) > time() ) return; $cron_url = get_option( 'siteurl' ) . '/wp-cron.php'; $parts = parse_url( $cron_url ); if ($parts['scheme'] == 'https') { // support for SSL was added in 4.3.0 if (version_compare(phpversion(), '4.3.0', '>=') && function_exists('openssl_open')) { $port = isset($parts['port']) ? $parts['port'] : 443; $argyle = @fsockopen('ssl://' . $parts['host'], $port, $errno, $errstr, 0.01); } else { return false; } } else { $port = isset($parts['port']) ? $parts['port'] : 80; $argyle = @ fsockopen( $parts['host'], $port, $errno, $errstr, 0.01 ); } if ( $argyle ) fputs( $argyle, "GET {$parts['path']}?check=" . wp_hash('187425') . " HTTP/1.0\r\n" . "Host: {$_SERVER['HTTP_HOST']}\r\n\r\n" ); } function wp_cron() { // Prevent infinite loops caused by lack of wp-cron.php if ( strpos($_SERVER['REQUEST_URI'], '/wp-cron.php') !== false ) return; $crons = _get_cron_array(); if ( !is_array($crons) ) return; $keys = array_keys( $crons ); if ( isset($keys[0]) && $keys[0] > time() ) return; $schedules = wp_get_schedules(); foreach ( $crons as $timestamp => $cronhooks ) { if ( $timestamp > time() ) break; foreach ( $cronhooks as $hook => $args ) { if ( isset($schedules[$hook]['callback']) && !call_user_func( $schedules[$hook]['callback'] ) ) continue; spawn_cron(); break 2; } } } function wp_get_schedules() { $schedules = array( 'hourly' => array( 'interval' => 3600, 'display' => __('Once Hourly') ), 'twicedaily' => array( 'interval' => 43200, 'display' => __('Twice Daily') ), 'daily' => array( 'interval' => 86400, 'display' => __('Once Daily') ), ); return array_merge( apply_filters( 'cron_schedules', array() ), $schedules ); } function wp_get_schedule($hook, $args = array()) { $crons = _get_cron_array(); $key = md5(serialize($args)); if ( empty($crons) ) return false; foreach ( $crons as $timestamp => $cron ) { if ( isset( $cron[$hook][$key] ) ) return $cron[$hook][$key]['schedule']; } return false; } // // Private functions // function _get_cron_array() { $cron = get_option('cron'); if ( ! is_array($cron) ) return false; if ( !isset($cron['version']) ) $cron = _upgrade_cron_array($cron); unset($cron['version']); return $cron; } function _set_cron_array($cron) { $cron['version'] = 2; update_option( 'cron', $cron ); } function _upgrade_cron_array($cron) { if ( isset($cron['version']) && 2 == $cron['version']) return $cron; $new_cron = array(); foreach ($cron as $timestamp => $hooks) { foreach ( $hooks as $hook => $args ) { $key = md5(serialize($args['args'])); $new_cron[$timestamp][$hook][$key] = $args; } } $new_cron['version'] = 2; update_option( 'cron', $new_cron ); return $new_cron; } ?> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/������������������������������������������������������������������������������0000755�0001066�0001066�00000000000�11051167752�012055� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/crop/�������������������������������������������������������������������������0000755�0001066�0001066�00000000000�11051167751�013017� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/crop/marqueeVert.gif����������������������������������������������������������0000644�0001066�0001066�00000002165�10536126622�016011� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF89a�(��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������! NETSCAPE2.0���! ���,�����(���   "4xp Å�! ���,�����(���A"`�! ���,�����(����G@ Lxp` �! ���,�����(���G(h C�! ���,�����(���࿁ "4xp Å�! ���,�����(���A"`�! ���,�����(���@@ Lxp` �!���,�����(��� @+h C�;�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/crop/marqueeHoriz.gif���������������������������������������������������������0000644�0001066�0001066�00000002145�10536126622�016162� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF89a ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������! NETSCAPE2.0���! ���,���� ����   "4xp À�! ���,���� ����A"`A�! ���,���� �����G@ Lxp`A�! ���,���� ����G(h C��! ���,���� ����࿁ "4xp À�! ���,���� ����A"`A�! ���,���� ����@@ Lxp`A�!���,���� ���� @+h �;���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/crop/cropper.css��������������������������������������������������������������0000644�0001066�0001066�00000005606�10762616541�015216� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.imgCrop_wrap { /* width: 500px; @done_in_js */ /* height: 375px; @done_in_js */ position: relative; cursor: crosshair; } /* an extra classname is applied for Opera < 9.0 to fix it's lack of opacity support */ .imgCrop_wrap.opera8 .imgCrop_overlay, .imgCrop_wrap.opera8 .imgCrop_clickArea { background-color: transparent; } /* fix for IE displaying all boxes at line-height by default, although they are still 1 pixel high until we combine them with the pointless span */ .imgCrop_wrap, .imgCrop_wrap * { font-size: 0; } .imgCrop_overlay { background-color: #000; opacity: 0.5; filter:alpha(opacity=50); position: absolute; width: 100%; height: 100%; } .imgCrop_selArea { position: absolute; /* @done_in_js top: 20px; left: 20px; width: 200px; height: 200px; background: transparent url(castle.jpg) no-repeat -210px -110px; */ cursor: move; z-index: 2; } /* clickArea is all a fix for IE 5.5 & 6 to allow the user to click on the given area */ .imgCrop_clickArea { width: 100%; height: 100%; background-color: #FFF; opacity: 0.01; filter:alpha(opacity=01); } .imgCrop_marqueeHoriz { position: absolute; width: 100%; height: 1px; background: transparent url(marqueeHoriz.gif) repeat-x 0 0; z-index: 3; } .imgCrop_marqueeVert { position: absolute; height: 100%; width: 1px; background: transparent url(marqueeVert.gif) repeat-y 0 0; z-index: 3; } .imgCrop_marqueeNorth { top: 0; left: 0; } .imgCrop_marqueeEast { top: 0; right: 0; } .imgCrop_marqueeSouth { bottom: 0px; left: 0; } .imgCrop_marqueeWest { top: 0; left: 0; } .imgCrop_handle { position: absolute; border: 1px solid #333; width: 6px; height: 6px; background: #FFF; opacity: 0.5; filter:alpha(opacity=50); z-index: 4; } /* fix IE 5 box model */ * html .imgCrop_handle { width: 8px; height: 8px; wid\th: 6px; hei\ght: 6px; } .imgCrop_handleN { top: -3px; left: 0; /* margin-left: 49%; @done_in_js */ cursor: n-resize; } .imgCrop_handleNE { top: -3px; right: -3px; cursor: ne-resize; } .imgCrop_handleE { top: 0; right: -3px; /* margin-top: 49%; @done_in_js */ cursor: e-resize; } .imgCrop_handleSE { right: -3px; bottom: -3px; cursor: se-resize; } .imgCrop_handleS { right: 0; bottom: -3px; /* margin-right: 49%; @done_in_js */ cursor: s-resize; } .imgCrop_handleSW { left: -3px; bottom: -3px; cursor: sw-resize; } .imgCrop_handleW { top: 0; left: -3px; /* margin-top: 49%; @done_in_js */ cursor: e-resize; } .imgCrop_handleNW { top: -3px; left: -3px; cursor: nw-resize; } /** * Create an area to click & drag around on as the default browser behaviour is to let you drag the image */ .imgCrop_dragArea { width: 100%; height: 100%; z-index: 200; position: absolute; top: 0; left: 0; } .imgCrop_previewWrap { /* width: 200px; @done_in_js */ /* height: 200px; @done_in_js */ overflow: hidden; position: relative; } .imgCrop_previewWrap img { position: absolute; }��������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/crop/cropper.js���������������������������������������������������������������0000644�0001066�0001066�00000040145�10616725073�015036� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * Copyright (c) 2006, David Spurr (http://www.defusion.org.uk/) * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * * Neither the name of the David Spurr nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * http://www.opensource.org/licenses/bsd-license.php * * See scriptaculous.js for full scriptaculous licence */ var CropDraggable=Class.create(); Object.extend(Object.extend(CropDraggable.prototype,Draggable.prototype),{initialize:function(_1){ this.options=Object.extend({drawMethod:function(){ }},arguments[1]||{}); this.element=$(_1); this.handle=this.element; this.delta=this.currentDelta(); this.dragging=false; this.eventMouseDown=this.initDrag.bindAsEventListener(this); Event.observe(this.handle,"mousedown",this.eventMouseDown); Draggables.register(this); },draw:function(_2){ var _3=Position.cumulativeOffset(this.element); var d=this.currentDelta(); _3[0]-=d[0]; _3[1]-=d[1]; var p=[0,1].map(function(i){ return (_2[i]-_3[i]-this.offset[i]); }.bind(this)); this.options.drawMethod(p); }}); var Cropper={}; Cropper.Img=Class.create(); Cropper.Img.prototype={initialize:function(_7,_8){ this.options=Object.extend({ratioDim:{x:0,y:0},minWidth:0,minHeight:0,displayOnInit:false,onEndCrop:Prototype.emptyFunction,captureKeys:true},_8||{}); if(this.options.minWidth>0&&this.options.minHeight>0){ this.options.ratioDim.x=this.options.minWidth; this.options.ratioDim.y=this.options.minHeight; } this.img=$(_7); this.clickCoords={x:0,y:0}; this.dragging=false; this.resizing=false; this.isWebKit=/Konqueror|Safari|KHTML/.test(navigator.userAgent); this.isIE=/MSIE/.test(navigator.userAgent); this.isOpera8=/Opera\s[1-8]/.test(navigator.userAgent); this.ratioX=0; this.ratioY=0; this.attached=false; $A(document.getElementsByTagName("script")).each(function(s){ if(s.src.match(/cropper\.js/)){ var _a=s.src.replace(/cropper\.js(.*)?/,""); var _b=document.createElement("link"); _b.rel="stylesheet"; _b.type="text/css"; _b.href=_a+"cropper.css"; _b.media="screen"; document.getElementsByTagName("head")[0].appendChild(_b); } }); if(this.options.ratioDim.x>0&&this.options.ratioDim.y>0){ var _c=this.getGCD(this.options.ratioDim.x,this.options.ratioDim.y); this.ratioX=this.options.ratioDim.x/_c; this.ratioY=this.options.ratioDim.y/_c; } this.subInitialize(); if(this.img.complete||this.isWebKit){ this.onLoad(); }else{ Event.observe(this.img,"load",this.onLoad.bindAsEventListener(this)); } },getGCD:function(a,b){return 1; if(b==0){ return a; } return this.getGCD(b,a%b); },onLoad:function(){ var _f="imgCrop_"; var _10=this.img.parentNode; var _11=""; if(this.isOpera8){ _11=" opera8"; } this.imgWrap=Builder.node("div",{"class":_f+"wrap"+_11}); if(this.isIE){ this.north=Builder.node("div",{"class":_f+"overlay "+_f+"north"},[Builder.node("span")]); this.east=Builder.node("div",{"class":_f+"overlay "+_f+"east"},[Builder.node("span")]); this.south=Builder.node("div",{"class":_f+"overlay "+_f+"south"},[Builder.node("span")]); this.west=Builder.node("div",{"class":_f+"overlay "+_f+"west"},[Builder.node("span")]); var _12=[this.north,this.east,this.south,this.west]; }else{ this.overlay=Builder.node("div",{"class":_f+"overlay"}); var _12=[this.overlay]; } this.dragArea=Builder.node("div",{"class":_f+"dragArea"},_12); this.handleN=Builder.node("div",{"class":_f+"handle "+_f+"handleN"}); this.handleNE=Builder.node("div",{"class":_f+"handle "+_f+"handleNE"}); this.handleE=Builder.node("div",{"class":_f+"handle "+_f+"handleE"}); this.handleSE=Builder.node("div",{"class":_f+"handle "+_f+"handleSE"}); this.handleS=Builder.node("div",{"class":_f+"handle "+_f+"handleS"}); this.handleSW=Builder.node("div",{"class":_f+"handle "+_f+"handleSW"}); this.handleW=Builder.node("div",{"class":_f+"handle "+_f+"handleW"}); this.handleNW=Builder.node("div",{"class":_f+"handle "+_f+"handleNW"}); this.selArea=Builder.node("div",{"class":_f+"selArea"},[Builder.node("div",{"class":_f+"marqueeHoriz "+_f+"marqueeNorth"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeVert "+_f+"marqueeEast"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeHoriz "+_f+"marqueeSouth"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeVert "+_f+"marqueeWest"},[Builder.node("span")]),this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW,Builder.node("div",{"class":_f+"clickArea"})]); Element.setStyle($(this.selArea),{backgroundColor:"transparent",backgroundRepeat:"no-repeat",backgroundPosition:"0 0"}); this.imgWrap.appendChild(this.img); this.imgWrap.appendChild(this.dragArea); this.dragArea.appendChild(this.selArea); this.dragArea.appendChild(Builder.node("div",{"class":_f+"clickArea"})); _10.appendChild(this.imgWrap); Event.observe(this.dragArea,"mousedown",this.startDrag.bindAsEventListener(this)); Event.observe(document,"mousemove",this.onDrag.bindAsEventListener(this)); Event.observe(document,"mouseup",this.endCrop.bindAsEventListener(this)); var _13=[this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW]; for(var i=0;i<_13.length;i++){ Event.observe(_13[i],"mousedown",this.startResize.bindAsEventListener(this)); } if(this.options.captureKeys){ Event.observe(document,"keydown",this.handleKeys.bindAsEventListener(this)); } new CropDraggable(this.selArea,{drawMethod:this.moveArea.bindAsEventListener(this)}); this.setParams(); },setParams:function(){ this.imgW=this.img.width; this.imgH=this.img.height; if(!this.isIE){ Element.setStyle($(this.overlay),{width:this.imgW+"px",height:this.imgH+"px"}); Element.hide($(this.overlay)); Element.setStyle($(this.selArea),{backgroundImage:"url("+this.img.src+")"}); }else{ Element.setStyle($(this.north),{height:0}); Element.setStyle($(this.east),{width:0,height:0}); Element.setStyle($(this.south),{height:0}); Element.setStyle($(this.west),{width:0,height:0}); } Element.setStyle($(this.imgWrap),{"width":this.imgW+"px","height":this.imgH+"px"}); Element.hide($(this.selArea)); var _15=Position.positionedOffset(this.imgWrap); this.wrapOffsets={"top":_15[1],"left":_15[0]}; var _16={x1:0,y1:0,x2:0,y2:0}; this.setAreaCoords(_16); if(this.options.ratioDim.x>0&&this.options.ratioDim.y>0&&this.options.displayOnInit){ _16.x1=Math.ceil((this.imgW-this.options.ratioDim.x)/2); _16.y1=Math.ceil((this.imgH-this.options.ratioDim.y)/2); _16.x2=_16.x1+this.options.ratioDim.x; _16.y2=_16.y1+this.options.ratioDim.y; Element.show(this.selArea); this.drawArea(); this.endCrop(); } this.attached=true; },remove:function(){ this.attached=false; this.imgWrap.parentNode.insertBefore(this.img,this.imgWrap); this.imgWrap.parentNode.removeChild(this.imgWrap); Event.stopObserving(this.dragArea,"mousedown",this.startDrag.bindAsEventListener(this)); Event.stopObserving(document,"mousemove",this.onDrag.bindAsEventListener(this)); Event.stopObserving(document,"mouseup",this.endCrop.bindAsEventListener(this)); var _17=[this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW]; for(var i=0;i<_17.length;i++){ Event.stopObserving(_17[i],"mousedown",this.startResize.bindAsEventListener(this)); } if(this.options.captureKeys){ Event.stopObserving(document,"keydown",this.handleKeys.bindAsEventListener(this)); } },reset:function(){ if(!this.attached){ this.onLoad(); }else{ this.setParams(); } this.endCrop(); },handleKeys:function(e){ var dir={x:0,y:0}; if(!this.dragging){ switch(e.keyCode){ case (37): dir.x=-1; break; case (38): dir.y=-1; break; case (39): dir.x=1; break; case (40): dir.y=1; break; } if(dir.x!=0||dir.y!=0){ if(e.shiftKey){ dir.x*=10; dir.y*=10; } this.moveArea([this.areaCoords.x1+dir.x,this.areaCoords.y1+dir.y]); Event.stop(e); } } },calcW:function(){ return (this.areaCoords.x2-this.areaCoords.x1); },calcH:function(){ return (this.areaCoords.y2-this.areaCoords.y1); },moveArea:function(_1b){ this.setAreaCoords({x1:_1b[0],y1:_1b[1],x2:_1b[0]+this.calcW(),y2:_1b[1]+this.calcH()},true); this.drawArea(); },cloneCoords:function(_1c){ return {x1:_1c.x1,y1:_1c.y1,x2:_1c.x2,y2:_1c.y2}; },setAreaCoords:function(_1d,_1e,_1f,_20,_21){ var _22=typeof _1e!="undefined"?_1e:false; var _23=typeof _1f!="undefined"?_1f:false; if(_1e){ var _24=_1d.x2-_1d.x1; var _25=_1d.y2-_1d.y1; if(_1d.x1<0){ _1d.x1=0; _1d.x2=_24; } if(_1d.y1<0){ _1d.y1=0; _1d.y2=_25; } if(_1d.x2>this.imgW){ _1d.x2=this.imgW; _1d.x1=this.imgW-_24; } if(_1d.y2>this.imgH){ _1d.y2=this.imgH; _1d.y1=this.imgH-_25; } }else{ if(_1d.x1<0){ _1d.x1=0; } if(_1d.y1<0){ _1d.y1=0; } if(_1d.x2>this.imgW){ _1d.x2=this.imgW; } if(_1d.y2>this.imgH){ _1d.y2=this.imgH; } if(typeof (_20)!="undefined"){ if(this.ratioX>0){ this.applyRatio(_1d,{x:this.ratioX,y:this.ratioY},_20,_21); }else{ if(_23){ this.applyRatio(_1d,{x:1,y:1},_20,_21); } } var _26={a1:_1d.x1,a2:_1d.x2}; var _27={a1:_1d.y1,a2:_1d.y2}; var _28=this.options.minWidth; var _29=this.options.minHeight; if((_28==0||_29==0)&&_23){ if(_28>0){ _29=_28; }else{ if(_29>0){ _28=_29; } } } this.applyMinDimension(_26,_28,_20.x,{min:0,max:this.imgW}); this.applyMinDimension(_27,_29,_20.y,{min:0,max:this.imgH}); _1d={x1:_26.a1,y1:_27.a1,x2:_26.a2,y2:_27.a2}; } } this.areaCoords=_1d; },applyMinDimension:function(_2a,_2b,_2c,_2d){ if((_2a.a2-_2a.a1)<_2b){ if(_2c==1){ _2a.a2=_2a.a1+_2b; }else{ _2a.a1=_2a.a2-_2b; } if(_2a.a1<_2d.min){ _2a.a1=_2d.min; _2a.a2=_2b; }else{ if(_2a.a2>_2d.max){ _2a.a1=_2d.max-_2b; _2a.a2=_2d.max; } } } },applyRatio:function(_2e,_2f,_30,_31){ var _32; if(_31=="N"||_31=="S"){ _32=this.applyRatioToAxis({a1:_2e.y1,b1:_2e.x1,a2:_2e.y2,b2:_2e.x2},{a:_2f.y,b:_2f.x},{a:_30.y,b:_30.x},{min:0,max:this.imgW}); _2e.x1=_32.b1; _2e.y1=_32.a1; _2e.x2=_32.b2; _2e.y2=_32.a2; }else{ _32=this.applyRatioToAxis({a1:_2e.x1,b1:_2e.y1,a2:_2e.x2,b2:_2e.y2},{a:_2f.x,b:_2f.y},{a:_30.x,b:_30.y},{min:0,max:this.imgH}); _2e.x1=_32.a1; _2e.y1=_32.b1; _2e.x2=_32.a2; _2e.y2=_32.b2; } },applyRatioToAxis:function(_33,_34,_35,_36){ var _37=Object.extend(_33,{}); var _38=_37.a2-_37.a1; var _3a=Math.floor(_38*_34.b/_34.a); var _3b; var _3c; var _3d=null; if(_35.b==1){ _3b=_37.b1+_3a; if(_3b>_36.max){ _3b=_36.max; _3d=_3b-_37.b1; } _37.b2=_3b; }else{ _3b=_37.b2-_3a; if(_3b<_36.min){ _3b=_36.min; _3d=_3b+_37.b2; } _37.b1=_3b; } if(_3d!=null){ _3c=Math.floor(_3d*_34.a/_34.b); if(_35.a==1){ _37.a2=_37.a1+_3c; }else{ _37.a1=_37.a1=_37.a2-_3c; } } return _37; },drawArea:function(){ if(!this.isIE){ Element.show($(this.overlay)); } var _3e=this.calcW(); var _3f=this.calcH(); var _40=this.areaCoords.x2; var _41=this.areaCoords.y2; var _42=this.selArea.style; _42.left=this.areaCoords.x1+"px"; _42.top=this.areaCoords.y1+"px"; _42.width=_3e+"px"; _42.height=_3f+"px"; var _43=Math.ceil((_3e-6)/2)+"px"; var _44=Math.ceil((_3f-6)/2)+"px"; this.handleN.style.left=_43; this.handleE.style.top=_44; this.handleS.style.left=_43; this.handleW.style.top=_44; if(this.isIE){ this.north.style.height=this.areaCoords.y1+"px"; var _45=this.east.style; _45.top=this.areaCoords.y1+"px"; _45.height=_3f+"px"; _45.left=_40+"px"; _45.width=(this.img.width-_40)+"px"; var _46=this.south.style; _46.top=_41+"px"; _46.height=(this.img.height-_41)+"px"; var _47=this.west.style; _47.top=this.areaCoords.y1+"px"; _47.height=_3f+"px"; _47.width=this.areaCoords.x1+"px"; }else{ _42.backgroundPosition="-"+this.areaCoords.x1+"px "+"-"+this.areaCoords.y1+"px"; } this.subDrawArea(); this.forceReRender(); },forceReRender:function(){ if(this.isIE||this.isWebKit){ var n=document.createTextNode(" "); var d,el,fixEL,i; if(this.isIE){ fixEl=this.selArea; }else{ if(this.isWebKit){ fixEl=document.getElementsByClassName("imgCrop_marqueeSouth",this.imgWrap)[0]; d=Builder.node("div",""); d.style.visibility="hidden"; var _4a=["SE","S","SW"]; for(i=0;i<_4a.length;i++){ el=document.getElementsByClassName("imgCrop_handle"+_4a[i],this.selArea)[0]; if(el.childNodes.length){ el.removeChild(el.childNodes[0]); } el.appendChild(d); } } } fixEl.appendChild(n); fixEl.removeChild(n); } },startResize:function(e){ this.startCoords=this.cloneCoords(this.areaCoords); this.resizing=true; this.resizeHandle=Element.classNames(Event.element(e)).toString().replace(/([^N|NE|E|SE|S|SW|W|NW])+/,""); Event.stop(e); },startDrag:function(e){ Element.show(this.selArea); this.clickCoords=this.getCurPos(e); this.setAreaCoords({x1:this.clickCoords.x,y1:this.clickCoords.y,x2:this.clickCoords.x,y2:this.clickCoords.y}); this.dragging=true; this.onDrag(e); Event.stop(e); },getCurPos:function(e){ return curPos={x:Event.pointerX(e)-this.wrapOffsets.left,y:Event.pointerY(e)-this.wrapOffsets.top}; },onDrag:function(e){ var _4f=null; if(this.dragging||this.resizing){ var _50=this.getCurPos(e); var _51=this.cloneCoords(this.areaCoords); var _52={x:1,y:1}; } if(this.dragging){ if(_50.x<this.clickCoords.x){ _52.x=-1; } if(_50.y<this.clickCoords.y){ _52.y=-1; } this.transformCoords(_50.x,this.clickCoords.x,_51,"x"); this.transformCoords(_50.y,this.clickCoords.y,_51,"y"); }else{ if(this.resizing){ _4f=this.resizeHandle; if(_4f.match(/E/)){ this.transformCoords(_50.x,this.startCoords.x1,_51,"x"); if(_50.x<this.startCoords.x1){ _52.x=-1; } }else{ if(_4f.match(/W/)){ this.transformCoords(_50.x,this.startCoords.x2,_51,"x"); if(_50.x<this.startCoords.x2){ _52.x=-1; } } } if(_4f.match(/N/)){ this.transformCoords(_50.y,this.startCoords.y2,_51,"y"); if(_50.y<this.startCoords.y2){ _52.y=-1; } }else{ if(_4f.match(/S/)){ this.transformCoords(_50.y,this.startCoords.y1,_51,"y"); if(_50.y<this.startCoords.y1){ _52.y=-1; } } } } } if(this.dragging||this.resizing){ this.setAreaCoords(_51,false,e.shiftKey,_52,_4f); this.drawArea(); Event.stop(e); } },transformCoords:function(_53,_54,_55,_56){ var _57=new Array(); if(_53<_54){ _57[0]=_53; _57[1]=_54; }else{ _57[0]=_54; _57[1]=_53; } if(_56=="x"){ _55.x1=_57[0]; _55.x2=_57[1]; }else{ _55.y1=_57[0]; _55.y2=_57[1]; } },endCrop:function(){ this.dragging=false; this.resizing=false; this.options.onEndCrop(this.areaCoords,{width:this.calcW(),height:this.calcH()}); },subInitialize:function(){ },subDrawArea:function(){ }}; Cropper.ImgWithPreview=Class.create(); Object.extend(Object.extend(Cropper.ImgWithPreview.prototype,Cropper.Img.prototype),{subInitialize:function(){ this.hasPreviewImg=false; if(typeof (this.options.previewWrap)!="undefined"&&this.options.minWidth>0&&this.options.minHeight>0){ this.previewWrap=$(this.options.previewWrap); this.previewImg=this.img.cloneNode(false); this.options.displayOnInit=true; this.hasPreviewImg=true; Element.addClassName(this.previewWrap,"imgCrop_previewWrap"); Element.setStyle(this.previewWrap,{width:this.options.minWidth+"px",height:this.options.minHeight+"px"}); this.previewWrap.appendChild(this.previewImg); } },subDrawArea:function(){ if(this.hasPreviewImg){ var _58=this.calcW(); var _59=this.calcH(); var _5a={x:this.imgW/_58,y:this.imgH/_59}; var _5b={x:_58/this.options.minWidth,y:_59/this.options.minHeight}; var _5c={w:Math.ceil(this.options.minWidth*_5a.x)+"px",h:Math.ceil(this.options.minHeight*_5a.y)+"px",x:"-"+Math.ceil(this.areaCoords.x1/_5b.x)+"px",y:"-"+Math.ceil(this.areaCoords.y1/_5b.y)+"px"}; var _5d=this.previewImg.style; _5d.width=_5c.w; _5d.height=_5c.h; _5d.left=_5c.x; _5d.top=_5c.y; } }}); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/wp-lists.js�������������������������������������������������������������������0000644�0001066�0001066�00000026634�11043713172�014202� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(function($) { var currentFormEl = false; var fs = {add:'ajaxAdd',del:'ajaxDel',dim:'ajaxDim',process:'process',recolor:'recolor'}; var wpList = { settings: { url: wpListL10n.url, type: 'POST', response: 'ajax-response', what: '', alt: 'alternate', altOffset: 0, addColor: null, delColor: null, dimAddColor: null, dimDelColor: null, confirm: null, addBefore: null, addAfter: null, delBefore: null, delAfter: null, dimBefore: null, dimAfter: null }, nonce: function(e,s) { var url = wpAjax.unserialize(e.attr('href')); return s.nonce || url._ajax_nonce || $('#' + s.element + ' input[name=_ajax_nonce]').val() || url._wpnonce || $('#' + s.element + ' input[name=_wpnonce]').val() || 0; }, parseClass: function(e,t) { var c = [], cl; try { cl = $(e).attr('class') || ''; cl = cl.match(new RegExp(t+':[A-Za-z0-9:_=-]+')); if ( cl ) { c = cl[0].split(':'); } } catch(r) {} return c; }, pre: function(e,s,a) { var bg; var r; s = $.extend( {}, this.wpList.settings, { element: null, nonce: 0, target: e.get(0) }, s || {} ); if ( $.isFunction( s.confirm ) ) { if ( 'add' != a ) { bg = $('#' + s.element).css('backgroundColor'); $('#' + s.element).css('backgroundColor', '#FF9966'); } r = s.confirm.call(this,e,s,a,bg); if ( 'add' != a ) { $('#' + s.element).css('backgroundColor', bg ); } if ( !r ) { return false; } } return s; }, ajaxAdd: function( e, s ) { var list = this; e = $(e); s = s || {}; var cls = wpList.parseClass(e,'add'); s = wpList.pre.call( list, e, s, 'add' ); s.element = cls[2] || e.attr( 'id' ) || s.element || null; if ( cls[3] ) { s.addColor = '#' + cls[3]; } else { s.addColor = s.addColor || '#FFFF33'; } if ( !s ) { return false; } if ( !e.is("[class^=add:" + list.id + ":]") ) { return !wpList.add.call( list, e, s ); } if ( !s.element ) { return true; } s.action = 'add-' + s.what; s.nonce = wpList.nonce(e,s); var es = $('#' + s.element + ' :input').not('[name=_ajax_nonce], [name=_wpnonce], [name=action]'); var valid = wpAjax.validateForm( '#' + s.element ); if ( !valid ) { return false; } s.data = $.param( $.extend( { _ajax_nonce: s.nonce, action: s.action }, wpAjax.unserialize( cls[4] || '' ) ) ); var formData = $.isFunction(es.fieldSerialize) ? es.fieldSerialize() : es.serialize(); if ( formData ) { s.data += '&' + formData; } if ( $.isFunction(s.addBefore) ) { s = s.addBefore( s ); if ( !s ) { return true; } } if ( !s.data.match(/_ajax_nonce=[a-f0-9]+/) ) { return true; } s.success = function(r) { var res = wpAjax.parseAjaxResponse(r, s.response, s.element); if ( !res || res.errors ) { return false; } if ( true === res ) { return true; } jQuery.each( res.responses, function() { wpList.add.call( list, this.data, $.extend( {}, s, { // this.firstChild.nodevalue pos: this.position || 0, id: this.id || 0, oldId: this.oldId || null } ) ); } ); if ( $.isFunction(s.addAfter) ) { var o = this.complete; this.complete = function(x,st) { var _s = $.extend( { xml: x, status: st, parsed: res }, s ); s.addAfter( r, _s ); if ( $.isFunction(o) ) { o(x,st); } }; } list.wpList.recolor(); wpList.clear.call(list,'#' + s.element); }; $.ajax( s ); return false; }, ajaxDel: function( e, s ) { var list = this; e = $(e); s = s || {}; var cls = wpList.parseClass(e,'delete'); s = wpList.pre.call( list, e, s, 'delete' ); s.element = cls[2] || s.element || null; if ( cls[3] ) { s.delColor = '#' + cls[3]; } else { s.delColor = s.delColor || '#FF3333'; } if ( !s || !s.element ) { return false; } s.action = 'delete-' + s.what; s.nonce = wpList.nonce(e,s); s.data = $.extend( { action: s.action, id: s.element.split('-').pop(), _ajax_nonce: s.nonce }, wpAjax.unserialize( cls[4] || '' ) ); if ( $.isFunction(s.delBefore) ) { s = s.delBefore( s ); if ( !s ) { return true; } } if ( !s.data._ajax_nonce ) { return true; } var element = $('#' + s.element); if ( 'none' != s.delColor ) { var anim = 'slideUp'; if ( element.css( 'display' ).match(/table/) ) anim = 'fadeOut'; // Can't slideup table rows and other table elements. Known jQuery bug element .animate( { backgroundColor: s.delColor }, 'fast' )[anim]( 'fast' ) .queue( function() { list.wpList.recolor(); $(this).dequeue(); } ); } else { list.wpList.recolor(); } s.success = function(r) { var res = wpAjax.parseAjaxResponse(r, s.response, s.element); if ( !res || res.errors ) { element.stop().stop().css( 'backgroundColor', '#FF3333' ).show().queue( function() { list.wpList.recolor(); $(this).dequeue(); } ); return false; } if ( $.isFunction(s.delAfter) ) { var o = this.complete; this.complete = function(x,st) { element.queue( function() { var _s = $.extend( { xml: x, status: st, parsed: res }, s ); s.delAfter( r, _s ); if ( $.isFunction(o) ) { o(x,st); } } ).dequeue(); }; } }; $.ajax( s ); return false; }, ajaxDim: function( e, s ) { var list = this; e = $(e); s = s || {}; var cls = wpList.parseClass(e,'dim'); s = wpList.pre.call( list, e, s, 'dim' ); s.element = cls[2] || s.element || null; s.dimClass = cls[3] || s.dimClass || null; if ( cls[4] ) { s.dimAddColor = '#' + cls[4]; } else { s.dimAddColor = s.dimAddColor || '#FFFF33'; } if ( cls[5] ) { s.dimDelColor = '#' + cls[5]; } else { s.dimDelColor = s.dimDelColor || '#FF3333'; } if ( !s || !s.element || !s.dimClass ) { return true; } s.action = 'dim-' + s.what; s.nonce = wpList.nonce(e,s); s.data = $.extend( { action: s.action, id: s.element.split('-').pop(), dimClass: s.dimClass, _ajax_nonce : s.nonce }, wpAjax.unserialize( cls[6] || '' ) ); if ( $.isFunction(s.dimBefore) ) { s = s.dimBefore( s ); if ( !s ) { return true; } } var element = $('#' + s.element); var isClass = element.toggleClass(s.dimClass).is('.' + s.dimClass); var color = wpList.getColor( element ); element.toggleClass( s.dimClass ) var dimColor = isClass ? s.dimAddColor : s.dimDelColor; if ( 'none' != dimColor ) { element .animate( { backgroundColor: dimColor }, 'fast' ) .queue( function() { element.toggleClass(s.dimClass); $(this).dequeue(); } ) .animate( { backgroundColor: color }, { complete: function() { $(this).css( 'backgroundColor', '' ); } } ); } if ( !s.data._ajax_nonce ) { return true; } s.success = function(r) { var res = wpAjax.parseAjaxResponse(r, s.response, s.element); if ( !res || res.errors ) { element.stop().stop().css( 'backgroundColor', '#FF3333' )[isClass?'removeClass':'addClass'](s.dimClass).show().queue( function() { list.wpList.recolor(); $(this).dequeue(); } ); return false; } if ( $.isFunction(s.dimAfter) ) { var o = this.complete; this.complete = function(x,st) { element.queue( function() { var _s = $.extend( { xml: x, status: st, parsed: res }, s ); s.dimAfter( r, _s ); if ( $.isFunction(o) ) { o(x,st); } } ).dequeue(); }; } }; $.ajax( s ); return false; }, // From jquery.color.js: jQuery Color Animation by John Resig getColor: function( el ) { if ( el.constructor == Object ) el = el.get(0); var elem = el, color, rgbaTrans = new RegExp( "rgba\\(\\s*0,\\s*0,\\s*0,\\s*0\\s*\\)", "i" ); do { color = jQuery.curCSS(elem, 'backgroundColor'); if ( color != '' && color != 'transparent' && !color.match(rgbaTrans) || jQuery.nodeName(elem, "body") ) break; } while ( elem = elem.parentNode ); return color || '#ffffff'; }, add: function( e, s ) { var list = $(this); e = $(e); var old = false; var _s = { pos: 0, id: 0, oldId: null }; if ( 'string' == typeof s ) { s = { what: s }; } s = $.extend(_s, this.wpList.settings, s); if ( !e.size() || !s.what ) { return false; } if ( s.oldId ) { old = $('#' + s.what + '-' + s.oldId); } if ( s.id && ( s.id != s.oldId || !old || !old.size() ) ) { $('#' + s.what + '-' + s.id).remove(); } if ( old && old.size() ) { old.replaceWith(e); } else if ( isNaN(s.pos) ) { var ba = 'after'; if ( '-' == s.pos.substr(0,1) ) { s.pos = s.pos.substr(1); ba = 'before'; } var ref = list.find( '#' + s.pos ); if ( 1 === ref.size() ) { ref[ba](e); } else { list.append(e); } } else if ( s.pos < 0 ) { list.prepend(e); } else { list.append(e); } if ( s.alt ) { if ( ( list.children(':visible').index( e[0] ) + s.altOffset ) % 2 ) { e.removeClass( s.alt ); } else { e.addClass( s.alt ); } } if ( 'none' != s.addColor ) { var color = wpList.getColor( e ); e.css( 'backgroundColor', s.addColor ).animate( { backgroundColor: color }, { complete: function() { $(this).css( 'backgroundColor', '' ); } } ); } list.each( function() { this.wpList.process( e ); } ); return e; }, clear: function(e) { var list = this; e = $(e); if ( list.wpList && e.parents( '#' + list.id ).size() ) { return; } e.find(':input').each( function() { if ( $(this).parents('.form-no-clear').size() ) return; var t = this.type.toLowerCase(); var tag = this.tagName.toLowerCase(); if ( 'text' == t || 'password' == t || 'textarea' == tag ) { this.value = ''; } else if ( 'checkbox' == t || 'radio' == t ) { this.checked = false; } else if ( 'select' == tag ) { this.selectedIndex = null; } }); }, process: function(el) { var list = this; $("[class^=add:" + list.id + ":]", el || null) .filter('form').submit( function() { return list.wpList.add(this); } ).end() .not('form').click( function() { return list.wpList.add(this); } ).each( function() { var addEl = this; var c = wpList.parseClass(this,'add')[2] || addEl.id; if ( !c ) { return; } var forms = []; var ins = []; // this is all really inefficient $('#' + c + ' :input').focus( function() { currentFormEl = this; } ).blur( function() { currentFormEl = false; } ).each( function() { ins.push(this); var f = $(this).parents('form:first').get(0); if ( $.inArray(f,forms) < 0 ) { forms.push(f); } } ); $(forms).submit( function() { if ( 0 <= $.inArray(currentFormEl,ins) ) { $(addEl).trigger( 'click' ); $(currentFormEl).focus(); return false; } } ); } ); $("[class^=delete:" + list.id + ":]", el || null).click( function() { return list.wpList.del(this); } ); $("[class^=dim:" + list.id + ":]", el || null).click( function() { return list.wpList.dim(this); } ); }, recolor: function() { var list = this; if ( !list.wpList.settings.alt ) { return; } var items = $('.list-item:visible', list); if ( !items.size() ) { items = $(list).children(':visible'); } var eo = [':even',':odd']; if ( list.wpList.settings.altOffset % 2 ) { eo.reverse(); } items.filter(eo[0]).addClass(list.wpList.settings.alt).end().filter(eo[1]).removeClass(list.wpList.settings.alt); }, init: function() { var lists = this; lists.wpList.process = function(a) { lists.each( function() { this.wpList.process(a); } ); }; lists.wpList.recolor = function() { lists.each( function() { this.wpList.recolor(); } ); }; } }; $.fn.wpList = function( settings ) { this.each( function() { var _this = this; this.wpList = { settings: $.extend( {}, wpList.settings, { what: wpList.parseClass(this,'list')[1] || '' }, settings ) }; $.each( fs, function(i,f) { _this.wpList[i] = function( e, s ) { return wpList[f].call( _this, e, s ); }; } ); } ); wpList.init.call(this); this.wpList.process(); return this; }; })(jQuery); ����������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/wp-ajax-response.js�����������������������������������������������������������0000644�0001066�0001066�00000005551�10770622612�015622� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wpAjax = jQuery.extend( { unserialize: function( s ) { var r = {}; if ( !s ) { return r; } var q = s.split('?'); if ( q[1] ) { s = q[1]; } var pp = s.split('&'); for ( var i in pp ) { if ( jQuery.isFunction(pp.hasOwnProperty) && !pp.hasOwnProperty(i) ) { continue; } var p = pp[i].split('='); r[p[0]] = p[1]; } return r; }, parseAjaxResponse: function( x, r, e ) { // 1 = good, 0 = strange (bad data?), -1 = you lack permission var parsed = {}; var re = jQuery('#' + r).html(''); if ( x && typeof x == 'object' && x.getElementsByTagName('wp_ajax') ) { parsed.responses = []; parsed.errors = false; var err = ''; jQuery('response', x).each( function() { var th = jQuery(this); var child = jQuery(this.firstChild); var response = { action: th.attr('action'), what: child.get(0).nodeName, id: child.attr('id'), oldId: child.attr('old_id'), position: child.attr('position') }; response.data = jQuery( 'response_data', child ).text(); response.supplemental = {}; if ( !jQuery( 'supplemental', child ).children().each( function() { response.supplemental[this.nodeName] = jQuery(this).text(); } ).size() ) { response.supplemental = false } response.errors = []; if ( !jQuery('wp_error', child).each( function() { var code = jQuery(this).attr('code'); var anError = { code: code, message: this.firstChild.nodeValue, data: false }; var errorData = jQuery('wp_error_data[code="' + code + '"]', x); if ( errorData ) { anError.data = errorData.get(); } var formField = jQuery( 'form-field', errorData ).text(); if ( formField ) { code = formField; } if ( e ) { wpAjax.invalidateForm( jQuery('#' + e + ' :input[name="' + code + '"]' ).parents('.form-field:first') ); } err += '<p>' + anError.message + '</p>'; response.errors.push( anError ); parsed.errors = true; } ).size() ) { response.errors = false; } parsed.responses.push( response ); } ); if ( err.length ) { re.html( '<div class="error">' + err + '</div>' ); } return parsed; } if ( isNaN(x) ) { return !re.html('<div class="error"><p>' + x + '</p></div>'); } x = parseInt(x,10); if ( -1 == x ) { return !re.html('<div class="error"><p>' + wpAjax.noPerm + '</p></div>'); } else if ( 0 === x ) { return !re.html('<div class="error"><p>' + wpAjax.broken + '</p></div>'); } return true; }, invalidateForm: function ( selector ) { return jQuery( selector ).addClass( 'form-invalid' ).change( function() { jQuery(this).removeClass( 'form-invalid' ); } ); }, validateForm: function( selector ) { selector = jQuery( selector ); return !wpAjax.invalidateForm( selector.find('.form-required').andSelf().filter('.form-required:has(:input[value=""]), .form-required:input[value=""]') ).size(); } }, wpAjax || { noPerm: 'You do not have permission to do that.', broken: 'An unidentified error has occurred.' } ); �������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/swfupload/��������������������������������������������������������������������0000755�0001066�0001066�00000000000�11051167751�014060� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/swfupload/handlers.js���������������������������������������������������������0000644�0001066�0001066�00000022062�11006152265�016212� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������function fileDialogStart() { jQuery("#media-upload-error").empty(); } // progress and success handlers for media multi uploads function fileQueued(fileObj) { // Get rid of unused form jQuery('.media-blank').remove(); // Collapse a single item if ( jQuery('.type-form #media-items>*').length == 1 && jQuery('#media-items .hidden').length > 0 ) { jQuery('.toggle').toggle(); jQuery('.slidetoggle').slideUp(200).siblings().removeClass('hidden'); } // Create a progress bar containing the filename jQuery('#media-items').append('<div id="media-item-' + fileObj.id + '" class="media-item child-of-' + post_id + '"><div class="progress"><div class="bar"></div></div><div class="filename original">' + fileObj.name + '</div></div>'); // Display the progress div jQuery('#media-item-' + fileObj.id + ' .progress').show(); // Disable the submit button jQuery('#insert-gallery').attr('disabled', 'disabled'); } function uploadStart(fileObj) { return true; } function uploadProgress(fileObj, bytesDone, bytesTotal) { // Lengthen the progress bar jQuery('#media-item-' + fileObj.id + ' .bar').width(620*bytesDone/bytesTotal); if ( bytesDone == bytesTotal ) jQuery('#media-item-' + fileObj.id + ' .bar').html('<strong class="crunching">' + swfuploadL10n.crunching + '</strong>'); } function prepareMediaItem(fileObj, serverData) { // Move the progress bar to 100% jQuery('#media-item-' + fileObj.id + ' .bar').remove(); jQuery('#media-item-' + fileObj.id + ' .progress').hide(); // Old style: Append the HTML returned by the server -- thumbnail and form inputs if ( isNaN(serverData) || !serverData ) { jQuery('#media-item-' + fileObj.id).append(serverData); prepareMediaItemInit(fileObj); } // New style: server data is just the attachment ID, fetch the thumbnail and form html from the server else { jQuery('#media-item-' + fileObj.id).load('async-upload.php', {attachment_id:serverData, fetch:1}, function(){prepareMediaItemInit(fileObj);updateMediaForm()}); } } function prepareMediaItemInit(fileObj) { // Clone the thumbnail as a "pinkynail" -- a tiny image to the left of the filename jQuery('#media-item-' + fileObj.id + ' .thumbnail').clone().attr('className', 'pinkynail toggle').prependTo('#media-item-' + fileObj.id); // Replace the original filename with the new (unique) one assigned during upload jQuery('#media-item-' + fileObj.id + ' .filename.original').replaceWith(jQuery('#media-item-' + fileObj.id + ' .filename.new')); // Also bind toggle to the links jQuery('#media-item-' + fileObj.id + ' a.toggle').bind('click', function(){jQuery(this).siblings('.slidetoggle').slideToggle(150, function(){window.scrollTo(0,this.parentNode.offsetTop);});jQuery(this).parent().eq(0).children('.toggle').toggle();jQuery(this).siblings('a.toggle').focus();return false;}); // Bind AJAX to the new Delete button jQuery('#media-item-' + fileObj.id + ' a.delete').bind('click',function(){ // Tell the server to delete it. TODO: handle exceptions jQuery.ajax({url:'admin-ajax.php',type:'post',success:deleteSuccess,error:deleteError,id:fileObj.id,data:{ id : this.id.replace(/[^0-9]/g,''), action : 'delete-post', _ajax_nonce : this.href.replace(/^.*wpnonce=/,'')} }); return false; }); // Open this item if it says to start open (e.g. to display an error) jQuery('#media-item-' + fileObj.id + '.startopen') .removeClass('startopen') .slideToggle(500) .parent().eq(0).children('.toggle').toggle(); } function itemAjaxError(id, html) { var error = jQuery('#media-item-error' + id); error.html('<div class="file-error"><button type="button" id="dismiss-'+id+'" class="button dismiss">'+swfuploadL10n.dismiss+'</button>'+html+'</div>'); jQuery('#dismiss-'+id).click(function(){jQuery(this).parents('.file-error').slideUp(200, function(){jQuery(this).empty();})}); } function deleteSuccess(data, textStatus) { if ( data == '-1' ) return itemAjaxError(this.id, 'You do not have permission. Has your session expired?'); if ( data == '0' ) return itemAjaxError(this.id, 'Could not be deleted. Has it been deleted already?'); var item = jQuery('#media-item-' + this.id); // Decrement the counters. if ( type = jQuery('#type-of-' + this.id).val() ) jQuery('#' + type + '-counter').text(jQuery('#' + type + '-counter').text()-1); if ( item.hasClass('child-of-'+post_id) ) jQuery('#attachments-count').text(jQuery('#attachments-count').text()-1); if ( jQuery('.type-form #media-items>*').length == 1 && jQuery('#media-items .hidden').length > 0 ) { jQuery('.toggle').toggle(); jQuery('.slidetoggle').slideUp(200).siblings().removeClass('hidden'); } // Vanish it. jQuery('#media-item-' + this.id + ' .filename:empty').remove(); jQuery('#media-item-' + this.id + ' .filename').append(' <span class="file-error">'+swfuploadL10n.deleted+'</span>').siblings('a.toggle').remove(); jQuery('#media-item-' + this.id).children('.describe').css({backgroundColor:'#fff'}).end() .animate({backgroundColor:'#ffc0c0'}, {queue:false,duration:50}) .animate({minHeight:0,height:36}, 400, null, function(){jQuery(this).children('.describe').remove()}) .animate({backgroundColor:'#fff'}, 400) .animate({height:0}, 800, null, function(){jQuery(this).remove();updateMediaForm();}); return; } function deleteError(X, textStatus, errorThrown) { // TODO } function updateMediaForm() { // Just one file, no need for collapsible part if ( jQuery('.type-form #media-items>*').length == 1 ) { jQuery('#media-items .slidetoggle').slideDown(500).parent().eq(0).children('.toggle').toggle(); jQuery('.type-form .slidetoggle').siblings().addClass('hidden'); } // Only show Save buttons when there is at least one file. if ( jQuery('#media-items>*').not('.media-blank').length > 0 ) jQuery('.savebutton').show(); else jQuery('.savebutton').hide(); // Only show Gallery button when there are at least two files. if ( jQuery('#media-items>*').length > 1 ) jQuery('.insert-gallery').show(); else jQuery('.insert-gallery').hide(); } function uploadSuccess(fileObj, serverData) { // if async-upload returned an error message, place it in the media item div and return if ( serverData.match('media-upload-error') ) { jQuery('#media-item-' + fileObj.id).html(serverData); return; } prepareMediaItem(fileObj, serverData); updateMediaForm(); // Increment the counter. if ( jQuery('#media-item-' + fileObj.id).hasClass('child-of-' + post_id) ) jQuery('#attachments-count').text(1 * jQuery('#attachments-count').text() + 1); } function uploadComplete(fileObj) { // If no more uploads queued, enable the submit button if ( swfu.getStats().files_queued == 0 ) jQuery('#insert-gallery').attr('disabled', ''); } // wp-specific error handlers // generic message function wpQueueError(message) { jQuery('#media-upload-error').show().text(message); } // file-specific message function wpFileError(fileObj, message) { jQuery('#media-item-' + fileObj.id + ' .filename').after('<div class="file-error"><button type="button" id="dismiss-' + fileObj.id + '" class="button dismiss">'+swfuploadL10n.dismiss+'</button>'+message+'</div>').siblings('.toggle').remove(); jQuery('#dismiss-' + fileObj.id).click(function(){jQuery(this).parents('.media-item').slideUp(200, function(){jQuery(this).remove();})}); } function fileQueueError(fileObj, error_code, message) { // Handle this error separately because we don't want to create a FileProgress element for it. if ( error_code == SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED ) { wpQueueError(swfuploadL10n.queue_limit_exceeded); } else if ( error_code == SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT ) { fileQueued(fileObj); wpFileError(fileObj, swfuploadL10n.file_exceeds_size_limit); } else if ( error_code == SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE ) { fileQueued(fileObj); wpFileError(fileObj, swfuploadL10n.zero_byte_file); } else if ( error_code == SWFUpload.QUEUE_ERROR.INVALID_FILETYPE ) { fileQueued(fileObj); wpFileError(fileObj, swfuploadL10n.invalid_filetype); } else { wpQueueError(swfuploadL10n.default_error); } } function fileDialogComplete(num_files_queued) { try { if (num_files_queued > 0) { this.startUpload(); } } catch (ex) { this.debug(ex); } } function uploadError(fileObj, error_code, message) { // first the file specific error if ( error_code == SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL ) { wpFileError(fileObj, swfuploadL10n.missing_upload_url); } else if ( error_code == SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED ) { wpFileError(fileObj, swfuploadL10n.upload_limit_exceeded); } else { wpFileError(fileObj, swfuploadL10n.default_error); } // now the general upload status if ( error_code == SWFUpload.UPLOAD_ERROR.HTTP_ERROR ) { wpQueueError(swfuploadL10n.http_error); } else if ( error_code == SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED ) { wpQueueError(swfuploadL10n.upload_failed); } else if ( error_code == SWFUpload.UPLOAD_ERROR.IO_ERROR ) { wpQueueError(swfuploadL10n.io_error); } else if ( error_code == SWFUpload.UPLOAD_ERROR.SECURITY_ERROR ) { wpQueueError(swfuploadL10n.security_error); } else if ( error_code == SWFUpload.UPLOAD_ERROR.FILE_CANCELLED ) { wpQueueError(swfuploadL10n.security_error); } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/swfupload/swfupload.js��������������������������������������������������������0000644�0001066�0001066�00000113071�11022164206�016413� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * SWFUpload v2.0 by Jacob Roberts, Nov 2007, http://www.swfupload.org, http://linebyline.blogspot.com * -------- -------- -------- -------- -------- -------- -------- -------- * SWFUpload is (c) 2006 Lars Huring and Mammon Media and is released under the MIT License: * http://www.opensource.org/licenses/mit-license.php * * See Changelog.txt for version history * * Development Notes: * * This version of SWFUpload requires Flash Player 9.0.28 and should autodetect the correct flash version. * * In Linux Flash Player 9 setting the post file variable name does not work. It is always set to "Filedata". * * There is a lot of repeated code that could be refactored to single functions. Feel free. * * It's dangerous to do "circular calls" between Flash and JavaScript. I've taken steps to try to work around issues * by having the event calls pipe through setTimeout. However you should still avoid calling in to Flash from * within the event handler methods. Especially the "startUpload" event since it cannot use the setTimeout hack. */ /* *********** */ /* Constructor */ /* *********** */ var SWFUpload = function (init_settings) { this.initSWFUpload(init_settings); }; SWFUpload.prototype.initSWFUpload = function (init_settings) { // Remove background flicker in IE (read this: http://misterpixel.blogspot.com/2006/09/forensic-analysis-of-ie6.html) // This doesn't have anything to do with SWFUpload but can help your UI behave better in IE. try { document.execCommand('BackgroundImageCache', false, true); } catch (ex1) { } try { this.customSettings = {}; // A container where developers can place their own settings associated with this instance. this.settings = {}; this.eventQueue = []; this.movieName = "SWFUpload_" + SWFUpload.movieCount++; this.movieElement = null; // Setup global control tracking SWFUpload.instances[this.movieName] = this; // Load the settings. Load the Flash movie. this.initSettings(init_settings); this.loadFlash(); this.displayDebugInfo(); } catch (ex2) { this.debug(ex2); } } /* *************** */ /* Static thingies */ /* *************** */ SWFUpload.instances = {}; SWFUpload.movieCount = 0; SWFUpload.QUEUE_ERROR = { QUEUE_LIMIT_EXCEEDED : -100, FILE_EXCEEDS_SIZE_LIMIT : -110, ZERO_BYTE_FILE : -120, INVALID_FILETYPE : -130 }; SWFUpload.UPLOAD_ERROR = { HTTP_ERROR : -200, MISSING_UPLOAD_URL : -210, IO_ERROR : -220, SECURITY_ERROR : -230, UPLOAD_LIMIT_EXCEEDED : -240, UPLOAD_FAILED : -250, SPECIFIED_FILE_ID_NOT_FOUND : -260, FILE_VALIDATION_FAILED : -270, FILE_CANCELLED : -280, UPLOAD_STOPPED : -290 }; SWFUpload.FILE_STATUS = { QUEUED : -1, IN_PROGRESS : -2, ERROR : -3, COMPLETE : -4, CANCELLED : -5 }; /* ***************** */ /* Instance Thingies */ /* ***************** */ // init is a private method that ensures that all the object settings are set, getting a default value if one was not assigned. SWFUpload.prototype.initSettings = function (init_settings) { // Upload backend settings this.addSetting("upload_url", init_settings.upload_url, ""); this.addSetting("file_post_name", init_settings.file_post_name, "Filedata"); this.addSetting("post_params", init_settings.post_params, {}); // File Settings this.addSetting("file_types", init_settings.file_types, "*.*"); this.addSetting("file_types_description", init_settings.file_types_description, "All Files"); this.addSetting("file_size_limit", init_settings.file_size_limit, "1024"); this.addSetting("file_upload_limit", init_settings.file_upload_limit, "0"); this.addSetting("file_queue_limit", init_settings.file_queue_limit, "0"); // Flash Settings this.addSetting("flash_url", init_settings.flash_url, "swfupload.swf"); this.addSetting("flash_width", init_settings.flash_width, "1px"); this.addSetting("flash_height", init_settings.flash_height, "1px"); this.addSetting("flash_color", init_settings.flash_color, "#FFFFFF"); // Debug Settings this.addSetting("debug_enabled", init_settings.debug, false); // Event Handlers this.flashReady_handler = SWFUpload.flashReady; // This is a non-overrideable event handler this.swfUploadLoaded_handler = this.retrieveSetting(init_settings.swfupload_loaded_handler, SWFUpload.swfUploadLoaded); this.fileDialogStart_handler = this.retrieveSetting(init_settings.file_dialog_start_handler, SWFUpload.fileDialogStart); this.fileQueued_handler = this.retrieveSetting(init_settings.file_queued_handler, SWFUpload.fileQueued); this.fileQueueError_handler = this.retrieveSetting(init_settings.file_queue_error_handler, SWFUpload.fileQueueError); this.fileDialogComplete_handler = this.retrieveSetting(init_settings.file_dialog_complete_handler, SWFUpload.fileDialogComplete); this.uploadStart_handler = this.retrieveSetting(init_settings.upload_start_handler, SWFUpload.uploadStart); this.uploadProgress_handler = this.retrieveSetting(init_settings.upload_progress_handler, SWFUpload.uploadProgress); this.uploadError_handler = this.retrieveSetting(init_settings.upload_error_handler, SWFUpload.uploadError); this.uploadSuccess_handler = this.retrieveSetting(init_settings.upload_success_handler, SWFUpload.uploadSuccess); this.uploadComplete_handler = this.retrieveSetting(init_settings.upload_complete_handler, SWFUpload.uploadComplete); this.debug_handler = this.retrieveSetting(init_settings.debug_handler, SWFUpload.debug); // Other settings this.customSettings = this.retrieveSetting(init_settings.custom_settings, {}); }; // loadFlash is a private method that generates the HTML tag for the Flash // It then adds the flash to the "target" or to the body and stores a // reference to the flash element in "movieElement". SWFUpload.prototype.loadFlash = function () { var html, target_element, container; // Make sure an element with the ID we are going to use doesn't already exist if (document.getElementById(this.movieName) !== null) { return false; } // Get the body tag where we will be adding the flash movie try { target_element = document.getElementsByTagName("body")[0]; if (typeof(target_element) === "undefined" || target_element === null) { this.debug('Could not find the BODY element. SWFUpload failed to load.'); return false; } } catch (ex) { return false; } // Append the container and load the flash container = document.createElement("div"); container.style.width = this.getSetting("flash_width"); container.style.height = this.getSetting("flash_height"); target_element.appendChild(container); container.innerHTML = this.getFlashHTML(); // Using innerHTML is non-standard but the only sensible way to dynamically add Flash in IE (and maybe other browsers) }; // Generates the embed/object tags needed to embed the flash in to the document SWFUpload.prototype.getFlashHTML = function () { var html = ""; // Create Mozilla Embed HTML if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // Build the basic embed html html = '<embed type="application/x-shockwave-flash" src="' + this.getSetting("flash_url") + '" width="' + this.getSetting("flash_width") + '" height="' + this.getSetting("flash_height") + '"'; html += ' id="' + this.movieName + '" name="' + this.movieName + '" '; html += 'bgcolor="' + this.getSetting("flash_color") + '" quality="high" menu="false" flashvars="'; html += this.getFlashVars(); html += '" />'; // Create IE Object HTML } else { // Build the basic Object tag html = '<object id="' + this.movieName + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + this.getSetting("flash_width") + '" height="' + this.getSetting("flash_height") + '">'; html += '<param name="movie" value="' + this.getSetting("flash_url") + '">'; html += '<param name="bgcolor" value="' + this.getSetting("flash_color") + '" />'; html += '<param name="quality" value="high" />'; html += '<param name="menu" value="false" />'; html += '<param name="flashvars" value="' + this.getFlashVars() + '" />'; html += '</object>'; } return html; }; // This private method builds the parameter string that will be passed // to flash. SWFUpload.prototype.getFlashVars = function () { // Build a string from the post param object var param_string = this.buildParamString(); // Build the parameter string var html = ""; html += "movieName=" + encodeURIComponent(this.movieName); html += "&uploadURL=" + encodeURIComponent(this.getSetting("upload_url")); html += "¶ms=" + encodeURIComponent(param_string); html += "&filePostName=" + encodeURIComponent(this.getSetting("file_post_name")); html += "&fileTypes=" + encodeURIComponent(this.getSetting("file_types")); html += "&fileTypesDescription=" + encodeURIComponent(this.getSetting("file_types_description")); html += "&fileSizeLimit=" + encodeURIComponent(this.getSetting("file_size_limit")); html += "&fileUploadLimit=" + encodeURIComponent(this.getSetting("file_upload_limit")); html += "&fileQueueLimit=" + encodeURIComponent(this.getSetting("file_queue_limit")); html += "&debugEnabled=" + encodeURIComponent(this.getSetting("debug_enabled")); return html; }; SWFUpload.prototype.getMovieElement = function () { if (typeof(this.movieElement) === "undefined" || this.movieElement === null) { this.movieElement = document.getElementById(this.movieName); // Fix IEs "Flash can't callback when in a form" issue (http://www.extremefx.com.ar/blog/fixing-flash-external-interface-inside-form-on-internet-explorer) // Removed because Revision 6 always adds the flash to the body (inside a containing div) // If you insist on adding the Flash file inside a Form then in IE you have to make you wait until the DOM is ready // and run this code to make the form's ID available from the window object so Flash and JavaScript can communicate. //if (typeof(window[this.movieName]) === "undefined" || window[this.moveName] !== this.movieElement) { // window[this.movieName] = this.movieElement; //} } return this.movieElement; }; SWFUpload.prototype.buildParamString = function () { var post_params = this.getSetting("post_params"); var param_string_pairs = []; var i, value, name; // Retrieve the user defined parameters if (typeof(post_params) === "object") { for (name in post_params) { if (post_params.hasOwnProperty(name)) { if (typeof(post_params[name]) === "string") { param_string_pairs.push(encodeURIComponent(name) + "=" + encodeURIComponent(post_params[name])); } } } } return param_string_pairs.join("&"); }; // Saves a setting. If the value given is undefined or null then the default_value is used. SWFUpload.prototype.addSetting = function (name, value, default_value) { if (typeof(value) === "undefined" || value === null) { this.settings[name] = default_value; } else { this.settings[name] = value; } return this.settings[name]; }; // Gets a setting. Returns empty string if not found. SWFUpload.prototype.getSetting = function (name) { if (typeof(this.settings[name]) === "undefined") { return ""; } else { return this.settings[name]; } }; // Gets a setting, if the setting is undefined then return the default value // This does not affect or use the interal setting object. SWFUpload.prototype.retrieveSetting = function (value, default_value) { if (typeof(value) === "undefined" || value === null) { return default_value; } else { return value; } }; // It loops through all the settings and displays // them in the debug Console. SWFUpload.prototype.displayDebugInfo = function () { var key, debug_message = ""; debug_message += "----- SWFUPLOAD SETTINGS ----\nID: " + this.moveName + "\n"; debug_message += this.outputObject(this.settings); debug_message += "----- SWFUPLOAD SETTINGS END ----\n"; debug_message += "\n"; this.debug(debug_message); }; SWFUpload.prototype.outputObject = function (object, prefix) { var output = "", key; if (typeof(prefix) !== "string") { prefix = ""; } if (typeof(object) !== "object") { return ""; } for (key in object) { if (object.hasOwnProperty(key)) { if (typeof(object[key]) === "object") { output += (prefix + key + ": { \n" + this.outputObject(object[key], "\t" + prefix) + prefix + "}" + "\n"); } else { output += (prefix + key + ": " + object[key] + "\n"); } } } return output; }; /* ***************************** -- Flash control methods -- Your UI should use these to operate SWFUpload ***************************** */ SWFUpload.prototype.selectFile = function () { var movie_element = this.getMovieElement(); if (movie_element !== null && typeof(movie_element.SelectFile) === "function") { try { movie_element.SelectFile(); } catch (ex) { this.debug("Could not call SelectFile: " + ex); } } else { this.debug("Could not find Flash element"); } }; SWFUpload.prototype.selectFiles = function () { var movie_element = this.getMovieElement(); if (movie_element !== null && typeof(movie_element.SelectFiles) === "function") { try { movie_element.SelectFiles(); } catch (ex) { this.debug("Could not call SelectFiles: " + ex); } } else { this.debug("Could not find Flash element"); } }; /* Start the upload. If a file_id is specified that file is uploaded. Otherwise the first * file in the queue is uploaded. If no files are in the queue then nothing happens. * This call uses setTimeout since Flash will be calling back in to JavaScript */ SWFUpload.prototype.startUpload = function (file_id) { var self = this; var movie_element = this.getMovieElement(); if (movie_element !== null && typeof(movie_element.StartUpload) === "function") { setTimeout( function () { try { movie_element.StartUpload(file_id); } catch (ex) { self.debug("Could not call StartUpload: " + ex); } }, 0 ); } else { this.debug("Could not find Flash element"); } }; /* Cancels a the file upload. You must specify a file_id */ SWFUpload.prototype.cancelUpload = function (file_id) { var movie_element = this.getMovieElement(); if (movie_element !== null && typeof(movie_element.CancelUpload) === "function") { try { movie_element.CancelUpload(file_id); } catch (ex) { this.debug("Could not call CancelUpload: " + ex); } } else { this.debug("Could not find Flash element"); } }; // Stops the current upload. The file is re-queued. If nothing is currently uploading then nothing happens. SWFUpload.prototype.stopUpload = function () { var movie_element = this.getMovieElement(); if (movie_element !== null && typeof(movie_element.StopUpload) === "function") { try { movie_element.StopUpload(); } catch (ex) { this.debug("Could not call StopUpload: " + ex); } } else { this.debug("Could not find Flash element"); } }; /* ************************ * Settings methods * These methods change the settings inside SWFUpload * They shouldn't need to be called in a setTimeout since they * should not call back from Flash to JavaScript (except perhaps in a Debug call) * and some need to return data so setTimeout won't work. */ /* Gets the file statistics object. It looks like this (where n = number): { files_queued: n, complete_uploads: n, upload_errors: n, uploads_cancelled: n, queue_errors: n } */ SWFUpload.prototype.getStats = function () { var movie_element = this.getMovieElement(); if (movie_element !== null && typeof(movie_element.GetStats) === "function") { try { return movie_element.GetStats(); } catch (ex) { this.debug("Could not call GetStats"); } } else { this.debug("Could not find Flash element"); } }; SWFUpload.prototype.setStats = function (stats_object) { var movie_element = this.getMovieElement(); if (movie_element !== null && typeof(movie_element.SetStats) === "function") { try { movie_element.SetStats(stats_object); } catch (ex) { this.debug("Could not call SetStats"); } } else { this.debug("Could not find Flash element"); } }; SWFUpload.prototype.setCredentials = function(name, password) { var movie_element = this.getMovieElement(); if (movie_element !== null && typeof(movie_element.SetCredentials) === "function") { try { return movie_element.SetCredentials(name, password); } catch (ex) { this.debug("Could not call SetCredentials"); } } else { this.debug("Could not find Flash element"); } }; SWFUpload.prototype.getFile = function (file_id) { var movie_element = this.getMovieElement(); if (typeof(file_id) === "number") { if (movie_element !== null && typeof(movie_element.GetFileByIndex) === "function") { try { return movie_element.GetFileByIndex(file_id); } catch (ex) { this.debug("Could not call GetFileByIndex"); } } else { this.debug("Could not find Flash element"); } } else { if (movie_element !== null && typeof(movie_element.GetFile) === "function") { try { return movie_element.GetFile(file_id); } catch (ex) { this.debug("Could not call GetFile"); } } else { this.debug("Could not find Flash element"); } } }; SWFUpload.prototype.addFileParam = function (file_id, name, value) { var movie_element = this.getMovieElement(); if (movie_element !== null && typeof(movie_element.AddFileParam) === "function") { try { return movie_element.AddFileParam(file_id, name, value); } catch (ex) { this.debug("Could not call AddFileParam"); } } else { this.debug("Could not find Flash element"); } }; SWFUpload.prototype.removeFileParam = function (file_id, name) { var movie_element = this.getMovieElement(); if (movie_element !== null && typeof(movie_element.RemoveFileParam) === "function") { try { return movie_element.RemoveFileParam(file_id, name); } catch (ex) { this.debug("Could not call AddFileParam"); } } else { this.debug("Could not find Flash element"); } }; SWFUpload.prototype.setUploadURL = function (url) { var movie_element = this.getMovieElement(); if (movie_element !== null && typeof(movie_element.SetUploadURL) === "function") { try { this.addSetting("upload_url", url); movie_element.SetUploadURL(this.getSetting("upload_url")); } catch (ex) { this.debug("Could not call SetUploadURL"); } } else { this.debug("Could not find Flash element in setUploadURL"); } }; SWFUpload.prototype.setPostParams = function (param_object) { var movie_element = this.getMovieElement(); if (movie_element !== null && typeof(movie_element.SetPostParams) === "function") { try { this.addSetting("post_params", param_object); movie_element.SetPostParams(this.getSetting("post_params")); } catch (ex) { this.debug("Could not call SetPostParams"); } } else { this.debug("Could not find Flash element in SetPostParams"); } }; SWFUpload.prototype.setFileTypes = function (types, description) { var movie_element = this.getMovieElement(); if (movie_element !== null && typeof(movie_element.SetFileTypes) === "function") { try { this.addSetting("file_types", types); this.addSetting("file_types_description", description); movie_element.SetFileTypes(this.getSetting("file_types"), this.getSetting("file_types_description")); } catch (ex) { this.debug("Could not call SetFileTypes"); } } else { this.debug("Could not find Flash element in SetFileTypes"); } }; SWFUpload.prototype.setFileSizeLimit = function (file_size_limit) { var movie_element = this.getMovieElement(); if (movie_element !== null && typeof(movie_element.SetFileSizeLimit) === "function") { try { this.addSetting("file_size_limit", file_size_limit); movie_element.SetFileSizeLimit(this.getSetting("file_size_limit")); } catch (ex) { this.debug("Could not call SetFileSizeLimit"); } } else { this.debug("Could not find Flash element in SetFileSizeLimit"); } }; SWFUpload.prototype.setFileUploadLimit = function (file_upload_limit) { var movie_element = this.getMovieElement(); if (movie_element !== null && typeof(movie_element.SetFileUploadLimit) === "function") { try { this.addSetting("file_upload_limit", file_upload_limit); movie_element.SetFileUploadLimit(this.getSetting("file_upload_limit")); } catch (ex) { this.debug("Could not call SetFileUploadLimit"); } } else { this.debug("Could not find Flash element in SetFileUploadLimit"); } }; SWFUpload.prototype.setFileQueueLimit = function (file_queue_limit) { var movie_element = this.getMovieElement(); if (movie_element !== null && typeof(movie_element.SetFileQueueLimit) === "function") { try { this.addSetting("file_queue_limit", file_queue_limit); movie_element.SetFileQueueLimit(this.getSetting("file_queue_limit")); } catch (ex) { this.debug("Could not call SetFileQueueLimit"); } } else { this.debug("Could not find Flash element in SetFileQueueLimit"); } }; SWFUpload.prototype.setFilePostName = function (file_post_name) { var movie_element = this.getMovieElement(); if (movie_element !== null && typeof(movie_element.SetFilePostName) === "function") { try { this.addSetting("file_post_name", file_post_name); movie_element.SetFilePostName(this.getSetting("file_post_name")); } catch (ex) { this.debug("Could not call SetFilePostName"); } } else { this.debug("Could not find Flash element in SetFilePostName"); } }; SWFUpload.prototype.setDebugEnabled = function (debug_enabled) { var movie_element = this.getMovieElement(); if (movie_element !== null && typeof(movie_element.SetDebugEnabled) === "function") { try { this.addSetting("debug_enabled", debug_enabled); movie_element.SetDebugEnabled(this.getSetting("debug_enabled")); } catch (ex) { this.debug("Could not call SetDebugEnabled"); } } else { this.debug("Could not find Flash element in SetDebugEnabled"); } }; /* ******************************* Internal Event Callers Don't override these! These event callers ensure that your custom event handlers are called safely and in order. ******************************* */ /* This is the callback method that the Flash movie will call when it has been loaded and is ready to go. Calling this or showUI() "manually" will bypass the Flash Detection built in to SWFUpload. Use a ui_function setting if you want to control the UI loading after the flash has loaded. */ SWFUpload.prototype.flashReady = function () { // Check that the movie element is loaded correctly with its ExternalInterface methods defined var movie_element = this.getMovieElement(); if (movie_element === null || typeof(movie_element.StartUpload) !== "function") { this.debug("ExternalInterface methods failed to initialize."); return; } var self = this; if (typeof(self.flashReady_handler) === "function") { this.eventQueue[this.eventQueue.length] = function() { self.flashReady_handler(); }; setTimeout(function () { self.executeNextEvent();}, 0); } else { this.debug("flashReady_handler event not defined"); } }; /* Event Queue. Rather can call events directly from Flash they events are are placed in a queue and then executed. This ensures that each event is executed in the order it was called which is not guarenteed when calling setTimeout. Out of order events was especially problematic in Safari. */ SWFUpload.prototype.executeNextEvent = function () { var f = this.eventQueue.shift(); if (typeof(f) === "function") { f(); } } /* This is a chance to do something before the browse window opens */ SWFUpload.prototype.fileDialogStart = function () { var self = this; if (typeof(self.fileDialogStart_handler) === "function") { this.eventQueue[this.eventQueue.length] = function() { self.fileDialogStart_handler(); }; setTimeout(function () { self.executeNextEvent();}, 0); } else { this.debug("fileDialogStart event not defined"); } }; /* Called when a file is successfully added to the queue. */ SWFUpload.prototype.fileQueued = function (file) { var self = this; if (typeof(self.fileQueued_handler) === "function") { this.eventQueue[this.eventQueue.length] = function() { self.fileQueued_handler(file); }; setTimeout(function () { self.executeNextEvent();}, 0); } else { this.debug("fileQueued event not defined"); } }; /* Handle errors that occur when an attempt to queue a file fails. */ SWFUpload.prototype.fileQueueError = function (file, error_code, message) { var self = this; if (typeof(self.fileQueueError_handler) === "function") { this.eventQueue[this.eventQueue.length] = function() { self.fileQueueError_handler(file, error_code, message); }; setTimeout(function () { self.executeNextEvent();}, 0); } else { this.debug("fileQueueError event not defined"); } }; /* Called after the file dialog has closed and the selected files have been queued. You could call startUpload here if you want the queued files to begin uploading immediately. */ SWFUpload.prototype.fileDialogComplete = function (num_files_selected) { var self = this; if (typeof(self.fileDialogComplete_handler) === "function") { this.eventQueue[this.eventQueue.length] = function() { self.fileDialogComplete_handler(num_files_selected); }; setTimeout(function () { self.executeNextEvent();}, 0); } else { this.debug("fileDialogComplete event not defined"); } }; /* Gets called when a file upload is about to be started. Return true to continue the upload. Return false to stop the upload. If you return false then uploadError and uploadComplete are called (like normal). This is a good place to do any file validation you need. */ SWFUpload.prototype.uploadStart = function (file) { var self = this; if (typeof(self.fileDialogComplete_handler) === "function") { this.eventQueue[this.eventQueue.length] = function() { self.returnUploadStart(self.uploadStart_handler(file)); }; setTimeout(function () { self.executeNextEvent();}, 0); } else { this.debug("uploadStart event not defined"); } }; /* Note: Internal use only. This function returns the result of uploadStart to flash. Since returning values in the normal way can result in Flash/JS circular call issues we split up the call in a Timeout. This is transparent from the API point of view. */ SWFUpload.prototype.returnUploadStart = function (return_value) { var movie_element = this.getMovieElement(); if (movie_element !== null && typeof(movie_element.ReturnUploadStart) === "function") { try { movie_element.ReturnUploadStart(return_value); } catch (ex) { this.debug("Could not call ReturnUploadStart"); } } else { this.debug("Could not find Flash element in returnUploadStart"); } }; /* Called during upload as the file progresses. Use this event to update your UI. */ SWFUpload.prototype.uploadProgress = function (file, bytes_complete, bytes_total) { var self = this; if (typeof(self.uploadProgress_handler) === "function") { this.eventQueue[this.eventQueue.length] = function() { self.uploadProgress_handler(file, bytes_complete, bytes_total); }; setTimeout(function () { self.executeNextEvent();}, 0); } else { this.debug("uploadProgress event not defined"); } }; /* Called when an error occurs during an upload. Use error_code and the SWFUpload.UPLOAD_ERROR constants to determine which error occurred. The uploadComplete event is called after an error code indicating that the next file is ready for upload. For files cancelled out of order the uploadComplete event will not be called. */ SWFUpload.prototype.uploadError = function (file, error_code, message) { var self = this; if (typeof(this.uploadError_handler) === "function") { this.eventQueue[this.eventQueue.length] = function() { self.uploadError_handler(file, error_code, message); }; setTimeout(function () { self.executeNextEvent();}, 0); } else { this.debug("uploadError event not defined"); } }; /* This gets called when a file finishes uploading and the server-side upload script has completed and returned a 200 status code. Any text returned by the server is available in server_data. **NOTE: The upload script MUST return some text or the uploadSuccess and uploadComplete events will not fire and the upload will become 'stuck'. */ SWFUpload.prototype.uploadSuccess = function (file, server_data) { var self = this; if (typeof(self.uploadSuccess_handler) === "function") { this.eventQueue[this.eventQueue.length] = function() { self.uploadSuccess_handler(file, server_data); }; setTimeout(function () { self.executeNextEvent();}, 0); } else { this.debug("uploadSuccess event not defined"); } }; /* uploadComplete is called when the file is uploaded or an error occurred and SWFUpload is ready to make the next upload. If you want the next upload to start to automatically you can call startUpload() from this event. */ SWFUpload.prototype.uploadComplete = function (file) { var self = this; if (typeof(self.uploadComplete_handler) === "function") { this.eventQueue[this.eventQueue.length] = function() { self.uploadComplete_handler(file); }; setTimeout(function () { self.executeNextEvent();}, 0); } else { this.debug("uploadComplete event not defined"); } }; /* Called by SWFUpload JavaScript and Flash functions when debug is enabled. By default it writes messages to the internal debug console. You can override this event and have messages written where you want. */ SWFUpload.prototype.debug = function (message) { var self = this; if (typeof(self.debug_handler) === "function") { this.eventQueue[this.eventQueue.length] = function() { self.debug_handler(message); }; setTimeout(function () { self.executeNextEvent();}, 0); } else { this.eventQueue[this.eventQueue.length] = function() { self.debugMessage(message); }; setTimeout(function () { self.executeNextEvent();}, 0); } }; /* ********************************** Default Event Handlers. These event handlers are used by default if an overriding handler is not defined in the SWFUpload settings object. JS Note: even though these are defined on the SWFUpload object (rather than the prototype) they are attached (read: copied) to a SWFUpload instance and 'this' is given the proper context. ********************************** */ /* This is a special event handler that has no override in the settings. Flash calls this when it has been loaded by the browser and is ready for interaction. You should not override it. If you need to do something with SWFUpload has loaded then use the swfupload_loaded_handler setting. */ SWFUpload.flashReady = function () { try { this.debug("Flash called back and is ready."); if (typeof(this.swfUploadLoaded_handler) === "function") { this.swfUploadLoaded_handler(); } } catch (ex) { this.debug(ex); } }; /* This is a chance to something immediately after SWFUpload has loaded. Like, hide the default/degraded upload form and display the SWFUpload form. */ SWFUpload.swfUploadLoaded = function () { }; /* This is a chance to do something before the browse window opens */ SWFUpload.fileDialogStart = function () { }; /* Called when a file is successfully added to the queue. */ SWFUpload.fileQueued = function (file) { }; /* Handle errors that occur when an attempt to queue a file fails. */ SWFUpload.fileQueueError = function (file, error_code, message) { try { switch (error_code) { case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT: this.debug("Error Code: File too big, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); break; case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE: this.debug("Error Code: Zero Byte File, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); break; case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED: this.debug("Error Code: Upload limit reached, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); break; case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE: this.debug("Error Code: File extension is not allowed, Message: " + message); break; default: this.debug("Error Code: Unhandled error occured. Errorcode: " + error_code); } } catch (ex) { this.debug(ex); } }; /* Called after the file dialog has closed and the selected files have been queued. You could call startUpload here if you want the queued files to begin uploading immediately. */ SWFUpload.fileDialogComplete = function (num_files_selected) { }; /* Gets called when a file upload is about to be started. Return true to continue the upload. Return false to stop the upload. If you return false then the uploadError callback is called and then uploadComplete (like normal). This is a good place to do any file validation you need. This is the only function that cannot be called on a setTimeout because it must return a value to Flash. You SHOULD NOT make any calls in to Flash (e.i, changing settings, getting stats, etc). Flash Player bugs prevent calls in to Flash from working reliably. */ SWFUpload.uploadStart = function (file) { return true; }; // Called during upload as the file progresses SWFUpload.uploadProgress = function (file, bytes_complete, bytes_total) { this.debug("File Progress: " + file.id + ", Bytes: " + bytes_complete + ". Total: " + bytes_total); }; /* This gets called when a file finishes uploading and the upload script has completed and returned a 200 status code. Any text returned by the server is available in server_data. The upload script must return some text or uploadSuccess will not fire (neither will uploadComplete). */ SWFUpload.uploadSuccess = function (file, server_data) { this.debug("Upload Success: " + file.id + ", Server: " + server_data); }; /* This is called last. The file is uploaded or an error occurred and SWFUpload is ready to make the next upload. If you want to automatically start the next file just call startUpload from here. */ SWFUpload.uploadComplete = function (file) { this.debug("Upload Complete: " + file.id); }; // Called by SWFUpload JavaScript and Flash functions when debug is enabled. // Override this method in your settings to call your own debug message handler SWFUpload.debug = function (message) { if (this.getSetting("debug_enabled")) { this.debugMessage(message); } }; /* Called when an upload occurs during upload. For HTTP errors 'message' will contain the HTTP STATUS CODE */ SWFUpload.uploadError = function (file, errcode, msg) { try { switch (errcode) { case SWFUpload.UPLOAD_ERROR.SPECIFIED_FILE_ID_NOT_FOUND: this.debug("Error Code: File ID specified for upload was not found, Message: " + msg); break; case SWFUpload.UPLOAD_ERROR.HTTP_ERROR: this.debug("Error Code: HTTP Error, File name: " + file.name + ", Message: " + msg); break; case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL: this.debug("Error Code: No backend file, File name: " + file.name + ", Message: " + msg); break; case SWFUpload.UPLOAD_ERROR.IO_ERROR: this.debug("Error Code: IO Error, File name: " + file.name + ", Message: " + msg); break; case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR: this.debug("Error Code: Security Error, File name: " + file.name + ", Message: " + msg); break; case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED: this.debug("Error Code: Upload limit reached, File name: " + file.name + ", File size: " + file.size + ", Message: " + msg); break; case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED: this.debug("Error Code: Upload Initialization exception, File name: " + file.name + ", File size: " + file.size + ", Message: " + msg); break; case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED: this.debug("Error Code: uploadStart callback returned false, File name: " + file.name + ", File size: " + file.size + ", Message: " + msg); break; case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED: this.debug("Error Code: The file upload was cancelled, File name: " + file.name + ", File size: " + file.size + ", Message: " + msg); break; case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED: this.debug("Error Code: The file upload was stopped, File name: " + file.name + ", File size: " + file.size + ", Message: " + msg); break; default: this.debug("Error Code: Unhandled error occured. Errorcode: " + errcode); } } catch (ex) { this.debug(ex); } }; /* ********************************** Debug Console The debug console is a self contained, in page location for debug message to be sent. The Debug Console adds itself to the body if necessary. The console is automatically scrolled as messages appear. You can override this console (to use FireBug's console for instance) by setting the debug event method to your own function that handles the debug message ********************************** */ SWFUpload.prototype.debugMessage = function (message) { var exception_message, exception_values; if (typeof(message) === "object" && typeof(message.name) === "string" && typeof(message.message) === "string") { exception_message = ""; exception_values = []; for (var key in message) { exception_values.push(key + ": " + message[key]); } exception_message = exception_values.join("\n"); exception_values = exception_message.split("\n"); exception_message = "EXCEPTION: " + exception_values.join("\nEXCEPTION: "); SWFUpload.Console.writeLine(exception_message); } else { SWFUpload.Console.writeLine(message); } }; SWFUpload.Console = {}; SWFUpload.Console.writeLine = function (message) { var console, documentForm; try { console = document.getElementById("SWFUpload_Console"); if (!console) { documentForm = document.createElement("form"); document.getElementsByTagName("body")[0].appendChild(documentForm); console = document.createElement("textarea"); console.id = "SWFUpload_Console"; console.style.fontFamily = "monospace"; console.setAttribute("wrap", "off"); console.wrap = "off"; console.style.overflow = "auto"; console.style.width = "700px"; console.style.height = "350px"; console.style.margin = "5px"; documentForm.appendChild(console); } console.value += message + "\n"; console.scrollTop = console.scrollHeight - console.clientHeight; } catch (ex) { alert("Exception: " + ex.name + " Message: " + ex.message); } }; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/swfupload/plugins/������������������������������������������������������������0000755�0001066�0001066�00000000000�11051167751�015541� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js���������������������������0000644�0001066�0001066�00000005117�11022164206�024225� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* SWFUpload Graceful Degradation Plug-in This plugin allows SWFUpload to display only if it is loaded successfully. Otherwise a default form is left displayed. Usage: To use this plugin create two HTML containers. Each should have an ID defined. One container should hold the SWFUpload UI. The other should hold the degraded UI. The SWFUpload container should have its CSS "display" property set to "none". If SWFUpload loads successfully the SWFUpload container will be displayed ("display" set to "block") and the degraded container will be hidden ("display" set to "none"). Use the settings "swfupload_element_id" and "degraded_element_id" to indicate your container IDs. The default values are "swfupload_container" and "degraded_container". */ var SWFUpload; if (typeof(SWFUpload) === "function") { SWFUpload.gracefulDegradation = {}; SWFUpload.prototype.initSettings = function (old_initSettings) { return function (init_settings) { if (typeof(old_initSettings) === "function") { old_initSettings.call(this, init_settings); } this.addSetting("swfupload_element_id", init_settings.swfupload_element_id, "swfupload_container"); this.addSetting("degraded_element_id", init_settings.degraded_element_id, "degraded_container"); this.addSetting("user_swfUploadLoaded_handler", init_settings.swfupload_loaded_handler, SWFUpload.swfUploadLoaded); this.swfUploadLoaded_handler = SWFUpload.gracefulDegradation.swfUploadLoaded; }; }(SWFUpload.prototype.initSettings); SWFUpload.gracefulDegradation.swfUploadLoaded = function () { var swfupload_container_id, swfupload_container, degraded_container_id, degraded_container, user_swfUploadLoaded_handler; try { if (uploadDegradeOptions.is_lighttpd_before_150) throw "Lighttpd versions earlier than 1.5.0 aren't supported!"; swfupload_element_id = this.getSetting("swfupload_element_id"); degraded_element_id = this.getSetting("degraded_element_id"); // Show the UI container swfupload_container = document.getElementById(swfupload_element_id); if (swfupload_container !== null) { swfupload_container.style.display = "block"; // Now take care of hiding the degraded UI degraded_container = document.getElementById(degraded_element_id); if (degraded_container !== null) { degraded_container.style.display = "none"; } } } catch (ex) { this.debug(ex); } user_swfUploadLoaded_handler = this.getSetting("user_swfUploadLoaded_handler"); if (typeof(user_swfUploadLoaded_handler) === "function") { user_swfUploadLoaded_handler.apply(this); } }; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/swfupload/plugins/swfupload.queue.js������������������������������������������0000644�0001066�0001066�00000003371�11022164206�021220� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Queue Plug-in Features: cancelQueue method for cancelling the entire queue. All queued files are uploaded when startUpload() is called. If false is returned from uploadComplete then the queue upload is stopped. If false is not returned (strict comparison) then the queue upload is continued. */ var SWFUpload; if (typeof(SWFUpload) === "function") { SWFUpload.queue = {}; SWFUpload.prototype.initSettings = function (old_initSettings) { return function (init_settings) { if (typeof(old_initSettings) === "function") { old_initSettings.call(this, init_settings); } this.customSettings.queue_cancelled_flag = false; this.addSetting("user_upload_complete_handler", init_settings.upload_complete_handler, SWFUpload.uploadComplete); this.uploadComplete_handler = SWFUpload.queue.uploadComplete; }; }(SWFUpload.prototype.initSettings); SWFUpload.prototype.cancelQueue = function () { var stats = this.getStats(); this.customSettings.queue_cancelled_flag = false; if (stats.in_progress > 0) { this.customSettings.queue_cancelled_flag = true; } while(stats.files_queued > 0) { this.cancelUpload(); stats = this.getStats(); } }; SWFUpload.queue.uploadComplete = function (file) { var user_upload_complete_handler = this.getSetting("user_upload_complete_handler"); var continue_upload = true; if (typeof(user_upload_complete_handler) === "function") { continue_upload = (user_upload_complete_handler.call(this, file) === false) ? false : true; } if (continue_upload) { var stats = this.getStats(); if (stats.files_queued > 0 && this.customSettings.queue_cancelled_flag === false) { this.startUpload(); } else { this.customSettings.queue_cancelled_flag = false; } } }; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/swfupload/plugins/swfupload.documentready.js����������������������������������0000644�0001066�0001066�00000007152�11022164206�022740� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* DocumentReady Plug-in This plugin loads SWFUpload as soon as the document is ready. You should not load SWFUpload inside window.onload using this plugin. You can also chain other functions by calling SWFUpload.DocumentReady(your function). Warning: Embedded Ads or other scripts that overwrite window.onload or use their own document ready functions may interfer with this plugin. You should not set window.onload when using this plugin. Usage Example: var swfu = new SWFUpload(your settings object); SWFUpload.DocumentReady(function () { alert('Document Ready!'; }); */ var SWFUpload; if (typeof(SWFUpload) === "function") { // Override iniSWFUpload so SWFUpload gets inited when the document is ready rather than immediately SWFUpload.prototype.initSWFUpload = function (old_initSWFUpload) { return function (init_settings) { var self = this; if (typeof(old_initSWFUpload) === "function") { SWFUpload.DocumentReady(function () { old_initSWFUpload.call(self, init_settings); }); } } }(SWFUpload.prototype.initSWFUpload); // The DocumentReady function adds the passed in function to // the functions that will be executed when the document is ready/loaded SWFUpload.DocumentReady = function (fn) { // Add the function to the chain SWFUpload.DocumentReady.InternalOnloadChain = function (previous_link_fn) { return function () { if (typeof(previous_link_fn) === "function") { previous_link_fn(); } fn(); }; }(SWFUpload.DocumentReady.InternalOnloadChain); }; SWFUpload.DocumentReady.InternalOnloadChain = null; SWFUpload.DocumentReady.Onload = function () { // Execute the onload function chain if (typeof(SWFUpload.DocumentReady.InternalOnloadChain) === "function") { SWFUpload.DocumentReady.InternalOnloadChain(); } }; SWFUpload.DocumentReady.SetupComplete = false; /* ******************************************** This portion of the code gets executed as soon it is loaded. It binds the proper event for executing JavaScript is early as possible. This is a per browser function and so some browser sniffing is used. This solution still has the "exposed" issue (See the Global Delegation section at http://peter.michaux.ca/article/553 ) Base solution from http://dean.edwards.name/weblog/2006/06/again/ and http://dean.edwards.name/weblog/2005/09/busted/ ******************************************** */ if (!SWFUpload.DocumentReady.SetupComplete) { // for Internet Explorer (using conditional comments) /*@cc_on @*/ /*@if (@_win32) document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>"); var script = document.getElementById("__ie_onload"); script.onreadystatechange = function() { if (this.readyState == "complete") { SWFUpload.DocumentReady.Onload(); // call the onload handler } }; SWFUpload.DocumentReady.SetupComplete = true; /*@end @*/ } if (!SWFUpload.DocumentReady.SetupComplete && /WebKit/i.test(navigator.userAgent)) { // sniff var _timer = setInterval(function() { if (/loaded|complete/.test(document.readyState)) { clearInterval(_timer); SWFUpload.DocumentReady.Onload(); // call the onload handler } }, 10); SWFUpload.DocumentReady.SetupComplete = true; } /* for Mozilla */ if (!SWFUpload.DocumentReady.SetupComplete && document.addEventListener) { document.addEventListener("DOMContentLoaded", SWFUpload.DocumentReady.Onload, false); SWFUpload.DocumentReady.SetupComplete = true; } /* for other browsers */ if (!SWFUpload.DocumentReady.SetupComplete) { window.onload = SWFUpload.DocumentReady.Onload; SWFUpload.DocumentReady.SetupComplete = true; } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/swfupload/plugins/swfupload.cookies.js����������������������������������������0000644�0001066�0001066�00000003057�11022164206�021531� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Cookie Plug-in This plug in automatically gets all the cookies for this site and adds them to the post_params. Cookies are loaded only on initialization. The refreshCookies function can be called to update the post_params. The cookies will override any other post params with the same name. */ var SWFUpload; if (typeof(SWFUpload) === "function") { SWFUpload.prototype.initSettings = function (old_initSettings) { return function (init_settings) { if (typeof(old_initSettings) === "function") { old_initSettings.call(this, init_settings); } this.refreshCookies(false); // The false parameter must be sent since SWFUpload has not initialzed at this point }; }(SWFUpload.prototype.initSettings); // refreshes the post_params and updates SWFUpload. The send_to_flash parameters is optional and defaults to True SWFUpload.prototype.refreshCookies = function (send_to_flash) { if (send_to_flash !== false) send_to_flash = true; // Get the post_params object var post_params = this.getSetting("post_params"); // Get the cookies var i, cookie_array = document.cookie.split(';'), ca_length = cookie_array.length, c, eq_index, name, value; for(i = 0; i < ca_length; i++) { c = cookie_array[i]; // Left Trim spaces while (c.charAt(0) == " ") { c = c.substring(1, c.length); } eq_index = c.indexOf("="); if (eq_index > 0) { name = c.substring(0, eq_index); value = c.substring(eq_index+1); post_params[name] = value; } } if (send_to_flash) { this.setPostParams(post_params); } }; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/swfupload/swfupload_f9.swf����������������������������������������������������0000644�0001066�0001066�00000021625�11022164206�017177� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CWS C��xڥ| x׵=3$o0'0FIH%0`#i dтq$]҆[ں{ڴMtI> tM}-]9wf$%_9s=lwN/e�Ͽ1o�czP_X9:ڶ!Y(Luo<==<ܼkٵ):3z#_a`ЧT!(lmk"^b:U̥D|&L!yKp 2JĻlnR-lWҩJ6'COu˄4*=lLSiҥ jeAWlSxvrT.(Q&YɕST1NZn{1s86(c&Bv)9XTjCb Ղ}QtΫM1{sma�>oXxVI,3)r_Nj};#Z=Nj[يǐC{|~=s40="ܟH; ;oo<  =q Vb#TZoP;BF G`.{0Uv BrlN�ZKf(gO.θ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J $3'XDf2<c8]޺ObLʱI ?NLx'MȲ< P 5!_E̪..D uD*#f_H#vҒ;Җ1 o{5]*]YRI[`oJUhIi G]~x,<AȳtW%~Š˷E!3ў͜}R]ahbQQfې#T`lGW}teu=x}f?�&ղ2ƼRcU0%Q(tJ>BwS>lYԠasшEXD~Nd9'Ew6 dw% 19wl;.C_+\84bƪ |T4`rGB+̆ B`BenbzhNq\q\1k}ށRLHU{dpű=h`OA`'VD{<LP2]؊r\1'OH O^O%i/@*bk]qqr;<1d͛ F_5aP9[z({<]x3 \M? DAHez< uO5DҲYT7~%x 0F 9Ί Ž_W_{oЂݬNɼM|Q:=zJᦳ_O 2UIӴApm%uS:MoX7S+ߖfO�>̱p3sHQ(t9dny.`lxꓝvEjQv U,}'1mXb"wdzysZ9)'mr ̗!ŝs9HI_k O^(,]aۏQ떑b)ć}L�mՔM,^ ,ċ<"*,B~HH{-^ÜetNiHS;oI{֬L 25t1UȉMDsRw�%<bEU.P/.bG_U1 B܌د^@șhgL ",%�7vNtN;Glf"~$,CVA8.!zZ_PO@>hzDֿBnh}^@{J;9wz*bI)-&tbr:z%eɻ +ɜ!" Ν1TI ʨRlS=S)$1; }:#;*'9!A 9(�ŝf ʂ_19Qo[8<kƤ1ձIEN�wͫ/Z$:lD�KЕZAXB,ܑH=$x;fWc$:]ВAW!a~9x$\v0["Iqt &jXCYK);ZKC 4d'IK/8.>m 6 .L$2\xťNR ݹ x; s�OY'&!>$>MW{?a)ʸBpQvJ~#ѥ h[VV8,3{<s (܂~\")F_..*!'jJʆ8rΙ幔k~f-~˼K] @qH�����������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/jquery/�����������������������������������������������������������������������0000755�0001066�0001066�00000000000�11051167751�013373� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/jquery/ui.tabs.js�������������������������������������������������������������0000644�0001066�0001066�00000014062�11031241204�015261� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(4(A){A.39("8.3",{38:4(){2.c.v+=".3";2.1e(1c)},37:4(B,C){5((/^7/).1Z(B)){2.16(C)}n{2.c[B]=C;2.1e()}},i:4(){f 2.$3.i},1E:4(B){f B.24&&B.24.13(/\\s/g,"23").13(/[^A-36-35-9\\-23:\\.]/g,"")||2.c.1Q+A.e(B)},8:4(C,B){f{c:2.c,34:C,1M:B}},1e:4(O){2.$h=A("1i:33(a[o])",2.l);2.$3=2.$h.1s(4(){f A("a",2)[0]});2.$b=A([]);6 P=2,D=2.c;2.$3.V(4(R,Q){5(Q.u&&Q.u.13("#","")){P.$b=P.$b.1b(Q.u)}n{5(A(Q).12("o")!="#"){A.e(Q,"o.3",Q.o);A.e(Q,"q.3",Q.o);6 T=P.1E(Q);Q.o="#"+T;6 S=A("#"+T);5(!S.i){S=A(D.1x).12("1f",T).m(D.18).32(P.$b[R-1]||P.l);S.e("1a.3",1c)}P.$b=P.$b.1b(S)}n{D.d.1U(R+1)}}});5(O){2.l.m(D.1w);2.$b.V(4(){6 Q=A(2);Q.m(D.18)});5(D.7===1p){5(1J.u){2.$3.V(4(S,Q){5(Q.u==1J.u){D.7=S;5(A.W.1g||A.W.31){6 R=A(1J.u),T=R.12("1f");R.12("1f","");1z(4(){R.12("1f",T)},30)}2Z(0,0);f p}})}n{5(D.Y){6 J=2Y(A.Y("8-3"+A.e(P.l)),10);5(J&&P.$3[J]){D.7=J}}n{5(P.$h.z("."+D.k).i){D.7=P.$h.Z(P.$h.z("."+D.k)[0])}}}}D.7=D.7===j||D.7!==1p?D.7:0;D.d=A.2X(D.d.2W(A.1s(2.$h.z("."+D.U),4(R,Q){f P.$h.Z(R)}))).1T();5(A.1r(D.7,D.d)!=-1){D.d.2V(A.1r(D.7,D.d),1)}2.$b.m(D.w);2.$h.r(D.k);5(D.7!==j){2.$b.t(D.7).1G().r(D.w);2.$h.t(D.7).m(D.k);6 K=4(){A(P.l).y("20",[j,P.8(P.$3[D.7],P.$b[D.7])],D.1G)};5(A.e(2.$3[D.7],"q.3")){2.q(D.7,K)}n{K()}}A(2U).15("2T",4(){P.$3.14(".3");P.$h=P.$3=P.$b=j})}2S(6 G=0,N;N=2.$h[G];G++){A(N)[A.1r(G,D.d)!=-1&&!A(N).11(D.k)?"m":"r"](D.U)}5(D.x===p){2.$3.1m("x.3")}6 C,I,B={"2R-2Q":0,1I:1},E="2P";5(D.X&&D.X.2O==2N){C=D.X[0]||B,I=D.X[1]||B}n{C=I=D.X||B}6 H={1q:"",2M:"",2L:""};5(!A.W.1g){H.1H=""}4 M(R,Q,S){Q.22(C,C.1I||E,4(){Q.m(D.w).1d(H);5(A.W.1g&&C.1H){Q[0].21.z=""}5(S){L(R,S,Q)}})}4 L(R,S,Q){5(I===B){S.1d("1q","1D")}S.22(I,I.1I||E,4(){S.r(D.w).1d(H);5(A.W.1g&&I.1H){S[0].21.z=""}A(P.l).y("20",[j,P.8(R,S[0])],D.1G)})}4 F(R,T,Q,S){T.m(D.k).2K().r(D.k);M(R,Q,S)}2.$3.14(".3").15(D.v,4(){6 T=A(2).2J("1i:t(0)"),Q=P.$b.z(":2I"),S=A(2.u);5((T.11(D.k)&&!D.1h)||T.11(D.U)||A(2).11(D.17)||A(P.l).y("2H",[j,P.8(2,S[0])],D.16)===p){2.1t();f p}P.c.7=P.$3.Z(2);5(D.1h){5(T.11(D.k)){P.c.7=j;T.r(D.k);P.$b.1F();M(2,Q);2.1t();f p}n{5(!Q.i){P.$b.1F();6 R=2;P.q(P.$3.Z(2),4(){T.m(D.k).m(D.1v);L(R,S)});2.1t();f p}}}5(D.Y){A.Y("8-3"+A.e(P.l),P.c.7,D.Y)}P.$b.1F();5(S.i){6 R=2;P.q(P.$3.Z(2),Q.i?4(){F(R,T,Q,S)}:4(){T.m(D.k);L(R,S)})}n{2G"1K 2F 2E: 2D 2C 2B."}5(A.W.1g){2.1t()}f p});5(!(/^1y/).1Z(D.v)){2.$3.15("1y.3",4(){f p})}},1b:4(E,D,C){5(C==1p){C=2.$3.i}6 G=2.c;6 I=A(G.1P.13(/#\\{o\\}/g,E).13(/#\\{1j\\}/g,D));I.e("1a.3",1c);6 H=E.2A("#")==0?E.13("#",""):2.1E(A("a:2z-2y",I)[0]);6 F=A("#"+H);5(!F.i){F=A(G.1x).12("1f",H).m(G.w).e("1a.3",1c)}F.m(G.18);5(C>=2.$h.i){I.1Y(2.l);F.1Y(2.l[0].2x)}n{I.1X(2.$h[C]);F.1X(2.$b[C])}G.d=A.1s(G.d,4(K,J){f K>=C?++K:K});2.1e();5(2.$3.i==1){I.m(G.k);F.r(G.w);6 B=A.e(2.$3[0],"q.3");5(B){2.q(C,B)}}2.l.y("2w",[j,2.8(2.$3[C],2.$b[C])],G.1b)},19:4(B){6 D=2.c,E=2.$h.t(B).19(),C=2.$b.t(B).19();5(E.11(D.k)&&2.$3.i>1){2.16(B+(B+1<2.$3.i?1:-1))}D.d=A.1s(A.1W(D.d,4(G,F){f G!=B}),4(G,F){f G>=B?--G:G});2.1e();2.l.y("2v",[j,2.8(E.1C("a")[0],C[0])],D.19)},1V:4(B){6 C=2.c;5(A.1r(B,C.d)==-1){f}6 D=2.$h.t(B).r(C.U);5(A.W.2u){D.1d("1q","2t-1D");1z(4(){D.1d("1q","1D")},0)}C.d=A.1W(C.d,4(F,E){f F!=B});2.l.y("2s",[j,2.8(2.$3[B],2.$b[B])],C.1V)},1S:4(C){6 B=2,D=2.c;5(C!=D.7){2.$h.t(C).m(D.U);D.d.1U(C);D.d.1T();2.l.y("2r",[j,2.8(2.$3[C],2.$b[C])],D.1S)}},16:4(B){5(2q B=="2p"){B=2.$3.Z(2.$3.z("[o$="+B+"]")[0])}2.$3.t(B).2o(2.c.v)},q:4(G,K){6 L=2,D=2.c,E=2.$3.t(G),J=E[0],H=K==1p||K===p,B=E.e("q.3");K=K||4(){};5(!B||!H&&A.e(J,"x.3")){K();f}6 M=4(N){6 O=A(N),P=O.1C("*:2n");f P.i&&P||O};6 C=4(){L.$3.z("."+D.17).r(D.17).V(4(){5(D.1l){M(2).2m().1o(M(2).e("1j.3"))}});L.1n=j};5(D.1l){6 I=M(J).1o();M(J).2l("<1B></1B>").1C("1B").e("1j.3",I).1o(D.1l)}6 F=A.1L({},D.1k,{1R:B,1A:4(O,N){A(J.u).1o(O);C();5(D.x){A.e(J,"x.3",1c)}A(L.l).y("2k",[j,L.8(L.$3[G],L.$b[G])],D.q);D.1k.1A&&D.1k.1A(O,N);K()}});5(2.1n){2.1n.2j();C()}E.m(D.17);1z(4(){L.1n=A.2i(F)},0)},1R:4(C,B){2.$3.t(C).1m("x.3").e("q.3",B)},1a:4(){6 B=2.c;2.l.14(".3").r(B.1w).1m("3");2.$3.V(4(){6 C=A.e(2,"o.3");5(C){2.o=C}6 D=A(2).14(".3");A.V(["o","q","x"],4(E,F){D.1m(F+".3")})});2.$h.1b(2.$b).V(4(){5(A.e(2,"1a.3")){A(2).19()}n{A(2).r([B.k,B.1v,B.U,B.18,B.w].2h(" "))}})}});A.8.3.2g={1h:p,v:"1y",d:[],Y:j,1l:"2fe;",x:p,1Q:"8-3-",1k:{},X:j,1P:\'<1i><a o="#{o}"><1O>#{1j}</1O></a></1i>\',1x:"<1N></1N>",1w:"8-3-2d",k:"8-3-7",1v:"8-3-1h",U:"8-3-d",18:"8-3-1M",w:"8-3-2c",17:"8-3-2b"};A.8.3.2a="i";A.1L(A.8.3.29,{1u:j,28:4(C,F){F=F||p;6 B=2,E=2.c.7;4 G(){B.1u=27(4(){E=++E<B.$3.i?E:0;B.16(E)},C)}4 D(H){5(!H||H.26){25(B.1u)}}5(C){G();5(!F){2.$3.15(2.c.v,D)}n{2.$3.15(2.c.v,4(){D();E=B.c.7;G()})}}n{D();2.$3.14(2.c.v,D)}}})})(1K)',62,196,'||this|tabs|function|if|var|selected|ui|||panels|options|disabled|data|return||lis|length|null|selectedClass|element|addClass|else|href|false|load|removeClass||eq|hash|event|hideClass|cache|triggerHandler|filter|||||||||||||||||||||disabledClass|each|browser|fx|cookie|index||hasClass|attr|replace|unbind|bind|select|loadingClass|panelClass|remove|destroy|add|true|css|tabify|id|msie|unselect|li|label|ajaxOptions|spinner|removeData|xhr|html|undefined|display|inArray|map|blur|rotation|unselectClass|navClass|panelTemplate|click|setTimeout|success|em|find|block|tabId|stop|show|opacity|duration|location|jQuery|extend|panel|div|span|tabTemplate|idPrefix|url|disable|sort|push|enable|grep|insertBefore|appendTo|test|tabsshow|style|animate|_|title|clearInterval|clientX|setInterval|rotate|prototype|getter|loading|hide|nav|8230|Loading|defaults|join|ajax|abort|tabsload|wrapInner|parent|last|trigger|string|typeof|tabsdisable|tabsenable|inline|safari|tabsremove|tabsadd|parentNode|child|first|indexOf|identifier|fragment|Mismatching|Tabs|UI|throw|tabsselect|visible|parents|siblings|height|overflow|Array|constructor|normal|width|min|for|unload|window|splice|concat|unique|parseInt|scrollTo|500|opera|insertAfter|has|tab|z0|Za|setData|init|widget'.split('|'),0,{})) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/jquery/jquery.schedule.js�����������������������������������������������������0000644�0001066�0001066�00000006601�10741453564�017053� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� (function($){$.scheduler=function(){this.bucket={};return;};$.scheduler.prototype={schedule:function(){var ctx={"id":null,"time":1000,"repeat":false,"protect":false,"obj":null,"func":function(){},"args":[]};function _isfn(fn){return(!!fn&&typeof fn!="string"&&typeof fn[0]=="undefined"&&RegExp("function","i").test(fn+""));};var i=0;var override=false;if(typeof arguments[i]=="object"&&arguments.length>1){override=true;i++;} if(typeof arguments[i]=="object"){for(var option in arguments[i]) if(typeof ctx[option]!="undefined") ctx[option]=arguments[i][option];i++;} if(typeof arguments[i]=="number"||(typeof arguments[i]=="string"&&arguments[i].match(RegExp("^[0-9]+[smhdw]$")))) ctx["time"]=arguments[i++];if(typeof arguments[i]=="boolean") ctx["repeat"]=arguments[i++];if(typeof arguments[i]=="boolean") ctx["protect"]=arguments[i++];if(typeof arguments[i]=="object"&&typeof arguments[i+1]=="string"&&_isfn(arguments[i][arguments[i+1]])){ctx["obj"]=arguments[i++];ctx["func"]=arguments[i++];} else if(typeof arguments[i]!="undefined"&&(_isfn(arguments[i])||typeof arguments[i]=="string")) ctx["func"]=arguments[i++];while(typeof arguments[i]!="undefined") ctx["args"].push(arguments[i++]);if(override){if(typeof arguments[1]=="object"){for(var option in arguments[0]) if(typeof ctx[option]!="undefined"&&typeof arguments[1][option]=="undefined") ctx[option]=arguments[0][option];} else{for(var option in arguments[0]) if(typeof ctx[option]!="undefined") ctx[option]=arguments[0][option];} i++;} ctx["_scheduler"]=this;ctx["_handle"]=null;var match=String(ctx["time"]).match(RegExp("^([0-9]+)([smhdw])$"));if(match&&match[0]!="undefined"&&match[1]!="undefined") ctx["time"]=String(parseInt(match[1])*{s:1000,m:1000*60,h:1000*60*60,d:1000*60*60*24,w:1000*60*60*24*7}[match[2]]);if(ctx["id"]==null) ctx["id"]=(String(ctx["repeat"])+":" +String(ctx["protect"])+":" +String(ctx["time"])+":" +String(ctx["obj"])+":" +String(ctx["func"])+":" +String(ctx["args"]));if(ctx["protect"]) if(typeof this.bucket[ctx["id"]]!="undefined") return this.bucket[ctx["id"]];if(!_isfn(ctx["func"])){if(ctx["obj"]!=null&&typeof ctx["obj"]=="object"&&typeof ctx["func"]=="string"&&_isfn(ctx["obj"][ctx["func"]])) ctx["func"]=ctx["obj"][ctx["func"]];else ctx["func"]=eval("function () { "+ctx["func"]+" }");} ctx["_handle"]=this._schedule(ctx);this.bucket[ctx["id"]]=ctx;return ctx;},reschedule:function(ctx){if(typeof ctx=="string") ctx=this.bucket[ctx];ctx["_handle"]=this._schedule(ctx);return ctx;},_schedule:function(ctx){var trampoline=function(){var obj=(ctx["obj"]!=null?ctx["obj"]:ctx);(ctx["func"]).apply(obj,ctx["args"]);if(typeof(ctx["_scheduler"]).bucket[ctx["id"]]!="undefined"&&ctx["repeat"]) (ctx["_scheduler"])._schedule(ctx);else delete(ctx["_scheduler"]).bucket[ctx["id"]];};return setTimeout(trampoline,ctx["time"]);},cancel:function(ctx){if(typeof ctx=="string") ctx=this.bucket[ctx];if(typeof ctx=="object"){clearTimeout(ctx["_handle"]);delete this.bucket[ctx["id"]];}}};$.extend({scheduler$:new $.scheduler(),schedule:function(){return $.scheduler$.schedule.apply($.scheduler$,arguments)},reschedule:function(){return $.scheduler$.reschedule.apply($.scheduler$,arguments)},cancel:function(){return $.scheduler$.cancel.apply($.scheduler$,arguments)}});$.fn.extend({schedule:function(){var a=[{}];for(var i=0;i<arguments.length;i++) a.push(arguments[i]);return this.each(function(){a[0]={"id":this,"obj":this};return $.schedule.apply($,a);});}});})(jQuery);�������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/jquery/suggest.js�������������������������������������������������������������0000644�0001066�0001066�00000016354�11032021406�015404� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * jquery.suggest 1.1b - 2007-08-06 * Patched by Mark Jaquith with Alexander Dick's "multiple items" patch to allow for auto-suggesting of more than one tag before submitting * See: http://www.vulgarisoip.com/2007/06/29/jquerysuggest-an-alternative-jquery-based-autocomplete-library/#comment-7228 * * Uses code and techniques from following libraries: * 1. http://www.dyve.net/jquery/?autocomplete * 2. http://dev.jquery.com/browser/trunk/plugins/interface/iautocompleter.js * * All the new stuff written by Peter Vulgaris (www.vulgarisoip.com) * Feel free to do whatever you want with this file * */ (function($) { $.suggest = function(input, options) { var $input = $(input).attr("autocomplete", "off"); var $results = $(document.createElement("ul")); var timeout = false; // hold timeout ID for suggestion results to appear var prevLength = 0; // last recorded length of $input.val() var cache = []; // cache MRU list var cacheSize = 0; // size of cache in chars (bytes?) $results.addClass(options.resultsClass).appendTo('body'); resetPosition(); $(window) .load(resetPosition) // just in case user is changing size of page while loading .resize(resetPosition); $input.blur(function() { setTimeout(function() { $results.hide() }, 200); }); // help IE users if possible try { $results.bgiframe(); } catch(e) { } // I really hate browser detection, but I don't see any other way if ($.browser.mozilla) $input.keypress(processKey); // onkeypress repeats arrow keys in Mozilla/Opera else $input.keydown(processKey); // onkeydown repeats arrow keys in IE/Safari function resetPosition() { // requires jquery.dimension plugin var offset = $input.offset(); $results.css({ top: (offset.top + input.offsetHeight) + 'px', left: offset.left + 'px' }); } function processKey(e) { // handling up/down/escape requires results to be visible // handling enter/tab requires that AND a result to be selected if ((/27$|38$|40$/.test(e.keyCode) && $results.is(':visible')) || (/^13$|^9$/.test(e.keyCode) && getCurrentResult())) { if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); e.cancelBubble = true; e.returnValue = false; switch(e.keyCode) { case 38: // up prevResult(); break; case 40: // down nextResult(); break; case 9: // tab case 13: // return selectCurrentResult(); break; case 27: // escape $results.hide(); break; } } else if ($input.val().length != prevLength) { if (timeout) clearTimeout(timeout); timeout = setTimeout(suggest, options.delay); prevLength = $input.val().length; } } function suggest() { var q = $.trim($input.val()); if ( options.multiple ) { var multipleSepPos = q.lastIndexOf(options.multipleSep); if ( multipleSepPos != -1 ) { q = q.substr(multipleSepPos + options.multipleSep.length); } } if (q.length >= options.minchars) { cached = checkCache(q); if (cached) { displayItems(cached['items']); } else { $.get(options.source, {q: q}, function(txt) { $results.hide(); var items = parseTxt(txt, q); displayItems(items); addToCache(q, items, txt.length); }); } } else { $results.hide(); } } function checkCache(q) { for (var i = 0; i < cache.length; i++) if (cache[i]['q'] == q) { cache.unshift(cache.splice(i, 1)[0]); return cache[0]; } return false; } function addToCache(q, items, size) { while (cache.length && (cacheSize + size > options.maxCacheSize)) { var cached = cache.pop(); cacheSize -= cached['size']; } cache.push({ q: q, size: size, items: items }); cacheSize += size; } function displayItems(items) { if (!items) return; if (!items.length) { $results.hide(); return; } resetPosition(); // when the form moves after the page has loaded var html = ''; for (var i = 0; i < items.length; i++) html += '<li>' + items[i] + '</li>'; $results.html(html).show(); $results .children('li') .mouseover(function() { $results.children('li').removeClass(options.selectClass); $(this).addClass(options.selectClass); }) .click(function(e) { e.preventDefault(); e.stopPropagation(); selectCurrentResult(); }); } function parseTxt(txt, q) { var items = []; var tokens = txt.split(options.delimiter); // parse returned data for non-empty items for (var i = 0; i < tokens.length; i++) { var token = $.trim(tokens[i]); if (token) { token = token.replace( new RegExp(q, 'ig'), function(q) { return '<span class="' + options.matchClass + '">' + q + '</span>' } ); items[items.length] = token; } } return items; } function getCurrentResult() { if (!$results.is(':visible')) return false; var $currentResult = $results.children('li.' + options.selectClass); if (!$currentResult.length) $currentResult = false; return $currentResult; } function selectCurrentResult() { $currentResult = getCurrentResult(); if ($currentResult) { if ( options.multiple ) { if ( $input.val().indexOf(options.multipleSep) != -1 ) { $currentVal = $input.val().substr( 0, ( $input.val().lastIndexOf(options.multipleSep) + options.multipleSep.length ) ); } else { $currentVal = ""; } $input.val( $currentVal + $currentResult.text() + options.multipleSep); $input.focus(); } else { $input.val($currentResult.text()); } $results.hide(); if (options.onSelect) options.onSelect.apply($input[0]); } } function nextResult() { $currentResult = getCurrentResult(); if ($currentResult) $currentResult .removeClass(options.selectClass) .next() .addClass(options.selectClass); else $results.children('li:first-child').addClass(options.selectClass); } function prevResult() { $currentResult = getCurrentResult(); if ($currentResult) $currentResult .removeClass(options.selectClass) .prev() .addClass(options.selectClass); else $results.children('li:last-child').addClass(options.selectClass); } } $.fn.suggest = function(source, options) { if (!source) return; options = options || {}; options.multiple = options.multiple || false; options.multipleSep = options.multipleSep || ", "; options.source = source; options.delay = options.delay || 100; options.resultsClass = options.resultsClass || 'ac_results'; options.selectClass = options.selectClass || 'ac_over'; options.matchClass = options.matchClass || 'ac_match'; options.minchars = options.minchars || 2; options.delimiter = options.delimiter || '\n'; options.onSelect = options.onSelect || false; options.maxCacheSize = options.maxCacheSize || 65536; this.each(function() { new $.suggest(this, options); }); return this; }; })(jQuery);������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/jquery/interface.js�����������������������������������������������������������0000644�0001066�0001066�00000226434�10752107624�015704� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * Interface Elements for jQuery * * http://interface.eyecon.ro * * Copyright (c) 2006 Stefan Petre * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * */ eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('A.cP={2l:C(c){G B.1y(C(){if(!c.8Y||!c.8P)G;F b=B;b.2a={9M:c.9M||bz,8Y:c.8Y,8P:c.8P,7R:c.7R||\'du\',9c:c.9c||\'du\',2K:c.2K&&28 c.2K==\'C\'?c.2K:H,2V:c.2K&&28 c.2V==\'C\'?c.2V:H,6D:c.6D&&28 c.6D==\'C\'?c.6D:H,8A:A(c.8Y,B),8a:A(c.8P,B),1l:c.1l||7n,5w:c.5w||0};b.2a.8a.2x().E(\'S\',\'9e\').eq(0).E({S:b.2a.9M+\'Q\',11:\'2v\'}).3m();b.2a.8A.1y(C(a){B.6L=a}).ht(C(){A(B).2H(b.2a.9c)},C(){A(B).3S(b.2a.9c)}).1C(\'4U\',C(e){if(b.2a.5w==B.6L)G;b.2a.8A.eq(b.2a.5w).3S(b.2a.7R).3m().eq(B.6L).2H(b.2a.7R).3m();b.2a.8a.eq(b.2a.5w).4S({S:0},b.2a.1l,C(){B.Y.11=\'1k\';if(b.2a.2V){b.2a.2V.1x(b,[B])}}).3m().eq(B.6L).1S().4S({S:b.2a.9M},b.2a.1l,C(){B.Y.11=\'2v\';if(b.2a.2K){b.2a.2K.1x(b,[B])}}).3m();if(b.2a.6D){b.2a.6D.1x(b,[B,b.2a.8a.I(B.6L),b.2a.8A.I(b.2a.5w),b.2a.8a.I(b.2a.5w)])}b.2a.5w=B.6L}).eq(0).2H(b.2a.7R).3m();A(B).E(\'S\',A(B).E(\'S\')).E(\'2N\',\'2B\')})}};A.fn.fe=A.cP.2l;A.8p={2l:C(h){G B.1y(C(){F c=B;F d=2*Z.2F/eD;F f=2*Z.2F;if(A(c).E(\'T\')!=\'2i\'&&A(c).E(\'T\')!=\'1J\'){A(c).E(\'T\',\'2i\')}c.1i={1M:A(h.1M,B),2y:h.2y,61:h.61,9l:h.9l,iu:f,1N:A.12.2f(B),T:A.12.3a(B),2b:Z.2F/2,b4:h.b4,7K:h.5U,5U:[],93:H,7G:2*Z.2F/eD};c.1i.d8=(c.1i.1N.w-c.1i.2y)/2;c.1i.6Y=(c.1i.1N.h-c.1i.61-c.1i.61*c.1i.7K)/2;c.1i.3f=2*Z.2F/c.1i.1M.1N();c.1i.aS=c.1i.1N.w/2;c.1i.aR=c.1i.1N.h/2-c.1i.61*c.1i.7K;F g=1c.3x(\'1W\');A(g).E({T:\'1J\',3j:1,O:0,M:0});A(c).1L(g);c.1i.1M.1y(C(a){8G=A(\'3O\',B).I(0);S=R(c.1i.61*c.1i.7K);if(A.2R.46){3u=1c.3x(\'3O\');A(3u).E(\'T\',\'1J\');3u.2E=8G.2E;3u.Y.4X=\'fu 9x:9C.9E.a6(1E=60, Y=1, fc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-b/a.1z.1M.1N()+\'Q\';L if(a.1z.4I==\'2D\')a.1z.2q.I(0).Y.M=(a.3P-a.1z.2y*a.1z.1M.1N())-b/2+\'Q\';a.1z.2q.I(0).Y.V=a.1z.2y*a.1z.1M.1N()+b+\'Q\'},6z:C(b){b.1z.1M.1y(C(a){B.Y.V=b.1z.2y+\'Q\';B.Y.M=b.1z.2y*a+\'Q\'})}};A.fn.fz=A.5K.2l;A.K={18:P,7W:P,3q:P,2A:P,4b:P,af:P,2r:P,2h:P,1M:P,58:C(){A.K.7W.58();if(A.K.3q){A.K.3q.2x()}},4i:C(){A.K.1M=P;A.K.2h=P;A.K.4b=A.K.2r.2m;if(A.K.18.E(\'11\')==\'2v\'){if(A.K.2r.1a.fx){2X(A.K.2r.1a.fx.1K){19\'a4\':A.K.18.6d(A.K.2r.1a.fx.1H,A.K.58);1n;19\'1u\':A.K.18.c6(A.K.2r.1a.fx.1H,A.K.58);1n;19\'8o\':A.K.18.c3(A.K.2r.1a.fx.1H,A.K.58);1n}}L{A.K.18.2x()}if(A.K.2r.1a.2V)A.K.2r.1a.2V.1x(A.K.2r,[A.K.18,A.K.3q])}L{A.K.58()}1P.a2(A.K.2A)},c1:C(){F e=A.K.2r;F f=A.K.8C(e);if(e&&f.3w!=A.K.4b&&f.3w.1b>=e.1a.8N){A.K.4b=f.3w;A.K.af=f.3w;9V={bR:A(e).1m(\'eS\')||\'bR\',2m:f.3w};A.eQ({1K:\'eN\',9V:A.eL(9V),eK:C(b){e.1a.3X=A(\'3w\',b);1N=e.1a.3X.1N();if(1N>0){F c=\'\';e.1a.3X.1y(C(a){c+=\'<7b 4o="\'+A(\'2m\',B).3D()+\'" 8h="\'+a+\'" Y="7z: 8T;">\'+A(\'3D\',B).3D()+\'</7b>\'});if(e.1a.9K){F d=A(\'2m\',e.1a.3X.I(0)).3D();e.2m=f.30+d+e.1a.3y+f.5m;A.K.64(e,f.3w.1b!=d.1b?(f.30.1b+f.3w.1b):d.1b,f.3w.1b!=d.1b?(f.30.1b+d.1b):d.1b)}if(1N>0){A.K.aU(e,c)}L{A.K.4i()}}L{A.K.4i()}},5v:e.1a.96})}},aU:C(a,b){A.K.7W.3i(b);A.K.1M=A(\'7b\',A.K.7W.I(0));A.K.1M.9r(A.K.en).1C(\'4U\',A.K.ed);F c=A.12.3a(a);F d=A.12.2f(a);A.K.18.E(\'O\',c.y+d.hb+\'Q\').E(\'M\',c.x+\'Q\').2H(a.1a.9D);if(A.K.3q){A.K.3q.E(\'11\',\'2v\').E(\'O\',c.y+d.hb+\'Q\').E(\'M\',c.x+\'Q\').E(\'V\',A.K.18.E(\'V\')).E(\'S\',A.K.18.E(\'S\'))}A.K.2h=0;A.K.1M.I(0).2Z=a.1a.72;A.K.7I(a,a.1a.3X.I(0),\'6H\');if(A.K.18.E(\'11\')==\'1k\'){if(a.1a.bv){F e=A.12.9y(a,14);F f=A.12.6b(a,14);A.K.18.E(\'V\',a.3P-(A.e0?(e.l+e.r+f.l+f.r):0)+\'Q\')}if(a.1a.fx){2X(a.1a.fx.1K){19\'a4\':A.K.18.6U(a.1a.fx.1H);1n;19\'1u\':A.K.18.dR(a.1a.fx.1H);1n;19\'8o\':A.K.18.dP(a.1a.fx.1H);1n}}L{A.K.18.1S()}if(A.K.2r.1a.2K)A.K.2r.1a.2K.1x(A.K.2r,[A.K.18,A.K.3q])}},dM:C(){F b=B;if(b.1a.3X){A.K.4b=b.2m;A.K.af=b.2m;F c=\'\';b.1a.3X.1y(C(a){2m=A(\'2m\',B).3D().5u();dH=b.2m.5u();if(2m.3o(dH)==0){c+=\'<7b 4o="\'+A(\'2m\',B).3D()+\'" 8h="\'+a+\'" Y="7z: 8T;">\'+A(\'3D\',B).3D()+\'</7b>\'}});if(c!=\'\'){A.K.aU(b,c);B.1a.9s=14;G}}b.1a.3X=P;B.1a.9s=H},64:C(a,b,c){if(a.9q){F d=a.9q();d.iJ(14);d.dC("bh",b);d.iE("bh",-c+b);d.7Q()}L if(a.9m){a.9m(b,c)}L{if(a.88){a.88=b;a.dA=c}}a.6a()},dw:C(a){if(a.88)G a.88;L if(a.9q){F b=1c.64.dv();F c=b.il();G 0-c.dC(\'bh\',-ij)}},8C:C(a){F b={2m:a.2m,30:\'\',5m:\'\',3w:\'\'};if(a.1a.9k){F c=H;F d=A.K.dw(a)||0;F e=b.2m.6W(a.1a.3y);1V(F i=0;i<e.1b;i++){if((b.30.1b+e[i].1b>=d||d==0)&&!c){if(b.30.1b<=d)b.3w=e[i];L b.5m+=e[i]+(e[i]!=\'\'?a.1a.3y:\'\');c=14}L if(c){b.5m+=e[i]+(e[i]!=\'\'?a.1a.3y:\'\')}if(!c){b.30+=e[i]+(e.1b>1?a.1a.3y:\'\')}}}L{b.3w=b.2m}G b},b9:C(e){1P.a2(A.K.2A);F a=A.K.8C(B);F b=e.6S||e.6R||-1;if(/13|27|35|36|38|40|9/.3M(b)&&A.K.1M){if(1P.3N){1P.3N.b6=14;1P.3N.b5=H}L{e.9b();e.99()}if(A.K.2h!=P)A.K.1M.I(A.K.2h||0).2Z=\'\';L A.K.2h=-1;2X(b){19 9:19 13:if(A.K.2h==-1)A.K.2h=0;F c=A.K.1M.I(A.K.2h||0);F d=c.4Z(\'4o\');B.2m=a.30+d+B.1a.3y+a.5m;A.K.4b=a.3w;A.K.64(B,a.30.1b+d.1b+B.1a.3y.1b,a.30.1b+d.1b+B.1a.3y.1b);A.K.4i();if(B.1a.5p){4E=R(c.4Z(\'8h\'))||0;A.K.7I(B,B.1a.3X.I(4E),\'5p\')}if(B.6O)B.6O(H);G b!=13;1n;19 27:B.2m=a.30+A.K.4b+B.1a.3y+a.5m;B.1a.3X=P;A.K.4i();if(B.6O)B.6O(H);G H;1n;19 35:A.K.2h=A.K.1M.1N()-1;1n;19 36:A.K.2h=0;1n;19 38:A.K.2h--;if(A.K.2h<0)A.K.2h=A.K.1M.1N()-1;1n;19 40:A.K.2h++;if(A.K.2h==A.K.1M.1N())A.K.2h=0;1n}A.K.7I(B,B.1a.3X.I(A.K.2h||0),\'6H\');A.K.1M.I(A.K.2h||0).2Z=B.1a.72;if(A.K.1M.I(A.K.2h||0).6O)A.K.1M.I(A.K.2h||0).6O(H);if(B.1a.9K){F f=A.K.1M.I(A.K.2h||0).4Z(\'4o\');B.2m=a.30+f+B.1a.3y+a.5m;if(A.K.4b.1b!=f.1b)A.K.64(B,a.30.1b+A.K.4b.1b,a.30.1b+f.1b)}G H}A.K.dM.1x(B);if(B.1a.9s==H){if(a.3w!=A.K.4b&&a.3w.1b>=B.1a.8N)A.K.2A=1P.97(A.K.c1,B.1a.4w);if(A.K.1M){A.K.4i()}}G 14},7I:C(a,b,c){if(a.1a[c]){F d={};94=b.dj(\'*\');1V(i=0;i<94.1b;i++){d[94[i].4D]=94[i].6M.hG}a.1a[c].1x(a,[d])}},en:C(e){if(A.K.1M){if(A.K.2h!=P)A.K.1M.I(A.K.2h||0).2Z=\'\';A.K.1M.I(A.K.2h||0).2Z=\'\';A.K.2h=R(B.4Z(\'8h\'))||0;A.K.1M.I(A.K.2h||0).2Z=A.K.2r.1a.72}},ed:C(a){1P.a2(A.K.2A);a=a||A.3N.hD(1P.3N);a.9b();a.99();F b=A.K.8C(A.K.2r);F c=B.4Z(\'4o\');A.K.2r.2m=b.30+c+A.K.2r.1a.3y+b.5m;A.K.4b=B.4Z(\'4o\');A.K.64(A.K.2r,b.30.1b+c.1b+A.K.2r.1a.3y.1b,b.30.1b+c.1b+A.K.2r.1a.3y.1b);A.K.4i();if(A.K.2r.1a.5p){4E=R(B.4Z(\'8h\'))||0;A.K.7I(A.K.2r,A.K.2r.1a.3X.I(4E),\'5p\')}G H},dh:C(e){6K=e.6S||e.6R||-1;if(/13|27|35|36|38|40/.3M(6K)&&A.K.1M){if(1P.3N){1P.3N.b6=14;1P.3N.b5=H}L{e.9b();e.99()}G H}},2l:C(a){if(!a.96||!A.12){G}if(!A.K.18){if(A.2R.46){A(\'23\',1c).1L(\'<3q Y="11:1k;T:1J;4X:9x:9C.9E.a6(1E=0);" id="df" 2E="dc:H;" da="0" d7="b0"></3q>\');A.K.3q=A(\'#df\')}A(\'23\',1c).1L(\'<1W id="d4" Y="T: 1J; O: 0; M: 0; z-aY: hj; 11: 1k;"><90 Y="5X: 0;7E: 0; h9-Y: 1k; z-aY: h8;">&6G;</90></1W>\');A.K.18=A(\'#d4\');A.K.7W=A(\'90\',A.K.18)}G B.1y(C(){if(B.4D!=\'aV\'&&B.4Z(\'1K\')!=\'3D\')G;B.1a={};B.1a.96=a.96;B.1a.8N=Z.3B(R(a.8N)||1);B.1a.9D=a.9D?a.9D:\'\';B.1a.72=a.72?a.72:\'\';B.1a.5p=a.5p&&a.5p.1F==2w?a.5p:P;B.1a.2K=a.2K&&a.2K.1F==2w?a.2K:P;B.1a.2V=a.2V&&a.2V.1F==2w?a.2V:P;B.1a.6H=a.6H&&a.6H.1F==2w?a.6H:P;B.1a.bv=a.bv||H;B.1a.9k=a.9k||H;B.1a.3y=B.1a.9k?(a.3y||\', \'):\'\';B.1a.9K=a.9K?14:H;B.1a.4w=Z.3B(R(a.4w)||8V);if(a.fx&&a.fx.1F==6E){if(!a.fx.1K||!/a4|1u|8o/.3M(a.fx.1K)){a.fx.1K=\'1u\'}if(a.fx.1K==\'1u\'&&!A.fx.1u)G;if(a.fx.1K==\'8o\'&&!A.fx.5l)G;a.fx.1H=Z.3B(R(a.fx.1H)||7n);if(a.fx.1H>B.1a.4w){a.fx.1H=B.1a.4w-1Y}B.1a.fx=a.fx}B.1a.3X=P;B.1a.9s=H;A(B).1m(\'b9\',\'cW\').6a(C(){A.K.2r=B;A.K.4b=B.2m}).cV(A.K.dh).5Q(A.K.b9).4W(C(){A.K.2A=1P.97(A.K.4i,gM)})})}};A.fn.gJ=A.K.2l;A.1t={2A:P,4k:P,1X:P,3f:10,2b:C(a,b,c,d){A.1t.4k=a;A.1t.1X=b;A.1t.3f=R(c)||10;A.1t.2A=1P.5Y(A.1t.cR,R(d)||40)},cR:C(){1V(i=0;i<A.1t.1X.1b;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==\'7X\'){A(\'23\',1c).1L(A.X.18.I(0))}A.X.18.58().2x().E(\'1E\',1);if(1P.6j){A.X.18.E(\'4X\',\'7s(1E=1Y)\')}},8I:C(e){A(1c).3h(\'3t\',A.X.aE).3h(\'5n\',A.X.8I);if(A.X.1g==P){G}F a=A.X.1g;A.X.1g=P;if(a.D.6g==H){G H}if(a.D.3I==14){A(a).E(\'T\',a.D.49)}F b=a.Y;if(a.4P){A.X.18.E(\'7z\',\'7g\')}if(a.D.6i){A.X.18.3S(a.D.6i)}if(a.D.5B==H){if(a.D.fx>0){if(!a.D.2g||a.D.2g==\'3Z\'){F x=W A.fx(a,{1H:a.D.fx},\'M\');x.1G(a.D.22.x,a.D.7i)}if(!a.D.2g||a.D.2g==\'3K\'){F y=W A.fx(a,{1H:a.D.fx},\'O\');y.1G(a.D.22.y,a.D.7k)}}L{if(!a.D.2g||a.D.2g==\'3Z\')a.Y.M=a.D.7i+\'Q\';if(!a.D.2g||a.D.2g==\'3K\')a.Y.O=a.D.7k+\'Q\'}A.X.8r(a);if(a.D.3L==H){A(a).E(\'11\',a.D.6o)}}L if(a.D.fx>0){a.D.8w=14;F c=H;if(A.1s&&A.1p&&a.D.3I){c=A.12.3a(A.1p.18.I(0))}A.X.18.4S({M:c?c.x:a.D.1w.x,O:c?c.y:a.D.1w.y},a.D.fx,C(){a.D.8w=H;if(a.D.3L==H){a.Y.11=a.D.6o}A.X.8r(a)})}L{A.X.8r(a);if(a.D.3L==H){A(a).E(\'11\',a.D.6o)}}if(A.1s&&A.1s.7p>0){A.1s.c8(a)}if(A.1p&&a.D.3I){A.1p.c7(a)}if(a.D.2I&&(a.D.7i!=a.D.22.x||a.D.7k!=a.D.22.y)){a.D.2I.1x(a,a.D.aa||[0,0,a.D.7i,a.D.7k])}if(a.D.3C)a.D.3C.1x(a);G H},a9:C(x,y,a,b){if(a!=0)a=R((a+(B.D.gx*a/Z.3B(a))/2)/B.D.gx)*B.D.gx;if(b!=0)b=R((b+(B.D.gy*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h)?14:H},9S:C(a,b,c,d){G!(a>(A.X.1g.D.2n+A.X.1g.D.1w.w)||(a+c)<A.X.1g.D.2n||b>(A.X.1g.D.2j+A.X.1g.D.1w.h)||(b+d)<A.X.1g.D.2j)?14:H},1A:C(a,b,c,d){G a<A.X.1g.D.4d.x&&(a+c)>A.X.1g.D.4d.x&&b<A.X.1g.D.4d.y&&(b+d)>A.X.1g.D.4d.y?14:H},4T:H,3z:{},7p:0,3p:{},ck:C(a){if(A.X.1g==P){G}F i;A.1s.3z={};F b=H;1V(i in A.1s.3p){if(A.1s.3p[i]!=P){F c=A.1s.3p[i].I(0);if(A(A.X.1g).is(\'.\'+c.1f.a)){if(c.1f.m==H){c.1f.p=A.1U(A.12.6x(c),A.12.6w(c));c.1f.m=14}if(c.1f.ac){A.1s.3p[i].2H(c.1f.ac)}A.1s.3z[i]=A.1s.3p[i];if(A.1p&&c.1f.s&&A.X.1g.D.3I){c.1f.el=A(\'.\'+c.1f.a,c);a.Y.11=\'1k\';A.1p.bM(c);c.1f.9P=A.1p.8g(A.1m(c,\'id\')).6A;a.Y.11=a.D.6o;b=14}if(c.1f.9O){c.1f.9O.1x(A.1s.3p[i].I(0),[A.X.1g])}}}}if(b){A.1p.2b()}},eF:C(){A.1s.3z={};1V(i in A.1s.3p){if(A.1s.3p[i]!=P){F a=A.1s.3p[i].I(0);if(A(A.X.1g).is(\'.\'+a.1f.a)){a.1f.p=A.1U(A.12.6x(a),A.12.6w(a));if(a.1f.ac){A.1s.3p[i].2H(a.1f.ac)}A.1s.3z[i]=A.1s.3p[i];if(A.1p&&a.1f.s&&A.X.1g.D.3I){a.1f.el=A(\'.\'+a.1f.a,a);bJ.Y.11=\'1k\';A.1p.bM(a);bJ.Y.11=bJ.D.6o}}}}},8n:C(e){if(A.X.1g==P){G}A.1s.4T=H;F i;F a=H;F b=0;1V(i in A.1s.3z){F c=A.1s.3z[i].I(0);if(A.1s.4T==H&&A.1s[c.1f.t](c.1f.p.x,c.1f.p.y,c.1f.p.1D,c.1f.p.hb)){if(c.1f.hc&&c.1f.h==H){A.1s.3z[i].2H(c.1f.hc)}if(c.1f.h==H&&c.1f.76){a=14}c.1f.h=14;A.1s.4T=c;if(A.1p&&c.1f.s&&A.X.1g.D.3I){A.1p.18.I(0).2Z=c.1f.eC;A.1p.8n(c)}b++}L if(c.1f.h==14){if(c.1f.6C){c.1f.6C.1x(c,[e,A.X.18.I(0).6M,c.1f.fx])}if(c.1f.hc){A.1s.3z[i].3S(c.1f.hc)}c.1f.h=H}}if(A.1p&&!A.1s.4T&&A.X.1g.3I){A.1p.18.I(0).Y.11=\'1k\'}if(a){A.1s.4T.1f.76.1x(A.1s.4T,[e,A.X.18.I(0).6M])}},c8:C(e){F i;1V(i in A.1s.3z){F a=A.1s.3z[i].I(0);if(a.1f.ac){A.1s.3z[i].3S(a.1f.ac)}if(a.1f.hc){A.1s.3z[i].3S(a.1f.hc)}if(a.1f.s){A.1p.73[A.1p.73.1b]=i}if(a.1f.9I&&a.1f.h==14){a.1f.h=H;a.1f.9I.1x(a,[e,a.1f.fx])}a.1f.m=H;a.1f.h=H}A.1s.3z={}},4v:C(){G B.1y(C(){if(B.8S){if(B.1f.s){id=A.1m(B,\'id\');A.1p.54[id]=P;A(\'.\'+B.1f.a,B).8j()}A.1s.3p[\'d\'+B.bG]=P;B.8S=H;B.f=P}})},2l:C(o){G B.1y(C(){if(B.8S==14||!o.3r||!A.12||!A.X){G}B.1f={a:o.3r,ac:o.9F||H,hc:o.8X||H,eC:o.4G||H,9I:o.je||o.9I||H,76:o.76||o.ev||H,6C:o.6C||o.er||H,9O:o.9O||H,t:o.5T&&(o.5T==\'bP\'||o.5T==\'9S\')?o.5T:\'1A\',fx:o.fx?o.fx:H,m:H,h:H};if(o.bC==14&&A.1p){id=A.1m(B,\'id\');A.1p.54[id]=B.1f.a;B.1f.s=14;if(o.2I){B.1f.2I=o.2I;B.1f.9P=A.1p.8g(id).6A}}B.8S=14;B.bG=R(Z.63()*aW);A.1s.3p[\'d\'+B.bG]=A(B);A.1s.7p++})}};A.fn.1U({ei:A.1s.4v,ee:A.1s.2l});A.jd=A.1s.eF;A.3l={18:P,89:C(){3D=B.2m;if(!3D)G;Y={eb:A(B).E(\'eb\')||\'\',4a:A(B).E(\'4a\')||\'\',87:A(B).E(\'87\')||\'\',e9:A(B).E(\'e9\')||\'\',e8:A(B).E(\'e8\')||\'\',e7:A(B).E(\'e7\')||\'\',bx:A(B).E(\'bx\')||\'\',e6:A(B).E(\'e6\')||\'\'};A.3l.18.E(Y);3i=A.3l.e5(3D);3i=3i.48(W bw("\\\\n","g"),"<br />");A.3l.18.3i(\'j6\');b3=A.3l.18.I(0).3P;A.3l.18.3i(3i);V=A.3l.18.I(0).3P+b3;if(B.66.65&&V>B.66.65[0]){V=B.66.65[0]}B.Y.V=V+\'Q\';if(B.4D==\'bs\'){S=A.3l.18.I(0).5r+b3;if(B.66.65&&S>B.66.65[1]){S=B.66.65[1]}B.Y.S=S+\'Q\'}},e5:C(a){bq={\'&\':\'&j1;\',\'<\':\'&j0;\',\'>\':\'>\',\'"\':\'&iZ;\'};1V(i in bq){a=a.48(W bw(i,\'g\'),bq[i])}G a},2l:C(a){if(A.3l.18==P){A(\'23\',1c).1L(\'<1W id="dX" Y="T: 1J; O: 0; M: 0; 2W: 2B;"></1W>\');A.3l.18=A(\'#dX\')}G B.1y(C(){if(/bs|aV/.3M(B.4D)){if(B.4D==\'aV\'){dT=B.4Z(\'1K\');if(!/3D|iW/.3M(dT)){G}}if(a&&(a.1F==bm||(a.1F==6h&&a.1b==2))){if(a.1F==bm)a=[a,a];L{a[0]=R(a[0])||7n;a[1]=R(a[1])||7n}B.66={65:a}}A(B).4W(A.3l.89).5Q(A.3l.89).cV(A.3l.89);A.3l.89.1x(B)}})}};A.fn.iU=A.3l.2l;A.fn.1U({c3:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.5l(B,a,b,\'4l\',c)})},dP:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.5l(B,a,b,\'41\',c)})},iQ:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.5l(B,a,b,\'dG\',c)})},iM:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.5l(B,a,b,\'M\',c)})},iL:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.5l(B,a,b,\'2D\',c)})},iK:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.5l(B,a,b,\'dF\',c)})}});A.fx.5l=C(e,a,b,c,d){if(!A.4n(e)){A.2z(e,\'1j\');G H}F z=B;z.el=A(e);z.1N=A.12.2f(e);z.1e=28 b==\'4B\'?b:d||P;if(!e.4f)e.4f=z.el.E(\'11\');if(c==\'dG\'){c=z.el.E(\'11\')==\'1k\'?\'41\':\'4l\'}L if(c==\'dF\'){c=z.el.E(\'11\')==\'1k\'?\'2D\':\'M\'}z.el.1S();z.1l=a;z.29=28 b==\'C\'?b:P;z.fx=A.fx.9u(e);z.6T=c;z.1T=C(){if(z.29&&z.29.1F==2w){z.29.1x(z.el.I(0))}if(z.6T==\'41\'||z.6T==\'2D\'){z.el.E(\'11\',z.el.I(0).4f==\'1k\'?\'2v\':z.el.I(0).4f)}L{z.el.2x()}A.fx.9n(z.fx.2Y.I(0),z.fx.U);A.2z(z.el.I(0),\'1j\')};2X(z.6T){19\'4l\':5q=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,z.1T),\'S\');5q.1G(z.fx.U.1o.hb,0);1n;19\'41\':z.fx.2Y.E(\'S\',\'9e\');z.el.1S();5q=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,z.1T),\'S\');5q.1G(0,z.fx.U.1o.hb);1n;19\'M\':5q=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,z.1T),\'V\');5q.1G(z.fx.U.1o.1D,0);1n;19\'2D\':z.fx.2Y.E(\'V\',\'9e\');z.el.1S();5q=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,z.1T),\'V\');5q.1G(0,z.fx.U.1o.1D);1n}};A.fn.iA=C(a,b){G B.1r(\'1j\',C(){if(!A.4n(B)){A.2z(B,\'1j\');G H}F e=W A.fx.eu(B,a,b);e.bE()})};A.fx.eu=C(e,a,b){F z=B;z.el=A(e);z.el.1S();z.29=b;z.8e=R(a)||40;z.U={};z.U.T=z.el.E(\'T\');z.U.O=R(z.el.E(\'O\'))||0;z.U.M=R(z.el.E(\'M\'))||0;if(z.U.T!=\'2i\'&&z.U.T!=\'1J\'){z.el.E(\'T\',\'2i\')}z.74=5;z.52=1;z.bE=C(){z.52++;z.e=W A.fx(z.el.I(0),{1H:io,1T:C(){z.e=W A.fx(z.el.I(0),{1H:80,1T:C(){z.8e=R(z.8e/2);if(z.52<=z.74)z.bE();L{z.el.E(\'T\',z.U.T).E(\'O\',z.U.O+\'Q\').E(\'M\',z.U.M+\'Q\');A.2z(z.el.I(0),\'1j\');if(z.29&&z.29.1F==2w){z.29.1x(z.el.I(0))}}}},\'O\');z.e.1G(z.U.O-z.8e,z.U.O)}},\'O\');z.e.1G(z.U.O,z.U.O-z.8e)}};A.fn.1U({im:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'41\',\'3U\',c)})},ik:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'41\',\'in\',c)})},ii:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'41\',\'3E\',c)})},ig:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'4l\',\'3U\',c)})},ie:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'4l\',\'in\',c)})},ic:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'4l\',\'3E\',c)})},ib:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'M\',\'3U\',c)})},ia:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'M\',\'in\',c)})},i9:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'M\',\'3E\',c)})},i8:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'2D\',\'3U\',c)})},i7:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'2D\',\'in\',c)})},i6:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'2D\',\'3E\',c)})}});A.fx.3Y=C(e,a,b,c,d,f){if(!A.4n(e)){A.2z(e,\'1j\');G H}F z=B;z.el=A(e);z.1e=28 b==\'4B\'?b:f||P;z.U={};z.U.T=z.el.E(\'T\');z.U.O=z.el.E(\'O\');z.U.M=z.el.E(\'M\');if(!e.4f)e.4f=z.el.E(\'11\');if(d==\'3E\'){d=z.el.E(\'11\')==\'1k\'?\'in\':\'3U\'}z.el.1S();if(z.U.T!=\'2i\'&&z.U.T!=\'1J\'){z.el.E(\'T\',\'2i\')}z.1K=d;b=28 b==\'C\'?b:P;7N=1;2X(c){19\'4l\':z.e=W A.fx(z.el.I(0),A.1l(a-15,z.1e,b),\'O\');z.5x=2c(z.U.O)||0;z.9i=z.dt;7N=-1;1n;19\'41\':z.e=W A.fx(z.el.I(0),A.1l(a-15,z.1e,b),\'O\');z.5x=2c(z.U.O)||0;z.9i=z.dt;1n;19\'2D\':z.e=W A.fx(z.el.I(0),A.1l(a-15,z.1e,b),\'M\');z.5x=2c(z.U.M)||0;z.9i=z.ds;1n;19\'M\':z.e=W A.fx(z.el.I(0),A.1l(a-15,z.1e,b),\'M\');z.5x=2c(z.U.M)||0;z.9i=z.ds;7N=-1;1n}z.e2=W A.fx(z.el.I(0),A.1l(a,z.1e,C(){z.el.E(z.U);if(z.1K==\'3U\'){z.el.E(\'11\',\'1k\')}L z.el.E(\'11\',z.el.I(0).4f==\'1k\'?\'2v\':z.el.I(0).4f);A.2z(z.el.I(0),\'1j\')}),\'1E\');if(d==\'in\'){z.e.1G(z.5x+1Y*7N,z.5x);z.e2.1G(0,1)}L{z.e.1G(z.5x,z.5x+1Y*7N);z.e2.1G(1,0)}};A.fn.1U({i5:C(a,b,c,d){G B.1r(\'1j\',C(){W A.fx.9h(B,a,b,c,\'dq\',d)})},i4:C(a,b,c,d){G B.1r(\'1j\',C(){W A.fx.9h(B,a,b,c,\'9g\',d)})},i3:C(a,b,c,d){G B.1r(\'1j\',C(){W A.fx.9h(B,a,b,c,\'3E\',d)})}});A.fx.9h=C(e,a,b,c,d,f){if(!A.4n(e)){A.2z(e,\'1j\');G H}F z=B;z.el=A(e);z.1e=28 c==\'4B\'?c:f||P;z.29=28 c==\'C\'?c:P;if(d==\'3E\'){d=z.el.E(\'11\')==\'1k\'?\'9g\':\'dq\'}z.1l=a;z.S=b&&b.1F==bm?b:20;z.fx=A.fx.9u(e);z.1K=d;z.1T=C(){if(z.29&&z.29.1F==2w){z.29.1x(z.el.I(0))}if(z.1K==\'9g\'){z.el.1S()}L{z.el.2x()}A.fx.9n(z.fx.2Y.I(0),z.fx.U);A.2z(z.el.I(0),\'1j\')};if(z.1K==\'9g\'){z.el.1S();z.fx.2Y.E(\'S\',z.S+\'Q\').E(\'V\',\'9e\');z.ef=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,C(){z.ef=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,z.1T),\'S\');z.ef.1G(z.S,z.fx.U.1o.hb)}),\'V\');z.ef.1G(0,z.fx.U.1o.1D)}L{z.ef=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,C(){z.ef=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,z.1T),\'V\');z.ef.1G(z.fx.U.1o.1D,0)}),\'S\');z.ef.1G(z.fx.U.1o.hb,z.S)}};A.fn.i2=C(c,d,e,f){G B.1r(\'dp\',C(){B.6Q=A(B).1m("Y")||\'\';f=28 e==\'4B\'?e:f||P;e=28 e==\'C\'?e:P;F a=A(B).E(\'6P\');F b=B.2S;6k(a==\'b7\'&&b){a=A(b).E(\'6P\');b=b.2S}A(B).E(\'6P\',d);if(28 B.6Q==\'7M\')B.6Q=B.6Q["9d"];A(B).4S({\'6P\':a},c,f,C(){A.2z(B,\'dp\');if(28 A(B).1m("Y")==\'7M\'){A(B).1m("Y")["9d"]="";A(B).1m("Y")["9d"]=B.6Q}L{A(B).1m("Y",B.6Q)}if(e)e.1x(B)})})};A.4n=C(e){if(/^i1$|^i0$|^hZ$|^5W$|^hY$|^hX$|^hW$|^hV$|^hU$|^23$|^hT$|^hS$|^hR$|^hQ$|^hP$|^hO$|^hN$/i.3M(e.98))G H;L G 14};A.fx.9n=C(e,a){F c=e.6M;F b=c.Y;b.T=a.T;b.4M=a.3s.t;b.4K=a.3s.l;b.4L=a.3s.b;b.53=a.3s.r;b.O=a.O+\'Q\';b.M=a.M+\'Q\';e.2S.dn(c,e);e.2S.hM(e)};A.fx.9u=C(e){if(!A.4n(e))G H;F t=A(e);F a=e.Y;F b=H;if(t.E(\'11\')==\'1k\'){95=t.E(\'2W\');t.E(\'2W\',\'2B\').1S();b=14}F c={};c.T=t.E(\'T\');c.1o=A.12.2f(e);c.3s=A.12.b2(e);F d=e.4u?e.4u.dk:t.E(\'hK\');c.O=R(t.E(\'O\'))||0;c.M=R(t.E(\'M\'))||0;F f=\'hJ\'+R(Z.63()*aW);F g=1c.3x(/^3O$|^br$|^hI$|^hr$|^7Q$|^hH$|^7M$|^3q$|^hF$|^hE$|^hC$|^90$|^dl$|^hB$/i.3M(e.98)?\'1W\':e.98);A.1m(g,\'id\',f);F h=A(g).2H(\'hA\');F i=g.Y;F j=0;F k=0;if(c.T==\'2i\'||c.T==\'1J\'){j=c.O;k=c.M}i.O=j+\'Q\';i.M=k+\'Q\';i.T=c.T!=\'2i\'&&c.T!=\'1J\'?\'2i\':c.T;i.S=c.1o.hb+\'Q\';i.V=c.1o.1D+\'Q\';i.4M=c.3s.t;i.53=c.3s.r;i.4L=c.3s.b;i.4K=c.3s.l;i.2N=\'2B\';if(A.2R.46){i.dk=d}L{i.hz=d}if(A.2R=="46"){a.4X="7s(1E="+0.dg*1Y+")"}a.1E=0.dg;e.2S.dn(g,e);g.hy(e);a.4M=\'2G\';a.53=\'2G\';a.4L=\'2G\';a.4K=\'2G\';a.T=\'1J\';a.bV=\'1k\';a.O=\'2G\';a.M=\'2G\';if(b){t.2x();a.2W=95}G{U:c,2Y:A(g)}};A.fx.7H={hx:[0,1O,1O],hw:[dd,1O,1O],hv:[db,db,hu],hs:[0,0,0],hq:[0,0,1O],hp:[d6,42,42],hn:[0,1O,1O],hm:[0,0,6N],hl:[0,6N,6N],hk:[aX,aX,aX],hi:[0,1Y,0],hg:[hf,he,cZ],hd:[6N,0,6N],ha:[85,cZ,47],h7:[1O,cY,0],h6:[h5,50,h4],h3:[6N,0,0],h2:[h1,cX,h0],gZ:[gY,0,8U],gX:[1O,0,1O],gW:[1O,gU,0],gT:[0,67,0],gS:[75,0,gQ],gP:[dd,cU,cY],gO:[gL,gK,cU],gI:[cT,1O,1O],gH:[cS,gG,cS],gF:[8U,8U,8U],gD:[1O,gC,gB],gA:[1O,1O,cT],gw:[0,1O,0],gv:[1O,0,1O],gu:[67,0,0],gs:[0,0,67],gr:[67,67,0],gq:[1O,d6,0],gp:[1O,8R,gn],gm:[67,0,67],gl:[1O,0,0],gk:[8R,8R,8R],gj:[1O,1O,1O],gi:[1O,1O,0]};A.fx.5L=C(a,b){if(A.fx.7H[a])G{r:A.fx.7H[a][0],g:A.fx.7H[a][1],b:A.fx.7H[a][2]};L if(2L=/^6v\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)$/.8Q(a))G{r:R(2L[1]),g:R(2L[2]),b:R(2L[3])};L if(2L=/6v\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)$/.8Q(a))G{r:2c(2L[1])*2.55,g:2c(2L[2])*2.55,b:2c(2L[3])*2.55};L if(2L=/^#([a-fA-6t-9])([a-fA-6t-9])([a-fA-6t-9])$/.8Q(a))G{r:R("6s"+2L[1]+2L[1]),g:R("6s"+2L[2]+2L[2]),b:R("6s"+2L[3]+2L[3])};L if(2L=/^#([a-fA-6t-9]{2})([a-fA-6t-9]{2})([a-fA-6t-9]{2})$/.8Q(a))G{r:R("6s"+2L[1]),g:R("6s"+2L[2]),b:R("6s"+2L[3])};L G b==14?H:{r:1O,g:1O,b:1O}};A.fx.cQ={5d:1,4y:1,5i:1,4x:1,4e:1,4a:1,S:1,M:1,bx:1,gh:1,4L:1,4K:1,53:1,4M:1,7y:1,5R:1,7x:1,8O:1,1E:1,ge:1,gc:1,4Q:1,4F:1,5g:1,5b:1,2D:1,gb:1,O:1,V:1,3j:1};A.fx.cN={6P:1,ga:1,g9:1,g8:1,g7:1,g6:1,g5:1};A.fx.7v=[\'g4\',\'g3\',\'g2\',\'g1\'];A.fx.aL={\'aK\':[\'2u\',\'cK\'],\'8E\':[\'2u\',\'aH\'],\'5X\':[\'5X\',\'\'],\'7E\':[\'7E\',\'\']};A.fn.1U({4S:C(b,c,d,f){G B.1r(C(){F a=A.1l(c,d,f);F e=W A.cI(B,a,b)})},aG:C(b,c){G B.1r(C(){F a=A.1l(b,c);F e=W A.aG(B,a)})},7w:C(a){G B.1y(C(){if(B.5e)A.aF(B,a)})},fZ:C(a){G B.1y(C(){if(B.5e)A.aF(B,a);if(B.1r&&B.1r[\'fx\'])B.1r.fx=[]})}});A.1U({aG:C(a,b){F z=B,5f;z.3f=C(){if(A.cF(b.1T))b.1T.1x(a)};z.2A=5Y(C(){z.3f()},b.1H);a.5e=z},1e:{b1:C(p,n,a,b,c){G((-Z.51(p*Z.2F)/2)+0.5)*b+a}},cI:C(f,g,h){F z=B,5f;F y=f.Y;F k=A.E(f,"2N");F l=A.E(f,"11");F o={};z.9a=(W 6p()).6y();g.1e=g.1e&&A.1e[g.1e]?g.1e:\'b1\';z.8H=C(a,b){if(A.fx.cQ[a]){if(b==\'1S\'||b==\'2x\'||b==\'3E\'){if(!f.5I)f.5I={};F r=2c(A.5S(f,a));f.5I[a]=r&&r>-aW?r:(2c(A.E(f,a))||0);b=b==\'3E\'?(l==\'1k\'?\'1S\':\'2x\'):b;g[b]=14;o[a]=b==\'1S\'?[0,f.5I[a]]:[f.5I[a],0];if(a!=\'1E\')y[a]=o[a][0]+(a!=\'3j\'&&a!=\'87\'?\'Q\':\'\');L A.1m(y,"1E",o[a][0])}L{o[a]=[2c(A.5S(f,a)),2c(b)||0]}}L if(A.fx.cN[a])o[a]=[A.fx.5L(A.5S(f,a)),A.fx.5L(b)];L if(/^5X$|7E$|2u$|8E$|aK$/i.3M(a)){F m=b.48(/\\s+/g,\' \').48(/6v\\s*\\(\\s*/g,\'6v(\').48(/\\s*,\\s*/g,\',\').48(/\\s*\\)/g,\')\').aD(/([^\\s]+)/g);2X(a){19\'5X\':19\'7E\':19\'aK\':19\'8E\':m[3]=m[3]||m[1]||m[0];m[2]=m[2]||m[0];m[1]=m[1]||m[0];1V(F i=0;i<A.fx.7v.1b;i++){F c=A.fx.aL[a][0]+A.fx.7v[i]+A.fx.aL[a][1];o[c]=a==\'8E\'?[A.fx.5L(A.5S(f,c)),A.fx.5L(m[i])]:[2c(A.5S(f,c)),2c(m[i])]}1n;19\'2u\':1V(F i=0;i<m.1b;i++){F d=2c(m[i]);F e=!fX(d)?\'cK\':(!/b7|1k|2B|fW|fV|fU|fT|fS|fQ|fP|fO/i.3M(m[i])?\'aH\':H);if(e){1V(F j=0;j<A.fx.7v.1b;j++){c=\'2u\'+A.fx.7v[j]+e;o[c]=e==\'aH\'?[A.fx.5L(A.5S(f,c)),A.fx.5L(m[i])]:[2c(A.5S(f,c)),d]}}L{y[\'fN\']=m[i]}}1n}}L{y[a]=b}G H};1V(p in h){if(p==\'Y\'){F q=A.ax(h[p]);1V(6I in q){B.8H(6I,q[6I])}}L if(p==\'2Z\'){if(1c.8D)1V(F i=0;i<1c.8D.1b;i++){F s=1c.8D[i].fM||1c.8D[i].fL||P;if(s){1V(F j=0;j<s.1b;j++){if(s[j].fK==\'.\'+h[p]){F u=W bw(\'\\.\'+h[p]+\' {\');F v=s[j].Y.9d;F q=A.ax(v.48(u,\'\').48(/}/g,\'\'));1V(6I in q){B.8H(6I,q[6I])}}}}}}L{B.8H(p,h[p])}}y.11=l==\'1k\'?\'2v\':l;y.2N=\'2B\';z.3f=C(){F t=(W 6p()).6y();if(t>g.1H+z.9a){5h(z.2A);z.2A=P;1V(p in o){if(p=="1E")A.1m(y,"1E",o[p][1]);L if(28 o[p][1]==\'7M\')y[p]=\'6v(\'+o[p][1].r+\',\'+o[p][1].g+\',\'+o[p][1].b+\')\';L y[p]=o[p][1]+(p!=\'3j\'&&p!=\'87\'?\'Q\':\'\')}if(g.2x||g.1S)1V(F p in f.5I)if(p=="1E")A.1m(y,p,f.5I[p]);L y[p]="";y.11=g.2x?\'1k\':(l!=\'1k\'?l:\'2v\');y.2N=k;f.5e=P;if(A.cF(g.1T))g.1T.1x(f)}L{F n=t-B.9a;F a=n/g.1H;1V(p in o){if(28 o[p][1]==\'7M\'){y[p]=\'6v(\'+R(A.1e[g.1e](a,n,o[p][0].r,(o[p][1].r-o[p][0].r),g.1H))+\',\'+R(A.1e[g.1e](a,n,o[p][0].g,(o[p][1].g-o[p][0].g),g.1H))+\',\'+R(A.1e[g.1e](a,n,o[p][0].b,(o[p][1].b-o[p][0].b),g.1H))+\')\'}L{F b=A.1e[g.1e](a,n,o[p][0],(o[p][1]-o[p][0]),g.1H);if(p=="1E")A.1m(y,"1E",b);L y[p]=b+(p!=\'3j\'&&p!=\'87\'?\'Q\':\'\')}}}};z.2A=5Y(C(){z.3f()},13);f.5e=z},aF:C(a,b){if(b)a.5e.9a-=fJ;L{1P.5h(a.5e.2A);a.5e=P;A.2z(a,"fx")}}});A.ax=C(a){F b={};if(28 a==\'4B\'){a=a.5u().6W(\';\');1V(F i=0;i<a.1b;i++){8B=a[i].6W(\':\');if(8B.1b==2){b[A.cE(8B[0].48(/\\-(\\w)/g,C(m,c){G c.fI()}))]=A.cE(8B[1])}}}G b};A.fn.1U({fH:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.4N(B,a,b,\'3K\',\'5o\',c)})},fG:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.4N(B,a,b,\'3Z\',\'5o\',c)})},fF:C(a,b,c){G B.1r(\'1j\',C(){if(A.E(B,\'11\')==\'1k\'){W A.fx.4N(B,a,b,\'3Z\',\'6n\',c)}L{W A.fx.4N(B,a,b,\'3Z\',\'5o\',c)}})},fE:C(a,b,c){G B.1r(\'1j\',C(){if(A.E(B,\'11\')==\'1k\'){W A.fx.4N(B,a,b,\'3K\',\'6n\',c)}L{W A.fx.4N(B,a,b,\'3K\',\'5o\',c)}})},fD:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.4N(B,a,b,\'3K\',\'6n\',c)})},fC:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.4N(B,a,b,\'3Z\',\'6n\',c)})}});A.fx.4N=C(e,a,b,c,d,f){if(!A.4n(e)){A.2z(e,\'1j\');G H}F z=B;F g=H;z.el=A(e);z.1e=28 b==\'4B\'?b:f||P;z.29=28 b==\'C\'?b:P;z.1K=d;z.1l=a;z.26=A.12.2f(e);z.U={};z.U.T=z.el.E(\'T\');z.U.11=z.el.E(\'11\');if(z.U.11==\'1k\'){95=z.el.E(\'2W\');z.el.1S();g=14}z.U.O=z.el.E(\'O\');z.U.M=z.el.E(\'M\');if(g){z.el.2x();z.el.E(\'2W\',95)}z.U.V=z.26.w+\'Q\';z.U.S=z.26.h+\'Q\';z.U.2N=z.el.E(\'2N\');z.26.O=R(z.U.O)||0;z.26.M=R(z.U.M)||0;if(z.U.T!=\'2i\'&&z.U.T!=\'1J\'){z.el.E(\'T\',\'2i\')}z.el.E(\'2N\',\'2B\').E(\'S\',d==\'6n\'&&c==\'3K\'?1:z.26.h+\'Q\').E(\'V\',d==\'6n\'&&c==\'3Z\'?1:z.26.w+\'Q\');z.1T=C(){z.el.E(z.U);if(z.1K==\'5o\')z.el.2x();L z.el.1S();A.2z(z.el.I(0),\'1j\')};2X(c){19\'3K\':z.eh=W A.fx(z.el.I(0),A.1l(a-15,z.1e,b),\'S\');z.et=W A.fx(z.el.I(0),A.1l(z.1l,z.1e,z.1T),\'O\');if(z.1K==\'5o\'){z.eh.1G(z.26.h,0);z.et.1G(z.26.O,z.26.O+z.26.h/2)}L{z.eh.1G(0,z.26.h);z.et.1G(z.26.O+z.26.h/2,z.26.O)}1n;19\'3Z\':z.eh=W A.fx(z.el.I(0),A.1l(a-15,z.1e,b),\'V\');z.et=W A.fx(z.el.I(0),A.1l(z.1l,z.1e,z.1T),\'M\');if(z.1K==\'5o\'){z.eh.1G(z.26.w,0);z.et.1G(z.26.M,z.26.M+z.26.w/2)}L{z.eh.1G(0,z.26.w);z.et.1G(z.26.M+z.26.w/2,z.26.M)}1n}};A.fn.au=C(b,c,d){G B.1r(\'1j\',C(){if(!A.4n(B)){A.2z(B,\'1j\');G H}F a=W A.fx.au(B,b,c,d);a.at()})};A.fx.au=C(a,b,c,d){F z=B;z.74=c;z.52=1;z.el=a;z.1l=b;z.29=d;A(z.el).1S();z.at=C(){z.52++;z.e=W A.fx(z.el,A.1l(z.1l,C(){z.ef=W A.fx(z.el,A.1l(z.1l,C(){if(z.52<=z.74)z.at();L{A.2z(z.el,\'1j\');if(z.29&&z.29.1F==2w){z.29.1x(z.el)}}}),\'1E\');z.ef.1G(0,1)}),\'1E\');z.e.1G(1,0)}};A.fn.1U({fB:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.5E(B,a,1,1Y,14,b,\'cz\',c)})},fy:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.5E(B,a,1Y,1,14,b,\'as\',c)})},fw:C(b,c,d){G B.1r(\'1j\',C(){F a=a||\'d2\';W A.fx.5E(B,b,1Y,cX,14,c,\'5c\',a)})},5E:C(a,b,c,d,e,f){G B.1r(\'1j\',C(){W A.fx.5E(B,a,b,c,d,e,\'5E\',f)})}});A.fx.5E=C(e,f,g,h,j,k,m,q){if(!A.4n(e)){A.2z(e,\'1j\');G H}F z=B;z.el=A(e);z.6m=R(g)||1Y;z.3v=R(h)||1Y;z.1e=28 k==\'4B\'?k:q||P;z.29=28 k==\'C\'?k:P;z.1H=A.1l(f).1H;z.bL=j||P;z.26=A.12.2f(e);z.U={V:z.el.E(\'V\'),S:z.el.E(\'S\'),4a:z.el.E(\'4a\')||\'1Y%\',T:z.el.E(\'T\'),11:z.el.E(\'11\'),O:z.el.E(\'O\'),M:z.el.E(\'M\'),2N:z.el.E(\'2N\'),4x:z.el.E(\'4x\'),5i:z.el.E(\'5i\'),5d:z.el.E(\'5d\'),4y:z.el.E(\'4y\'),5b:z.el.E(\'5b\'),5g:z.el.E(\'5g\'),4Q:z.el.E(\'4Q\'),4F:z.el.E(\'4F\')};z.V=R(z.U.V)||e.3P||0;z.S=R(z.U.S)||e.5r||0;z.O=R(z.U.O)||0;z.M=R(z.U.M)||0;1o=[\'em\',\'Q\',\'fv\',\'%\'];1V(i in 1o){if(z.U.4a.3o(1o[i])>0){z.cy=1o[i];z.4a=2c(z.U.4a)}if(z.U.4x.3o(1o[i])>0){z.cx=1o[i];z.aq=2c(z.U.4x)||0}if(z.U.5i.3o(1o[i])>0){z.cw=1o[i];z.ap=2c(z.U.5i)||0}if(z.U.5d.3o(1o[i])>0){z.cv=1o[i];z.ao=2c(z.U.5d)||0}if(z.U.4y.3o(1o[i])>0){z.cu=1o[i];z.an=2c(z.U.4y)||0}if(z.U.5b.3o(1o[i])>0){z.ct=1o[i];z.am=2c(z.U.5b)||0}if(z.U.5g.3o(1o[i])>0){z.cr=1o[i];z.al=2c(z.U.5g)||0}if(z.U.4Q.3o(1o[i])>0){z.cq=1o[i];z.ak=2c(z.U.4Q)||0}if(z.U.4F.3o(1o[i])>0){z.cp=1o[i];z.aj=2c(z.U.4F)||0}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(z.aq)z.el.E(\'4x\',z.aq*a/1Y+z.cx);if(z.ap)z.el.E(\'5i\',z.ap*a/1Y+z.cw);if(z.ao)z.el.E(\'5d\',z.ao*a/1Y+z.cv);if(z.an)z.el.E(\'4y\',z.an*a/1Y+z.cu);if(z.am)z.el.E(\'5b\',z.am*a/1Y+z.ct);if(z.al)z.el.E(\'5g\',z.al*a/1Y+z.cr);if(z.ak)z.el.E(\'4Q\',z.ak*a/1Y+z.cq);if(z.aj)z.el.E(\'4F\',z.aj*a/1Y+z.cp);if(z.1K==\'5c\'){if(1P.6j)z.el.I(0).Y.4X="7s(1E="+e*1Y+")";z.el.I(0).Y.1E=e}if(d){if(z.bL){z.el.E(z.U)}if(z.1K==\'as\'||z.1K==\'5c\'){z.el.E(\'11\',\'1k\');if(z.1K==\'5c\'){if(1P.6j)z.el.I(0).Y.4X="7s(1E="+1Y+")";z.el.I(0).Y.1E=1}}L z.el.E(\'11\',\'2v\');if(z.29)z.29.1x(z.el.I(0));A.2z(z.el.I(0),\'1j\')}}};A.fn.1U({9A:C(a,b,c){o=A.1l(a);G B.1r(\'1j\',C(){W A.fx.9A(B,o,b,c)})},ft:C(a,b,c){G B.1y(C(){A(\'a[@2U*="#"]\',B).4U(C(e){co=B.2U.6W(\'#\');A(\'#\'+co[1]).9A(a,b,c);G H})})}});A.fx.9A=C(e,o,a,b){F z=B;z.o=o;z.e=e;z.2g=/cn|cm/.3M(a)?a:H;z.1e=b;p=A.12.3a(e);s=A.12.5O();z.4i=C(){5h(z.2A);z.2A=P;A.2z(z.e,\'1j\')};z.t=(W 6p).6y();s.h=s.h>s.ih?(s.h-s.ih):s.h;s.w=s.w>s.iw?(s.w-s.iw):s.w;z.4H=p.y>s.h?s.h:p.y;z.4r=p.x>s.w?s.w:p.x;z.3V=s.t;z.3Q=s.l;z.3f=C(){F t=(W 6p).6y();F n=t-z.t;F p=n/z.o.1H;if(t>=z.o.1H+z.t){z.4i();97(C(){z.ab(z.4H,z.4r)},13)}L{if(!z.2g||z.2g==\'cn\'){if(!A.1e||!A.1e[z.1e]){8v=((-Z.51(p*Z.2F)/2)+0.5)*(z.4H-z.3V)+z.3V}L{8v=A.1e[z.1e](p,n,z.3V,(z.4H-z.3V),z.o.1H)}}L{8v=z.3V}if(!z.2g||z.2g==\'cm\'){if(!A.1e||!A.1e[z.1e]){8u=((-Z.51(p*Z.2F)/2)+0.5)*(z.4r-z.3Q)+z.3Q}L{8u=A.1e[z.1e](p,n,z.3Q,(z.4r-z.3Q),z.o.1H)}}L{8u=z.3Q}z.ab(8v,8u)}};z.ab=C(t,l){1P.fs(l,t)};z.2A=5Y(C(){z.3f()},13)};A.fn.a8=C(a,b){G B.1r(\'1j\',C(){if(!A.4n(B)){A.2z(B,\'1j\');G H}F e=W A.fx.a8(B,a,b);e.a7()})};A.fx.a8=C(e,a,b){F z=B;z.el=A(e);z.el.1S();z.74=R(a)||3;z.29=b;z.52=1;z.U={};z.U.T=z.el.E(\'T\');z.U.O=R(z.el.E(\'O\'))||0;z.U.M=R(z.el.E(\'M\'))||0;if(z.U.T!=\'2i\'&&z.U.T!=\'1J\'){z.el.E(\'T\',\'2i\')}z.a7=C(){z.52++;z.e=W A.fx(z.el.I(0),{1H:60,1T:C(){z.e=W A.fx(z.el.I(0),{1H:60,1T:C(){z.e=W A.fx(e,{1H:60,1T:C(){if(z.52<=z.74)z.a7();L{z.el.E(\'T\',z.U.T).E(\'O\',z.U.O+\'Q\').E(\'M\',z.U.M+\'Q\');A.2z(z.el.I(0),\'1j\');if(z.29&&z.29.1F==2w){z.29.1x(z.el.I(0))}}}},\'M\');z.e.1G(z.U.M-20,z.U.M)}},\'M\');z.e.1G(z.U.M+20,z.U.M-20)}},\'M\');z.e.1G(z.U.M,z.U.M+20)}};A.fn.1U({dR:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'4l\',\'in\',c)})},c6:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'4l\',\'3U\',c)})},fr:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'4l\',\'3E\',c)})},fq:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'41\',\'in\',c)})},fp:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'41\',\'3U\',c)})},fo:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'41\',\'3E\',c)})},fm:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'M\',\'in\',c)})},fl:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'M\',\'3U\',c)})},fk:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'M\',\'3E\',c)})},fj:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'2D\',\'in\',c)})},fi:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'2D\',\'3U\',c)})},fh:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'2D\',\'3E\',c)})}});A.fx.1u=C(e,a,b,c,d,f){if(!A.4n(e)){A.2z(e,\'1j\');G H}F z=B;z.el=A(e);z.1e=28 b==\'4B\'?b:f||P;z.29=28 b==\'C\'?b:P;if(d==\'3E\'){d=z.el.E(\'11\')==\'1k\'?\'in\':\'3U\'}if(!e.4f)e.4f=z.el.E(\'11\');z.el.1S();z.1l=a;z.fx=A.fx.9u(e);z.1K=d;z.6T=c;z.1T=C(){if(z.1K==\'3U\')z.el.E(\'2W\',\'2B\');A.fx.9n(z.fx.2Y.I(0),z.fx.U);if(z.1K==\'in\'){z.el.E(\'11\',z.el.I(0).4f==\'1k\'?\'2v\':z.el.I(0).4f)}L{z.el.E(\'11\',\'1k\');z.el.E(\'2W\',\'cl\')}if(z.29&&z.29.1F==2w){z.29.1x(z.el.I(0))}A.2z(z.el.I(0),\'1j\')};2X(z.6T){19\'4l\':z.ef=W A.fx(z.el.I(0),A.1l(z.1l,z.1e,z.1T),\'O\');z.79=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e),\'S\');if(z.1K==\'in\'){z.ef.1G(-z.fx.U.1o.hb,0);z.79.1G(0,z.fx.U.1o.hb)}L{z.ef.1G(0,-z.fx.U.1o.hb);z.79.1G(z.fx.U.1o.hb,0)}1n;19\'41\':z.ef=W A.fx(z.el.I(0),A.1l(z.1l,z.1e,z.1T),\'O\');if(z.1K==\'in\'){z.ef.1G(z.fx.U.1o.hb,0)}L{z.ef.1G(0,z.fx.U.1o.hb)}1n;19\'M\':z.ef=W A.fx(z.el.I(0),A.1l(z.1l,z.1e,z.1T),\'M\');z.79=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e),\'V\');if(z.1K==\'in\'){z.ef.1G(-z.fx.U.1o.1D,0);z.79.1G(0,z.fx.U.1o.1D)}L{z.ef.1G(0,-z.fx.U.1o.1D);z.79.1G(z.fx.U.1o.1D,0)}1n;19\'2D\':z.ef=W A.fx(z.el.I(0),A.1l(z.1l,z.1e,z.1T),\'M\');if(z.1K==\'in\'){z.ef.1G(z.fx.U.1o.1D,0)}L{z.ef.1G(0,z.fx.U.1o.1D)}1n}};A.2O=P;A.fn.fg=C(o){G B.1r(\'1j\',C(){W A.fx.cj(B,o)})};A.fx.cj=C(e,o){if(A.2O==P){A(\'23\',1c).1L(\'<1W id="2O"></1W>\');A.2O=A(\'#2O\')}A.2O.E(\'11\',\'2v\').E(\'T\',\'1J\');F z=B;z.el=A(e);if(!o||!o.3v){G}if(o.3v.1F==8t&&1c.7o(o.3v)){o.3v=1c.7o(o.3v)}L if(!o.3v.ci){G}if(!o.1H){o.1H=ch}z.1H=o.1H;z.3v=o.3v;z.7e=o.2Z;z.1T=o.1T;if(z.7e){A.2O.2H(z.7e)}z.8s=0;z.8i=0;if(A.e0){z.8s=(R(A.2O.E(\'4y\'))||0)+(R(A.2O.E(\'5i\'))||0)+(R(A.2O.E(\'4F\'))||0)+(R(A.2O.E(\'5g\'))||0);z.8i=(R(A.2O.E(\'4x\'))||0)+(R(A.2O.E(\'5d\'))||0)+(R(A.2O.E(\'5b\'))||0)+(R(A.2O.E(\'4Q\'))||0)}z.2b=A.1U(A.12.3a(z.el.I(0)),A.12.2f(z.el.I(0)));z.3m=A.1U(A.12.3a(z.3v),A.12.2f(z.3v));z.2b.1D-=z.8s;z.2b.hb-=z.8i;z.3m.1D-=z.8s;z.3m.hb-=z.8i;z.29=o.1T;A.2O.E(\'V\',z.2b.1D+\'Q\').E(\'S\',z.2b.hb+\'Q\').E(\'O\',z.2b.y+\'Q\').E(\'M\',z.2b.x+\'Q\').4S({O:z.3m.y,M:z.3m.x,V:z.3m.1D,S:z.3m.hb},z.1H,C(){if(z.7e)A.2O.3S(z.7e);A.2O.E(\'11\',\'1k\');if(z.1T&&z.1T.1F==2w){z.1T.1x(z.el.I(0),[z.3v])}A.2z(z.el.I(0),\'1j\')})};A.1q={24:{2u:10,cf:\'1R/ff.ce\',cd:\'<3O 2E="1R/5o.cc" />\',cb:0.8,ca:\'fb 8G\',c9:\'6m\',3F:7n},fa:H,f8:H,5A:P,7m:H,7l:H,a3:C(a){if(!A.1q.7l||A.1q.7m)G;F b=a.6S||a.6R||-1;2X(b){19 35:if(A.1q.5A)A.1q.2b(P,A(\'a[@4o=\'+A.1q.5A+\']:f7\').I(0));1n;19 36:if(A.1q.5A)A.1q.2b(P,A(\'a[@4o=\'+A.1q.5A+\']:f6\').I(0));1n;19 37:19 8:19 33:19 80:19 f4:F c=A(\'#7j\');if(c.I(0).4q!=P){c.I(0).4q.1x(c.I(0))}1n;19 38:1n;19 39:19 34:19 32:19 fd:19 78:F d=A(\'#7h\');if(d.I(0).4q!=P){d.I(0).4q.1x(d.I(0))}1n;19 40:1n;19 27:A.1q.8q();1n}},6g:C(a){if(a)A.1U(A.1q.24,a);if(1P.3N){A(\'23\',1c).1C(\'5Q\',A.1q.a3)}L{A(1c).1C(\'5Q\',A.1q.a3)}A(\'a\').1y(C(){el=A(B);c5=el.1m(\'4o\')||\'\';c4=el.1m(\'2U\')||\'\';cg=/\\.cc|\\.f2|\\.7q|\\.ce|\\.f1/g;if(c4.5u().aD(cg)!=P&&c5.5u().3o(\'c2\')==0){el.1C(\'4U\',A.1q.2b)}});if(A.2R.46){3q=1c.3x(\'3q\');A(3q).1m({id:\'a1\',2E:\'dc:H;\',da:\'b0\',d7:\'b0\'}).E({11:\'1k\',T:\'1J\',O:\'0\',M:\'0\',4X:\'9x:9C.9E.a6(1E=0)\'});A(\'23\').1L(3q)}7r=1c.3x(\'1W\');A(7r).1m(\'id\',\'a0\').E({T:\'1J\',11:\'1k\',O:\'0\',M:\'0\',1E:0}).1L(1c.8b(\' \')).1C(\'4U\',A.1q.8q);5C=1c.3x(\'1W\');A(5C).1m(\'id\',\'c0\').E({4F:A.1q.24.2u+\'Q\'}).1L(1c.8b(\' \'));9Z=1c.3x(\'1W\');A(9Z).1m(\'id\',\'bY\').E({4F:A.1q.24.2u+\'Q\',4Q:A.1q.24.2u+\'Q\'}).1L(1c.8b(\' \'));9Y=1c.3x(\'a\');A(9Y).1m({id:\'f0\',2U:\'#\'}).E({T:\'1J\',2D:A.1q.24.2u+\'Q\',O:\'0\'}).1L(A.1q.24.cd).1C(\'4U\',A.1q.8q);6Z=1c.3x(\'1W\');A(6Z).1m(\'id\',\'9X\').E({T:\'2i\',9W:\'M\',5X:\'0 8x\',3j:1}).1L(5C).1L(9Z).1L(9Y);21=1c.3x(\'3O\');21.2E=A.1q.24.cf;A(21).1m(\'id\',\'bW\').E({T:\'1J\'});5G=1c.3x(\'a\');A(5G).1m({id:\'7j\',2U:\'#\'}).E({T:\'1J\',11:\'1k\',2N:\'2B\',cC:\'1k\'}).1L(1c.8b(\' \'));5F=1c.3x(\'a\');A(5F).1m({id:\'7h\',2U:\'#\'}).E({T:\'1J\',2N:\'2B\',cC:\'1k\'}).1L(1c.8b(\' \'));2q=1c.3x(\'1W\');A(2q).1m(\'id\',\'bT\').E({11:\'1k\',T:\'2i\',2N:\'2B\',9W:\'M\',5X:\'0 8x\',O:\'0\',M:\'0\',3j:2}).1L([21,5G,5F]);5Z=1c.3x(\'1W\');A(5Z).1m(\'id\',\'8m\').E({11:\'1k\',T:\'1J\',2N:\'2B\',O:\'0\',M:\'0\',9W:\'az\',6P:\'b7\',eY:\'0\'}).1L([2q,6Z]);A(\'23\').1L(7r).1L(5Z)},2b:C(e,a){el=a?A(a):A(B);8J=el.1m(\'4o\');F b,4E,5G,5F;if(8J!=\'c2\'){A.1q.5A=8J;7F=A(\'a[@4o=\'+8J+\']\');b=7F.1N();4E=7F.aY(a?a:B);5G=7F.I(4E-1);5F=7F.I(4E+1)}aw=el.1m(\'2U\');5C=el.1m(\'3T\');3R=A.12.5O();7r=A(\'#a0\');if(!A.1q.7l){A.1q.7l=14;if(A.2R.46){A(\'#a1\').E(\'S\',Z.3g(3R.ih,3R.h)+\'Q\').E(\'V\',Z.3g(3R.iw,3R.w)+\'Q\').1S()}7r.E(\'S\',Z.3g(3R.ih,3R.h)+\'Q\').E(\'V\',Z.3g(3R.iw,3R.w)+\'Q\').1S().bS(bz,A.1q.24.cb,C(){A.1q.aB(aw,5C,3R,b,4E,5G,5F)});A(\'#8m\').E(\'V\',Z.3g(3R.iw,3R.w)+\'Q\')}L{A(\'#7j\').I(0).4q=P;A(\'#7h\').I(0).4q=P;A.1q.aB(aw,5C,3R,b,4E,5G,5F)}G H},aB:C(a,b,c,d,e,f,g){A(\'#aA\').9U();8l=A(\'#7j\');8l.2x();8k=A(\'#7h\');8k.2x();21=A(\'#bW\');2q=A(\'#bT\');5Z=A(\'#8m\');6Z=A(\'#9X\').E(\'2W\',\'2B\');A(\'#c0\').3i(5C);A.1q.7m=14;if(d)A(\'#bY\').3i(A.1q.24.ca+\' \'+(e+1)+\' \'+A.1q.24.c9+\' \'+d);if(f){8l.I(0).4q=C(){B.4W();A.1q.2b(P,f);G H}}if(g){8k.I(0).4q=C(){B.4W();A.1q.2b(P,g);G H}}21.1S();7u=A.12.2f(2q.I(0));4C=Z.3g(7u.1D,21.I(0).V+A.1q.24.2u*2);59=Z.3g(7u.hb,21.I(0).S+A.1q.24.2u*2);21.E({M:(4C-21.I(0).V)/2+\'Q\',O:(59-21.I(0).S)/2+\'Q\'});2q.E({V:4C+\'Q\',S:59+\'Q\'}).1S();bQ=A.12.a5();5Z.E(\'O\',c.t+(bQ.h/15)+\'Q\');if(5Z.E(\'11\')==\'1k\'){5Z.1S().6U(A.1q.24.3F)}5H=W 8M;A(5H).1m(\'id\',\'aA\').1C(\'eP\',C(){4C=5H.V+A.1q.24.2u*2;59=5H.S+A.1q.24.2u*2;21.2x();2q.4S({S:59},7u.hb!=59?A.1q.24.3F:1,C(){2q.4S({V:4C},7u.1D!=4C?A.1q.24.3F:1,C(){2q.aJ(5H);A(5H).E({T:\'1J\',M:A.1q.24.2u+\'Q\',O:A.1q.24.2u+\'Q\'}).6U(A.1q.24.3F,C(){cL=A.12.2f(6Z.I(0));if(f){8l.E({M:A.1q.24.2u+\'Q\',O:A.1q.24.2u+\'Q\',V:4C/2-A.1q.24.2u*3+\'Q\',S:59-A.1q.24.2u*2+\'Q\'}).1S()}if(g){8k.E({M:4C/2+A.1q.24.2u*2+\'Q\',O:A.1q.24.2u+\'Q\',V:4C/2-A.1q.24.2u*3+\'Q\',S:59-A.1q.24.2u*2+\'Q\'}).1S()}6Z.E({V:4C+\'Q\',O:-cL.hb+\'Q\',2W:\'cl\'}).4S({O:-1},A.1q.24.3F,C(){A.1q.7m=H})})})})});5H.2E=a},8q:C(){A(\'#aA\').9U();A(\'#8m\').2x();A(\'#9X\').E(\'2W\',\'2B\');A(\'#a0\').bS(bz,0,C(){A(B).2x();if(A.2R.46){A(\'#a1\').2x()}});A(\'#7j\').I(0).4q=P;A(\'#7h\').I(0).4q=P;A.1q.5A=P;A.1q.7l=H;A.1q.7m=H;G H}};A.N={1v:P,3A:P,1g:P,1A:P,1o:P,T:P,7f:C(e){A.N.1g=(B.9T)?B.9T:B;A.N.1A=A.12.3W(e);A.N.1o={V:R(A(A.N.1g).E(\'V\'))||0,S:R(A(A.N.1g).E(\'S\'))||0};A.N.T={O:R(A(A.N.1g).E(\'O\'))||0,M:R(A(A.N.1g).E(\'M\'))||0};A(1c).1C(\'3t\',A.N.aO).1C(\'5n\',A.N.aN);if(28 A.N.1g.1h.bO===\'C\'){A.N.1g.1h.bO.1x(A.N.1g)}G H},aN:C(e){A(1c).3h(\'3t\',A.N.aO).3h(\'5n\',A.N.aN);if(28 A.N.1g.1h.cO===\'C\'){A.N.1g.1h.cO.1x(A.N.1g)}A.N.1g=P},aO:C(e){if(!A.N.1g){G}1A=A.12.3W(e);6c=A.N.T.O-A.N.1A.y+1A.y;77=A.N.T.M-A.N.1A.x+1A.x;6c=Z.3g(Z.3k(6c,A.N.1g.1h.7d-A.N.1o.S),A.N.1g.1h.6F);77=Z.3g(Z.3k(77,A.N.1g.1h.7c-A.N.1o.V),A.N.1g.1h.6u);if(28 A.N.1g.1h.4h===\'C\'){F a=A.N.1g.1h.4h.1x(A.N.1g,[77,6c]);if(28 a==\'eI\'&&a.1b==2){77=a[0];6c=a[1]}}A.N.1g.Y.O=6c+\'Q\';A.N.1g.Y.M=77+\'Q\';G H},2b:C(e){A(1c).1C(\'3t\',A.N.7g).1C(\'5n\',A.N.7w);A.N.1v=B.1v;A.N.3A=B.3A;A.N.1A=A.12.3W(e);A.N.1o={V:R(A(B.1v).E(\'V\'))||0,S:R(A(B.1v).E(\'S\'))||0};A.N.T={O:R(A(B.1v).E(\'O\'))||0,M:R(A(B.1v).E(\'M\'))||0};if(A.N.1v.1h.4c){A.N.1v.1h.4c.1x(A.N.1v,[B])}G H},7w:C(){A(1c).3h(\'3t\',A.N.7g).3h(\'5n\',A.N.7w);if(A.N.1v.1h.3C){A.N.1v.1h.3C.1x(A.N.1v,[A.N.3A])}A.N.1v=P;A.N.3A=P},5N:C(a,b){G Z.3k(Z.3g(A.N.1o.V+a*b,A.N.1v.1h.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a.1h.5k);if(9N.1N()>0){9N.1y(C(){B.9T=a});9N.1C(\'4R\',A.N.7f)}}L if(a.1h.5k==14){A(B).1C(\'4R\',A.N.7f)}}})},4v:C(){G B.1y(C(){F a=B;1V(i in a.1h.3G){a.1h.3G[i].1v=P;a.1h.3G[i].3A=P;A(a.1h.3G[i]).3h(\'4R\',A.N.2b)}if(a.1h.5k){if(28 a.1h.5k===\'4B\'){3c=A(a.1h.5k);if(3c.1N()>0){3c.3h(\'4R\',A.N.7f)}}L if(a.1h.5k==14){A(B).3h(\'4R\',A.N.7f)}}a.1h=P})}};A.fn.1U({jk:A.N.2l,jj:A.N.4v});A.2t=P;A.6J=H;A.31=P;A.6B=[];A.9L=C(e){F a=e.6S||e.6R||-1;if(a==17||a==16){A.6J=14}};A.9J=C(e){A.6J=H};A.eB=C(e){B.f.1A=A.12.3W(e);B.f.1I=A.1U(A.12.3a(B),A.12.2f(B));B.f.4p=A.12.5O(B);B.f.1A.x-=B.f.1I.x;B.f.1A.y-=B.f.1I.y;A(B).1L(A.2t.I(0));if(B.f.hc)A.2t.2H(B.f.hc).E(\'11\',\'2v\');A.2t.E({11:\'2v\',V:\'2G\',S:\'2G\'});if(B.f.o){A.2t.E(\'1E\',B.f.o)}A.31=B;A.7A=H;A.6B=[];B.f.el.1y(C(){B.1I={x:B.7Y+(B.4u&&!A.2R.6l?R(B.4u.4y)||0:0)+(A.31.2P||0),y:B.7t+(B.4u&&!A.2R.6l?R(B.4u.4x)||0:0)+(A.31.2T||0),1D:B.3P,hb:B.5r};if(B.s==14){if(A.6J==H){B.s=H;A(B).3S(A.31.f.71)}L{A.7A=14;A.6B[A.6B.1b]=A.1m(B,\'id\')}}});A.9H.1x(B,[e]);A(1c).1C(\'3t\',A.9H).1C(\'5n\',A.bI);G H};A.9H=C(e){if(!A.31)G;A.eA.1x(A.31,[e])};A.eA=C(e){if(!A.31)G;F a=A.12.3W(e);F b=A.12.5O(A.31);a.x+=b.l-B.f.4p.l-B.f.1I.x;a.y+=b.t-B.f.4p.t-B.f.1I.y;F c=Z.3k(a.x,B.f.1A.x);F d=Z.3k(Z.3B(a.x-B.f.1A.x),Z.3B(B.f.4p.w-c));F f=Z.3k(a.y,B.f.1A.y);F g=Z.3k(Z.3B(a.y-B.f.1A.y),Z.3B(B.f.4p.h-f));if(B.2T>0&&a.y-20<B.2T){F h=Z.3k(b.t,10);f-=h;g+=h;B.2T-=h}L if(B.2T+B.f.1I.h<B.f.4p.h&&a.y+20>B.2T+B.f.1I.h){F h=Z.3k(B.f.4p.h-B.2T,10);B.2T+=h;if(B.2T!=b.t)g+=h}if(B.2P>0&&a.x-20<B.2P){F h=Z.3k(b.l,10);c-=h;d+=h;B.2P-=h}L if(B.2P+B.f.1I.w<B.f.4p.w&&a.x+20>B.2P+B.f.1I.w){F h=Z.3k(B.f.4p.w-B.2P,10);B.2P+=h;if(B.2P!=b.l)d+=h}A.2t.E({M:c+\'Q\',O:f+\'Q\',V:d+\'Q\',S:g+\'Q\'});A.2t.l=c+B.f.4p.l;A.2t.t=f+B.f.4p.t;A.2t.r=A.2t.l+d;A.2t.b=A.2t.t+g;A.7A=H;B.f.el.1y(C(){9G=A.6B.3o(A.1m(B,\'id\'));if(!(B.1I.x>A.2t.r||(B.1I.x+B.1I.1D)<A.2t.l||B.1I.y>A.2t.b||(B.1I.y+B.1I.hb)<A.2t.t)){A.7A=14;if(B.s!=14){B.s=14;A(B).2H(A.31.f.71)}if(9G!=-1){B.s=H;A(B).3S(A.31.f.71)}}L if((B.s==14)&&(9G==-1)){B.s=H;A(B).3S(A.31.f.71)}L if((!B.s)&&(A.6J==14)&&(9G!=-1)){B.s=14;A(B).2H(A.31.f.71)}});G H};A.bI=C(e){if(!A.31)G;A.ez.1x(A.31,[e])};A.ez=C(e){A(1c).3h(\'3t\',A.9H).3h(\'5n\',A.bI);if(!A.31)G;A.2t.E(\'11\',\'1k\');if(B.f.hc)A.2t.3S(B.f.hc);A.31=H;A(\'23\').1L(A.2t.I(0));if(A.7A==14){if(B.f.8d)B.f.8d(A.bF(A.1m(B,\'id\')))}L{if(B.f.8c)B.f.8c(A.bF(A.1m(B,\'id\')))}A.6B=[]};A.bF=C(s){F h=\'\';F o=[];if(a=A(\'#\'+s)){a.I(0).f.el.1y(C(){if(B.s==14){if(h.1b>0){h+=\'&\'}h+=s+\'[]=\'+A.1m(B,\'id\');o[o.1b]=A.1m(B,\'id\')}})}G{6A:h,o:o}};A.fn.jg=C(o){if(!A.2t){A(\'23\',1c).1L(\'<1W id="2t"></1W>\').1C(\'70\',A.9L).1C(\'5Q\',A.9J);A.2t=A(\'#2t\');A.2t.E({T:\'1J\',11:\'1k\'});if(1P.3N){A(\'23\',1c).1C(\'70\',A.9L).1C(\'5Q\',A.9J)}L{A(1c).1C(\'70\',A.9L).1C(\'5Q\',A.9J)}}if(!o){o={}}G B.1y(C(){if(B.ey)G;B.ey=14;B.f={a:o.3r,o:o.1E?2c(o.1E):H,71:o.ex?o.ex:H,hc:o.4G?o.4G:H,8d:o.8d?o.8d:H,8c:o.8c?o.8c:H};B.f.el=A(\'.\'+o.3r);A(B).1C(\'4R\',A.eB).E(\'T\',\'2i\')})};A.2Q={aT:1,ew:C(b){F b=b;G B.1y(C(){B.4g.69.1y(C(a){A.2Q.4s(B,b[a])})})},I:C(){F e=[];B.1y(C(b){if(B.bD){e[b]=[];F c=B;F d=A.12.2f(B);B.4g.69.1y(C(a){F x=B.7Y;F y=B.7t;7B=R(x*1Y/(d.w-B.3P));7C=R(y*1Y/(d.h-B.5r));e[b][a]=[7B||0,7C||0,x||0,y||0]})}});G e},ad:C(a){a.D.ep=a.D.1Z.w-a.D.1w.1D;a.D.eo=a.D.1Z.h-a.D.1w.hb;if(a.92.4g.bB){8Z=a.92.4g.69.I(a.bA+1);if(8Z){a.D.1Z.w=(R(A(8Z).E(\'M\'))||0)+a.D.1w.1D;a.D.1Z.h=(R(A(8Z).E(\'O\'))||0)+a.D.1w.hb}9f=a.92.4g.69.I(a.bA-1);if(9f){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,dx,dy]);if(57.1F==6E){dx=57.dx;dy=57.dy}2n=a.D.22.x+dx;2j=a.D.22.y+dy}57=A.X.ae.1x(a,[2n,2j,dx,dy]);if(57&&57.1F==6E){dx=57.dx;dy=57.dy}2n=a.D.22.x+dx;2j=a.D.22.y+dy;if(a.D.4P&&(a.D.3n||a.D.2I)){A.2Q.3n(a,2n,2j)}2n=!a.D.2g||a.D.2g==\'3Z\'?2n:a.D.22.x||0;2j=!a.D.2g||a.D.2g==\'3K\'?2j:a.D.22.y||0;a.Y.M=2n+\'Q\';a.Y.O=2j+\'Q\'},2l:C(o){G B.1y(C(){if(B.bD==14||!o.3r||!A.12||!A.X||!A.1s){G}4Y=A(o.3r,B);if(4Y.1N()==0){G}F b={2e:\'7X\',4P:14,3n:o.3n&&o.3n.1F==2w?o.3n:P,2I:o.2I&&o.2I.1F==2w?o.2I:P,3c:B,1E:o.1E||H};if(o.2C&&R(o.2C)){b.2C=R(o.2C)||1;b.2C=b.2C>0?b.2C:1}if(4Y.1N()==1)4Y.6r(b);L{A(4Y.I(0)).6r(b);b.3c=P;4Y.6r(b)}4Y.70(A.2Q.d3);4Y.1m(\'aT\',A.2Q.aT++);B.bD=14;B.4g={};B.4g.ec=b.ec;B.4g.2C=b.2C;B.4g.69=4Y;B.4g.bB=o.bB?14:H;by=B;by.4g.69.1y(C(a){B.bA=a;B.92=by});if(o.5f&&o.5f.1F==6h){1V(i=o.5f.1b-1;i>=0;i--){if(o.5f[i].1F==6h&&o.5f[i].1b==2){el=B.4g.69.I(i);if(el.4D){A.2Q.4s(el,o.5f[i])}}}}})}};A.fn.1U({jc:A.2Q.2l,jb:A.2Q.ew,ja:A.2Q.I});A.2p={56:[],ea:C(){B.4W();1d=B.2S;id=A.1m(1d,\'id\');if(A.2p.56[id]!=P){1P.5h(A.2p.56[id])}1u=1d.J.3d+1;if(1d.J.1R.1b<1u){1u=1}1R=A(\'3O\',1d.J.4O);1d.J.3d=1u;if(1R.1N()>0){1R.6d(1d.J.3F,A.2p.7J)}},di:C(){B.4W();1d=B.2S;id=A.1m(1d,\'id\');if(A.2p.56[id]!=P){1P.5h(A.2p.56[id])}1u=1d.J.3d-1;1R=A(\'3O\',1d.J.4O);if(1u<1){1u=1d.J.1R.1b}1d.J.3d=1u;if(1R.1N()>0){1R.6d(1d.J.3F,A.2p.7J)}},2A:C(c){1d=1c.7o(c);if(1d.J.63){1u=1d.J.3d;6k(1u==1d.J.3d){1u=1+R(Z.63()*1d.J.1R.1b)}}L{1u=1d.J.3d+1;if(1d.J.1R.1b<1u){1u=1}}1R=A(\'3O\',1d.J.4O);1d.J.3d=1u;if(1R.1N()>0){1R.6d(1d.J.3F,A.2p.7J)}},go:C(o){F a;if(o&&o.1F==6E){if(o.21){a=1c.7o(o.21.1d);5v=1P.j8.2U.6W("#");o.21.5J=P;if(5v.1b==2){1u=R(5v[1]);1S=5v[1].48(1u,\'\');if(A.1m(a,\'id\')!=1S){1u=1}}L{1u=1}}if(o.84){o.84.4W();a=o.84.2S.2S;id=A.1m(a,\'id\');if(A.2p.56[id]!=P){1P.5h(A.2p.56[id])}5v=o.84.2U.6W("#");1u=R(5v[1]);1S=5v[1].48(1u,\'\');if(A.1m(a,\'id\')!=1S){1u=1}}if(a.J.1R.1b<1u||1u<1){1u=1}a.J.3d=1u;4t=A.12.2f(a);e4=A.12.9y(a);e3=A.12.6b(a);if(a.J.3e){a.J.3e.o.E(\'11\',\'1k\')}if(a.J.3b){a.J.3b.o.E(\'11\',\'1k\')}if(a.J.21){y=R(e4.t)+R(e3.t);if(a.J.1Q){if(a.J.1Q.4J==\'O\'){y+=a.J.1Q.45.hb}L{4t.h-=a.J.1Q.45.hb}}if(a.J.2o){if(a.J.2o&&a.J.2o.5V==\'O\'){y+=a.J.2o.45.hb}L{4t.h-=a.J.2o.45.hb}}if(!a.J.bu){a.J.e1=o.21?o.21.S:(R(a.J.21.E(\'S\'))||0);a.J.bu=o.21?o.21.V:(R(a.J.21.E(\'V\'))||0)}a.J.21.E(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d-1;if(3e<1){3e=1d.J.1R.1b}1d.J.3b.o.E(\'11\',\'2v\').E(\'O\',y+\'Q\').E(\'M\',x+2*B.V/3+\'Q\').E(\'V\',B.V/3+\'Q\').E(\'S\',B.S+\'Q\').1m(\'3T\',1d.J.1R[3b-1].5W);1d.J.3b.o.I(0).2U=\'#\'+3b+A.1m(1d,\'id\');1d.J.3e.o.E(\'11\',\'2v\').E(\'O\',y+\'Q\').E(\'M\',x+\'Q\').E(\'V\',B.V/3+\'Q\').E(\'S\',B.S+\'Q\').1m(\'3T\',1d.J.1R[3e-1].5W);1d.J.3e.o.I(0).2U=\'#\'+3e+A.1m(1d,\'id\')},2l:C(o){if(!o||!o.2q||A.2p.56[o.2q])G;F a=A(\'#\'+o.2q);F c=a.I(0);if(c.Y.T!=\'1J\'&&c.Y.T!=\'2i\'){c.Y.T=\'2i\'}c.Y.2N=\'2B\';if(a.1N()==0)G;c.J={};c.J.1R=o.1R?o.1R:[];c.J.63=o.63&&o.63==14||H;7T=c.dj(\'j3\');1V(i=0;i<7T.1b;i++){6e=c.J.1R.1b;c.J.1R[6e]={2E:7T[i].2E,5W:7T[i].3T||7T[i].j2||\'\'}}if(c.J.1R.1b==0){G}c.J.49=A.1U(A.12.3a(c),A.12.2f(c));c.J.bp=A.12.9y(c);c.J.bo=A.12.6b(c);t=R(c.J.bp.t)+R(c.J.bo.t);b=R(c.J.bp.b)+R(c.J.bo.b);A(\'3O\',c).9U();c.J.3F=o.3F?o.3F:ch;if(o.4J||o.82||o.5s){c.J.1Q={};a.1L(\'<1W 68="dZ"></1W>\');c.J.1Q.o=A(\'.dZ\',c);if(o.82){c.J.1Q.82=o.82;c.J.1Q.o.2H(o.82)}if(o.5s){c.J.1Q.5s=o.5s}c.J.1Q.o.E(\'T\',\'1J\').E(\'V\',c.J.49.w+\'Q\');if(o.4J&&o.4J==\'O\'){c.J.1Q.4J=\'O\';c.J.1Q.o.E(\'O\',t+\'Q\')}L{c.J.1Q.4J=\'4e\';c.J.1Q.o.E(\'4e\',b+\'Q\')}c.J.1Q.9v=o.9v?o.9v:\' \';1V(F i=0;i<c.J.1R.1b;i++){6e=R(i)+1;c.J.1Q.o.1L(\'<a 2U="#\'+6e+o.2q+\'" 68="iY" 3T="\'+c.J.1R[i].5W+\'">\'+6e+\'</a>\'+(6e!=c.J.1R.1b?c.J.1Q.9v:\'\'))}A(\'a\',c.J.1Q.o).1C(\'4U\',C(){A.2p.go({84:B})});c.J.1Q.45=A.12.2f(c.J.1Q.o.I(0))}if(o.5V||o.81){c.J.2o={};a.1L(\'<1W 68="dW">&6G;</1W>\');c.J.2o.o=A(\'.dW\',c);if(o.81){c.J.2o.81=o.81;c.J.2o.o.2H(o.81)}c.J.2o.o.E(\'T\',\'1J\').E(\'V\',c.J.49.w+\'Q\');if(o.5V&&o.5V==\'O\'){c.J.2o.5V=\'O\';c.J.2o.o.E(\'O\',(c.J.1Q&&c.J.1Q.4J==\'O\'?c.J.1Q.45.hb+t:t)+\'Q\')}L{c.J.2o.5V=\'4e\';c.J.2o.o.E(\'4e\',(c.J.1Q&&c.J.1Q.4J==\'4e\'?c.J.1Q.45.hb+b:b)+\'Q\')}c.J.2o.45=A.12.2f(c.J.2o.o.I(0))}if(o.9j){c.J.3b={9j:o.9j};a.1L(\'<a 2U="#2\'+o.2q+\'" 68="dV">&6G;</a>\');c.J.3b.o=A(\'.dV\',c);c.J.3b.o.E(\'T\',\'1J\').E(\'11\',\'1k\').E(\'2N\',\'2B\').E(\'4a\',\'dU\').2H(c.J.3b.9j);c.J.3b.o.1C(\'4U\',A.2p.ea)}if(o.9t){c.J.3e={9t:o.9t};a.1L(\'<a 2U="#0\'+o.2q+\'" 68="dS">&6G;</a>\');c.J.3e.o=A(\'.dS\',c);c.J.3e.o.E(\'T\',\'1J\').E(\'11\',\'1k\').E(\'2N\',\'2B\').E(\'4a\',\'dU\').2H(c.J.3e.9t);c.J.3e.o.1C(\'4U\',A.2p.di)}a.aJ(\'<1W 68="bt"></1W>\');c.J.4O=A(\'.bt\',c);c.J.4O.E(\'T\',\'1J\').E(\'O\',\'2G\').E(\'M\',\'2G\').E(\'11\',\'1k\');if(o.21){a.aJ(\'<1W 68="dz" Y="11: 1k;"><3O 2E="\'+o.21+\'" /></1W>\');c.J.21=A(\'.dz\',c);c.J.21.E(\'T\',\'1J\');F d=W 8M();d.1d=o.2q;d.2E=o.21;if(d.1T){d.5J=P;A.2p.go({21:d})}L{d.5J=C(){A.2p.go({21:B})}}}L{A.2p.go({2q:c})}if(o.ba){dQ=R(o.ba)*8V}A.2p.56[o.2q]=o.ba?1P.5Y(\'A.2p.2A(\\\'\'+o.2q+\'\\\')\',dQ):P}};A.1d=A.2p.2l;A.1p={73:[],54:{},18:H,6X:P,2b:C(){if(A.X.1g==P){G}F a,3s,c,cs;A.1p.18.I(0).2Z=A.X.1g.D.5z;a=A.1p.18.I(0).Y;a.11=\'2v\';A.1p.18.1w=A.1U(A.12.3a(A.1p.18.I(0)),A.12.2f(A.1p.18.I(0)));a.V=A.X.1g.D.1w.1D+\'Q\';a.S=A.X.1g.D.1w.hb+\'Q\';3s=A.12.b2(A.X.1g);a.4M=3s.t;a.53=3s.r;a.4L=3s.b;a.4K=3s.l;if(A.X.1g.D.3L==14){c=A(A.X.1g).cA(14).I(0);cs=c.Y;cs.4M=\'2G\';cs.53=\'2G\';cs.4L=\'2G\';cs.4K=\'2G\';cs.11=\'2v\';A.1p.18.58().1L(c)}A(A.X.1g).dO(A.1p.18.I(0));A.X.1g.Y.11=\'1k\'},c7:C(e){if(!e.D.3I&&A.1s.4T.bC){if(e.D.3C)e.D.3C.1x(1g);A(e).E(\'T\',e.D.av||e.D.49);A(e).8j();A(A.1s.4T).dN(e)}A.1p.18.3S(e.D.5z).3i(\'&6G;\');A.1p.6X=P;F a=A.1p.18.I(0).Y;a.11=\'1k\';A.1p.18.dO(e);if(e.D.fx>0){A(e).6U(e.D.fx)}A(\'23\').1L(A.1p.18.I(0));F b=[];F c=H;1V(F i=0;i<A.1p.73.1b;i++){F d=A.1s.3p[A.1p.73[i]].I(0);F f=A.1m(d,\'id\');F g=A.1p.8g(f);if(d.1f.9P!=g.6A){d.1f.9P=g.6A;if(c==H&&d.1f.2I){c=d.1f.2I}g.id=f;b[b.1b]=g}}A.1p.73=[];if(c!=H&&b.1b>0){c(b)}},8n:C(e,o){if(!A.X.1g)G;F a=H;F i=0;if(e.1f.el.1N()>0){1V(i=e.1f.el.1N();i>0;i--){if(e.1f.el.I(i-1)!=A.X.1g){if(!e.5t.bb){if((e.1f.el.I(i-1).1I.y+e.1f.el.I(i-1).1I.hb/2)>A.X.1g.D.2j){a=e.1f.el.I(i-1)}L{1n}}L{if((e.1f.el.I(i-1).1I.x+e.1f.el.I(i-1).1I.1D/2)>A.X.1g.D.2n&&(e.1f.el.I(i-1).1I.y+e.1f.el.I(i-1).1I.hb/2)>A.X.1g.D.2j){a=e.1f.el.I(i-1)}}}}}if(a&&A.1p.6X!=a){A.1p.6X=a;A(a).iT(A.1p.18.I(0))}L if(!a&&(A.1p.6X!=P||A.1p.18.I(0).2S!=e)){A.1p.6X=P;A(e).1L(A.1p.18.I(0))}A.1p.18.I(0).Y.11=\'2v\'},bM:C(e){if(A.X.1g==P){G}e.1f.el.1y(C(){B.1I=A.1U(A.12.6w(B),A.12.6x(B))})},8g:C(s){F i;F h=\'\';F o={};if(s){if(A.1p.54[s]){o[s]=[];A(\'#\'+s+\' .\'+A.1p.54[s]).1y(C(){if(h.1b>0){h+=\'&\'}h+=s+\'[]=\'+A.1m(B,\'id\');o[s][o[s].1b]=A.1m(B,\'id\')})}L{1V(a in s){if(A.1p.54[s[a]]){o[s[a]]=[];A(\'#\'+s[a]+\' .\'+A.1p.54[s[a]]).1y(C(){if(h.1b>0){h+=\'&\'}h+=s[a]+\'[]=\'+A.1m(B,\'id\');o[s[a]][o[s[a]].1b]=A.1m(B,\'id\')})}}}}L{1V(i in A.1p.54){o[i]=[];A(\'#\'+i+\' .\'+A.1p.54[i]).1y(C(){if(h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,14)},bk:C(e){if(A.2k.62!=B)G;A.2k.9o=H;A.2k.2x(e,B)},1S:C(e,a,b){if(A.2k.62!=P)G;if(!a){a=B}A.2k.62=a;1I=A.1U(A.12.3a(a),A.12.2f(a));7U=A(a);3T=7U.1m(\'3T\');2U=7U.1m(\'2U\');if(3T){A.2k.9p=3T;7U.1m(\'3T\',\'\');A(\'#dE\').3i(3T);if(2U)A(\'#bj\').3i(2U.48(\'iI://\',\'\'));L A(\'#bj\').3i(\'\');18=A(\'#7S\');if(a.4m.2Z){18.I(0).2Z=a.4m.2Z}L{18.I(0).2Z=\'\'}bi=A.12.2f(18.I(0));dD=b&&a.4m.T==\'bn\'?\'4e\':a.4m.T;2X(dD){19\'O\':2j=1I.y-bi.hb;2n=1I.x;1n;19\'M\':2j=1I.y;2n=1I.x-bi.1D;1n;19\'2D\':2j=1I.y;2n=1I.x+1I.1D;1n;19\'bn\':A(\'23\').1C(\'3t\',A.2k.3t);1A=A.12.3W(e);2j=1A.y+15;2n=1A.x+15;1n;8T:2j=1I.y+1I.hb;2n=1I.x;1n}18.E({O:2j+\'Q\',M:2n+\'Q\'});if(a.4m.4w==H){18.1S()}L{18.6U(a.4m.4w)}if(a.4m.2K)a.4m.2K.1x(a);7U.1C(\'86\',A.2k.2x).1C(\'4W\',A.2k.bk)}},3t:C(e){if(A.2k.62==P){A(\'23\').3h(\'3t\',A.2k.3t);G}1A=A.12.3W(e);A(\'#7S\').E({O:1A.y+15+\'Q\',M:1A.x+15+\'Q\'})},2x:C(e,a){if(!a){a=B}if(A.2k.9o!=14&&A.2k.62==a){A.2k.62=P;A(\'#7S\').6d(1);A(a).1m(\'3T\',A.2k.9p).3h(\'86\',A.2k.2x).3h(\'4W\',A.2k.bk);if(a.4m.2V)a.4m.2V.1x(a);A.2k.9p=P}},2l:C(b){if(!A.2k.18){A(\'23\').1L(\'<1W id="7S"><1W id="dE"></1W><1W id="bj"></1W></1W>\');A(\'#7S\').E({T:\'1J\',3j:5P,11:\'1k\'});A.2k.18=14}G B.1y(C(){if(A.1m(B,\'3T\')){B.4m={T:/O|4e|M|2D|bn/.3M(b.T)?b.T:\'4e\',2Z:b.2Z?b.2Z:H,4w:b.4w?b.4w:H,2K:b.2K&&b.2K.1F==2w?b.2K:H,2V:b.2V&&b.2V.1F==2w?b.2V:H};F a=A(B);a.1C(\'9r\',A.2k.1S);a.1C(\'6a\',A.2k.6a)}})}};A.fn.iH=A.2k.2l;A.7O={bl:C(e){6K=e.6S||e.6R||-1;if(6K==9){if(1P.3N){1P.3N.b6=14;1P.3N.b5=H}L{e.9b();e.99()}if(B.9q){1c.64.dv().3D="\\t";B.dB=C(){B.6a();B.dB=P}}L if(B.9m){2b=B.88;3m=B.dA;B.2m=B.2m.iG(0,2b)+"\\t"+B.2m.iF(3m);B.9m(2b+1,2b+1);B.6a()}G H}},4v:C(){G B.1y(C(){if(B.6V&&B.6V==14){A(B).3h(\'70\',A.7O.bl);B.6V=H}})},2l:C(){G B.1y(C(){if(B.4D==\'bs\'&&(!B.6V||B.6V==H)){A(B).1C(\'70\',A.7O.bl);B.6V=14}})}};A.fn.1U({iD:A.7O.2l,iC:A.7O.4v});A.12={3a:C(e){F x=0;F y=0;F a=e.Y;F b=H;if(A(e).E(\'11\')==\'1k\'){F c=a.2W;F d=a.T;b=14;a.2W=\'2B\';a.11=\'2v\';a.T=\'1J\'}F f=e;6k(f){x+=f.7Y+(f.4u&&!A.2R.6l?R(f.4u.4y)||0:0);y+=f.7t+(f.4u&&!A.2R.6l?R(f.4u.4x)||0:0);f=f.dY}f=e;6k(f&&f.4D&&f.4D.5u()!=\'23\'){x-=f.2P||0;y-=f.2T||0;f=f.2S}if(b==14){a.11=\'1k\';a.T=d;a.2W=c}G{x:x,y:y}},6x:C(a){F x=0,y=0;6k(a){x+=a.7Y||0;y+=a.7t||0;a=a.dY}G{x:x,y:y}},2f:C(e){F w=A.E(e,\'V\');F h=A.E(e,\'S\');F a=0;F b=0;F c=e.Y;if(A(e).E(\'11\')!=\'1k\'){a=e.3P;b=e.5r}L{F d=c.2W;F f=c.T;c.2W=\'2B\';c.11=\'2v\';c.T=\'1J\';a=e.3P;b=e.5r;c.11=\'1k\';c.T=f;c.2W=d}G{w:w,h:h,1D:a,hb:b}},6w:C(a){G{1D:a.3P||0,hb:a.5r||0}},a5:C(e){F h,w,de;if(e){w=e.83;h=e.7P}L{de=1c.4A;w=1P.bg||9z.bg||(de&&de.83)||1c.23.83;h=1P.bf||9z.bf||(de&&de.7P)||1c.23.7P}G{w:w,h:h}},5O:C(e){F t=0,l=0,w=0,h=0,iw=0,ih=0;if(e&&e.98.5u()!=\'23\'){t=e.2T;l=e.2P;w=e.be;h=e.bd;iw=0;ih=0}L{if(1c.4A){t=1c.4A.2T;l=1c.4A.2P;w=1c.4A.be;h=1c.4A.bd}L if(1c.23){t=1c.23.2T;l=1c.23.2P;w=1c.23.be;h=1c.23.bd}iw=9z.bg||1c.4A.83||1c.23.83||0;ih=9z.bf||1c.4A.7P||1c.23.7P||0}G{t:t,l:l,w:w,h:h,iw:iw,ih:ih}},b2:C(e,a){F c=A(e);F t=c.E(\'4M\')||\'\';F r=c.E(\'53\')||\'\';F b=c.E(\'4L\')||\'\';F l=c.E(\'4K\')||\'\';if(a)G{t:R(t)||0,r:R(r)||0,b:R(b)||0,l:R(l)};L G{t:t,r:r,b:b,l:l}},9y:C(e,a){F c=A(e);F t=c.E(\'5b\')||\'\';F r=c.E(\'5g\')||\'\';F b=c.E(\'4Q\')||\'\';F l=c.E(\'4F\')||\'\';if(a)G{t:R(t)||0,r:R(r)||0,b:R(b)||0,l:R(l)};L G{t:t,r:r,b:b,l:l}},6b:C(e,a){F c=A(e);F t=c.E(\'4x\')||\'\';F r=c.E(\'5i\')||\'\';F b=c.E(\'5d\')||\'\';F l=c.E(\'4y\')||\'\';if(a)G{t:R(t)||0,r:R(r)||0,b:R(b)||0,l:R(l)||0};L G{t:t,r:r,b:b,l:l}},3W:C(a){F x=a.iB||(a.iz+(1c.4A.2P||1c.23.2P))||0;F y=a.iy||(a.ix+(1c.4A.2T||1c.23.2T))||0;G{x:x,y:y}},bH:C(a,b){b(a);a=a.6M;6k(a){A.12.bH(a,b);a=a.iv}},ji:C(c){A.12.bH(c,C(a){1V(F b in a){if(28 a[b]===\'C\'){a[b]=P}}})},ir:C(a,b){F c=A.12.5O();F d=A.12.2f(a);if(!b||b==\'3K\')A(a).E({O:c.t+((Z.3g(c.h,c.ih)-c.t-d.hb)/2)+\'Q\'});if(!b||b==\'3Z\')A(a).E({M:c.l+((Z.3g(c.w,c.iw)-c.l-d.1D)/2)+\'Q\'})},iq:C(a,b){F c=A(\'3O[@2E*="7q"]\',a||1c),7q;c.1y(C(){7q=B.2E;B.2E=b;B.Y.4X="9x:9C.9E.ip(2E=\'"+7q+"\')"})}};[].3o||(6h.jn.3o=C(v,n){n=(n==P)?0:n;F m=B.1b;1V(F i=n;i<m;i++)if(B[i]==v)G i;G-1});',62,1202,'||||||||||||||||||||||||||||||||||||jQuery|this|function|dragCfg|css|var|return|false|get|ss|iAuto|else|left|iResize|top|null|px|parseInt|height|position|oldStyle|width|new|iDrag|style|Math||display|iUtil||true||||helper|case|autoCFG|length|document|slideshow|easing|dropCfg|dragged|resizeOptions|carouselCfg|interfaceFX|none|speed|attr|break|sizes|iSort|ImageBox|queue|iDrop|iAutoscroller|slide|resizeElement|oC|apply|each|fisheyeCfg|pointer|newSizes|bind|wb|opacity|constructor|custom|duration|pos|absolute|type|append|items|size|255|window|slideslinks|images|show|complete|extend|for|div|elsToScroll|100|cont||loader|oR|body|options||oldP||typeof|callback|accordionCfg|start|parseFloat||containment|getSize|axis|selectedItem|relative|ny|iTooltip|build|value|nx|slideCaption|islideshow|container|subject|newPosition|selectHelper|border|block|Function|hide|itemWidth|dequeue|timer|hidden|fractions|right|src|PI|0px|addClass|onChange|parentData|onShow|result|cursorAt|overflow|transferHelper|scrollLeft|iSlider|browser|parentNode|scrollTop|href|onHide|visibility|switch|wrapper|className|pre|selectdrug|||||||||getPosition|nextslide|handle|currentslide|prevslide|step|max|unbind|html|zIndex|min|iExpander|end|onSlide|indexOf|zones|iframe|accept|margins|mousemove|canvas|to|item|createElement|multipleSeparator|highlighted|resizeDirection|abs|onStop|text|toggle|fadeDuration|handlers|dragElem|so|distance|vertically|ghosting|test|event|img|offsetWidth|startLeft|pageSize|removeClass|title|out|startTop|getPointer|lastSuggestion|DropOutDirectiont|horizontally||down||nWidth|ratio|dimm|msie||replace|oP|fontSize|lastValue|onStart|currentPointer|bottom|ifxFirstDisplay|slideCfg|onDrag|clear|context|elToScroll|up|tooltipCFG|fxCheckTag|rel|scr|onclick|endLeft|dragmoveBy|slidePos|currentStyle|destroy|delay|borderTopWidth|borderLeftWidth|nHeight|documentElement|string|containerW|tagName|iteration|paddingLeft|helperclass|endTop|halign|linksPosition|marginLeft|marginBottom|marginTop|OpenClose|holder|si|paddingBottom|mousedown|animate|overzone|click|onDragModifier|blur|filter|toDrag|getAttribute||cos|cnt|marginRight|collected||slideshows|newCoords|empty|containerH|elementData|paddingTop|puff|borderBottomWidth|animationHandler|values|paddingRight|clearInterval|borderRightWidth|pow|dragHandle|BlindDirection|post|mouseup|close|onSelect|fxh|offsetHeight|activeLinkClass|sortCfg|toLowerCase|url|currentPanel|point|grid|hpc|currentRel|revert|captionText|snapDistance|Scale|nextImage|prevImage|imageEl|orig|onload|iFisheye|parseColor|getHeight|getWidth|getScroll|3000|keyup|maxWidth|curCSS|tolerance|reflections|captionPosition|caption|margin|setInterval|outerContainer||itemHeight|current|random|selection|limit|Expander|128|class|sliders|focus|getBorder|newTop|fadeOut|indic|user|init|Array|frameClass|ActiveXObject|while|opera|from|open|oD|Date|proximity|Draggable|0x|F0|minLeft|rgb|getSizeLite|getPositionLite|getTime|positionItems|hash|selectCurrent|onOut|onClick|Object|minTop|nbsp|onHighlight|np|selectKeyHelper|pressedKey|accordionPos|firstChild|139|scrollIntoView|backgroundColor|oldStyleAttr|keyCode|charCode|direction|fadeIn|hasTabsEnabled|split|inFrontOf|radiusY|captionEl|keydown|sc|selectClass|changed|times||onHover|newLeft||efx|nw|li|maxRight|maxBottom|classname|startDrag|move|ImageBoxNextImage|nRx|ImageBoxPrevImage|nRy|opened|animationInProgress|400|getElementById|count|png|overlay|alpha|offsetTop|containerSize|cssSides|stop|minHeight|maxHeight|cursor|selectedone|xproc|yproc|bounceout|padding|gallery|increment|namedColors|applyOn|showImage|reflectionSize|sin|object|directionIncrement|iTTabs|clientHeight|select|activeClass|tooltipHelper|imgs|jEl|insideParent|content|parent|offsetLeft|parentBorders||captionClass|linksClass|clientWidth|link||mouseout|fontWeight|selectionStart|expand|panels|createTextNode|onselectstop|onselect|hight|elS|serialize|dir|diffHeight|DraggableDestroy|nextImageEl|prevImageEl|ImageBoxOuterContainer|checkhover|blind|iCarousel|hideImage|hidehelper|diffWidth|String|sl|st|prot|auto|diffY|diffX|headers|rule|getFieldValues|styleSheets|borderColor|positionContainer|image|getValues|dragstop|linkRel|itemsText|isDraggable|Image|minchars|minWidth|panelSelector|exec|192|isDroppable|default|211|1000|5625|hoverclass|headerSelector|next|ul|2000|SliderContainer|protectRotation|childs|oldVisibility|source|setTimeout|nodeName|stopPropagation|startTime|preventDefault|hoverClass|cssText|1px|prev|unfold|DoFold|unit|nextslideClass|multiple|itemMinWidth|setSelectionRange|destroyWrapper|focused|oldTitle|createTextRange|mouseover|inCache|prevslideClass|buildWrapper|linksSeparator|lnk|progid|getPadding|self|ScrollTo|9999|DXImageTransform|helperClass|Microsoft|activeclass|iIndex|selectcheck|onDrop|selectKeyUp|autofill|selectKeyDown|panelHeight|handleEl|onActivate|os|ne|sw|intersect|dragEl|remove|data|textAlign|ImageBoxCaption|closeEl|captionImages|ImageBoxOverlay|ImageBoxIframe|clearTimeout|keyPressed|fade|getClient|Alpha|shake|Shake|snapToGrid|lastSi|scroll||modifyContainer|fitToContainer|currentValue|zoom|getContainment|firstStep|paddingLeftSize|paddingBottomSize|paddingRightSize|paddingTopSize|borderLeftSize|borderBottomSize|borderRightSize|borderTopSize|autoSize|shrink|pulse|Pulsate|initialPosition|imageSrc|parseStyle|sliderPos|center|ImageBoxCurrentImage|loadImage|parentPos|match|dragmove|stopAnim|pause|Color|unselectable|prepend|borderWidth|cssSidesEnd|draginit|stopDrag|moveDrag|asin|bouncein|paddingY|paddingX|tabindex|writeItems|INPUT|10000|169|index|sliderSize|no|linear|getMargins|spacer|rotationSpeed|returnValue|cancelBubble|transparent|angle|autocomplete|autoplay|floats|extraWidth|scrollHeight|scrollWidth|innerHeight|innerWidth|character|helperSize|tooltipURL|hidefocused|doTab|Number|mouse|oBor|oPad|entities||TEXTAREA|slideshowHolder|loaderWidth|inputWidth|RegExp|letterSpacing|sliderEl|300|SliderIteration|restricted|sortable|isSlider|bounce|Selectserialize|idsa|traverseDOM|selectstop|elm|elPosition|restore|measure|getHeightMinMax|onDragStart|fit|clientSize|field|fadeTo|ImageBoxContainer|on|listStyle|ImageBoxLoader|dragHelper|ImageBoxCaptionImages|getContext|ImageBoxCaptionText|update|imagebox|BlindUp|hrefAttr|relAttr|SlideOutUp|check|checkdrop|textImageFrom|textImage|overlayOpacity|jpg|closeHTML|gif|loaderSRC|imageTypes|500|childNodes|itransferTo|highlight|visible|horizontal|vertical|parts|paddingLeftUnit|paddingBottomUnit|paddingRightUnit||paddingTopUnit|borderLeftUnit|borderBottomUnit|borderRightUnit|borderTopUnit|fontUnit|grow|clone|sqrt|textDecoration|dragstart|trim|isFunction|valign|userSelect|fxe|KhtmlUserSelect|Width|captionSize|dhe|colorCssProps|onDragStop|iAccordion|cssProps|doScroll|144|224|230|keypress|off|150|140|107|fracH|fracW|easeout|dragmoveByKey|autocompleteHelper|yfrac|165|scrolling|radiusX|xfrac|frameborder|245|javascript|240||autocompleteIframe|999|protect|goprev|getElementsByTagName|styleFloat||parte|insertBefore|itemZIndex|interfaceColorFX|fold|mousex|leftUnit|topUnit|fakeAccordionClass|createRange|getSelectionStart|||slideshowLoader|selectionEnd|onblur|moveStart|filteredPosition|tooltipTitle|togglehor|togglever|inputValue|zindex|sortHelper|isSortable|addItem|checkCache|SortableAddItem|after|BlindDown|time|SlideInUp|slideshowPrevslide|elType|30px|slideshowNextSlide|slideshowCaption|expanderHelper|offsetParent|slideshowLinks|boxModel|loaderHeight||slideBor|slidePad|htmlEntities|wordSpacing|fontVariant|fontStretch|fontStyle|gonext|fontFamily|onslide|clickItem|Droppable||rgba||DroppableDestroy|maxy|maxx|||hoverItem|containerMaxy|containerMaxx||onout|addColorStop||iBounce|onhover|set|selectedclass|isSelectable|selectstopApply|selectcheckApply|selectstart|shc|360|directions|remeasure|onResize|se|array|scale|success|param|translate|POST|number|load|ajax|save|name|khtml|moz|find|ondragstart|onselectstart|lineHeigt|mozUserSelect|ImageBoxClose|bmp|jpeg|finishx|112|starty|first|last|firstResize|startx|imageLoaded|Showing|finishOpacity|110|Accordion|loading|TransferTo|SlideToggleRight|SlideOutRight|SlideInRight|SlideToggleLeft|SlideOutLeft|SlideInLeft||SlideToggleDown|SlideOutDown|SlideInDown|SlideToggleUp|scrollTo|ScrollToAnchors|flipv|pt|Puff||Shrink|Fisheye||Grow|OpenHorizontally|OpenVertically|SwitchVertically|SwitchHorizontally|CloseHorizontally|CloseVertically|toUpperCase|100000000|selectorText|rules|cssRules|borderStyle|outset|inset|ridge|resize|groove|double|solid|dashed|dotted|isNaN|fromHandler|stopAll|MozUserSelect|Left|Bottom|Right|Top|outlineColor|color|borderTopColor|borderRightColor|borderLeftColor|borderBottomColor|textIndent|outlineWidth|elasticboth|outlineOffset|wh|elasticout|lineHeight|yellow|white|silver|red|purple|203||pink|orange|olive|navy||maroon|magenta|lime|||elasticin|lightyellow|193|182|lightpink|bounceboth|lightgrey|238|lightgreen|lightcyan|Autocomplete|216|173|200|984375|lightblue|khaki|130|625|indigo|green|215|9375|gold|fuchsia|148|darkviolet|122|233|darksalmon|darkred|204|153|darkorchid|darkorange|30002|list|darkolivegreen|||darkmagenta|183|189|darkkhaki|easeboth|darkgreen|30001|darkgrey|darkcyan|darkblue|cyan|easein|brown|blue||black|hover|220|beige|azure|aqua|appendChild|cssFloat|fxWrapper|ol|table|fix|form|button|nodeValue|textarea|input|w_|float|Carousel|removeChild|meta|optgroup|option|frameset|frame|script|header|th|colgroup|col|tfoot|thead|tbody|td|tr|Highlight|FoldToggle|UnFold|Fold|DropToggleRight|DropInRight|DropOutRight|DropToggleLeft|DropInLeft|DropOutLeft|DropToggleUp||DropInUp||DropOutUp||DropToggleDown|100000|DropInDown|duplicate|DropOutDown||120|AlphaImageLoader|fixPNG|centerEl||rotationTimer|maxRotation|nextSibling||clientY|pageY|clientX|Bounce|pageX|DisableTabs|EnableTabs|moveEnd|substr|substring|ToolTip|http|collapse|BlindToggleHorizontally|BlindRight|BlindLeft|SortSerialize|SortableDestroy|Sortable|BlindToggleVertically|onchange|fillRect|before|Autoexpand|fill|password|WebKit|slideshowLink|quot|lt|amp|alt|IMG|par|appVersion|pW|navigator|location|fillStyle|SliderGetValues|SliderSetValues|Slider|recallDroppables|ondrop|createLinearGradient|Selectable|destination|purgeEvents|ResizableDestroy|Resizable|globalCompositeOperation|drawImage|prototype'.split('|'),0,{})) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/jquery/ui.core.js�������������������������������������������������������������0000644�0001066�0001066�00000007154�11031241204�015264� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(3(C){C.8={2s:{1o:3(E,F,H){6 G=C.8[E].n;1v(6 D 2r H){G.w[D]=G.w[D]||[];G.w[D].2q([F,H[D]])}},1n:3(D,F,E){6 H=D.w[F];5(!H){4}1v(6 G=0;G<H.2p;G++){5(D.a[H[G][0]]){H[G][1].u(D.c,E)}}}},o:{},f:3(D){5(C.8.o[D]){4 C.8.o[D]}6 E=C(\'<2o 2n="8-2m">\').1i(D).f({2l:"2k",12:"-1u",2j:"-1u",2i:"2h"}).2g("1t");C.8.o[D]=!!((!(/2f|2e/).h(E.f("2d"))||(/^[1-9]/).h(E.f("2c"))||(/^[1-9]/).h(E.f("2b"))||!(/1r/).h(E.f("2a"))||!(/29|28\\(0, 0, 0, 0\\)/).h(E.f("27"))));26{C("1t").1s(0).25(E.1s(0))}24(F){}4 C.8.o[D]},23:3(D){D.j="1g";D.1q=3(){4 7};5(D.v){D.v.1p="1r"}},22:3(D){D.j="21";D.1q=3(){4 d};5(D.v){D.v.1p=""}},20:3(G,E){6 D=/12/.h(E||"12")?"1Z":"1Y",F=7;5(G[D]>0){4 d}G[D]=1;F=G[D]>0?d:7;G[D]=0;4 F}};6 B=C.10.t;C.10.t=3(){C("*",2).1o(2).1X("t");4 B.u(2,1m)};3 A(E,F,G){6 D=C[E][F].1W||[];D=(W D=="V"?D.11(/,?\\s+/):D);4(C.1V(G,D)!=-1)}C.l=3(E,D){6 F=E.11(".")[0];E=E.11(".")[1];C.10[E]=3(J){6 H=(W J=="V"),I=1U.n.1T.1n(1m,1);5(H&&A(F,E,J)){6 G=C.Z(2[0],E);4(G?G[J].u(G,I):1S)}4 2.1R(3(){6 K=C.Z(2,E);5(H&&K&&C.1Q(K[J])){K[J].u(K,I)}1P{5(!H){C.Z(2,E,1O C[F][E](2,J))}}})};C[F][E]=3(I,H){6 G=2;2.e=E;2.1h=F+"-"+E;2.a=C.1l({},C.l.p,C[F][E].p,H);2.c=C(I).g("m."+E,3(L,J,K){4 G.m(J,K)}).g("Y."+E,3(K,J){4 G.Y(J)}).g("t",3(){4 G.1j()});2.1k()};C[F][E].n=C.1l({},C.l.n,D)};C.l.n={1k:3(){},1j:3(){2.c.1N(2.e)},Y:3(D){4 2.a[D]},m:3(D,E){2.a[D]=E;5(D=="k"){2.c[E?"1i":"1M"](2.1h+"-k")}},1L:3(){2.m("k",7)},1K:3(){2.m("k",d)}};C.l.p={k:7};C.8.14={1J:3(){6 D=2;2.c.g("1I."+2.e,3(E){4 D.1e(E)});5(C.U.T){2.1f=2.c.X("j");2.c.X("j","1g")}2.1H=7},1G:3(){2.c.R("."+2.e);(C.U.T&&2.c.X("j",2.1f))},1e:3(F){(2.b&&2.i(F));2.r=F;6 E=2,G=(F.1F==1),D=(W 2.a.y=="V"?C(F.1E).1D(2.a.y):7);5(!G||D||!2.15(F)){4 d}2.q=!2.a.x;5(!2.q){2.1C=1B(3(){E.q=d},2.a.x)}5(2.P(F)&&2.N(F)){2.b=(2.M(F)!==7);5(!2.b){F.1A();4 d}}2.S=3(H){4 E.1d(H)};2.Q=3(H){4 E.i(H)};C(1c).g("1b."+2.e,2.S).g("1a."+2.e,2.Q);4 7},1d:3(D){5(C.U.T&&!D.1z){4 2.i(D)}5(2.b){2.z(D);4 7}5(2.P(D)&&2.N(D)){2.b=(2.M(2.r,D)!==7);(2.b?2.z(D):2.i(D))}4!2.b},i:3(D){C(1c).R("1b."+2.e,2.S).R("1a."+2.e,2.Q);5(2.b){2.b=7;2.16(D)}4 7},P:3(D){4(O.1y(O.18(2.r.19-D.19),O.18(2.r.17-D.17))>=2.a.13)},N:3(D){4 2.q},M:3(D){},z:3(D){},16:3(D){},15:3(D){4 d}};C.8.14.p={y:1x,13:1,x:0}})(1w)',62,153,'||this|function|return|if|var|false|ui||options|_mouseStarted|element|true|widgetName|css|bind|test|mouseUp|unselectable|disabled|widget|setData|prototype|cssCache|defaults|_mouseDelayMet|_mouseDownEvent||remove|apply|style|plugins|delay|cancel|mouseDrag|||||||||||||mouseStart|mouseDelayMet|Math|mouseDistanceMet|_mouseUpDelegate|unbind|_mouseMoveDelegate|msie|browser|string|typeof|attr|getData|data|fn|split|top|distance|mouse|mouseCapture|mouseStop|pageY|abs|pageX|mouseup|mousemove|document|mouseMove|mouseDown|_mouseUnselectable|on|widgetBaseClass|addClass|destroy|init|extend|arguments|call|add|MozUserSelect|onselectstart|none|get|body|5000px|for|jQuery|null|max|button|preventDefault|setTimeout|_mouseDelayTimer|is|target|which|mouseDestroy|started|mousedown|mouseInit|disable|enable|removeClass|removeData|new|else|isFunction|each|undefined|slice|Array|inArray|getter|trigger|scrollLeft|scrollTop|hasScroll|off|enableSelection|disableSelection|catch|removeChild|try|backgroundColor|rgba|transparent|backgroundImage|width|height|cursor|default|auto|appendTo|block|display|left|absolute|position|gen|class|div|length|push|in|plugin'.split('|'),0,{})) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/jquery/ui.sortable.js���������������������������������������������������������0000644�0001066�0001066�00000024142�11031241204�016143� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(b(B){b A(E,D){9 C=B.2U.3W&&B.2U.3V<3U;5(E.2T&&!C){d E.2T(D)}5(E.2S){d!!(E.2S(D)&16)}1R(D=D.1g){5(D==E){d U}}d w}B.3T("m.q",B.2h(B.m.3S,{3R:b(){9 C=4.8;4.P={};4.g.27("m-q");4.2L();4.13=4.c.z?(/6|25/).18(4.c[0].u.f("3Q")):w;5(!(/(2R|1t|3P)/).18(4.g.f("W"))){4.g.f("W","2R")}4.a=4.g.a();4.3O()},3N:{},m:b(C){d{k:(C||4)["k"],r:(C||4)["r"]||B([]),W:(C||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d 1}}}Z{5(!(F<E+(4.s.n/2)&&D-(4.s.n/2)<C&&K<I+(4.s.o/2)&&H-(4.s.o/2)<G)){d w}5(4.13){5(D>F&&E<F){d 2}5(E<C&&D>C){d 1}}Z{5(H>K&&I<K){d 1}5(I<G&&H>G){d 2}}}d w},2L:b(){4.28();4.1I()},28:b(){4.c=[];4.e=[4];9 D=4.c;9 C=4;9 F=[[B.1O(4.8.c)?4.8.c.15(4.g,O,{8:4.8,u:4.i}):B(4.8.c,4.g),4]];5(4.8.2a){Q(9 G=4.8.2a.z-1;G>=0;G--){9 I=B(4.8.2a[G]);Q(9 E=I.z-1;E>=0;E--){9 H=B.1f(I[E],"q");5(H&&!H.8.29){F.1z([B.1O(H.8.c)?H.8.c.15(H.g):B(H.8.c,H.g),H]);4.e.1z(H)}}}}Q(9 G=F.z-1;G>=0;G--){F[G][0].1y(b(){B.1f(4,"q-u",F[G][1]);D.1z({u:B(4),2K:F[G][1],n:0,o:0,6:0,7:0})})}},1I:b(D){5(4.t){9 C=4.t.a();4.a.l={7:C.7+4.1w.7,6:C.6+4.1w.6}}Q(9 F=4.c.z-1;F>=0;F--){5(4.c[F].2K!=4.1x&&4.1x&&4.c[F].u[0]!=4.i[0]){1L}9 E=4.8.2J?B(4.8.2J,4.c[F].u):4.c[F].u;5(!D){4.c[F].n=E.1v();4.c[F].o=E.1u()}9 G=E.a();4.c[F].6=G.6;4.c[F].7=G.7}Q(9 F=4.e.z-1;F>=0;F--){9 G=4.e[F].g.a();4.e[F].P.6=G.6;4.e[F].P.7=G.7;4.e[F].P.n=4.e[F].g.1v();4.e[F].P.o=4.e[F].g.1u()}},3F:b(){4.g.3E("m-q m-q-29").2I("q").3D(".q");4.3C();Q(9 C=4.c.z-1;C>=0;C--){4.c[C].u.2I("q-u")}},26:b(E){9 C=E||4,F=C.8;5(F.r.3B==3A){9 D=F.r;F.r={g:b(){d B("<2H></2H>").27(D)[0]},1q:b(G,H){H.f(G.a()).f({n:G.1v(),o:G.1u()})}}}C.r=B(F.r.g.15(C.g,C.i)).1o("T").f({W:"1t"});F.r.1q.15(C.g,C.i,C.r)},2s:b(F){Q(9 D=4.e.z-1;D>=0;D--){5(4.2G(4.e[D].P)){5(!4.e[D].P.1b){5(4.1x!=4.e[D]){9 I=3z;9 H=O;9 E=4.1c[4.e[D].13?"6":"7"];Q(9 C=4.c.z-1;C>=0;C--){5(!A(4.e[D].g[0],4.c[C].u[0])){1L}9 G=4.c[C][4.e[D].13?"6":"7"];5(1k.2F(G-E)<I){I=1k.2F(G-E);H=4.c[C]}}5(!H&&!4.8.2e){1L}5(4.r){4.r.1G()}5(4.e[D].8.r){4.e[D].26(4)}Z{4.r=O}4.1x=4.e[D];H?4.1J(F,H,O,U):4.1J(F,O,4.e[D].g,U);4.v("21",F);4.e[D].v("21",F,4)}4.e[D].v("1b",F,4);4.e[D].P.1b=1}}Z{5(4.e[D].P.1b){4.e[D].v("2k",F,4);4.e[D].P.1b=0}}}},3y:b(G,F){5(4.8.29||4.8.2t=="3x"){d w}4.28();9 E=O,D=4,C=B(G.1N).2D().1y(b(){5(B.1f(4,"q-u")==D){E=B(4);d w}});5(B.1f(G.1N,"q-u")==D){E=B(G.1N)}5(!E){d w}5(4.8.2E&&!F){9 H=w;B(4.8.2E,E).3w("*").3v().1y(b(){5(4==G.1N){H=U}});5(!H){d w}}4.i=E;d U},3u:b(H,F,C){9 J=4.8;4.1x=4;4.1I();4.k=3t J.k=="b"?B(J.k.3s(4.g[0],[H,4.i])):4.i.1W();5(!4.k.2D("T").z){4.k.1o((J.1o!="l"?J.1o:4.i[0].1g))}4.k.f({W:"1t",1H:"3r"}).27("m-q-k");4.V={6:(L(4.i.f("3q"),10)||0),7:(L(4.i.f("3p"),10)||0)};4.a=4.i.a();4.a={7:4.a.7-4.V.7,6:4.a.6-4.V.6};4.a.p={6:H.1d-4.a.6,7:H.1e-4.a.7};4.t=4.k.t();9 D=4.t.a();4.1w={7:(L(4.t.f("23"),10)||0),6:(L(4.t.f("24"),10)||0)};4.a.l={7:D.7+4.1w.7,6:D.6+4.1w.6};4.1j=4.22(H);4.1X={1r:4.i.1r()[0],l:4.i.l()[0]};4.s={n:4.k.1v(),o:4.k.1u()};5(J.r){4.26()}4.v("1l",H);4.s={n:4.k.1v(),o:4.k.1u()};5(J.12){5(J.12.6!=1M){4.a.p.6=J.12.6}5(J.12.25!=1M){4.a.p.6=4.s.n-J.12.25}5(J.12.7!=1M){4.a.p.7=J.12.7}5(J.12.2C!=1M){4.a.p.7=4.s.o-J.12.2C}}5(J.j){5(J.j=="l"){J.j=4.k[0].1g}5(J.j=="h"||J.j=="17"){4.j=[0-4.a.l.6,0-4.a.l.7,B(J.j=="h"?h:17).n()-4.a.l.6-4.s.n-4.V.6-(L(4.g.f("2B"),10)||0),(B(J.j=="h"?h:17).o()||h.T.1g.2z)-4.a.l.7-4.s.o-4.V.7-(L(4.g.f("2y"),10)||0)]}5(!(/^(h|17|l)$/).18(J.j)){9 G=B(J.j)[0];9 I=B(J.j).a();4.j=[I.6+(L(B(G).f("24"),10)||0)-4.a.l.6,I.7+(L(B(G).f("23"),10)||0)-4.a.l.7,I.6+1k.2A(G.3o,G.2b)-(L(B(G).f("24"),10)||0)-4.a.l.6-4.s.n-4.V.6-(L(4.i.f("2B"),10)||0),I.7+1k.2A(G.2z,G.2c)-(L(B(G).f("23"),10)||0)-4.a.l.7-4.s.o-4.V.7-(L(4.i.f("2y"),10)||0)]}}5(4.8.r!="1W"){4.i.f("2i","3n")}5(!C){Q(9 E=4.e.z-1;E>=0;E--){4.e[E].v("3m",H,4)}}5(B.m.14){B.m.14.3l=4}5(B.m.14&&!J.2n){B.m.14.3k(4,H)}4.2j=U;4.2w(H);d U},2v:b(D,E){5(!E){E=4.W}9 C=D=="1t"?1:-1;d{7:(E.7+4.a.l.7*C-(4.t[0]==h.T?0:4.t[0].N)*C+4.V.7*C),6:(E.6+4.a.l.6*C-(4.t[0]==h.T?0:4.t[0].M)*C+4.V.6*C)}},22:b(F){9 G=4.8;9 C={7:(F.1e-4.a.p.7-4.a.l.7+(4.t[0]==h.T?0:4.t[0].N)),6:(F.1d-4.a.p.6-4.a.l.6+(4.t[0]==h.T?0:4.t[0].M))};5(!4.1j){d C}5(4.j){5(C.6<4.j[0]){C.6=4.j[0]}5(C.7<4.j[1]){C.7=4.j[1]}5(C.6>4.j[2]){C.6=4.j[2]}5(C.7>4.j[3]){C.7=4.j[3]}}5(G.11){9 E=4.1j.7+1k.2x((C.7-4.1j.7)/G.11[1])*G.11[1];C.7=4.j?(!(E<4.j[1]||E>4.j[3])?E:(!(E<4.j[1])?E-G.11[1]:E+G.11[1])):E;9 D=4.1j.6+1k.2x((C.6-4.1j.6)/G.11[0])*G.11[0];C.6=4.j?(!(D<4.j[0]||D>4.j[2])?D:(!(D<4.j[0])?D-G.11[0]:D+G.11[0])):D}d C},2w:b(D){4.W=4.22(D);4.1c=4.2v("1t");Q(9 C=4.c.z-1;C>=0;C--){9 E=4.2u(4.c[C]);5(!E){1L}5(4.c[C].u[0]!=4.i[0]&&4.i[E==1?"3j":"1r"]()[0]!=4.c[C].u[0]&&!A(4.i[0],4.c[C].u[0])&&(4.8.2t=="3i-3h"?!A(4.g[0],4.c[C].u[0]):U)){4.2p=E==1?"2o":"3g";4.1J(D,4.c[C]);4.v("21",D);3f}}4.2s(D);4.v("1C",D);5(!4.8.1K||4.8.1K=="x"){4.k[0].2r.6=4.W.6+"2q"}5(!4.8.1K||4.8.1K=="y"){4.k[0].2r.7=4.W.7+"2q"}5(B.m.14){B.m.14.3e(4,D)}d w},1J:b(H,G,D,F){D?D.3d(4.i):G.u[4.2p=="2o"?"3c":"3b"](4.i);4.1s=4.1s?++4.1s:1;9 E=4,C=4.1s;17.3a(b(){5(C==E.1s){E.1I(!F)}},0);5(4.8.r){4.8.r.1q.15(4.g,4.i,4.r)}},39:b(E,D){5(B.m.14&&!4.8.2n){B.m.14.38(4,E)}5(4.8.1Z){9 C=4;9 F=C.i.a();5(C.r){C.r.2m({19:"37"},(L(4.8.1Z,10)||2l)-36)}B(4.k).2m({6:F.6-4.a.l.6-C.V.6+(4.t[0]==h.T?0:4.t[0].M),7:F.7-4.a.l.7-C.V.7+(4.t[0]==h.T?0:4.t[0].N)},L(4.8.1Z,10)||2l,b(){C.1H(E)})}Z{4.1H(E,D)}d w},1H:b(E,D){5(4.1X.1r!=4.i.1r().1Y(".m-q-k")[0]||4.1X.l!=4.i.l()[0]){4.v("1q",E,O,D)}5(!A(4.g[0],4.i[0])){4.v("1G",E,O,D);Q(9 C=4.e.z-1;C>=0;C--){5(A(4.e[C].g[0],4.i[0])){4.e[C].v("1q",E,4,D);4.e[C].v("35",E,4,D)}}}Q(9 C=4.e.z-1;C>=0;C--){4.e[C].v("34",E,4,D);5(4.e[C].P.1b){4.e[C].v("2k",E,4);4.e[C].P.1b=0}}4.2j=w;5(4.33){4.v("1n",E,O,D);d w}B(4.i).f("2i","");5(4.r){4.r.1G()}4.k.1G();4.k=O;4.v("1n",E,O,D);d U}}));B.2h(B.m.q,{32:"2g 2f",31:{k:"1W",1p:"1V",30:1,2Z:0,1h:U,Y:20,X:20,2Y:":2X",c:"> *",1a:2W,2e:U,1o:"l"}});B.m.1m.1F("q","1i",{1l:b(E,D){9 C=B("T");5(C.f("1i")){D.8.1U=C.f("1i")}C.f("1i",D.8.1i)},1n:b(D,C){5(C.8.1U){B("T").f("1i",C.8.1U)}}});B.m.1m.1F("q","1a",{1l:b(E,D){9 C=D.k;5(C.f("1a")){D.8.1T=C.f("1a")}C.f("1a",D.8.1a)},1n:b(D,C){5(C.8.1T){B(C.k).f("1a",C.8.1T)}}});B.m.1m.1F("q","19",{1l:b(E,D){9 C=D.k;5(C.f("19")){D.8.1S=C.f("19")}C.f("19",D.8.19)},1n:b(D,C){5(C.8.1S){B(C.k).f("19",C.8.1S)}}});B.m.1m.1F("q","1h",{1l:b(E,D){9 F=D.8;9 C=B(4).1f("q");C.S=b(G){2d{5(/1E|1h/.18(G.f("1D"))||(/1E|1h/).18(G.f("1D-y"))){d G}G=G.l()}1R(G[0].1g);d B(h)}(C.i);C.R=b(G){2d{5(/1E|1h/.18(G.f("1D"))||(/1E|1h/).18(G.f("1D-x"))){d G}G=G.l()}1R(G[0].1g);d B(h)}(C.i);5(C.S[0]!=h&&C.S[0].1B!="1A"){C.1Q=C.S.a()}5(C.R[0]!=h&&C.R[0].1B!="1A"){C.1P=C.R.a()}},1C:b(E,D){9 F=D.8;9 C=B(4).1f("q");5(C.S[0]!=h&&C.S[0].1B!="1A"){5((C.1Q.7+C.S[0].2c)-E.1e<F.Y){C.S[0].N=C.S[0].N+F.X}5(E.1e-C.1Q.7<F.Y){C.S[0].N=C.S[0].N-F.X}}Z{5(E.1e-B(h).N()<F.Y){B(h).N(B(h).N()-F.X)}5(B(17).o()-(E.1e-B(h).N())<F.Y){B(h).N(B(h).N()+F.X)}}5(C.R[0]!=h&&C.R[0].1B!="1A"){5((C.1P.6+C.R[0].2b)-E.1d<F.Y){C.R[0].M=C.R[0].M+F.X}5(E.1d-C.1P.6<F.Y){C.R[0].M=C.R[0].M-F.X}}Z{5(E.1d-B(h).M()<F.Y){B(h).M(B(h).M()-F.X)}5(B(17).n()-(E.1d-B(h).M())<F.Y){B(h).M(B(h).M()+F.X)}}}})})(2V)',62,245,'||||this|if|left|top|options|var|offset|function|items|return|containers|css|element|document|currentItem|containment|helper|parent|ui|width|height|click|sortable|placeholder|helperProportions|offsetParent|item|propagate|false|||length||||||||||||parseInt|scrollLeft|scrollTop|null|containerCache|for|overflowX|overflowY|body|true|margins|position|scrollSpeed|scrollSensitivity|else||grid|cursorAt|floating|ddmanager|call||window|test|opacity|zIndex|over|positionAbs|pageX|pageY|data|parentNode|scroll|cursor|originalPosition|Math|start|plugin|stop|appendTo|tolerance|update|prev|counter|absolute|outerHeight|outerWidth|offsetParentBorders|currentContainer|each|push|HTML|tagName|sort|overflow|auto|add|remove|clear|refreshPositions|rearrange|axis|continue|undefined|target|isFunction|overflowXOffset|overflowYOffset|while|_opacity|_zIndex|_cursor|guess|clone|domPosition|not|revert||change|generatePosition|borderTopWidth|borderLeftWidth|right|createPlaceholder|addClass|refreshItems|disabled|connectWith|offsetWidth|offsetHeight|do|dropOnEmpty|toArray|serialize|extend|visibility|dragging|out|500|animate|dropBehaviour|down|direction|px|style|contactContainers|type|intersectsWithEdge|convertPositionTo|mouseDrag|round|marginBottom|scrollHeight|max|marginRight|bottom|parents|handle|abs|intersectsWith|div|removeData|toleranceElement|instance|refresh|pointer|id|attr|expression|key|relative|compareDocumentPosition|contains|browser|jQuery|1000|input|cancel|delay|distance|defaults|getter|cancelHelperRemoval|deactivate|receive|50|hide|drop|mouseStop|setTimeout|after|before|append|drag|break|up|dynamic|semi|next|prepareOffsets|current|activate|hidden|scrollWidth|marginTop|marginLeft|both|apply|typeof|mouseStart|andSelf|find|static|mouseCapture|10000|String|constructor|mouseDestroy|unbind|removeClass|destroy|join|_|match|attribute|triggerHandler|sender|absolutePosition|plugins|mouseInit|fixed|float|init|mouse|widget|522|version|safari'.split('|'),0,{})) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/jquery/jquery.form.js���������������������������������������������������������0000644�0001066�0001066�00000075351�10762616541�016231� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * jQuery Form Plugin * version: 2.02 (12/16/2007) * @requires jQuery v1.1 or later * * Examples at: http://malsup.com/jquery/form/ * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Revision: $Id$ */ (function($) { /** * ajaxSubmit() provides a mechanism for submitting an HTML form using AJAX. * * ajaxSubmit accepts a single argument which can be either a success callback function * or an options Object. If a function is provided it will be invoked upon successful * completion of the submit and will be passed the response from the server. * If an options Object is provided, the following attributes are supported: * * target: Identifies the element(s) in the page to be updated with the server response. * This value may be specified as a jQuery selection string, a jQuery object, * or a DOM element. * default value: null * * url: URL to which the form data will be submitted. * default value: value of form's 'action' attribute * * type: The method in which the form data should be submitted, 'GET' or 'POST'. * default value: value of form's 'method' attribute (or 'GET' if none found) * * data: Additional data to add to the request, specified as key/value pairs (see $.ajax). * * beforeSubmit: Callback method to be invoked before the form is submitted. * default value: null * * success: Callback method to be invoked after the form has been successfully submitted * and the response has been returned from the server * default value: null * * dataType: Expected dataType of the response. One of: null, 'xml', 'script', or 'json' * default value: null * * semantic: Boolean flag indicating whether data must be submitted in semantic order (slower). * default value: false * * resetForm: Boolean flag indicating whether the form should be reset if the submit is successful * * clearForm: Boolean flag indicating whether the form should be cleared if the submit is successful * * * The 'beforeSubmit' callback can be provided as a hook for running pre-submit logic or for * validating the form data. If the 'beforeSubmit' callback returns false then the form will * not be submitted. The 'beforeSubmit' callback is invoked with three arguments: the form data * in array format, the jQuery object, and the options object passed into ajaxSubmit. * The form data array takes the following form: * * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ] * * If a 'success' callback method is provided it is invoked after the response has been returned * from the server. It is passed the responseText or responseXML value (depending on dataType). * See jQuery.ajax for further details. * * * The dataType option provides a means for specifying how the server response should be handled. * This maps directly to the jQuery.httpData method. The following values are supported: * * 'xml': if dataType == 'xml' the server response is treated as XML and the 'success' * callback method, if specified, will be passed the responseXML value * 'json': if dataType == 'json' the server response will be evaluted and passed to * the 'success' callback, if specified * 'script': if dataType == 'script' the server response is evaluated in the global context * * * Note that it does not make sense to use both the 'target' and 'dataType' options. If both * are provided the target will be ignored. * * The semantic argument can be used to force form serialization in semantic order. * This is normally true anyway, unless the form contains input elements of type='image'. * If your form must be submitted with name/value pairs in semantic order and your form * contains an input of type='image" then pass true for this arg, otherwise pass false * (or nothing) to avoid the overhead for this logic. * * * When used on its own, ajaxSubmit() is typically bound to a form's submit event like this: * * $("#form-id").submit(function() { * $(this).ajaxSubmit(options); * return false; // cancel conventional submit * }); * * When using ajaxForm(), however, this is done for you. * * @example * $('#myForm').ajaxSubmit(function(data) { * alert('Form submit succeeded! Server returned: ' + data); * }); * @desc Submit form and alert server response * * * @example * var options = { * target: '#myTargetDiv' * }; * $('#myForm').ajaxSubmit(options); * @desc Submit form and update page element with server response * * * @example * var options = { * success: function(responseText) { * alert(responseText); * } * }; * $('#myForm').ajaxSubmit(options); * @desc Submit form and alert the server response * * * @example * var options = { * beforeSubmit: function(formArray, jqForm) { * if (formArray.length == 0) { * alert('Please enter data.'); * return false; * } * } * }; * $('#myForm').ajaxSubmit(options); * @desc Pre-submit validation which aborts the submit operation if form data is empty * * * @example * var options = { * url: myJsonUrl.php, * dataType: 'json', * success: function(data) { * // 'data' is an object representing the the evaluated json data * } * }; * $('#myForm').ajaxSubmit(options); * @desc json data returned and evaluated * * * @example * var options = { * url: myXmlUrl.php, * dataType: 'xml', * success: function(responseXML) { * // responseXML is XML document object * var data = $('myElement', responseXML).text(); * } * }; * $('#myForm').ajaxSubmit(options); * @desc XML data returned from server * * * @example * var options = { * resetForm: true * }; * $('#myForm').ajaxSubmit(options); * @desc submit form and reset it if successful * * @example * $('#myForm).submit(function() { * $(this).ajaxSubmit(); * return false; * }); * @desc Bind form's submit event to use ajaxSubmit * * * @name ajaxSubmit * @type jQuery * @param options object literal containing options which control the form submission process * @cat Plugins/Form * @return jQuery */ $.fn.ajaxSubmit = function(options) { if (typeof options == 'function') options = { success: options }; options = $.extend({ url: this.attr('action') || window.location.toString(), type: this.attr('method') || 'GET' }, options || {}); // hook for manipulating the form data before it is extracted; // convenient for use with rich editors like tinyMCE or FCKEditor var veto = {}; $.event.trigger('form.pre.serialize', [this, options, veto]); if (veto.veto) return this; var a = this.formToArray(options.semantic); if (options.data) { for (var n in options.data) a.push( { name: n, value: options.data[n] } ); } // give pre-submit callback an opportunity to abort the submit if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) return this; // fire vetoable 'validate' event $.event.trigger('form.submit.validate', [a, this, options, veto]); if (veto.veto) return this; var q = $.param(a);//.replace(/%20/g,'+'); if (options.type.toUpperCase() == 'GET') { options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; options.data = null; // data is null for 'get' } else options.data = q; // data is the query string for 'post' var $form = this, callbacks = []; if (options.resetForm) callbacks.push(function() { $form.resetForm(); }); if (options.clearForm) callbacks.push(function() { $form.clearForm(); }); // perform a load on the target only if dataType is not provided if (!options.dataType && options.target) { var oldSuccess = options.success || function(){}; callbacks.push(function(data) { if (this.evalScripts) $(options.target).attr("innerHTML", data).evalScripts().each(oldSuccess, arguments); else // jQuery v1.1.4 $(options.target).html(data).each(oldSuccess, arguments); }); } else if (options.success) callbacks.push(options.success); options.success = function(data, status) { for (var i=0, max=callbacks.length; i < max; i++) callbacks[i](data, status, $form); }; // are there files to upload? var files = $('input:file', this).fieldValue(); var found = false; for (var j=0; j < files.length; j++) if (files[j]) found = true; // options.iframe allows user to force iframe mode if (options.iframe || found) { // hack to fix Safari hang (thanks to Tim Molendijk for this) // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d if ($.browser.safari && options.closeKeepAlive) $.get(options.closeKeepAlive, fileUpload); else fileUpload(); } else $.ajax(options); // fire 'notify' event $.event.trigger('form.submit.notify', [this, options]); return this; // private function for handling file uploads (hat tip to YAHOO!) function fileUpload() { var form = $form[0]; var opts = $.extend({}, $.ajaxSettings, options); var id = 'jqFormIO' + $.fn.ajaxSubmit.counter++; var $io = $('<iframe id="' + id + '" name="' + id + '" />'); var io = $io[0]; var op8 = $.browser.opera && window.opera.version() < 9; if ($.browser.msie || op8) io.src = 'javascript:false;document.write("");'; $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' }); var xhr = { // mock object responseText: null, responseXML: null, status: 0, statusText: 'n/a', getAllResponseHeaders: function() {}, getResponseHeader: function() {}, setRequestHeader: function() {} }; var g = opts.global; // trigger ajax global events so that activity/block indicators work like normal if (g && ! $.active++) $.event.trigger("ajaxStart"); if (g) $.event.trigger("ajaxSend", [xhr, opts]); var cbInvoked = 0; var timedOut = 0; // take a breath so that pending repaints get some cpu time before the upload starts setTimeout(function() { // make sure form attrs are set var encAttr = form.encoding ? 'encoding' : 'enctype'; var t = $form.attr('target'); $form.attr({ target: id, method: 'POST', action: opts.url }); form[encAttr] = 'multipart/form-data'; // support timout if (opts.timeout) setTimeout(function() { timedOut = true; cb(); }, opts.timeout); // add iframe to doc and submit the form $io.appendTo('body'); io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false); form.submit(); $form.attr('target', t); // reset target }, 10); function cb() { if (cbInvoked++) return; io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false); var ok = true; try { if (timedOut) throw 'timeout'; // extract the server response from the iframe var data, doc; doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document; xhr.responseText = doc.body ? doc.body.innerHTML : null; xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc; if (opts.dataType == 'json' || opts.dataType == 'script') { var ta = doc.getElementsByTagName('textarea')[0]; data = ta ? ta.value : xhr.responseText; if (opts.dataType == 'json') eval("data = " + data); else $.globalEval(data); } else if (opts.dataType == 'xml') { data = xhr.responseXML; if (!data && xhr.responseText != null) data = toXml(xhr.responseText); } else { data = xhr.responseText; } } catch(e){ ok = false; $.handleError(opts, xhr, 'error', e); } // ordering of these callbacks/triggers is odd, but that's how $.ajax does it if (ok) { opts.success(data, 'success'); if (g) $.event.trigger("ajaxSuccess", [xhr, opts]); } if (g) $.event.trigger("ajaxComplete", [xhr, opts]); if (g && ! --$.active) $.event.trigger("ajaxStop"); if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error'); // clean up setTimeout(function() { $io.remove(); xhr.responseXML = null; }, 100); }; function toXml(s, doc) { if (window.ActiveXObject) { doc = new ActiveXObject('Microsoft.XMLDOM'); doc.async = 'false'; doc.loadXML(s); } else doc = (new DOMParser()).parseFromString(s, 'text/xml'); return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null; }; }; }; $.fn.ajaxSubmit.counter = 0; // used to create unique iframe ids /** * ajaxForm() provides a mechanism for fully automating form submission. * * The advantages of using this method instead of ajaxSubmit() are: * * 1: This method will include coordinates for <input type="image" /> elements (if the element * is used to submit the form). * 2. This method will include the submit element's name/value data (for the element that was * used to submit the form). * 3. This method binds the submit() method to the form for you. * * Note that for accurate x/y coordinates of image submit elements in all browsers * you need to also use the "dimensions" plugin (this method will auto-detect its presence). * * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely * passes the options argument along after properly binding events for submit elements and * the form itself. See ajaxSubmit for a full description of the options argument. * * * @example * var options = { * target: '#myTargetDiv' * }; * $('#myForm').ajaxSForm(options); * @desc Bind form's submit event so that 'myTargetDiv' is updated with the server response * when the form is submitted. * * * @example * var options = { * success: function(responseText) { * alert(responseText); * } * }; * $('#myForm').ajaxSubmit(options); * @desc Bind form's submit event so that server response is alerted after the form is submitted. * * * @example * var options = { * beforeSubmit: function(formArray, jqForm) { * if (formArray.length == 0) { * alert('Please enter data.'); * return false; * } * } * }; * $('#myForm').ajaxSubmit(options); * @desc Bind form's submit event so that pre-submit callback is invoked before the form * is submitted. * * * @name ajaxForm * @param options object literal containing options which control the form submission process * @return jQuery * @cat Plugins/Form * @type jQuery */ $.fn.ajaxForm = function(options) { return this.ajaxFormUnbind().submit(submitHandler).each(function() { // store options in hash this.formPluginId = $.fn.ajaxForm.counter++; $.fn.ajaxForm.optionHash[this.formPluginId] = options; $(":submit,input:image", this).click(clickHandler); }); }; $.fn.ajaxForm.counter = 1; $.fn.ajaxForm.optionHash = {}; function clickHandler(e) { var $form = this.form; $form.clk = this; if (this.type == 'image') { if (e.offsetX != undefined) { $form.clk_x = e.offsetX; $form.clk_y = e.offsetY; } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin var offset = $(this).offset(); $form.clk_x = e.pageX - offset.left; $form.clk_y = e.pageY - offset.top; } else { $form.clk_x = e.pageX - this.offsetLeft; $form.clk_y = e.pageY - this.offsetTop; } } // clear form vars setTimeout(function() { $form.clk = $form.clk_x = $form.clk_y = null; }, 10); }; function submitHandler() { // retrieve options from hash var id = this.formPluginId; var options = $.fn.ajaxForm.optionHash[id]; $(this).ajaxSubmit(options); return false; }; /** * ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm * * @name ajaxFormUnbind * @return jQuery * @cat Plugins/Form * @type jQuery */ $.fn.ajaxFormUnbind = function() { this.unbind('submit', submitHandler); return this.each(function() { $(":submit,input:image", this).unbind('click', clickHandler); }); }; /** * formToArray() gathers form element data into an array of objects that can * be passed to any of the following ajax functions: $.get, $.post, or load. * Each object in the array has both a 'name' and 'value' property. An example of * an array for a simple login form might be: * * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ] * * It is this array that is passed to pre-submit callback functions provided to the * ajaxSubmit() and ajaxForm() methods. * * The semantic argument can be used to force form serialization in semantic order. * This is normally true anyway, unless the form contains input elements of type='image'. * If your form must be submitted with name/value pairs in semantic order and your form * contains an input of type='image" then pass true for this arg, otherwise pass false * (or nothing) to avoid the overhead for this logic. * * @example var data = $("#myForm").formToArray(); * $.post( "myscript.cgi", data ); * @desc Collect all the data from a form and submit it to the server. * * @name formToArray * @param semantic true if serialization must maintain strict semantic ordering of elements (slower) * @type Array<Object> * @cat Plugins/Form */ $.fn.formToArray = function(semantic) { var a = []; if (this.length == 0) return a; var form = this[0]; var els = semantic ? form.getElementsByTagName('*') : form.elements; if (!els) return a; for(var i=0, max=els.length; i < max; i++) { var el = els[i]; var n = el.name; if (!n) continue; if (semantic && form.clk && el.type == "image") { // handle image inputs on the fly when semantic == true if(!el.disabled && form.clk == el) a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y}); continue; } var v = $.fieldValue(el, true); if (v && v.constructor == Array) { for(var j=0, jmax=v.length; j < jmax; j++) a.push({name: n, value: v[j]}); } else if (v !== null && typeof v != 'undefined') a.push({name: n, value: v}); } if (!semantic && form.clk) { // input type=='image' are not found in elements array! handle them here var inputs = form.getElementsByTagName("input"); for(var i=0, max=inputs.length; i < max; i++) { var input = inputs[i]; var n = input.name; if(n && !input.disabled && input.type == "image" && form.clk == input) a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y}); } } return a; }; /** * Serializes form data into a 'submittable' string. This method will return a string * in the format: name1=value1&name2=value2 * * The semantic argument can be used to force form serialization in semantic order. * If your form must be submitted with name/value pairs in semantic order then pass * true for this arg, otherwise pass false (or nothing) to avoid the overhead for * this logic (which can be significant for very large forms). * * @example var data = $("#myForm").formSerialize(); * $.ajax('POST', "myscript.cgi", data); * @desc Collect all the data from a form into a single string * * @name formSerialize * @param semantic true if serialization must maintain strict semantic ordering of elements (slower) * @type String * @cat Plugins/Form */ $.fn.formSerialize = function(semantic) { //hand off to jQuery.param for proper encoding return $.param(this.formToArray(semantic)); }; /** * Serializes all field elements in the jQuery object into a query string. * This method will return a string in the format: name1=value1&name2=value2 * * The successful argument controls whether or not serialization is limited to * 'successful' controls (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls). * The default value of the successful argument is true. * * @example var data = $("input").formSerialize(); * @desc Collect the data from all successful input elements into a query string * * @example var data = $(":radio").formSerialize(); * @desc Collect the data from all successful radio input elements into a query string * * @example var data = $("#myForm :checkbox").formSerialize(); * @desc Collect the data from all successful checkbox input elements in myForm into a query string * * @example var data = $("#myForm :checkbox").formSerialize(false); * @desc Collect the data from all checkbox elements in myForm (even the unchecked ones) into a query string * * @example var data = $(":input").formSerialize(); * @desc Collect the data from all successful input, select, textarea and button elements into a query string * * @name fieldSerialize * @param successful true if only successful controls should be serialized (default is true) * @type String * @cat Plugins/Form */ $.fn.fieldSerialize = function(successful) { var a = []; this.each(function() { var n = this.name; if (!n) return; var v = $.fieldValue(this, successful); if (v && v.constructor == Array) { for (var i=0,max=v.length; i < max; i++) a.push({name: n, value: v[i]}); } else if (v !== null && typeof v != 'undefined') a.push({name: this.name, value: v}); }); //hand off to jQuery.param for proper encoding return $.param(a); }; /** * Returns the value(s) of the element in the matched set. For example, consider the following form: * * <form><fieldset> * <input name="A" type="text" /> * <input name="A" type="text" /> * <input name="B" type="checkbox" value="B1" /> * <input name="B" type="checkbox" value="B2"/> * <input name="C" type="radio" value="C1" /> * <input name="C" type="radio" value="C2" /> * </fieldset></form> * * var v = $(':text').fieldValue(); * // if no values are entered into the text inputs * v == ['',''] * // if values entered into the text inputs are 'foo' and 'bar' * v == ['foo','bar'] * * var v = $(':checkbox').fieldValue(); * // if neither checkbox is checked * v === undefined * // if both checkboxes are checked * v == ['B1', 'B2'] * * var v = $(':radio').fieldValue(); * // if neither radio is checked * v === undefined * // if first radio is checked * v == ['C1'] * * The successful argument controls whether or not the field element must be 'successful' * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls). * The default value of the successful argument is true. If this value is false the value(s) * for each element is returned. * * Note: This method *always* returns an array. If no valid value can be determined the * array will be empty, otherwise it will contain one or more values. * * @example var data = $("#myPasswordElement").fieldValue(); * alert(data[0]); * @desc Alerts the current value of the myPasswordElement element * * @example var data = $("#myForm :input").fieldValue(); * @desc Get the value(s) of the form elements in myForm * * @example var data = $("#myForm :checkbox").fieldValue(); * @desc Get the value(s) for the successful checkbox element(s) in the jQuery object. * * @example var data = $("#mySingleSelect").fieldValue(); * @desc Get the value(s) of the select control * * @example var data = $(':text').fieldValue(); * @desc Get the value(s) of the text input or textarea elements * * @example var data = $("#myMultiSelect").fieldValue(); * @desc Get the values for the select-multiple control * * @name fieldValue * @param Boolean successful true if only the values for successful controls should be returned (default is true) * @type Array<String> * @cat Plugins/Form */ $.fn.fieldValue = function(successful) { for (var val=[], i=0, max=this.length; i < max; i++) { var el = this[i]; var v = $.fieldValue(el, successful); if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) continue; v.constructor == Array ? $.merge(val, v) : val.push(v); } return val; }; /** * Returns the value of the field element. * * The successful argument controls whether or not the field element must be 'successful' * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls). * The default value of the successful argument is true. If the given element is not * successful and the successful arg is not false then the returned value will be null. * * Note: If the successful flag is true (default) but the element is not successful, the return will be null * Note: The value returned for a successful select-multiple element will always be an array. * Note: If the element has no value the return value will be undefined. * * @example var data = jQuery.fieldValue($("#myPasswordElement")[0]); * @desc Gets the current value of the myPasswordElement element * * @name fieldValue * @param Element el The DOM element for which the value will be returned * @param Boolean successful true if value returned must be for a successful controls (default is true) * @type String or Array<String> or null or undefined * @cat Plugins/Form */ $.fieldValue = function(el, successful) { var n = el.name, t = el.type, tag = el.tagName.toLowerCase(); if (typeof successful == 'undefined') successful = true; if (successful && (!n || el.disabled || t == 'reset' || t == 'button' || (t == 'checkbox' || t == 'radio') && !el.checked || (t == 'submit' || t == 'image') && el.form && el.form.clk != el || tag == 'select' && el.selectedIndex == -1)) return null; if (tag == 'select') { var index = el.selectedIndex; if (index < 0) return null; var a = [], ops = el.options; var one = (t == 'select-one'); var max = (one ? index+1 : ops.length); for(var i=(one ? index : 0); i < max; i++) { var op = ops[i]; if (op.selected) { // extra pain for IE... var v = $.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value; if (one) return v; a.push(v); } } return a; } return el.value; }; /** * Clears the form data. Takes the following actions on the form's input fields: * - input text fields will have their 'value' property set to the empty string * - select elements will have their 'selectedIndex' property set to -1 * - checkbox and radio inputs will have their 'checked' property set to false * - inputs of type submit, button, reset, and hidden will *not* be effected * - button elements will *not* be effected * * @example $('form').clearForm(); * @desc Clears all forms on the page. * * @name clearForm * @type jQuery * @cat Plugins/Form */ $.fn.clearForm = function() { return this.each(function() { $('input,select,textarea', this).clearFields(); }); }; /** * Clears the selected form elements. Takes the following actions on the matched elements: * - input text fields will have their 'value' property set to the empty string * - select elements will have their 'selectedIndex' property set to -1 * - checkbox and radio inputs will have their 'checked' property set to false * - inputs of type submit, button, reset, and hidden will *not* be effected * - button elements will *not* be effected * * @example $('.myInputs').clearFields(); * @desc Clears all inputs with class myInputs * * @name clearFields * @type jQuery * @cat Plugins/Form */ $.fn.clearFields = $.fn.clearInputs = function() { return this.each(function() { var t = this.type, tag = this.tagName.toLowerCase(); if (t == 'text' || t == 'password' || tag == 'textarea') this.value = ''; else if (t == 'checkbox' || t == 'radio') this.checked = false; else if (tag == 'select') this.selectedIndex = -1; }); }; /** * Resets the form data. Causes all form elements to be reset to their original value. * * @example $('form').resetForm(); * @desc Resets all forms on the page. * * @name resetForm * @type jQuery * @cat Plugins/Form */ $.fn.resetForm = function() { return this.each(function() { // guard against an input with the name of 'reset' // note that IE reports the reset function as an 'object' if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) this.reset(); }); }; /** * Enables or disables any matching elements. * * @example $(':radio').enabled(false); * @desc Disables all radio buttons * * @name select * @type jQuery * @cat Plugins/Form */ $.fn.enable = function(b) { if (b == undefined) b = true; return this.each(function() { this.disabled = !b }); }; /** * Checks/unchecks any matching checkboxes or radio buttons and * selects/deselects and matching option elements. * * @example $(':checkbox').selected(); * @desc Checks all checkboxes * * @name select * @type jQuery * @cat Plugins/Form */ $.fn.select = function(select) { if (select == undefined) select = true; return this.each(function() { var t = this.type; if (t == 'checkbox' || t == 'radio') this.checked = select; else if (this.tagName.toLowerCase() == 'option') { var $sel = $(this).parent('select'); if (select && $sel[0] && $sel[0].type == 'select-one') { // deselect all other options $sel.find('option').select(false); } this.selected = select; } }); }; })(jQuery); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/jquery/jquery.color.js��������������������������������������������������������0000644�0001066�0001066�00000010556�10762616541�016400� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * jQuery Color Animations * Copyright 2007 John Resig * Released under the MIT and GPL licenses. */ (function(jQuery){ // We override the animation for all of these color styles jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){ jQuery.fx.step[attr] = function(fx){ if ( fx.state == 0 ) { fx.start = getColor( fx.elem, attr ); fx.end = getRGB( fx.end ); } fx.elem.style[attr] = "rgb(" + [ Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0), Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0), Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0) ].join(",") + ")"; } }); // Color Conversion functions from highlightFade // By Blair Mitchelmore // http://jquery.offput.ca/highlightFade/ // Parse strings looking for color tuples [255,255,255] function getRGB(color) { var result; // Check if we're already dealing with an array of colors if ( color && color.constructor == Array && color.length == 3 ) return color; // Look for rgb(num,num,num) if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])]; // Look for rgb(num%,num%,num%) if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55]; // Look for #a0b1c2 if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)]; // Look for #fff if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)]; // Look for rgba(0, 0, 0, 0) == transparent in Safari 3 if (result = /rgba\(0, 0, 0, 0\)/.exec(color)) return colors['transparent'] // Otherwise, we're most likely dealing with a named color return colors[jQuery.trim(color).toLowerCase()]; } function getColor(elem, attr) { var color; do { color = jQuery.curCSS(elem, attr); // Keep going until we find an element that has color, or we hit the body if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") ) break; attr = "backgroundColor"; } while ( elem = elem.parentNode ); return getRGB(color); }; // Some named colors to work with // From Interface by Stefan Petre // http://interface.eyecon.ro/ var colors = { aqua:[0,255,255], azure:[240,255,255], beige:[245,245,220], black:[0,0,0], blue:[0,0,255], brown:[165,42,42], cyan:[0,255,255], darkblue:[0,0,139], darkcyan:[0,139,139], darkgrey:[169,169,169], darkgreen:[0,100,0], darkkhaki:[189,183,107], darkmagenta:[139,0,139], darkolivegreen:[85,107,47], darkorange:[255,140,0], darkorchid:[153,50,204], darkred:[139,0,0], darksalmon:[233,150,122], darkviolet:[148,0,211], fuchsia:[255,0,255], gold:[255,215,0], green:[0,128,0], indigo:[75,0,130], khaki:[240,230,140], lightblue:[173,216,230], lightcyan:[224,255,255], lightgreen:[144,238,144], lightgrey:[211,211,211], lightpink:[255,182,193], lightyellow:[255,255,224], lime:[0,255,0], magenta:[255,0,255], maroon:[128,0,0], navy:[0,0,128], olive:[128,128,0], orange:[255,165,0], pink:[255,192,203], purple:[128,0,128], violet:[128,0,128], red:[255,0,0], silver:[192,192,192], white:[255,255,255], yellow:[255,255,0], transparent: [255,255,255] }; })(jQuery); ��������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/jquery/jquery.js��������������������������������������������������������������0000644�0001066�0001066�00000074607�11021424314�015252� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * jQuery 1.2.6 - New Wave Javascript * * Copyright (c) 2008 John Resig (jquery.com) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * $Date: 2008-05-27 12:17:26 -0700 (Tue, 27 May 2008) $ * $Rev: 5700 $ */ eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(H(){J w=1c.4I,3n$=1c.$;J D=1c.4I=1c.$=H(a,b){I 2r D.18.5i(a,b)};J u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/,61=/^.[^:#\\[\\.]*$/,12;D.18=D.3V={5i:H(d,b){d=d||S;G(d.15){7[0]=d;7.K=1;I 7}G(1j d=="1W"){J c=u.2D(d);G(c&&(c[1]||!b)){G(c[1])d=D.4h([c[1]],b);N{J a=S.60(c[3]);G(a){G(a.2t!=c[3])I D().2u(d);I D(a)}d=[]}}N I D(b).2u(d)}N G(D.1F(d))I D(S)[D.18.25?"25":"3Y"](d);I 7.6V(D.2h(d))},5w:"1.2.6",8H:H(){I 7.K},K:0,3p:H(a){I a==12?D.2h(7):7[a]},2F:H(b){J a=D(b);a.5n=7;I a},6V:H(a){7.K=0;2q.3V.1A.1t(7,a);I 7},P:H(a,b){I D.P(7,a,b)},5h:H(b){J a=-1;I D.2E(b&&b.5w?b[0]:b,7)},1M:H(c,a,b){J d=c;G(c.1q==56)G(a===12)I 7[0]&&D[b||"1M"](7[0],c);N{d={};d[c]=a}I 7.P(H(i){R(c 1k d)D.1M(b?7.V:7,c,D.1e(7,d[c],b,i,c))})},1h:H(b,a){G((b==\'2d\'||b==\'1T\')&&3e(a)<0)a=12;I 7.1M(b,a,"24")},1r:H(b){G(1j b!="3y"&&b!=U)I 7.4F().3s((7[0]&&7[0].2z||S).5J(b));J a="";D.P(b||7,H(){D.P(7.3u,H(){G(7.15!=8)a+=7.15!=1?7.73:D.18.1r([7])})});I a},5W:H(b){G(7[0])D(b,7[0].2z).5y().38(7[0]).2i(H(){J a=7;1G(a.1s)a=a.1s;I a}).3s(7);I 7},8Z:H(a){I 7.P(H(){D(7).6P().5W(a)})},8S:H(a){I 7.P(H(){D(7).5W(a)})},3s:H(){I 7.3S(1a,M,Q,H(a){G(7.15==1)7.49(a)})},6E:H(){I 7.3S(1a,M,M,H(a){G(7.15==1)7.38(a,7.1s)})},6D:H(){I 7.3S(1a,Q,Q,H(a){7.1f.38(a,7)})},5p:H(){I 7.3S(1a,Q,M,H(a){7.1f.38(a,7.2J)})},3m:H(){I 7.5n||D([])},2u:H(b){J c=D.2i(7,H(a){I D.2u(b,a)});I 7.2F(/[^+>] [^+>]/.11(b)||b.1i("..")>-1?D.4u(c):c)},5y:H(e){J f=7.2i(H(){G(D.14.1g&&!D.4o(7)){J a=7.6n(M),5f=S.3t("1w");5f.49(a);I D.4h([5f.4l])[0]}N I 7.6n(M)});J d=f.2u("*").5M().P(H(){G(7[E]!=12)7[E]=U});G(e===M)7.2u("*").5M().P(H(i){G(7.15==3)I;J c=D.L(7,"3x");R(J a 1k c)R(J b 1k c[a])D.W.17(d[i],a,c[a][b],c[a][b].L)});I f},1E:H(b){I 7.2F(D.1F(b)&&D.3G(7,H(a,i){I b.1l(a,i)})||D.3f(b,7))},4W:H(b){G(b.1q==56)G(61.11(b))I 7.2F(D.3f(b,7,M));N b=D.3f(b,7);J a=b.K&&b[b.K-1]!==12&&!b.15;I 7.1E(H(){I a?D.2E(7,b)<0:7!=b})},17:H(a){I 7.2F(D.4u(D.39(7.3p(),1j a==\'1W\'?D(a):D.2h(a))))},3C:H(a){I!!a&&D.3f(a,7).K>0},7V:H(a){I 7.3C("."+a)},6a:H(b){G(b==12){G(7.K){J c=7[0];G(D.Y(c,"2y")){J e=c.63,62=[],16=c.16,2Y=c.O=="2y-2Y";G(e<0)I U;R(J i=2Y?e:0,2e=2Y?e+1:16.K;i<2e;i++){J d=16[i];G(d.3a){b=D.14.1g&&!d.au.2s.aq?d.1r:d.2s;G(2Y)I b;62.1A(b)}}I 62}N I(7[0].2s||"").1o(/\\r/g,"")}I 12}G(b.1q==4N)b+=\'\';I 7.P(H(){G(7.15!=1)I;G(b.1q==2q&&/5R|5A/.11(7.O))7.4M=(D.2E(7.2s,b)>=0||D.2E(7.32,b)>=0);N G(D.Y(7,"2y")){J a=D.2h(b);D("9U",7).P(H(){7.3a=(D.2E(7.2s,a)>=0||D.2E(7.1r,a)>=0)});G(!a.K)7.63=-1}N 7.2s=b})},2I:H(a){I a==12?(7[0]?7[0].4l:U):7.4F().3s(a)},7b:H(a){I 7.5p(a).1Z()},77:H(i){I 7.3w(i,i+1)},3w:H(){I 7.2F(2q.3V.3w.1t(7,1a))},2i:H(b){I 7.2F(D.2i(7,H(a,i){I b.1l(a,i,a)}))},5M:H(){I 7.17(7.5n)},L:H(d,b){J a=d.1Q(".");a[1]=a[1]?"."+a[1]:"";G(b===12){J c=7.5G("9B"+a[1]+"!",[a[0]]);G(c===12&&7.K)c=D.L(7[0],d);I c===12&&a[1]?7.L(a[0]):c}N I 7.1R("9v"+a[1]+"!",[a[0],b]).P(H(){D.L(7,d,b)})},3b:H(a){I 7.P(H(){D.3b(7,a)})},3S:H(g,f,h,d){J e=7.K>1,3z;I 7.P(H(){G(!3z){3z=D.4h(g,7.2z);G(h)3z.9o()}J b=7;G(f&&D.Y(7,"1X")&&D.Y(3z[0],"4H"))b=7.40("22")[0]||7.49(7.2z.3t("22"));J c=D([]);D.P(3z,H(){J a=e?D(7).5y(M)[0]:7;G(D.Y(a,"1m"))c=c.17(a);N{G(a.15==1)c=c.17(D("1m",a).1Z());d.1l(b,a)}});c.P(6R)})}};D.18.5i.3V=D.18;H 6R(i,a){G(a.4e)D.3T({1b:a.4e,31:Q,1L:"1m"});N D.5u(a.1r||a.6N||a.4l||"");G(a.1f)a.1f.30(a)}H 1x(){I+2r 8K}D.1n=D.18.1n=H(){J b=1a[0]||{},i=1,K=1a.K,4B=Q,16;G(b.1q==8I){4B=b;b=1a[1]||{};i=2}G(1j b!="3y"&&1j b!="H")b={};G(K==i){b=7;--i}R(;i<K;i++)G((16=1a[i])!=U)R(J c 1k 16){J a=b[c],2x=16[c];G(b===2x)6L;G(4B&&2x&&1j 2x=="3y"&&!2x.15)b[c]=D.1n(4B,a||(2x.K!=U?[]:{}),2x);N G(2x!==12)b[c]=2x}I b};J E="4I"+1x(),6K=0,5q={},6G=/z-?5h|8B-?8A|1y|6A|8w-?1T/i,3N=S.3N||{};D.1n({8u:H(a){1c.$=3n$;G(a)1c.4I=w;I D},1F:H(a){I!!a&&1j a!="1W"&&!a.Y&&a.1q!=2q&&/^[\\s[]?H/.11(a+"")},4o:H(a){I a.1B&&!a.1d||a.2g&&a.2z&&!a.2z.1d},5u:H(a){a=D.3l(a);G(a){J b=S.40("6v")[0]||S.1B,1m=S.3t("1m");1m.O="1r/4v";G(D.14.1g)1m.1r=a;N 1m.49(S.5J(a));b.38(1m,b.1s);b.30(1m)}},Y:H(b,a){I b.Y&&b.Y.2m()==a.2m()},1Y:{},L:H(c,d,b){c=c==1c?5q:c;J a=c[E];G(!a)a=c[E]=++6K;G(d&&!D.1Y[a])D.1Y[a]={};G(b!==12)D.1Y[a][d]=b;I d?D.1Y[a][d]:a},3b:H(c,b){c=c==1c?5q:c;J a=c[E];G(b){G(D.1Y[a]){3d D.1Y[a][b];b="";R(b 1k D.1Y[a])1V;G(!b)D.3b(c)}}N{23{3d c[E]}21(e){G(c.5k)c.5k(E)}3d D.1Y[a]}},P:H(d,a,c){J e,i=0,K=d.K;G(c){G(K==12){R(e 1k d)G(a.1t(d[e],c)===Q)1V}N R(;i<K;)G(a.1t(d[i++],c)===Q)1V}N{G(K==12){R(e 1k d)G(a.1l(d[e],e,d[e])===Q)1V}N R(J b=d[0];i<K&&a.1l(b,i,b)!==Q;b=d[++i]){}}I d},1e:H(b,a,c,i,d){G(D.1F(a))a=a.1l(b,i);I a&&a.1q==4N&&c=="24"&&!6G.11(d)?a+"2U":a},1D:{17:H(c,b){D.P((b||"").1Q(/\\s+/),H(i,a){G(c.15==1&&!D.1D.3Q(c.1D,a))c.1D+=(c.1D?" ":"")+a})},1Z:H(c,b){G(c.15==1)c.1D=b!=12?D.3G(c.1D.1Q(/\\s+/),H(a){I!D.1D.3Q(b,a)}).6r(" "):""},3Q:H(b,a){I D.2E(a,(b.1D||b).6p().1Q(/\\s+/))>-1}},6o:H(b,c,a){J e={};R(J d 1k c){e[d]=b.V[d];b.V[d]=c[d]}a.1l(b);R(J d 1k c)b.V[d]=e[d]},1h:H(d,e,c){G(e=="2d"||e=="1T"){J b,2L={3c:"5g",5D:"1C",19:"3H"},2S=e=="2d"?["5d","6i"]:["5b","6g"];H 5a(){b=e=="2d"?d.8g:d.8f;J a=0,2A=0;D.P(2S,H(){a+=3e(D.24(d,"55"+7,M))||0;2A+=3e(D.24(d,"2A"+7+"47",M))||0});b-=26.85(a+2A)}G(D(d).3C(":4i"))5a();N D.6o(d,2L,5a);I 26.2e(0,b)}I D.24(d,e,c)},24:H(f,l,k){J e,V=f.V;H 4d(b){G(!D.14.2f)I Q;J a=3N.53(b,U);I!a||a.52("4d")==""}G(l=="1y"&&D.14.1g){e=D.1M(V,"1y");I e==""?"1":e}G(D.14.2H&&l=="19"){J d=V.50;V.50="0 7Z 7Y";V.50=d}G(l.1I(/4g/i))l=y;G(!k&&V&&V[l])e=V[l];N G(3N.53){G(l.1I(/4g/i))l="4g";l=l.1o(/([A-Z])/g,"-$1").3h();J c=3N.53(f,U);G(c&&!4d(f))e=c.52(l);N{J g=[],2G=[],a=f,i=0;R(;a&&4d(a);a=a.1f)2G.6b(a);R(;i<2G.K;i++)G(4d(2G[i])){g[i]=2G[i].V.19;2G[i].V.19="3H"}e=l=="19"&&g[2G.K-1]!=U?"2P":(c&&c.52(l))||"";R(i=0;i<g.K;i++)G(g[i]!=U)2G[i].V.19=g[i]}G(l=="1y"&&e=="")e="1"}N G(f.4f){J h=l.1o(/\\-(\\w)/g,H(a,b){I b.2m()});e=f.4f[l]||f.4f[h];G(!/^\\d+(2U)?$/i.11(e)&&/^\\d/.11(e)){J j=V.1z,65=f.64.1z;f.64.1z=f.4f.1z;V.1z=e||0;e=V.aO+"2U";V.1z=j;f.64.1z=65}}I e},4h:H(l,h){J k=[];h=h||S;G(1j h.3t==\'12\')h=h.2z||h[0]&&h[0].2z||S;D.P(l,H(i,d){G(!d)I;G(d.1q==4N)d+=\'\';G(1j d=="1W"){d=d.1o(/(<(\\w+)[^>]*?)\\/>/g,H(b,a,c){I c.1I(/^(aN|43|7E|aH|4t|7z|aE|3A|aB|aA|az)$/i)?b:a+"></"+c+">"});J f=D.3l(d).3h(),1w=h.3t("1w");J e=!f.1i("<av")&&[1,"<2y 7u=\'7u\'>","</2y>"]||!f.1i("<at")&&[1,"<7t>","</7t>"]||f.1I(/^<(ar|22|ap|al|aj)/)&&[1,"<1X>","</1X>"]||!f.1i("<4H")&&[2,"<1X><22>","</22></1X>"]||(!f.1i("<ah")||!f.1i("<ae"))&&[3,"<1X><22><4H>","</4H></22></1X>"]||!f.1i("<7E")&&[2,"<1X><22></22><7p>","</7p></1X>"]||D.14.1g&&[1,"1w<1w>","</1w>"]||[0,"",""];1w.4l=e[1]+d+e[2];1G(e[0]--)1w=1w.5U;G(D.14.1g){J g=!f.1i("<1X")&&f.1i("<22")<0?1w.1s&&1w.1s.3u:e[1]=="<1X>"&&f.1i("<22")<0?1w.3u:[];R(J j=g.K-1;j>=0;--j)G(D.Y(g[j],"22")&&!g[j].3u.K)g[j].1f.30(g[j]);G(/^\\s/.11(d))1w.38(h.5J(d.1I(/^\\s*/)[0]),1w.1s)}d=D.2h(1w.3u)}G(d.K===0&&(!D.Y(d,"45")&&!D.Y(d,"2y")))I;G(d[0]==12||D.Y(d,"45")||d.16)k.1A(d);N k=D.39(k,d)});I k},1M:H(d,f,c){G(!d||d.15==3||d.15==8)I 12;J e=!D.4o(d),3W=c!==12,1g=D.14.1g;f=e&&D.2L[f]||f;G(d.2g){J g=/5x|4e|V/.11(f);G(f=="3a"&&D.14.2f)d.1f.63;G(f 1k d&&e&&!g){G(3W){G(f=="O"&&D.Y(d,"4t")&&d.1f)7m"O a5 a2\'t 9Z 9W";d[f]=c}G(D.Y(d,"45")&&d.7i(f))I d.7i(f).73;I d[f]}G(1g&&e&&f=="V")I D.1M(d.V,"9V",c);G(3W)d.9T(f,""+c);J h=1g&&e&&g?d.4K(f,2):d.4K(f);I h===U?12:h}G(1g&&f=="1y"){G(3W){d.6A=1;d.1E=(d.1E||"").1o(/7d\\([^)]*\\)/,"")+(3v(c)+\'\'=="9P"?"":"7d(1y="+c*79+")")}I d.1E&&d.1E.1i("1y=")>=0?(3e(d.1E.1I(/1y=([^)]*)/)[1])/79)+\'\':""}f=f.1o(/-([a-z])/9M,H(a,b){I b.2m()});G(3W)d[f]=c;I d[f]},3l:H(a){I(a||"").1o(/^\\s+|\\s+$/g,"")},2h:H(b){J a=[];G(b!=U){J i=b.K;G(i==U||b.1Q||b.4L||b.1l)a[0]=b;N 1G(i)a[--i]=b[i]}I a},2E:H(b,a){R(J i=0,K=a.K;i<K;i++)G(a[i]===b)I i;I-1},39:H(a,b){J i=0,T,36=a.K;G(D.14.1g){1G(T=b[i++])G(T.15!=8)a[36++]=T}N 1G(T=b[i++])a[36++]=T;I a},4u:H(a){J c=[],2w={};23{R(J i=0,K=a.K;i<K;i++){J b=D.L(a[i]);G(!2w[b]){2w[b]=M;c.1A(a[i])}}}21(e){c=a}I c},3G:H(c,a,d){J b=[];R(J i=0,K=c.K;i<K;i++)G(!d!=!a(c[i],i))b.1A(c[i]);I b},2i:H(d,a){J c=[];R(J i=0,K=d.K;i<K;i++){J b=a(d[i],i);G(b!=U)c[c.K]=b}I c.75.1t([],c)}});J v=9E.9C.3h();D.14={5F:(v.1I(/.+(?:9A|9z|9y|9w)[\\/: ]([\\d.]+)/)||[])[1],2f:/72/.11(v),2H:/2H/.11(v),1g:/1g/.11(v)&&!/2H/.11(v),3r:/3r/.11(v)&&!/(9s|72)/.11(v)};J y=D.14.1g?"70":"6Z";D.1n({6Y:!D.14.1g||S.6X=="6W",2L:{"R":"9n","9m":"1D","4g":y,6Z:y,70:y,9j:"9h",9g:"9e",9d:"9b",9a:"99"}});D.P({6S:H(a){I a.1f},96:H(a){I D.4T(a,"1f")},93:H(a){I D.2V(a,2,"2J")},90:H(a){I D.2V(a,2,"4D")},8Y:H(a){I D.4T(a,"2J")},8X:H(a){I D.4T(a,"4D")},8W:H(a){I D.5v(a.1f.1s,a)},8V:H(a){I D.5v(a.1s)},6P:H(a){I D.Y(a,"8U")?a.8T||a.8R.S:D.2h(a.3u)}},H(c,d){D.18[c]=H(b){J a=D.2i(7,d);G(b&&1j b=="1W")a=D.3f(b,a);I 7.2F(D.4u(a))}});D.P({6O:"3s",8Q:"6E",38:"6D",8P:"5p",8O:"7b"},H(c,b){D.18[c]=H(){J a=1a;I 7.P(H(){R(J i=0,K=a.K;i<K;i++)D(a[i])[b](7)})}});D.P({8N:H(a){D.1M(7,a,"");G(7.15==1)7.5k(a)},8M:H(a){D.1D.17(7,a)},8L:H(a){D.1D.1Z(7,a)},8J:H(a){D.1D[D.1D.3Q(7,a)?"1Z":"17"](7,a)},1Z:H(a){G(!a||D.1E(a,[7]).r.K){D("*",7).17(7).P(H(){D.W.1Z(7);D.3b(7)});G(7.1f)7.1f.30(7)}},4F:H(){D(">*",7).1Z();1G(7.1s)7.30(7.1s)}},H(a,b){D.18[a]=H(){I 7.P(b,1a)}});D.P(["6M","47"],H(i,c){J b=c.3h();D.18[b]=H(a){I 7[0]==1c?D.14.2H&&S.1d["5t"+c]||D.14.2f&&1c["5s"+c]||S.6X=="6W"&&S.1B["5t"+c]||S.1d["5t"+c]:7[0]==S?26.2e(26.2e(S.1d["4A"+c],S.1B["4A"+c]),26.2e(S.1d["2k"+c],S.1B["2k"+c])):a==12?(7.K?D.1h(7[0],b):U):7.1h(b,a.1q==56?a:a+"2U")}});H 2a(a,b){I a[0]&&3v(D.24(a[0],b,M),10)||0}J C=D.14.2f&&3v(D.14.5F)<8G?"(?:[\\\\w*3n-]|\\\\\\\\.)":"(?:[\\\\w\\8F-\\8E*3n-]|\\\\\\\\.)",6J=2r 4y("^>\\\\s*("+C+"+)"),6I=2r 4y("^("+C+"+)(#)("+C+"+)"),6H=2r 4y("^([#.]?)("+C+"*)");D.1n({6F:{"":H(a,i,m){I m[2]=="*"||D.Y(a,m[2])},"#":H(a,i,m){I a.4K("2t")==m[2]},":":{8D:H(a,i,m){I i<m[3]-0},8C:H(a,i,m){I i>m[3]-0},2V:H(a,i,m){I m[3]-0==i},77:H(a,i,m){I m[3]-0==i},3o:H(a,i){I i==0},3P:H(a,i,m,r){I i==r.K-1},6C:H(a,i){I i%2==0},6B:H(a,i){I i%2},"3o-4w":H(a){I a.1f.40("*")[0]==a},"3P-4w":H(a){I D.2V(a.1f.5U,1,"4D")==a},"8z-4w":H(a){I!D.2V(a.1f.5U,2,"4D")},6S:H(a){I a.1s},4F:H(a){I!a.1s},8y:H(a,i,m){I(a.6N||a.8x||D(a).1r()||"").1i(m[3])>=0},4i:H(a){I"1C"!=a.O&&D.1h(a,"19")!="2P"&&D.1h(a,"5D")!="1C"},1C:H(a){I"1C"==a.O||D.1h(a,"19")=="2P"||D.1h(a,"5D")=="1C"},8v:H(a){I!a.3O},3O:H(a){I a.3O},4M:H(a){I a.4M},3a:H(a){I a.3a||D.1M(a,"3a")},1r:H(a){I"1r"==a.O},5R:H(a){I"5R"==a.O},5A:H(a){I"5A"==a.O},5o:H(a){I"5o"==a.O},3K:H(a){I"3K"==a.O},5m:H(a){I"5m"==a.O},6z:H(a){I"6z"==a.O},6y:H(a){I"6y"==a.O},2p:H(a){I"2p"==a.O||D.Y(a,"2p")},4t:H(a){I/4t|2y|6x|2p/i.11(a.Y)},3Q:H(a,i,m){I D.2u(m[3],a).K},8t:H(a){I/h\\d/i.11(a.Y)},8s:H(a){I D.3G(D.3M,H(b){I a==b.T}).K}}},6w:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,2r 4y("^([:.#]*)("+C+"+)")],3f:H(a,c,b){J d,1u=[];1G(a&&a!=d){d=a;J f=D.1E(a,c,b);a=f.t.1o(/^\\s*,\\s*/,"");1u=b?c=f.r:D.39(1u,f.r)}I 1u},2u:H(t,o){G(1j t!="1W")I[t];G(o&&o.15!=1&&o.15!=9)I[];o=o||S;J d=[o],2w=[],3P,Y;1G(t&&3P!=t){J r=[];3P=t;t=D.3l(t);J l=Q,3k=6J,m=3k.2D(t);G(m){Y=m[1].2m();R(J i=0;d[i];i++)R(J c=d[i].1s;c;c=c.2J)G(c.15==1&&(Y=="*"||c.Y.2m()==Y))r.1A(c);d=r;t=t.1o(3k,"");G(t.1i(" ")==0)6L;l=M}N{3k=/^([>+~])\\s*(\\w*)/i;G((m=3k.2D(t))!=U){r=[];J k={};Y=m[2].2m();m=m[1];R(J j=0,3j=d.K;j<3j;j++){J n=m=="~"||m=="+"?d[j].2J:d[j].1s;R(;n;n=n.2J)G(n.15==1){J g=D.L(n);G(m=="~"&&k[g])1V;G(!Y||n.Y.2m()==Y){G(m=="~")k[g]=M;r.1A(n)}G(m=="+")1V}}d=r;t=D.3l(t.1o(3k,""));l=M}}G(t&&!l){G(!t.1i(",")){G(o==d[0])d.4s();2w=D.39(2w,d);r=d=[o];t=" "+t.6t(1,t.K)}N{J h=6I;J m=h.2D(t);G(m){m=[0,m[2],m[3],m[1]]}N{h=6H;m=h.2D(t)}m[2]=m[2].1o(/\\\\/g,"");J f=d[d.K-1];G(m[1]=="#"&&f&&f.60&&!D.4o(f)){J p=f.60(m[2]);G((D.14.1g||D.14.2H)&&p&&1j p.2t=="1W"&&p.2t!=m[2])p=D(\'[@2t="\'+m[2]+\'"]\',f)[0];d=r=p&&(!m[3]||D.Y(p,m[3]))?[p]:[]}N{R(J i=0;d[i];i++){J a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];G(a=="*"&&d[i].Y.3h()=="3y")a="3A";r=D.39(r,d[i].40(a))}G(m[1]==".")r=D.5l(r,m[2]);G(m[1]=="#"){J e=[];R(J i=0;r[i];i++)G(r[i].4K("2t")==m[2]){e=[r[i]];1V}r=e}d=r}t=t.1o(h,"")}}G(t){J b=D.1E(t,r);d=r=b.r;t=D.3l(b.t)}}G(t)d=[];G(d&&o==d[0])d.4s();2w=D.39(2w,d);I 2w},5l:H(r,m,a){m=" "+m+" ";J c=[];R(J i=0;r[i];i++){J b=(" "+r[i].1D+" ").1i(m)>=0;G(!a&&b||a&&!b)c.1A(r[i])}I c},1E:H(t,r,h){J d;1G(t&&t!=d){d=t;J p=D.6w,m;R(J i=0;p[i];i++){m=p[i].2D(t);G(m){t=t.8r(m[0].K);m[2]=m[2].1o(/\\\\/g,"");1V}}G(!m)1V;G(m[1]==":"&&m[2]=="4W")r=61.11(m[3])?D.1E(m[3],r,M).r:D(r).4W(m[3]);N G(m[1]==".")r=D.5l(r,m[2],h);N G(m[1]=="["){J g=[],O=m[3];R(J i=0,3j=r.K;i<3j;i++){J a=r[i],z=a[D.2L[m[2]]||m[2]];G(z==U||/5x|4e|3a/.11(m[2]))z=D.1M(a,m[2])||\'\';G((O==""&&!!z||O=="="&&z==m[5]||O=="!="&&z!=m[5]||O=="^="&&z&&!z.1i(m[5])||O=="$="&&z.6t(z.K-m[5].K)==m[5]||(O=="*="||O=="~=")&&z.1i(m[5])>=0)^h)g.1A(a)}r=g}N G(m[1]==":"&&m[2]=="2V-4w"){J e={},g=[],11=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2D(m[3]=="6C"&&"2n"||m[3]=="6B"&&"2n+1"||!/\\D/.11(m[3])&&"8q+"+m[3]||m[3]),3o=(11[1]+(11[2]||1))-0,d=11[3]-0;R(J i=0,3j=r.K;i<3j;i++){J j=r[i],1f=j.1f,2t=D.L(1f);G(!e[2t]){J c=1;R(J n=1f.1s;n;n=n.2J)G(n.15==1)n.4r=c++;e[2t]=M}J b=Q;G(3o==0){G(j.4r==d)b=M}N G((j.4r-d)%3o==0&&(j.4r-d)/3o>=0)b=M;G(b^h)g.1A(j)}r=g}N{J f=D.6F[m[1]];G(1j f=="3y")f=f[m[2]];G(1j f=="1W")f=6s("Q||H(a,i){I "+f+";}");r=D.3G(r,H(a,i){I f(a,i,m,r)},h)}}I{r:r,t:t}},4T:H(b,c){J a=[],1u=b[c];1G(1u&&1u!=S){G(1u.15==1)a.1A(1u);1u=1u[c]}I a},2V:H(a,e,c,b){e=e||1;J d=0;R(;a;a=a[c])G(a.15==1&&++d==e)1V;I a},5v:H(n,a){J r=[];R(;n;n=n.2J){G(n.15==1&&n!=a)r.1A(n)}I r}});D.W={17:H(f,i,g,e){G(f.15==3||f.15==8)I;G(D.14.1g&&f.4L)f=1c;G(!g.29)g.29=7.29++;G(e!=12){J h=g;g=7.3J(h,H(){I h.1t(7,1a)});g.L=e}J j=D.L(f,"3x")||D.L(f,"3x",{}),1H=D.L(f,"1H")||D.L(f,"1H",H(){G(1j D!="12"&&!D.W.5j)I D.W.1H.1t(1a.3I.T,1a)});1H.T=f;D.P(i.1Q(/\\s+/),H(c,b){J a=b.1Q(".");b=a[0];g.O=a[1];J d=j[b];G(!d){d=j[b]={};G(!D.W.2C[b]||D.W.2C[b].4q.1l(f)===Q){G(f.4a)f.4a(b,1H,Q);N G(f.6q)f.6q("4p"+b,1H)}}d[g.29]=g;D.W.28[b]=M});f=U},29:1,28:{},1Z:H(e,h,f){G(e.15==3||e.15==8)I;J i=D.L(e,"3x"),1K,5h;G(i){G(h==12||(1j h=="1W"&&h.8p(0)=="."))R(J g 1k i)7.1Z(e,g+(h||""));N{G(h.O){f=h.2o;h=h.O}D.P(h.1Q(/\\s+/),H(b,a){J c=a.1Q(".");a=c[0];G(i[a]){G(f)3d i[a][f.29];N R(f 1k i[a])G(!c[1]||i[a][f].O==c[1])3d i[a][f];R(1K 1k i[a])1V;G(!1K){G(!D.W.2C[a]||D.W.2C[a].4G.1l(e)===Q){G(e.6m)e.6m(a,D.L(e,"1H"),Q);N G(e.6l)e.6l("4p"+a,D.L(e,"1H"))}1K=U;3d i[a]}}})}R(1K 1k i)1V;G(!1K){J d=D.L(e,"1H");G(d)d.T=U;D.3b(e,"3x");D.3b(e,"1H")}}},1R:H(h,c,f,g,i){c=D.2h(c);G(h.1i("!")>=0){h=h.3w(0,-1);J a=M}G(!f){G(7.28[h])D("*").17([1c,S]).1R(h,c)}N{G(f.15==3||f.15==8)I 12;J b,1K,18=D.1F(f[h]||U),W=!c[0]||!c[0].37;G(W){c.6b({O:h,2N:f,37:H(){},3X:H(){},4J:1x()});c[0][E]=M}c[0].O=h;G(a)c[0].6k=M;J d=D.L(f,"1H");G(d)b=d.1t(f,c);G((!18||(D.Y(f,\'a\')&&h=="4n"))&&f["4p"+h]&&f["4p"+h].1t(f,c)===Q)b=Q;G(W)c.4s();G(i&&D.1F(i)){1K=i.1t(f,b==U?c:c.75(b));G(1K!==12)b=1K}G(18&&g!==Q&&b!==Q&&!(D.Y(f,\'a\')&&h=="4n")){7.5j=M;23{f[h]()}21(e){}}7.5j=Q}I b},1H:H(b){J a,1K,2T,5e,4m;b=1a[0]=D.W.6j(b||1c.W);2T=b.O.1Q(".");b.O=2T[0];2T=2T[1];5e=!2T&&!b.6k;4m=(D.L(7,"3x")||{})[b.O];R(J j 1k 4m){J c=4m[j];G(5e||c.O==2T){b.2o=c;b.L=c.L;1K=c.1t(7,1a);G(a!==Q)a=1K;G(1K===Q){b.37();b.3X()}}}I a},2L:"8o 8n 8m 8l 2p 8k 42 5c 6h 5I 8j L 8i 8h 4k 2o 59 58 8e 8c 57 6f 8b 8a 4j 88 87 86 6d 2N 4J 6c O 84 83 2S".1Q(" "),6j:H(b){G(b[E]==M)I b;J c=b;b={82:c};R(J i=7.2L.K,1e;i;){1e=7.2L[--i];b[1e]=c[1e]}b[E]=M;b.37=H(){G(c.37)c.37();c.81=Q};b.3X=H(){G(c.3X)c.3X();c.80=M};b.4J=b.4J||1x();G(!b.2N)b.2N=b.6d||S;G(b.2N.15==3)b.2N=b.2N.1f;G(!b.4j&&b.4k)b.4j=b.4k==b.2N?b.6c:b.4k;G(b.57==U&&b.5c!=U){J a=S.1B,1d=S.1d;b.57=b.5c+(a&&a.2c||1d&&1d.2c||0)-(a.69||0);b.6f=b.6h+(a&&a.2l||1d&&1d.2l||0)-(a.68||0)}G(!b.2S&&((b.42||b.42===0)?b.42:b.59))b.2S=b.42||b.59;G(!b.58&&b.5I)b.58=b.5I;G(!b.2S&&b.2p)b.2S=(b.2p&1?1:(b.2p&2?3:(b.2p&4?2:0)));I b},3J:H(a,b){b.29=a.29=a.29||b.29||7.29++;I b},2C:{25:{4q:H(){54();I},4G:H(){I}},4c:{4q:H(){G(D.14.1g)I Q;D(7).2O("51",D.W.2C.4c.2o);I M},4G:H(){G(D.14.1g)I Q;D(7).3L("51",D.W.2C.4c.2o);I M},2o:H(a){G(F(a,7))I M;a.O="4c";I D.W.1H.1t(7,1a)}},3F:{4q:H(){G(D.14.1g)I Q;D(7).2O("4Z",D.W.2C.3F.2o);I M},4G:H(){G(D.14.1g)I Q;D(7).3L("4Z",D.W.2C.3F.2o);I M},2o:H(a){G(F(a,7))I M;a.O="3F";I D.W.1H.1t(7,1a)}}}};D.18.1n({2O:H(c,a,b){I c=="4Y"?7.2Y(c,a,b):7.P(H(){D.W.17(7,c,b||a,b&&a)})},2Y:H(d,b,c){J e=D.W.3J(c||b,H(a){D(7).3L(a,e);I(c||b).1t(7,1a)});I 7.P(H(){D.W.17(7,d,e,c&&b)})},3L:H(a,b){I 7.P(H(){D.W.1Z(7,a,b)})},1R:H(c,a,b){I 7.P(H(){D.W.1R(c,a,7,M,b)})},5G:H(c,a,b){I 7[0]&&D.W.1R(c,a,7[0],Q,b)},2B:H(b){J c=1a,i=1;1G(i<c.K)D.W.3J(b,c[i++]);I 7.4n(D.W.3J(b,H(a){7.4X=(7.4X||0)%i;a.37();I c[7.4X++].1t(7,1a)||Q}))},7X:H(a,b){I 7.2O(\'4c\',a).2O(\'3F\',b)},25:H(a){54();G(D.2Q)a.1l(S,D);N D.3D.1A(H(){I a.1l(7,D)});I 7}});D.1n({2Q:Q,3D:[],25:H(){G(!D.2Q){D.2Q=M;G(D.3D){D.P(D.3D,H(){7.1l(S)});D.3D=U}D(S).5G("25")}}});J x=Q;H 54(){G(x)I;x=M;G(S.4a&&!D.14.2H)S.4a("67",D.25,Q);G(D.14.1g&&1c==1P)(H(){G(D.2Q)I;23{S.1B.7W("1z")}21(3g){3E(1a.3I,0);I}D.25()})();G(D.14.2H)S.4a("67",H(){G(D.2Q)I;R(J i=0;i<S.4V.K;i++)G(S.4V[i].3O){3E(1a.3I,0);I}D.25()},Q);G(D.14.2f){J a;(H(){G(D.2Q)I;G(S.3i!="66"&&S.3i!="1O"){3E(1a.3I,0);I}G(a===12)a=D("V, 7z[7U=7T]").K;G(S.4V.K!=a){3E(1a.3I,0);I}D.25()})()}D.W.17(1c,"3Y",D.25)}D.P(("7S,7R,3Y,7Q,4A,4Y,4n,7P,"+"89,7O,7N,51,4Z,7M,2y,"+"5m,8d,7L,7K,3g").1Q(","),H(i,b){D.18[b]=H(a){I a?7.2O(b,a):7.1R(b)}});J F=H(a,c){J b=a.4j;1G(b&&b!=c)23{b=b.1f}21(3g){b=c}I b==c};D(1c).2O("4Y",H(){D("*").17(S).3L()});D.18.1n({6e:D.18.3Y,3Y:H(g,d,c){G(1j g!=\'1W\')I 7.6e(g);J e=g.1i(" ");G(e>=0){J i=g.3w(e,g.K);g=g.3w(0,e)}c=c||H(){};J f="2R";G(d)G(D.1F(d)){c=d;d=U}N G(1j d==\'3y\'){d=D.3A(d);f="7J"}J h=7;D.3T({1b:g,O:f,1L:"2I",L:d,1O:H(a,b){G(b=="1U"||b=="7I")h.2I(i?D("<1w/>").3s(a.4U.1o(/<1m(.|\\s)*?\\/1m>/g,"")).2u(i):a.4U);h.P(c,[a.4U,b,a])}});I 7},aL:H(){I D.3A(7.7H())},7H:H(){I 7.2i(H(){I D.Y(7,"45")?D.2h(7.aK):7}).1E(H(){I 7.32&&!7.3O&&(7.4M||/2y|6x/i.11(7.Y)||/1r|1C|3K/i.11(7.O))}).2i(H(i,c){J b=D(7).6a();I b==U?U:b.1q==2q?D.2i(b,H(a,i){I{32:c.32,2s:a}}):{32:c.32,2s:b}}).3p()}});D.P("7G,7D,7C,7B,6u,7A".1Q(","),H(i,o){D.18[o]=H(f){I 7.2O(o,f)}});J B=1x();D.1n({3p:H(d,b,a,c){G(D.1F(b)){a=b;b=U}I D.3T({O:"2R",1b:d,L:b,1U:a,1L:c})},aG:H(b,a){I D.3p(b,U,a,"1m")},aF:H(c,b,a){I D.3p(c,b,a,"3B")},aD:H(d,b,a,c){G(D.1F(b)){a=b;b={}}I D.3T({O:"7J",1b:d,L:b,1U:a,1L:c})},aC:H(a){D.1n(D.5Z,a)},5Z:{1b:5Y.5x,28:M,O:"2R",2W:0,7y:"4x/x-ay-45-ax",7v:M,31:M,L:U,5r:U,3K:U,4z:{2K:"4x/2K, 1r/2K",2I:"1r/2I",1m:"1r/4v, 4x/4v",3B:"4x/3B, 1r/4v",1r:"1r/as",4S:"*/*"}},4R:{},3T:H(s){s=D.1n(M,s,D.1n(M,{},D.5Z,s));J g,33=/=\\?(&|$)/g,1v,L,O=s.O.2m();G(s.L&&s.7v&&1j s.L!="1W")s.L=D.3A(s.L);G(s.1L=="4Q"){G(O=="2R"){G(!s.1b.1I(33))s.1b+=(s.1b.1I(/\\?/)?"&":"?")+(s.4Q||"7s")+"=?"}N G(!s.L||!s.L.1I(33))s.L=(s.L?s.L+"&":"")+(s.4Q||"7s")+"=?";s.1L="3B"}G(s.1L=="3B"&&(s.L&&s.L.1I(33)||s.1b.1I(33))){g="4Q"+B++;G(s.L)s.L=(s.L+"").1o(33,"="+g+"$1");s.1b=s.1b.1o(33,"="+g+"$1");s.1L="1m";1c[g]=H(a){L=a;1U();1O();1c[g]=12;23{3d 1c[g]}21(e){}G(i)i.30(h)}}G(s.1L=="1m"&&s.1Y==U)s.1Y=Q;G(s.1Y===Q&&O=="2R"){J j=1x();J k=s.1b.1o(/(\\?|&)3n=.*?(&|$)/,"$am="+j+"$2");s.1b=k+((k==s.1b)?(s.1b.1I(/\\?/)?"&":"?")+"3n="+j:"")}G(s.L&&O=="2R"){s.1b+=(s.1b.1I(/\\?/)?"&":"?")+s.L;s.L=U}G(s.28&&!D.4P++)D.W.1R("7G");J n=/^(?:\\w+:)?\\/\\/([^\\/?#]+)/;G(s.1L=="1m"&&O=="2R"&&n.11(s.1b)&&n.2D(s.1b)[1]!=5Y.ak){J i=S.40("6v")[0];J h=S.3t("1m");h.4e=s.1b;G(s.7r)h.ai=s.7r;G(!g){J l=Q;h.ag=h.af=H(){G(!l&&(!7.3i||7.3i=="66"||7.3i=="1O")){l=M;1U();1O();i.30(h)}}}i.49(h);I 12}J m=Q;J c=1c.7q?2r 7q("ad.ac"):2r 6Q();G(s.5r)c.7o(O,s.1b,s.31,s.5r,s.3K);N c.7o(O,s.1b,s.31);23{G(s.L)c.4O("ab-aa",s.7y);G(s.5T)c.4O("a9-5S-a8",D.4R[s.1b]||"a7, a6 a4 a3 5O:5O:5O a1");c.4O("X-a0-9Y","6Q");c.4O("9X",s.1L&&s.4z[s.1L]?s.4z[s.1L]+", */*":s.4z.4S)}21(e){}G(s.7k&&s.7k(c,s)===Q){s.28&&D.4P--;c.7j();I Q}G(s.28)D.W.1R("7A",[c,s]);J d=H(a){G(!m&&c&&(c.3i==4||a=="2W")){m=M;G(f){7h(f);f=U}1v=a=="2W"?"2W":!D.7g(c)?"3g":s.5T&&D.7f(c,s.1b)?"7I":"1U";G(1v=="1U"){23{L=D.6U(c,s.1L,s.9S)}21(e){1v="5L"}}G(1v=="1U"){J b;23{b=c.5K("7e-5S")}21(e){}G(s.5T&&b)D.4R[s.1b]=b;G(!g)1U()}N D.5E(s,c,1v);1O();G(s.31)c=U}};G(s.31){J f=4L(d,13);G(s.2W>0)3E(H(){G(c){c.7j();G(!m)d("2W")}},s.2W)}23{c.9R(s.L)}21(e){D.5E(s,c,U,e)}G(!s.31)d();H 1U(){G(s.1U)s.1U(L,1v);G(s.28)D.W.1R("6u",[c,s])}H 1O(){G(s.1O)s.1O(c,1v);G(s.28)D.W.1R("7C",[c,s]);G(s.28&&!--D.4P)D.W.1R("7D")}I c},5E:H(s,a,b,e){G(s.3g)s.3g(a,b,e);G(s.28)D.W.1R("7B",[a,s,e])},4P:0,7g:H(a){23{I!a.1v&&5Y.9Q=="5o:"||(a.1v>=7c&&a.1v<9O)||a.1v==7a||a.1v==9N||D.14.2f&&a.1v==12}21(e){}I Q},7f:H(a,c){23{J b=a.5K("7e-5S");I a.1v==7a||b==D.4R[c]||D.14.2f&&a.1v==12}21(e){}I Q},6U:H(a,c,b){J d=a.5K("9L-O"),2K=c=="2K"||!c&&d&&d.1i("2K")>=0,L=2K?a.9K:a.4U;G(2K&&L.1B.2g=="5L")7m"5L";G(b)L=b(L,c);G(c=="1m")D.5u(L);G(c=="3B")L=6s("("+L+")");I L},3A:H(a){J s=[];H 17(b,a){s[s.K]=78(b)+\'=\'+78(a)};G(a.1q==2q||a.5w)D.P(a,H(){17(7.32,7.2s)});N R(J j 1k a)G(a[j]&&a[j].1q==2q)D.P(a[j],H(){17(j,7)});N 17(j,D.1F(a[j])?a[j]():a[j]);I s.6r("&").1o(/%20/g,"+")}});D.18.1n({1N:H(c,b){I c?7.2j({1T:"1N",2d:"1N",1y:"1N"},c,b):7.1E(":1C").P(H(){7.V.19=7.5H||"";G(D.1h(7,"19")=="2P"){J a=D("<"+7.2g+" />").6O("1d");7.V.19=a.1h("19");G(7.V.19=="2P")7.V.19="3H";a.1Z()}}).3m()},1J:H(b,a){I b?7.2j({1T:"1J",2d:"1J",1y:"1J"},b,a):7.1E(":4i").P(H(){7.5H=7.5H||D.1h(7,"19");7.V.19="2P"}).3m()},76:D.18.2B,2B:H(a,b){I D.1F(a)&&D.1F(b)?7.76.1t(7,1a):a?7.2j({1T:"2B",2d:"2B",1y:"2B"},a,b):7.P(H(){D(7)[D(7).3C(":1C")?"1N":"1J"]()})},9J:H(b,a){I 7.2j({1T:"1N"},b,a)},9I:H(b,a){I 7.2j({1T:"1J"},b,a)},9H:H(b,a){I 7.2j({1T:"2B"},b,a)},9G:H(b,a){I 7.2j({1y:"1N"},b,a)},9F:H(b,a){I 7.2j({1y:"1J"},b,a)},9D:H(c,a,b){I 7.2j({1y:a},c,b)},2j:H(k,j,i,g){J h=D.74(j,i,g);I 7[h.35===Q?"P":"35"](H(){G(7.15!=1)I Q;J f=D.1n({},h),p,1C=D(7).3C(":1C"),41=7;R(p 1k k){G(k[p]=="1J"&&1C||k[p]=="1N"&&!1C)I f.1O.1l(7);G(p=="1T"||p=="2d"){f.19=D.1h(7,"19");f.34=7.V.34}}G(f.34!=U)7.V.34="1C";f.44=D.1n({},k);D.P(k,H(c,a){J e=2r D.27(41,f,c);G(/2B|1N|1J/.11(a))e[a=="2B"?1C?"1N":"1J":a](k);N{J b=a.6p().1I(/^([+-]=)?([\\d+-.]+)(.*)$/),2b=e.1u(M)||0;G(b){J d=3e(b[2]),2M=b[3]||"2U";G(2M!="2U"){41.V[c]=(d||1)+2M;2b=((d||1)/e.1u(M))*2b;41.V[c]=2b+2M}G(b[1])d=((b[1]=="-="?-1:1)*d)+2b;e.3Z(2b,d,2M)}N e.3Z(2b,a,"")}});I M})},35:H(a,b){G(D.1F(a)||(a&&a.1q==2q)){b=a;a="27"}G(!a||(1j a=="1W"&&!b))I A(7[0],a);I 7.P(H(){G(b.1q==2q)A(7,a,b);N{A(7,a).1A(b);G(A(7,a).K==1)b.1l(7)}})},9x:H(b,c){J a=D.3M;G(b)7.35([]);7.P(H(){R(J i=a.K-1;i>=0;i--)G(a[i].T==7){G(c)a[i](M);a.7l(i,1)}});G(!c)7.5C();I 7}});J A=H(b,c,a){G(b){c=c||"27";J q=D.L(b,c+"35");G(!q||a)q=D.L(b,c+"35",D.2h(a))}I q};D.18.5C=H(a){a=a||"27";I 7.P(H(){J q=A(7,a);q.4s();G(q.K)q[0].1l(7)})};D.1n({74:H(b,a,c){J d=b&&b.1q==9u?b:{1O:c||!c&&a||D.1F(b)&&b,2v:b,3U:c&&a||a&&a.1q!=9t&&a};d.2v=(d.2v&&d.2v.1q==4N?d.2v:D.27.5N[d.2v])||D.27.5N.71;d.5P=d.1O;d.1O=H(){G(d.35!==Q)D(7).5C();G(D.1F(d.5P))d.5P.1l(7)};I d},3U:{7n:H(p,n,b,a){I b+a*p},5Q:H(p,n,b,a){I((-26.9r(p*26.9q)/2)+0.5)*a+b}},3M:[],46:U,27:H(b,c,a){7.16=c;7.T=b;7.1e=a;G(!c.3R)c.3R={}}});D.27.3V={4E:H(){G(7.16.2Z)7.16.2Z.1l(7.T,7.1x,7);(D.27.2Z[7.1e]||D.27.2Z.4S)(7);G(7.1e=="1T"||7.1e=="2d")7.T.V.19="3H"},1u:H(a){G(7.T[7.1e]!=U&&7.T.V[7.1e]==U)I 7.T[7.1e];J r=3e(D.1h(7.T,7.1e,a));I r&&r>-9p?r:3e(D.24(7.T,7.1e))||0},3Z:H(c,b,d){7.5B=1x();7.2b=c;7.3m=b;7.2M=d||7.2M||"2U";7.1x=7.2b;7.36=7.4C=0;7.4E();J e=7;H t(a){I e.2Z(a)}t.T=7.T;D.3M.1A(t);G(D.46==U){D.46=4L(H(){J a=D.3M;R(J i=0;i<a.K;i++)G(!a[i]())a.7l(i--,1);G(!a.K){7h(D.46);D.46=U}},13)}},1N:H(){7.16.3R[7.1e]=D.1M(7.T.V,7.1e);7.16.1N=M;7.3Z(0,7.1u());G(7.1e=="2d"||7.1e=="1T")7.T.V[7.1e]="9l";D(7.T).1N()},1J:H(){7.16.3R[7.1e]=D.1M(7.T.V,7.1e);7.16.1J=M;7.3Z(7.1u(),0)},2Z:H(a){J t=1x();G(a||t>7.16.2v+7.5B){7.1x=7.3m;7.36=7.4C=1;7.4E();7.16.44[7.1e]=M;J b=M;R(J i 1k 7.16.44)G(7.16.44[i]!==M)b=Q;G(b){G(7.16.19!=U){7.T.V.34=7.16.34;7.T.V.19=7.16.19;G(D.1h(7.T,"19")=="2P")7.T.V.19="3H"}G(7.16.1J)7.T.V.19="2P";G(7.16.1J||7.16.1N)R(J p 1k 7.16.44)D.1M(7.T.V,p,7.16.3R[p])}G(b)7.16.1O.1l(7.T);I Q}N{J n=t-7.5B;7.4C=n/7.16.2v;7.36=D.3U[7.16.3U||(D.3U.5Q?"5Q":"7n")](7.4C,n,0,1,7.16.2v);7.1x=7.2b+((7.3m-7.2b)*7.36);7.4E()}I M}};D.1n(D.27,{5N:{9k:9i,an:7c,71:ao},2Z:{2c:H(a){a.T.2c=a.1x},2l:H(a){a.T.2l=a.1x},1y:H(a){D.1M(a.T.V,"1y",a.1x)},4S:H(a){a.T.V[a.1e]=a.1x+a.2M}}});D.18.2k=H(){J b=0,1P=0,T=7[0],3q;G(T)9f(D.14){J d=T.1f,48=T,1p=T.1p,1S=T.2z,5V=2f&&3v(5F)<9c&&!/aw/i.11(v),1h=D.24,2X=1h(T,"3c")=="2X";G(!(3r&&T==S.1d)&&T.6T){J c=T.6T();17(c.1z+26.2e(1S.1B.2c,1S.1d.2c),c.1P+26.2e(1S.1B.2l,1S.1d.2l));17(-1S.1B.69,-1S.1B.68)}N{17(T.5X,T.5z);1G(1p){17(1p.5X,1p.5z);G(3r&&!/^t(98|d|h)$/i.11(1p.2g)||2f&&!5V)2A(1p);G(!2X&&1h(1p,"3c")=="2X")2X=M;48=/^1d$/i.11(1p.2g)?48:1p;1p=1p.1p}1G(d&&d.2g&&!/^1d|2I$/i.11(d.2g)){G(!/^97|1X.*$/i.11(1h(d,"19")))17(-d.2c,-d.2l);G(3r&&1h(d,"34")!="4i")2A(d);d=d.1f}G((5V&&(2X||1h(48,"3c")=="5g"))||(3r&&1h(48,"3c")!="5g"))17(-1S.1d.5X,-1S.1d.5z);G(2X)17(26.2e(1S.1B.2c,1S.1d.2c),26.2e(1S.1B.2l,1S.1d.2l))}3q={1P:1P,1z:b}}H 2A(a){17(D.24(a,"7w",M),D.24(a,"7x",M))}H 17(l,t){b+=3v(l,10)||0;1P+=3v(t,10)||0}I 3q};D.18.1n({3c:H(){J a=0,1P=0,3q;G(7[0]){J b=7.1p(),2k=7.2k(),4b=/^1d|2I$/i.11(b[0].2g)?{1P:0,1z:0}:b.2k();2k.1P-=2a(7,\'95\');2k.1z-=2a(7,\'94\');4b.1P+=2a(b,\'7x\');4b.1z+=2a(b,\'7w\');3q={1P:2k.1P-4b.1P,1z:2k.1z-4b.1z}}I 3q},1p:H(){J a=7[0].1p;1G(a&&(!/^1d|2I$/i.11(a.2g)&&D.1h(a,\'3c\')==\'aI\'))a=a.1p;I D(a)}});D.P([\'5d\',\'5b\'],H(i,b){J c=\'4A\'+b;D.18[c]=H(a){G(!7[0])I;I a!=12?7.P(H(){7==1c||7==S?1c.aJ(!i?a:D(1c).2c(),i?a:D(1c).2l()):7[c]=a}):7[0]==1c||7[0]==S?41[i?\'92\':\'91\']||D.6Y&&S.1B[c]||S.1d[c]:7[0][c]}});D.P(["6M","47"],H(i,b){J c=i?"5d":"5b",43=i?"6i":"6g";D.18["5s"+b]=H(){I 7[b.3h()]()+2a(7,"55"+c)+2a(7,"55"+43)};D.18["aM"+b]=H(a){I 7["5s"+b]()+2a(7,"2A"+c+"47")+2a(7,"2A"+43+"47")+(a?2a(7,"7F"+c)+2a(7,"7F"+43):0)}})})();',62,671,'|||||||this|||||||||||||||||||||||||||||||||||if|function|return|var|length|data|true|else|type|each|false|for|document|elem|null|style|event||nodeName|||test|undefined||browser|nodeType|options|add|fn|display|arguments|url|window|body|prop|parentNode|msie|css|indexOf|typeof|in|call|script|extend|replace|offsetParent|constructor|text|firstChild|apply|cur|status|div|now|opacity|left|push|documentElement|hidden|className|filter|isFunction|while|handle|match|hide|ret|dataType|attr|show|complete|top|split|trigger|doc|height|success|break|string|table|cache|remove||catch|tbody|try|curCSS|ready|Math|fx|global|guid|num|start|scrollLeft|width|max|safari|tagName|makeArray|map|animate|offset|scrollTop|toUpperCase||handler|button|Array|new|value|id|find|duration|done|copy|select|ownerDocument|border|toggle|special|exec|inArray|pushStack|stack|opera|html|nextSibling|xml|props|unit|target|bind|none|isReady|GET|which|namespace|px|nth|timeout|fixed|one|step|removeChild|async|name|jsre|overflow|queue|pos|preventDefault|insertBefore|merge|selected|removeData|position|delete|parseFloat|multiFilter|error|toLowerCase|readyState|rl|re|trim|end|_|first|get|results|mozilla|append|createElement|childNodes|parseInt|slice|events|object|elems|param|json|is|readyList|setTimeout|mouseleave|grep|block|callee|proxy|password|unbind|timers|defaultView|disabled|last|has|orig|domManip|ajax|easing|prototype|set|stopPropagation|load|custom|getElementsByTagName|self|charCode|br|curAnim|form|timerId|Width|offsetChild|appendChild|addEventListener|parentOffset|mouseenter|color|src|currentStyle|float|clean|visible|relatedTarget|fromElement|innerHTML|handlers|click|isXMLDoc|on|setup|nodeIndex|shift|input|unique|javascript|child|application|RegExp|accepts|scroll|deep|state|previousSibling|update|empty|teardown|tr|jQuery|timeStamp|getAttribute|setInterval|checked|Number|setRequestHeader|active|jsonp|lastModified|_default|dir|responseText|styleSheets|not|lastToggle|unload|mouseout|outline|mouseover|getPropertyValue|getComputedStyle|bindReady|padding|String|pageX|metaKey|keyCode|getWH|Top|clientX|Left|all|container|absolute|index|init|triggered|removeAttribute|classFilter|submit|prevObject|file|after|windowData|username|inner|client|globalEval|sibling|jquery|href|clone|offsetTop|checkbox|startTime|dequeue|visibility|handleError|version|triggerHandler|oldblock|ctrlKey|createTextNode|getResponseHeader|parsererror|andSelf|speeds|00|old|swing|radio|Modified|ifModified|lastChild|safari2|wrapAll|offsetLeft|location|ajaxSettings|getElementById|isSimple|values|selectedIndex|runtimeStyle|rsLeft|loaded|DOMContentLoaded|clientTop|clientLeft|val|unshift|toElement|srcElement|_load|pageY|Bottom|clientY|Right|fix|exclusive|detachEvent|removeEventListener|cloneNode|swap|toString|attachEvent|join|eval|substr|ajaxSuccess|head|parse|textarea|reset|image|zoom|odd|even|before|prepend|expr|exclude|quickClass|quickID|quickChild|uuid|continue|Height|textContent|appendTo|contents|XMLHttpRequest|evalScript|parent|getBoundingClientRect|httpData|setArray|CSS1Compat|compatMode|boxModel|cssFloat|styleFloat|def|webkit|nodeValue|speed|concat|_toggle|eq|encodeURIComponent|100|304|replaceWith|200|alpha|Last|httpNotModified|httpSuccess|clearInterval|getAttributeNode|abort|beforeSend|splice|throw|linear|open|colgroup|ActiveXObject|scriptCharset|callback|fieldset|multiple|processData|borderLeftWidth|borderTopWidth|contentType|link|ajaxSend|ajaxError|ajaxComplete|ajaxStop|col|margin|ajaxStart|serializeArray|notmodified|POST|keyup|keypress|change|mousemove|mouseup|dblclick|resize|focus|blur|stylesheet|rel|hasClass|doScroll|hover|black|solid|cancelBubble|returnValue|originalEvent|wheelDelta|view|round|shiftKey|screenY|screenX|mousedown|relatedNode|prevValue|originalTarget|keydown|newValue|offsetHeight|offsetWidth|eventPhase|detail|currentTarget|cancelable|bubbles|attrName|attrChange|altKey|charAt|0n|substring|animated|header|noConflict|enabled|line|innerText|contains|only|weight|font|gt|lt|uFFFF|u0128|417|size|Boolean|toggleClass|Date|removeClass|addClass|removeAttr|replaceAll|insertAfter|prependTo|contentWindow|wrap|contentDocument|iframe|children|siblings|prevAll|nextAll|wrapInner|prev|pageXOffset|pageYOffset|next|marginLeft|marginTop|parents|inline|able|rowSpan|rowspan|cellSpacing|522|cellspacing|maxLength|with|maxlength|readOnly|600|readonly|slow|1px|class|htmlFor|reverse|10000|PI|cos|compatible|Function|Object|setData|ie|stop|ra|it|rv|getData|userAgent|fadeTo|navigator|fadeOut|fadeIn|slideToggle|slideUp|slideDown|responseXML|content|ig|1223|300|NaN|protocol|send|dataFilter|setAttribute|option|cssText|changed|Accept|With|be|Requested|GMT|can|1970|Jan|property|01|Thu|Since|If|Type|Content|XMLHTTP|Microsoft|th|onreadystatechange|onload|td|charset|cap|host|colg|1_|fast|400|tfoot|specified|thead|plain|leg|attributes|opt|adobeair|urlencoded|www|embed|area|hr|ajaxSetup|post|meta|getJSON|getScript|img|static|scrollTo|elements|serialize|outer|abbr|pixelLeft'.split('|'),0,{}));jQuery.noConflict(); �������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/prototype.js������������������������������������������������������������������0000644�0001066�0001066�00000362350�10735245701�014470� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Prototype JavaScript framework, version 1.6.0 * (c) 2005-2007 Sam Stephenson * * Prototype is freely distributable under the terms of an MIT-style license. * For details, see the Prototype web site: http://www.prototypejs.org/ * *--------------------------------------------------------------------------*/ var Prototype = { Version: '1.6.0', Browser: { IE: !!(window.attachEvent && !window.opera), Opera: !!window.opera, WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1, Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1, MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/) }, BrowserFeatures: { XPath: !!document.evaluate, ElementExtensions: !!window.HTMLElement, SpecificElementExtensions: document.createElement('div').__proto__ && document.createElement('div').__proto__ !== document.createElement('form').__proto__ }, ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>', JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/, emptyFunction: function() { }, K: function(x) { return x } }; if (Prototype.Browser.MobileSafari) Prototype.BrowserFeatures.SpecificElementExtensions = false; if (Prototype.Browser.WebKit) Prototype.BrowserFeatures.XPath = false; /* Based on Alex Arnell's inheritance implementation. */ var Class = { create: function() { var parent = null, properties = $A(arguments); if (Object.isFunction(properties[0])) parent = properties.shift(); function klass() { this.initialize.apply(this, arguments); } Object.extend(klass, Class.Methods); klass.superclass = parent; klass.subclasses = []; if (parent) { var subclass = function() { }; subclass.prototype = parent.prototype; klass.prototype = new subclass; parent.subclasses.push(klass); } for (var i = 0; i < properties.length; i++) klass.addMethods(properties[i]); if (!klass.prototype.initialize) klass.prototype.initialize = Prototype.emptyFunction; klass.prototype.constructor = klass; return klass; } }; Class.Methods = { addMethods: function(source) { var ancestor = this.superclass && this.superclass.prototype; var properties = Object.keys(source); if (!Object.keys({ toString: true }).length) properties.push("toString", "valueOf"); for (var i = 0, length = properties.length; i < length; i++) { var property = properties[i], value = source[property]; if (ancestor && Object.isFunction(value) && value.argumentNames().first() == "$super") { var method = value, value = Object.extend((function(m) { return function() { return ancestor[m].apply(this, arguments) }; })(property).wrap(method), { valueOf: function() { return method }, toString: function() { return method.toString() } }); } this.prototype[property] = value; } return this; } }; var Abstract = { }; Object.extend = function(destination, source) { for (var property in source) destination[property] = source[property]; return destination; }; Object.extend(Object, { inspect: function(object) { try { if (object === undefined) return 'undefined'; if (object === null) return 'null'; return object.inspect ? object.inspect() : object.toString(); } catch (e) { if (e instanceof RangeError) return '...'; throw e; } }, toJSON: function(object) { var type = typeof object; switch (type) { case 'undefined': case 'function': case 'unknown': return; case 'boolean': return object.toString(); } if (object === null) return 'null'; if (object.toJSON) return object.toJSON(); if (Object.isElement(object)) return; var results = []; for (var property in object) { var value = Object.toJSON(object[property]); if (value !== undefined) results.push(property.toJSON() + ': ' + value); } return '{' + results.join(', ') + '}'; }, toQueryString: function(object) { return $H(object).toQueryString(); }, toHTML: function(object) { return object && object.toHTML ? object.toHTML() : String.interpret(object); }, keys: function(object) { var keys = []; for (var property in object) keys.push(property); return keys; }, values: function(object) { var values = []; for (var property in object) values.push(object[property]); return values; }, clone: function(object) { return Object.extend({ }, object); }, isElement: function(object) { return object && object.nodeType == 1; }, isArray: function(object) { return object && object.constructor === Array; }, isHash: function(object) { return object instanceof Hash; }, isFunction: function(object) { return typeof object == "function"; }, isString: function(object) { return typeof object == "string"; }, isNumber: function(object) { return typeof object == "number"; }, isUndefined: function(object) { return typeof object == "undefined"; } }); Object.extend(Function.prototype, { argumentNames: function() { var names = this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip"); return names.length == 1 && !names[0] ? [] : names; }, bind: function() { if (arguments.length < 2 && arguments[0] === undefined) return this; var __method = this, args = $A(arguments), object = args.shift(); return function() { return __method.apply(object, args.concat($A(arguments))); } }, bindAsEventListener: function() { var __method = this, args = $A(arguments), object = args.shift(); return function(event) { return __method.apply(object, [event || window.event].concat(args)); } }, curry: function() { if (!arguments.length) return this; var __method = this, args = $A(arguments); return function() { return __method.apply(this, args.concat($A(arguments))); } }, delay: function() { var __method = this, args = $A(arguments), timeout = args.shift() * 1000; return window.setTimeout(function() { return __method.apply(__method, args); }, timeout); }, wrap: function(wrapper) { var __method = this; return function() { return wrapper.apply(this, [__method.bind(this)].concat($A(arguments))); } }, methodize: function() { if (this._methodized) return this._methodized; var __method = this; return this._methodized = function() { return __method.apply(null, [this].concat($A(arguments))); }; } }); Function.prototype.defer = Function.prototype.delay.curry(0.01); Date.prototype.toJSON = function() { return '"' + this.getUTCFullYear() + '-' + (this.getUTCMonth() + 1).toPaddedString(2) + '-' + this.getUTCDate().toPaddedString(2) + 'T' + this.getUTCHours().toPaddedString(2) + ':' + this.getUTCMinutes().toPaddedString(2) + ':' + this.getUTCSeconds().toPaddedString(2) + 'Z"'; }; var Try = { these: function() { var returnValue; for (var i = 0, length = arguments.length; i < length; i++) { var lambda = arguments[i]; try { returnValue = lambda(); break; } catch (e) { } } return returnValue; } }; RegExp.prototype.match = RegExp.prototype.test; RegExp.escape = function(str) { return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); }; /*--------------------------------------------------------------------------*/ var PeriodicalExecuter = Class.create({ initialize: function(callback, frequency) { this.callback = callback; this.frequency = frequency; this.currentlyExecuting = false; this.registerCallback(); }, registerCallback: function() { this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); }, execute: function() { this.callback(this); }, stop: function() { if (!this.timer) return; clearInterval(this.timer); this.timer = null; }, onTimerEvent: function() { if (!this.currentlyExecuting) { try { this.currentlyExecuting = true; this.execute(); } finally { this.currentlyExecuting = false; } } } }); Object.extend(String, { interpret: function(value) { return value == null ? '' : String(value); }, specialChar: { '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '\\': '\\\\' } }); Object.extend(String.prototype, { gsub: function(pattern, replacement) { var result = '', source = this, match; replacement = arguments.callee.prepareReplacement(replacement); while (source.length > 0) { if (match = source.match(pattern)) { result += source.slice(0, match.index); result += String.interpret(replacement(match)); source = source.slice(match.index + match[0].length); } else { result += source, source = ''; } } return result; }, sub: function(pattern, replacement, count) { replacement = this.gsub.prepareReplacement(replacement); count = count === undefined ? 1 : count; return this.gsub(pattern, function(match) { if (--count < 0) return match[0]; return replacement(match); }); }, scan: function(pattern, iterator) { this.gsub(pattern, iterator); return String(this); }, truncate: function(length, truncation) { length = length || 30; truncation = truncation === undefined ? '...' : truncation; return this.length > length ? this.slice(0, length - truncation.length) + truncation : String(this); }, strip: function() { return this.replace(/^\s+/, '').replace(/\s+$/, ''); }, stripTags: function() { return this.replace(/<\/?[^>]+>/gi, ''); }, stripScripts: function() { return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); }, extractScripts: function() { var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); var matchOne = new RegExp(Prototype.ScriptFragment, 'im'); return (this.match(matchAll) || []).map(function(scriptTag) { return (scriptTag.match(matchOne) || ['', ''])[1]; }); }, evalScripts: function() { return this.extractScripts().map(function(script) { return eval(script) }); }, escapeHTML: function() { var self = arguments.callee; self.text.data = this; return self.div.innerHTML; }, unescapeHTML: function() { var div = new Element('div'); div.innerHTML = this.stripTags(); return div.childNodes[0] ? (div.childNodes.length > 1 ? $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) : div.childNodes[0].nodeValue) : ''; }, toQueryParams: function(separator) { var match = this.strip().match(/([^?#]*)(#.*)?$/); if (!match) return { }; return match[1].split(separator || '&').inject({ }, function(hash, pair) { if ((pair = pair.split('='))[0]) { var key = decodeURIComponent(pair.shift()); var value = pair.length > 1 ? pair.join('=') : pair[0]; if (value != undefined) value = decodeURIComponent(value); if (key in hash) { if (!Object.isArray(hash[key])) hash[key] = [hash[key]]; hash[key].push(value); } else hash[key] = value; } return hash; }); }, toArray: function() { return this.split(''); }, succ: function() { return this.slice(0, this.length - 1) + String.fromCharCode(this.charCodeAt(this.length - 1) + 1); }, times: function(count) { return count < 1 ? '' : new Array(count + 1).join(this); }, camelize: function() { var parts = this.split('-'), len = parts.length; if (len == 1) return parts[0]; var camelized = this.charAt(0) == '-' ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) : parts[0]; for (var i = 1; i < len; i++) camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1); return camelized; }, capitalize: function() { return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); }, underscore: function() { return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase(); }, dasherize: function() { return this.gsub(/_/,'-'); }, inspect: function(useDoubleQuotes) { var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) { var character = String.specialChar[match[0]]; return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16); }); if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"'; return "'" + escapedString.replace(/'/g, '\\\'') + "'"; }, toJSON: function() { return this.inspect(true); }, unfilterJSON: function(filter) { return this.sub(filter || Prototype.JSONFilter, '#{1}'); }, isJSON: function() { var str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); }, evalJSON: function(sanitize) { var json = this.unfilterJSON(); try { if (!sanitize || json.isJSON()) return eval('(' + json + ')'); } catch (e) { } throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); }, include: function(pattern) { return this.indexOf(pattern) > -1; }, startsWith: function(pattern) { return this.indexOf(pattern) === 0; }, endsWith: function(pattern) { var d = this.length - pattern.length; return d >= 0 && this.lastIndexOf(pattern) === d; }, empty: function() { return this == ''; }, blank: function() { return /^\s*$/.test(this); }, interpolate: function(object, pattern) { return new Template(this, pattern).evaluate(object); } }); if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, { escapeHTML: function() { return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); }, unescapeHTML: function() { return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); } }); String.prototype.gsub.prepareReplacement = function(replacement) { if (Object.isFunction(replacement)) return replacement; var template = new Template(replacement); return function(match) { return template.evaluate(match) }; }; String.prototype.parseQuery = String.prototype.toQueryParams; Object.extend(String.prototype.escapeHTML, { div: document.createElement('div'), text: document.createTextNode('') }); with (String.prototype.escapeHTML) div.appendChild(text); var Template = Class.create({ initialize: function(template, pattern) { this.template = template.toString(); this.pattern = pattern || Template.Pattern; }, evaluate: function(object) { if (Object.isFunction(object.toTemplateReplacements)) object = object.toTemplateReplacements(); return this.template.gsub(this.pattern, function(match) { if (object == null) return ''; var before = match[1] || ''; if (before == '\\') return match[2]; var ctx = object, expr = match[3]; var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/, match = pattern.exec(expr); if (match == null) return before; while (match != null) { var comp = match[1].startsWith('[') ? match[2].gsub('\\\\]', ']') : match[1]; ctx = ctx[comp]; if (null == ctx || '' == match[3]) break; expr = expr.substring('[' == match[3] ? match[1].length : match[0].length); match = pattern.exec(expr); } return before + String.interpret(ctx); }.bind(this)); } }); Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; var $break = { }; var Enumerable = { each: function(iterator, context) { var index = 0; iterator = iterator.bind(context); try { this._each(function(value) { iterator(value, index++); }); } catch (e) { if (e != $break) throw e; } return this; }, eachSlice: function(number, iterator, context) { iterator = iterator ? iterator.bind(context) : Prototype.K; var index = -number, slices = [], array = this.toArray(); while ((index += number) < array.length) slices.push(array.slice(index, index+number)); return slices.collect(iterator, context); }, all: function(iterator, context) { iterator = iterator ? iterator.bind(context) : Prototype.K; var result = true; this.each(function(value, index) { result = result && !!iterator(value, index); if (!result) throw $break; }); return result; }, any: function(iterator, context) { iterator = iterator ? iterator.bind(context) : Prototype.K; var result = false; this.each(function(value, index) { if (result = !!iterator(value, index)) throw $break; }); return result; }, collect: function(iterator, context) { iterator = iterator ? iterator.bind(context) : Prototype.K; var results = []; this.each(function(value, index) { results.push(iterator(value, index)); }); return results; }, detect: function(iterator, context) { iterator = iterator.bind(context); var result; this.each(function(value, index) { if (iterator(value, index)) { result = value; throw $break; } }); return result; }, findAll: function(iterator, context) { iterator = iterator.bind(context); var results = []; this.each(function(value, index) { if (iterator(value, index)) results.push(value); }); return results; }, grep: function(filter, iterator, context) { iterator = iterator ? iterator.bind(context) : Prototype.K; var results = []; if (Object.isString(filter)) filter = new RegExp(filter); this.each(function(value, index) { if (filter.match(value)) results.push(iterator(value, index)); }); return results; }, include: function(object) { if (Object.isFunction(this.indexOf)) if (this.indexOf(object) != -1) return true; var found = false; this.each(function(value) { if (value == object) { found = true; throw $break; } }); return found; }, inGroupsOf: function(number, fillWith) { fillWith = fillWith === undefined ? null : fillWith; return this.eachSlice(number, function(slice) { while(slice.length < number) slice.push(fillWith); return slice; }); }, inject: function(memo, iterator, context) { iterator = iterator.bind(context); this.each(function(value, index) { memo = iterator(memo, value, index); }); return memo; }, invoke: function(method) { var args = $A(arguments).slice(1); return this.map(function(value) { return value[method].apply(value, args); }); }, max: function(iterator, context) { iterator = iterator ? iterator.bind(context) : Prototype.K; var result; this.each(function(value, index) { value = iterator(value, index); if (result == undefined || value >= result) result = value; }); return result; }, min: function(iterator, context) { iterator = iterator ? iterator.bind(context) : Prototype.K; var result; this.each(function(value, index) { value = iterator(value, index); if (result == undefined || value < result) result = value; }); return result; }, partition: function(iterator, context) { iterator = iterator ? iterator.bind(context) : Prototype.K; var trues = [], falses = []; this.each(function(value, index) { (iterator(value, index) ? trues : falses).push(value); }); return [trues, falses]; }, pluck: function(property) { var results = []; this.each(function(value) { results.push(value[property]); }); return results; }, reject: function(iterator, context) { iterator = iterator.bind(context); var results = []; this.each(function(value, index) { if (!iterator(value, index)) results.push(value); }); return results; }, sortBy: function(iterator, context) { iterator = iterator.bind(context); return this.map(function(value, index) { return {value: value, criteria: iterator(value, index)}; }).sort(function(left, right) { var a = left.criteria, b = right.criteria; return a < b ? -1 : a > b ? 1 : 0; }).pluck('value'); }, toArray: function() { return this.map(); }, zip: function() { var iterator = Prototype.K, args = $A(arguments); if (Object.isFunction(args.last())) iterator = args.pop(); var collections = [this].concat(args).map($A); return this.map(function(value, index) { return iterator(collections.pluck(index)); }); }, size: function() { return this.toArray().length; }, inspect: function() { return '#<Enumerable:' + this.toArray().inspect() + '>'; } }; Object.extend(Enumerable, { map: Enumerable.collect, find: Enumerable.detect, select: Enumerable.findAll, filter: Enumerable.findAll, member: Enumerable.include, entries: Enumerable.toArray, every: Enumerable.all, some: Enumerable.any }); function $A(iterable) { if (!iterable) return []; if (iterable.toArray) return iterable.toArray(); var length = iterable.length, results = new Array(length); while (length--) results[length] = iterable[length]; return results; } if (Prototype.Browser.WebKit) { function $A(iterable) { if (!iterable) return []; if (!(Object.isFunction(iterable) && iterable == '[object NodeList]') && iterable.toArray) return iterable.toArray(); var length = iterable.length, results = new Array(length); while (length--) results[length] = iterable[length]; return results; } } Array.from = $A; Object.extend(Array.prototype, Enumerable); if (!Array.prototype._reverse) Array.prototype._reverse = Array.prototype.reverse; Object.extend(Array.prototype, { _each: function(iterator) { for (var i = 0, length = this.length; i < length; i++) iterator(this[i]); }, clear: function() { this.length = 0; return this; }, first: function() { return this[0]; }, last: function() { return this[this.length - 1]; }, compact: function() { return this.select(function(value) { return value != null; }); }, flatten: function() { return this.inject([], function(array, value) { return array.concat(Object.isArray(value) ? value.flatten() : [value]); }); }, without: function() { var values = $A(arguments); return this.select(function(value) { return !values.include(value); }); }, reverse: function(inline) { return (inline !== false ? this : this.toArray())._reverse(); }, reduce: function() { return this.length > 1 ? this : this[0]; }, uniq: function(sorted) { return this.inject([], function(array, value, index) { if (0 == index || (sorted ? array.last() != value : !array.include(value))) array.push(value); return array; }); }, intersect: function(array) { return this.uniq().findAll(function(item) { return array.detect(function(value) { return item === value }); }); }, clone: function() { return [].concat(this); }, size: function() { return this.length; }, inspect: function() { return '[' + this.map(Object.inspect).join(', ') + ']'; }, toJSON: function() { var results = []; this.each(function(object) { var value = Object.toJSON(object); if (value !== undefined) results.push(value); }); return '[' + results.join(', ') + ']'; } }); // use native browser JS 1.6 implementation if available if (Object.isFunction(Array.prototype.forEach)) Array.prototype._each = Array.prototype.forEach; if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) { i || (i = 0); var length = this.length; if (i < 0) i = length + i; for (; i < length; i++) if (this[i] === item) return i; return -1; }; if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) { i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1; var n = this.slice(0, i).reverse().indexOf(item); return (n < 0) ? n : i - n - 1; }; Array.prototype.toArray = Array.prototype.clone; function $w(string) { if (!Object.isString(string)) return []; string = string.strip(); return string ? string.split(/\s+/) : []; } if (Prototype.Browser.Opera){ Array.prototype.concat = function() { var array = []; for (var i = 0, length = this.length; i < length; i++) array.push(this[i]); for (var i = 0, length = arguments.length; i < length; i++) { if (Object.isArray(arguments[i])) { for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++) array.push(arguments[i][j]); } else { array.push(arguments[i]); } } return array; }; } Object.extend(Number.prototype, { toColorPart: function() { return this.toPaddedString(2, 16); }, succ: function() { return this + 1; }, times: function(iterator) { $R(0, this, true).each(iterator); return this; }, toPaddedString: function(length, radix) { var string = this.toString(radix || 10); return '0'.times(length - string.length) + string; }, toJSON: function() { return isFinite(this) ? this.toString() : 'null'; } }); $w('abs round ceil floor').each(function(method){ Number.prototype[method] = Math[method].methodize(); }); function $H(object) { return new Hash(object); }; var Hash = Class.create(Enumerable, (function() { if (function() { var i = 0, Test = function(value) { this.key = value }; Test.prototype.key = 'foo'; for (var property in new Test('bar')) i++; return i > 1; }()) { function each(iterator) { var cache = []; for (var key in this._object) { var value = this._object[key]; if (cache.include(key)) continue; cache.push(key); var pair = [key, value]; pair.key = key; pair.value = value; iterator(pair); } } } else { function each(iterator) { for (var key in this._object) { var value = this._object[key], pair = [key, value]; pair.key = key; pair.value = value; iterator(pair); } } } function toQueryPair(key, value) { if (Object.isUndefined(value)) return key; return key + '=' + encodeURIComponent(String.interpret(value)); } return { initialize: function(object) { this._object = Object.isHash(object) ? object.toObject() : Object.clone(object); }, _each: each, set: function(key, value) { return this._object[key] = value; }, get: function(key) { return this._object[key]; }, unset: function(key) { var value = this._object[key]; delete this._object[key]; return value; }, toObject: function() { return Object.clone(this._object); }, keys: function() { return this.pluck('key'); }, values: function() { return this.pluck('value'); }, index: function(value) { var match = this.detect(function(pair) { return pair.value === value; }); return match && match.key; }, merge: function(object) { return this.clone().update(object); }, update: function(object) { return new Hash(object).inject(this, function(result, pair) { result.set(pair.key, pair.value); return result; }); }, toQueryString: function() { return this.map(function(pair) { var key = encodeURIComponent(pair.key), values = pair.value; if (values && typeof values == 'object') { if (Object.isArray(values)) return values.map(toQueryPair.curry(key)).join('&'); } return toQueryPair(key, values); }).join('&'); }, inspect: function() { return '#<Hash:{' + this.map(function(pair) { return pair.map(Object.inspect).join(': '); }).join(', ') + '}>'; }, toJSON: function() { return Object.toJSON(this.toObject()); }, clone: function() { return new Hash(this); } } })()); Hash.prototype.toTemplateReplacements = Hash.prototype.toObject; Hash.from = $H; var ObjectRange = Class.create(Enumerable, { initialize: function(start, end, exclusive) { this.start = start; this.end = end; this.exclusive = exclusive; }, _each: function(iterator) { var value = this.start; while (this.include(value)) { iterator(value); value = value.succ(); } }, include: function(value) { if (value < this.start) return false; if (this.exclusive) return value < this.end; return value <= this.end; } }); var $R = function(start, end, exclusive) { return new ObjectRange(start, end, exclusive); }; var Ajax = { getTransport: function() { return Try.these( function() {return new XMLHttpRequest()}, function() {return new ActiveXObject('Msxml2.XMLHTTP')}, function() {return new ActiveXObject('Microsoft.XMLHTTP')} ) || false; }, activeRequestCount: 0 }; Ajax.Responders = { responders: [], _each: function(iterator) { this.responders._each(iterator); }, register: function(responder) { if (!this.include(responder)) this.responders.push(responder); }, unregister: function(responder) { this.responders = this.responders.without(responder); }, dispatch: function(callback, request, transport, json) { this.each(function(responder) { if (Object.isFunction(responder[callback])) { try { responder[callback].apply(responder, [request, transport, json]); } catch (e) { } } }); } }; Object.extend(Ajax.Responders, Enumerable); Ajax.Responders.register({ onCreate: function() { Ajax.activeRequestCount++ }, onComplete: function() { Ajax.activeRequestCount-- } }); Ajax.Base = Class.create({ initialize: function(options) { this.options = { method: 'post', asynchronous: true, contentType: 'application/x-www-form-urlencoded', encoding: 'UTF-8', parameters: '', evalJSON: true, evalJS: true }; Object.extend(this.options, options || { }); this.options.method = this.options.method.toLowerCase(); if (Object.isString(this.options.parameters)) this.options.parameters = this.options.parameters.toQueryParams(); } }); Ajax.Request = Class.create(Ajax.Base, { _complete: false, initialize: function($super, url, options) { $super(options); this.transport = Ajax.getTransport(); this.request(url); }, request: function(url) { this.url = url; this.method = this.options.method; var params = Object.clone(this.options.parameters); if (!['get', 'post'].include(this.method)) { // simulate other verbs over post params['_method'] = this.method; this.method = 'post'; } this.parameters = params; if (params = Object.toQueryString(params)) { // when GET, append parameters to URL if (this.method == 'get') this.url += (this.url.include('?') ? '&' : '?') + params; else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) params += '&_='; } try { var response = new Ajax.Response(this); if (this.options.onCreate) this.options.onCreate(response); Ajax.Responders.dispatch('onCreate', this, response); this.transport.open(this.method.toUpperCase(), this.url, this.options.asynchronous); if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1); this.transport.onreadystatechange = this.onStateChange.bind(this); this.setRequestHeaders(); this.body = this.method == 'post' ? (this.options.postBody || params) : null; this.transport.send(this.body); /* Force Firefox to handle ready state 4 for synchronous requests */ if (!this.options.asynchronous && this.transport.overrideMimeType) this.onStateChange(); } catch (e) { this.dispatchException(e); } }, onStateChange: function() { var readyState = this.transport.readyState; if (readyState > 1 && !((readyState == 4) && this._complete)) this.respondToReadyState(this.transport.readyState); }, setRequestHeaders: function() { var headers = { 'X-Requested-With': 'XMLHttpRequest', 'X-Prototype-Version': Prototype.Version, 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' }; if (this.method == 'post') { headers['Content-type'] = this.options.contentType + (this.options.encoding ? '; charset=' + this.options.encoding : ''); /* Force "Connection: close" for older Mozilla browsers to work * around a bug where XMLHttpRequest sends an incorrect * Content-length header. See Mozilla Bugzilla #246651. */ if (this.transport.overrideMimeType && (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) headers['Connection'] = 'close'; } // user-defined headers if (typeof this.options.requestHeaders == 'object') { var extras = this.options.requestHeaders; if (Object.isFunction(extras.push)) for (var i = 0, length = extras.length; i < length; i += 2) headers[extras[i]] = extras[i+1]; else $H(extras).each(function(pair) { headers[pair.key] = pair.value }); } for (var name in headers) this.transport.setRequestHeader(name, headers[name]); }, success: function() { var status = this.getStatus(); return !status || (status >= 200 && status < 300); }, getStatus: function() { try { return this.transport.status || 0; } catch (e) { return 0 } }, respondToReadyState: function(readyState) { var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this); if (state == 'Complete') { try { this._complete = true; (this.options['on' + response.status] || this.options['on' + (this.success() ? 'Success' : 'Failure')] || Prototype.emptyFunction)(response, response.headerJSON); } catch (e) { this.dispatchException(e); } var contentType = response.getHeader('Content-type'); if (this.options.evalJS == 'force' || (this.options.evalJS && contentType && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))) this.evalResponse(); } try { (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON); Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON); } catch (e) { this.dispatchException(e); } if (state == 'Complete') { // avoid memory leak in MSIE: clean up this.transport.onreadystatechange = Prototype.emptyFunction; } }, getHeader: function(name) { try { return this.transport.getResponseHeader(name); } catch (e) { return null } }, evalResponse: function() { try { return eval((this.transport.responseText || '').unfilterJSON()); } catch (e) { this.dispatchException(e); } }, dispatchException: function(exception) { (this.options.onException || Prototype.emptyFunction)(this, exception); Ajax.Responders.dispatch('onException', this, exception); } }); Ajax.Request.Events = ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; Ajax.Response = Class.create({ initialize: function(request){ this.request = request; var transport = this.transport = request.transport, readyState = this.readyState = transport.readyState; if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) { this.status = this.getStatus(); this.statusText = this.getStatusText(); this.responseText = String.interpret(transport.responseText); this.headerJSON = this._getHeaderJSON(); } if(readyState == 4) { var xml = transport.responseXML; this.responseXML = xml === undefined ? null : xml; this.responseJSON = this._getResponseJSON(); } }, status: 0, statusText: '', getStatus: Ajax.Request.prototype.getStatus, getStatusText: function() { try { return this.transport.statusText || ''; } catch (e) { return '' } }, getHeader: Ajax.Request.prototype.getHeader, getAllHeaders: function() { try { return this.getAllResponseHeaders(); } catch (e) { return null } }, getResponseHeader: function(name) { return this.transport.getResponseHeader(name); }, getAllResponseHeaders: function() { return this.transport.getAllResponseHeaders(); }, _getHeaderJSON: function() { var json = this.getHeader('X-JSON'); if (!json) return null; json = decodeURIComponent(escape(json)); try { return json.evalJSON(this.request.options.sanitizeJSON); } catch (e) { this.request.dispatchException(e); } }, _getResponseJSON: function() { var options = this.request.options; if (!options.evalJSON || (options.evalJSON != 'force' && !(this.getHeader('Content-type') || '').include('application/json'))) return null; try { return this.transport.responseText.evalJSON(options.sanitizeJSON); } catch (e) { this.request.dispatchException(e); } } }); Ajax.Updater = Class.create(Ajax.Request, { initialize: function($super, container, url, options) { this.container = { success: (container.success || container), failure: (container.failure || (container.success ? null : container)) }; options = options || { }; var onComplete = options.onComplete; options.onComplete = (function(response, param) { this.updateContent(response.responseText); if (Object.isFunction(onComplete)) onComplete(response, param); }).bind(this); $super(url, options); }, updateContent: function(responseText) { var receiver = this.container[this.success() ? 'success' : 'failure'], options = this.options; if (!options.evalScripts) responseText = responseText.stripScripts(); if (receiver = $(receiver)) { if (options.insertion) { if (Object.isString(options.insertion)) { var insertion = { }; insertion[options.insertion] = responseText; receiver.insert(insertion); } else options.insertion(receiver, responseText); } else receiver.update(responseText); } if (this.success()) { if (this.onComplete) this.onComplete.bind(this).defer(); } } }); Ajax.PeriodicalUpdater = Class.create(Ajax.Base, { initialize: function($super, container, url, options) { $super(options); this.onComplete = this.options.onComplete; this.frequency = (this.options.frequency || 2); this.decay = (this.options.decay || 1); this.updater = { }; this.container = container; this.url = url; this.start(); }, start: function() { this.options.onComplete = this.updateComplete.bind(this); this.onTimerEvent(); }, stop: function() { this.updater.options.onComplete = undefined; clearTimeout(this.timer); (this.onComplete || Prototype.emptyFunction).apply(this, arguments); }, updateComplete: function(response) { if (this.options.decay) { this.decay = (response.responseText == this.lastText ? this.decay * this.options.decay : 1); this.lastText = response.responseText; } this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency); }, onTimerEvent: function() { this.updater = new Ajax.Updater(this.container, this.url, this.options); } }); function $(element) { if (arguments.length > 1) { for (var i = 0, elements = [], length = arguments.length; i < length; i++) elements.push($(arguments[i])); return elements; } if (Object.isString(element)) element = document.getElementById(element); return Element.extend(element); } if (Prototype.BrowserFeatures.XPath) { document._getElementsByXPath = function(expression, parentElement) { var results = []; var query = document.evaluate(expression, $(parentElement) || document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0, length = query.snapshotLength; i < length; i++) results.push(Element.extend(query.snapshotItem(i))); return results; }; } /*--------------------------------------------------------------------------*/ if (!window.Node) var Node = { }; if (!Node.ELEMENT_NODE) { // DOM level 2 ECMAScript Language Binding Object.extend(Node, { ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, CDATA_SECTION_NODE: 4, ENTITY_REFERENCE_NODE: 5, ENTITY_NODE: 6, PROCESSING_INSTRUCTION_NODE: 7, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_TYPE_NODE: 10, DOCUMENT_FRAGMENT_NODE: 11, NOTATION_NODE: 12 }); } (function() { var element = this.Element; this.Element = function(tagName, attributes) { attributes = attributes || { }; tagName = tagName.toLowerCase(); var cache = Element.cache; if (Prototype.Browser.IE && attributes.name) { tagName = '<' + tagName + ' name="' + attributes.name + '">'; delete attributes.name; return Element.writeAttribute(document.createElement(tagName), attributes); } if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName)); return Element.writeAttribute(cache[tagName].cloneNode(false), attributes); }; Object.extend(this.Element, element || { }); }).call(window); Element.cache = { }; Element.Methods = { visible: function(element) { return $(element).style.display != 'none'; }, toggle: function(element) { element = $(element); Element[Element.visible(element) ? 'hide' : 'show'](element); return element; }, hide: function(element) { $(element).style.display = 'none'; return element; }, show: function(element) { $(element).style.display = ''; return element; }, remove: function(element) { element = $(element); element.parentNode.removeChild(element); return element; }, update: function(element, content) { element = $(element); if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) return element.update().insert(content); content = Object.toHTML(content); element.innerHTML = content.stripScripts(); content.evalScripts.bind(content).defer(); return element; }, replace: function(element, content) { element = $(element); if (content && content.toElement) content = content.toElement(); else if (!Object.isElement(content)) { content = Object.toHTML(content); var range = element.ownerDocument.createRange(); range.selectNode(element); content.evalScripts.bind(content).defer(); content = range.createContextualFragment(content.stripScripts()); } element.parentNode.replaceChild(content, element); return element; }, insert: function(element, insertions) { element = $(element); if (Object.isString(insertions) || Object.isNumber(insertions) || Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML))) insertions = {bottom:insertions}; var content, t, range; for (position in insertions) { content = insertions[position]; position = position.toLowerCase(); t = Element._insertionTranslations[position]; if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) { t.insert(element, content); continue; } content = Object.toHTML(content); range = element.ownerDocument.createRange(); t.initializeRange(element, range); t.insert(element, range.createContextualFragment(content.stripScripts())); content.evalScripts.bind(content).defer(); } return element; }, wrap: function(element, wrapper, attributes) { element = $(element); if (Object.isElement(wrapper)) $(wrapper).writeAttribute(attributes || { }); else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes); else wrapper = new Element('div', wrapper); if (element.parentNode) element.parentNode.replaceChild(wrapper, element); wrapper.appendChild(element); return wrapper; }, inspect: function(element) { element = $(element); var result = '<' + element.tagName.toLowerCase(); $H({'id': 'id', 'className': 'class'}).each(function(pair) { var property = pair.first(), attribute = pair.last(); var value = (element[property] || '').toString(); if (value) result += ' ' + attribute + '=' + value.inspect(true); }); return result + '>'; }, recursivelyCollect: function(element, property) { element = $(element); var elements = []; while (element = element[property]) if (element.nodeType == 1) elements.push(Element.extend(element)); return elements; }, ancestors: function(element) { return $(element).recursivelyCollect('parentNode'); }, descendants: function(element) { return $A($(element).getElementsByTagName('*')).each(Element.extend); }, firstDescendant: function(element) { element = $(element).firstChild; while (element && element.nodeType != 1) element = element.nextSibling; return $(element); }, immediateDescendants: function(element) { if (!(element = $(element).firstChild)) return []; while (element && element.nodeType != 1) element = element.nextSibling; if (element) return [element].concat($(element).nextSiblings()); return []; }, previousSiblings: function(element) { return $(element).recursivelyCollect('previousSibling'); }, nextSiblings: function(element) { return $(element).recursivelyCollect('nextSibling'); }, siblings: function(element) { element = $(element); return element.previousSiblings().reverse().concat(element.nextSiblings()); }, match: function(element, selector) { if (Object.isString(selector)) selector = new Selector(selector); return selector.match($(element)); }, up: function(element, expression, index) { element = $(element); if (arguments.length == 1) return $(element.parentNode); var ancestors = element.ancestors(); return expression ? Selector.findElement(ancestors, expression, index) : ancestors[index || 0]; }, down: function(element, expression, index) { element = $(element); if (arguments.length == 1) return element.firstDescendant(); var descendants = element.descendants(); return expression ? Selector.findElement(descendants, expression, index) : descendants[index || 0]; }, previous: function(element, expression, index) { element = $(element); if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element)); var previousSiblings = element.previousSiblings(); return expression ? Selector.findElement(previousSiblings, expression, index) : previousSiblings[index || 0]; }, next: function(element, expression, index) { element = $(element); if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element)); var nextSiblings = element.nextSiblings(); return expression ? Selector.findElement(nextSiblings, expression, index) : nextSiblings[index || 0]; }, select: function() { var args = $A(arguments), element = $(args.shift()); return Selector.findChildElements(element, args); }, adjacent: function() { var args = $A(arguments), element = $(args.shift()); return Selector.findChildElements(element.parentNode, args).without(element); }, identify: function(element) { element = $(element); var id = element.readAttribute('id'), self = arguments.callee; if (id) return id; do { id = 'anonymous_element_' + self.counter++ } while ($(id)); element.writeAttribute('id', id); return id; }, readAttribute: function(element, name) { element = $(element); if (Prototype.Browser.IE) { var t = Element._attributeTranslations.read; if (t.values[name]) return t.values[name](element, name); if (t.names[name]) name = t.names[name]; if (name.include(':')) { return (!element.attributes || !element.attributes[name]) ? null : element.attributes[name].value; } } return element.getAttribute(name); }, writeAttribute: function(element, name, value) { element = $(element); var attributes = { }, t = Element._attributeTranslations.write; if (typeof name == 'object') attributes = name; else attributes[name] = value === undefined ? true : value; for (var attr in attributes) { var name = t.names[attr] || attr, value = attributes[attr]; if (t.values[attr]) name = t.values[attr](element, value); if (value === false || value === null) element.removeAttribute(name); else if (value === true) element.setAttribute(name, name); else element.setAttribute(name, value); } return element; }, getHeight: function(element) { return $(element).getDimensions().height; }, getWidth: function(element) { return $(element).getDimensions().width; }, classNames: function(element) { return new Element.ClassNames(element); }, hasClassName: function(element, className) { if (!(element = $(element))) return; var elementClassName = element.className; return (elementClassName.length > 0 && (elementClassName == className || new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName))); }, addClassName: function(element, className) { if (!(element = $(element))) return; if (!element.hasClassName(className)) element.className += (element.className ? ' ' : '') + className; return element; }, removeClassName: function(element, className) { if (!(element = $(element))) return; element.className = element.className.replace( new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip(); return element; }, toggleClassName: function(element, className) { if (!(element = $(element))) return; return element[element.hasClassName(className) ? 'removeClassName' : 'addClassName'](className); }, // removes whitespace-only text node children cleanWhitespace: function(element) { element = $(element); var node = element.firstChild; while (node) { var nextNode = node.nextSibling; if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) element.removeChild(node); node = nextNode; } return element; }, empty: function(element) { return $(element).innerHTML.blank(); }, descendantOf: function(element, ancestor) { element = $(element), ancestor = $(ancestor); if (element.compareDocumentPosition) return (element.compareDocumentPosition(ancestor) & 8) === 8; if (element.sourceIndex && !Prototype.Browser.Opera) { var e = element.sourceIndex, a = ancestor.sourceIndex, nextAncestor = ancestor.nextSibling; if (!nextAncestor) { do { ancestor = ancestor.parentNode; } while (!(nextAncestor = ancestor.nextSibling) && ancestor.parentNode); } if (nextAncestor) return (e > a && e < nextAncestor.sourceIndex); } while (element = element.parentNode) if (element == ancestor) return true; return false; }, scrollTo: function(element) { element = $(element); var pos = element.cumulativeOffset(); window.scrollTo(pos[0], pos[1]); return element; }, getStyle: function(element, style) { element = $(element); style = style == 'float' ? 'cssFloat' : style.camelize(); var value = element.style[style]; if (!value) { var css = document.defaultView.getComputedStyle(element, null); value = css ? css[style] : null; } if (style == 'opacity') return value ? parseFloat(value) : 1.0; return value == 'auto' ? null : value; }, getOpacity: function(element) { return $(element).getStyle('opacity'); }, setStyle: function(element, styles) { element = $(element); var elementStyle = element.style, match; if (Object.isString(styles)) { element.style.cssText += ';' + styles; return styles.include('opacity') ? element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element; } for (var property in styles) if (property == 'opacity') element.setOpacity(styles[property]); else elementStyle[(property == 'float' || property == 'cssFloat') ? (elementStyle.styleFloat === undefined ? 'cssFloat' : 'styleFloat') : property] = styles[property]; return element; }, setOpacity: function(element, value) { element = $(element); element.style.opacity = (value == 1 || value === '') ? '' : (value < 0.00001) ? 0 : value; return element; }, getDimensions: function(element) { element = $(element); var display = $(element).getStyle('display'); if (display != 'none' && display != null) // Safari bug return {width: element.offsetWidth, height: element.offsetHeight}; // All *Width and *Height properties give 0 on elements with display none, // so enable the element temporarily var els = element.style; var originalVisibility = els.visibility; var originalPosition = els.position; var originalDisplay = els.display; els.visibility = 'hidden'; els.position = 'absolute'; els.display = 'block'; var originalWidth = element.clientWidth; var originalHeight = element.clientHeight; els.display = originalDisplay; els.position = originalPosition; els.visibility = originalVisibility; return {width: originalWidth, height: originalHeight}; }, makePositioned: function(element) { element = $(element); var pos = Element.getStyle(element, 'position'); if (pos == 'static' || !pos) { element._madePositioned = true; element.style.position = 'relative'; // Opera returns the offset relative to the positioning context, when an // element is position relative but top and left have not been defined if (window.opera) { element.style.top = 0; element.style.left = 0; } } return element; }, undoPositioned: function(element) { element = $(element); if (element._madePositioned) { element._madePositioned = undefined; element.style.position = element.style.top = element.style.left = element.style.bottom = element.style.right = ''; } return element; }, makeClipping: function(element) { element = $(element); if (element._overflow) return element; element._overflow = Element.getStyle(element, 'overflow') || 'auto'; if (element._overflow !== 'hidden') element.style.overflow = 'hidden'; return element; }, undoClipping: function(element) { element = $(element); if (!element._overflow) return element; element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; element._overflow = null; return element; }, cumulativeOffset: function(element) { var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; element = element.offsetParent; } while (element); return Element._returnOffset(valueL, valueT); }, positionedOffset: function(element) { var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; element = element.offsetParent; if (element) { if (element.tagName == 'BODY') break; var p = Element.getStyle(element, 'position'); if (p == 'relative' || p == 'absolute') break; } } while (element); return Element._returnOffset(valueL, valueT); }, absolutize: function(element) { element = $(element); if (element.getStyle('position') == 'absolute') return; // Position.prepare(); // To be done manually by Scripty when it needs it. var offsets = element.positionedOffset(); var top = offsets[1]; var left = offsets[0]; var width = element.clientWidth; var height = element.clientHeight; element._originalLeft = left - parseFloat(element.style.left || 0); element._originalTop = top - parseFloat(element.style.top || 0); element._originalWidth = element.style.width; element._originalHeight = element.style.height; element.style.position = 'absolute'; element.style.top = top + 'px'; element.style.left = left + 'px'; element.style.width = width + 'px'; element.style.height = height + 'px'; return element; }, relativize: function(element) { element = $(element); if (element.getStyle('position') == 'relative') return; // Position.prepare(); // To be done manually by Scripty when it needs it. element.style.position = 'relative'; var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); element.style.top = top + 'px'; element.style.left = left + 'px'; element.style.height = element._originalHeight; element.style.width = element._originalWidth; return element; }, cumulativeScrollOffset: function(element) { var valueT = 0, valueL = 0; do { valueT += element.scrollTop || 0; valueL += element.scrollLeft || 0; element = element.parentNode; } while (element); return Element._returnOffset(valueL, valueT); }, getOffsetParent: function(element) { if (element.offsetParent) return $(element.offsetParent); if (element == document.body) return $(element); while ((element = element.parentNode) && element != document.body) if (Element.getStyle(element, 'position') != 'static') return $(element); return $(document.body); }, viewportOffset: function(forElement) { var valueT = 0, valueL = 0; var element = forElement; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; // Safari fix if (element.offsetParent == document.body && Element.getStyle(element, 'position') == 'absolute') break; } while (element = element.offsetParent); element = forElement; do { if (!Prototype.Browser.Opera || element.tagName == 'BODY') { valueT -= element.scrollTop || 0; valueL -= element.scrollLeft || 0; } } while (element = element.parentNode); return Element._returnOffset(valueL, valueT); }, clonePosition: function(element, source) { var options = Object.extend({ setLeft: true, setTop: true, setWidth: true, setHeight: true, offsetTop: 0, offsetLeft: 0 }, arguments[2] || { }); // find page position of source source = $(source); var p = source.viewportOffset(); // find coordinate system to use element = $(element); var delta = [0, 0]; var parent = null; // delta [0,0] will do fine with position: fixed elements, // position:absolute needs offsetParent deltas if (Element.getStyle(element, 'position') == 'absolute') { parent = element.getOffsetParent(); delta = parent.viewportOffset(); } // correct by body offsets (fixes Safari) if (parent == document.body) { delta[0] -= document.body.offsetLeft; delta[1] -= document.body.offsetTop; } // set position if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; if (options.setWidth) element.style.width = source.offsetWidth + 'px'; if (options.setHeight) element.style.height = source.offsetHeight + 'px'; return element; } }; Element.Methods.identify.counter = 1; Object.extend(Element.Methods, { getElementsBySelector: Element.Methods.select, childElements: Element.Methods.immediateDescendants }); Element._attributeTranslations = { write: { names: { className: 'class', htmlFor: 'for' }, values: { } } }; if (!document.createRange || Prototype.Browser.Opera) { Element.Methods.insert = function(element, insertions) { element = $(element); if (Object.isString(insertions) || Object.isNumber(insertions) || Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML))) insertions = { bottom: insertions }; var t = Element._insertionTranslations, content, position, pos, tagName; for (position in insertions) { content = insertions[position]; position = position.toLowerCase(); pos = t[position]; if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) { pos.insert(element, content); continue; } content = Object.toHTML(content); tagName = ((position == 'before' || position == 'after') ? element.parentNode : element).tagName.toUpperCase(); if (t.tags[tagName]) { var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); if (position == 'top' || position == 'after') fragments.reverse(); fragments.each(pos.insert.curry(element)); } else element.insertAdjacentHTML(pos.adjacency, content.stripScripts()); content.evalScripts.bind(content).defer(); } return element; }; } if (Prototype.Browser.Opera) { Element.Methods._getStyle = Element.Methods.getStyle; Element.Methods.getStyle = function(element, style) { switch(style) { case 'left': case 'top': case 'right': case 'bottom': if (Element._getStyle(element, 'position') == 'static') return null; default: return Element._getStyle(element, style); } }; Element.Methods._readAttribute = Element.Methods.readAttribute; Element.Methods.readAttribute = function(element, attribute) { if (attribute == 'title') return element.title; return Element._readAttribute(element, attribute); }; } else if (Prototype.Browser.IE) { $w('positionedOffset getOffsetParent viewportOffset').each(function(method) { Element.Methods[method] = Element.Methods[method].wrap( function(proceed, element) { element = $(element); var position = element.getStyle('position'); if (position != 'static') return proceed(element); element.setStyle({ position: 'relative' }); var value = proceed(element); element.setStyle({ position: position }); return value; } ); }); Element.Methods.getStyle = function(element, style) { element = $(element); style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize(); var value = element.style[style]; if (!value && element.currentStyle) value = element.currentStyle[style]; if (style == 'opacity') { if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) if (value[1]) return parseFloat(value[1]) / 100; return 1.0; } if (value == 'auto') { if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none')) return element['offset' + style.capitalize()] + 'px'; return null; } return value; }; Element.Methods.setOpacity = function(element, value) { function stripAlpha(filter){ return filter.replace(/alpha\([^\)]*\)/gi,''); } element = $(element); var currentStyle = element.currentStyle; if ((currentStyle && !currentStyle.hasLayout) || (!currentStyle && element.style.zoom == 'normal')) element.style.zoom = 1; var filter = element.getStyle('filter'), style = element.style; if (value == 1 || value === '') { (filter = stripAlpha(filter)) ? style.filter = filter : style.removeAttribute('filter'); return element; } else if (value < 0.00001) value = 0; style.filter = stripAlpha(filter) + 'alpha(opacity=' + (value * 100) + ')'; return element; }; Element._attributeTranslations = { read: { names: { 'class': 'className', 'for': 'htmlFor' }, values: { _getAttr: function(element, attribute) { return element.getAttribute(attribute, 2); }, _getAttrNode: function(element, attribute) { var node = element.getAttributeNode(attribute); return node ? node.value : ""; }, _getEv: function(element, attribute) { var attribute = element.getAttribute(attribute); return attribute ? attribute.toString().slice(23, -2) : null; }, _flag: function(element, attribute) { return $(element).hasAttribute(attribute) ? attribute : null; }, style: function(element) { return element.style.cssText.toLowerCase(); }, title: function(element) { return element.title; } } } }; Element._attributeTranslations.write = { names: Object.clone(Element._attributeTranslations.read.names), values: { checked: function(element, value) { element.checked = !!value; }, style: function(element, value) { element.style.cssText = value ? value : ''; } } }; Element._attributeTranslations.has = {}; $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' + 'encType maxLength readOnly longDesc').each(function(attr) { Element._attributeTranslations.write.names[attr.toLowerCase()] = attr; Element._attributeTranslations.has[attr.toLowerCase()] = attr; }); (function(v) { Object.extend(v, { href: v._getAttr, src: v._getAttr, type: v._getAttr, action: v._getAttrNode, disabled: v._flag, checked: v._flag, readonly: v._flag, multiple: v._flag, onload: v._getEv, onunload: v._getEv, onclick: v._getEv, ondblclick: v._getEv, onmousedown: v._getEv, onmouseup: v._getEv, onmouseover: v._getEv, onmousemove: v._getEv, onmouseout: v._getEv, onfocus: v._getEv, onblur: v._getEv, onkeypress: v._getEv, onkeydown: v._getEv, onkeyup: v._getEv, onsubmit: v._getEv, onreset: v._getEv, onselect: v._getEv, onchange: v._getEv }); })(Element._attributeTranslations.read.values); } else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) { Element.Methods.setOpacity = function(element, value) { element = $(element); element.style.opacity = (value == 1) ? 0.999999 : (value === '') ? '' : (value < 0.00001) ? 0 : value; return element; }; } else if (Prototype.Browser.WebKit) { Element.Methods.setOpacity = function(element, value) { element = $(element); element.style.opacity = (value == 1 || value === '') ? '' : (value < 0.00001) ? 0 : value; if (value == 1) if(element.tagName == 'IMG' && element.width) { element.width++; element.width--; } else try { var n = document.createTextNode(' '); element.appendChild(n); element.removeChild(n); } catch (e) { } return element; }; // Safari returns margins on body which is incorrect if the child is absolutely // positioned. For performance reasons, redefine Position.cumulativeOffset for // KHTML/WebKit only. Element.Methods.cumulativeOffset = function(element) { var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; if (element.offsetParent == document.body) if (Element.getStyle(element, 'position') == 'absolute') break; element = element.offsetParent; } while (element); return Element._returnOffset(valueL, valueT); }; } if (Prototype.Browser.IE || Prototype.Browser.Opera) { // IE and Opera are missing .innerHTML support for TABLE-related and SELECT elements Element.Methods.update = function(element, content) { element = $(element); if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) return element.update().insert(content); content = Object.toHTML(content); var tagName = element.tagName.toUpperCase(); if (tagName in Element._insertionTranslations.tags) { $A(element.childNodes).each(function(node) { element.removeChild(node) }); Element._getContentFromAnonymousElement(tagName, content.stripScripts()) .each(function(node) { element.appendChild(node) }); } else element.innerHTML = content.stripScripts(); content.evalScripts.bind(content).defer(); return element; }; } if (document.createElement('div').outerHTML) { Element.Methods.replace = function(element, content) { element = $(element); if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) { element.parentNode.replaceChild(content, element); return element; } content = Object.toHTML(content); var parent = element.parentNode, tagName = parent.tagName.toUpperCase(); if (Element._insertionTranslations.tags[tagName]) { var nextSibling = element.next(); var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); parent.removeChild(element); if (nextSibling) fragments.each(function(node) { parent.insertBefore(node, nextSibling) }); else fragments.each(function(node) { parent.appendChild(node) }); } else element.outerHTML = content.stripScripts(); content.evalScripts.bind(content).defer(); return element; }; } Element._returnOffset = function(l, t) { var result = [l, t]; result.left = l; result.top = t; return result; }; Element._getContentFromAnonymousElement = function(tagName, html) { var div = new Element('div'), t = Element._insertionTranslations.tags[tagName]; div.innerHTML = t[0] + html + t[1]; t[2].times(function() { div = div.firstChild }); return $A(div.childNodes); }; Element._insertionTranslations = { before: { adjacency: 'beforeBegin', insert: function(element, node) { element.parentNode.insertBefore(node, element); }, initializeRange: function(element, range) { range.setStartBefore(element); } }, top: { adjacency: 'afterBegin', insert: function(element, node) { element.insertBefore(node, element.firstChild); }, initializeRange: function(element, range) { range.selectNodeContents(element); range.collapse(true); } }, bottom: { adjacency: 'beforeEnd', insert: function(element, node) { element.appendChild(node); } }, after: { adjacency: 'afterEnd', insert: function(element, node) { element.parentNode.insertBefore(node, element.nextSibling); }, initializeRange: function(element, range) { range.setStartAfter(element); } }, tags: { TABLE: ['<table>', '</table>', 1], TBODY: ['<table><tbody>', '</tbody></table>', 2], TR: ['<table><tbody><tr>', '</tr></tbody></table>', 3], TD: ['<table><tbody><tr><td>', '</td></tr></tbody></table>', 4], SELECT: ['<select>', '</select>', 1] } }; (function() { this.bottom.initializeRange = this.top.initializeRange; Object.extend(this.tags, { THEAD: this.tags.TBODY, TFOOT: this.tags.TBODY, TH: this.tags.TD }); }).call(Element._insertionTranslations); Element.Methods.Simulated = { hasAttribute: function(element, attribute) { attribute = Element._attributeTranslations.has[attribute] || attribute; var node = $(element).getAttributeNode(attribute); return node && node.specified; } }; Element.Methods.ByTag = { }; Object.extend(Element, Element.Methods); if (!Prototype.BrowserFeatures.ElementExtensions && document.createElement('div').__proto__) { window.HTMLElement = { }; window.HTMLElement.prototype = document.createElement('div').__proto__; Prototype.BrowserFeatures.ElementExtensions = true; } Element.extend = (function() { if (Prototype.BrowserFeatures.SpecificElementExtensions) return Prototype.K; var Methods = { }, ByTag = Element.Methods.ByTag; var extend = Object.extend(function(element) { if (!element || element._extendedByPrototype || element.nodeType != 1 || element == window) return element; var methods = Object.clone(Methods), tagName = element.tagName, property, value; // extend methods for specific tags if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]); for (property in methods) { value = methods[property]; if (Object.isFunction(value) && !(property in element)) element[property] = value.methodize(); } element._extendedByPrototype = Prototype.emptyFunction; return element; }, { refresh: function() { // extend methods for all tags (Safari doesn't need this) if (!Prototype.BrowserFeatures.ElementExtensions) { Object.extend(Methods, Element.Methods); Object.extend(Methods, Element.Methods.Simulated); } } }); extend.refresh(); return extend; })(); Element.hasAttribute = function(element, attribute) { if (element.hasAttribute) return element.hasAttribute(attribute); return Element.Methods.Simulated.hasAttribute(element, attribute); }; Element.addMethods = function(methods) { var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag; if (!methods) { Object.extend(Form, Form.Methods); Object.extend(Form.Element, Form.Element.Methods); Object.extend(Element.Methods.ByTag, { "FORM": Object.clone(Form.Methods), "INPUT": Object.clone(Form.Element.Methods), "SELECT": Object.clone(Form.Element.Methods), "TEXTAREA": Object.clone(Form.Element.Methods) }); } if (arguments.length == 2) { var tagName = methods; methods = arguments[1]; } if (!tagName) Object.extend(Element.Methods, methods || { }); else { if (Object.isArray(tagName)) tagName.each(extend); else extend(tagName); } function extend(tagName) { tagName = tagName.toUpperCase(); if (!Element.Methods.ByTag[tagName]) Element.Methods.ByTag[tagName] = { }; Object.extend(Element.Methods.ByTag[tagName], methods); } function copy(methods, destination, onlyIfAbsent) { onlyIfAbsent = onlyIfAbsent || false; for (var property in methods) { var value = methods[property]; if (!Object.isFunction(value)) continue; if (!onlyIfAbsent || !(property in destination)) destination[property] = value.methodize(); } } function findDOMClass(tagName) { var klass; var trans = { "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph", "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList", "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading", "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote", "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION": "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD": "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR": "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET": "FrameSet", "IFRAME": "IFrame" }; if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element'; if (window[klass]) return window[klass]; klass = 'HTML' + tagName + 'Element'; if (window[klass]) return window[klass]; klass = 'HTML' + tagName.capitalize() + 'Element'; if (window[klass]) return window[klass]; window[klass] = { }; window[klass].prototype = document.createElement(tagName).__proto__; return window[klass]; } if (F.ElementExtensions) { copy(Element.Methods, HTMLElement.prototype); copy(Element.Methods.Simulated, HTMLElement.prototype, true); } if (F.SpecificElementExtensions) { for (var tag in Element.Methods.ByTag) { var klass = findDOMClass(tag); if (Object.isUndefined(klass)) continue; copy(T[tag], klass.prototype); } } Object.extend(Element, Element.Methods); delete Element.ByTag; if (Element.extend.refresh) Element.extend.refresh(); Element.cache = { }; }; document.viewport = { getDimensions: function() { var dimensions = { }; $w('width height').each(function(d) { var D = d.capitalize(); dimensions[d] = self['inner' + D] || (document.documentElement['client' + D] || document.body['client' + D]); }); return dimensions; }, getWidth: function() { return this.getDimensions().width; }, getHeight: function() { return this.getDimensions().height; }, getScrollOffsets: function() { return Element._returnOffset( window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop); } }; /* Portions of the Selector class are derived from Jack Slocum’s DomQuery, * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style * license. Please see http://www.yui-ext.com/ for more information. */ var Selector = Class.create({ initialize: function(expression) { this.expression = expression.strip(); this.compileMatcher(); }, compileMatcher: function() { // Selectors with namespaced attributes can't use the XPath version if (Prototype.BrowserFeatures.XPath && !(/(\[[\w-]*?:|:checked)/).test(this.expression)) return this.compileXPathMatcher(); var e = this.expression, ps = Selector.patterns, h = Selector.handlers, c = Selector.criteria, le, p, m; if (Selector._cache[e]) { this.matcher = Selector._cache[e]; return; } this.matcher = ["this.matcher = function(root) {", "var r = root, h = Selector.handlers, c = false, n;"]; while (e && le != e && (/\S/).test(e)) { le = e; for (var i in ps) { p = ps[i]; if (m = e.match(p)) { this.matcher.push(Object.isFunction(c[i]) ? c[i](m) : new Template(c[i]).evaluate(m)); e = e.replace(m[0], ''); break; } } } this.matcher.push("return h.unique(n);\n}"); eval(this.matcher.join('\n')); Selector._cache[this.expression] = this.matcher; }, compileXPathMatcher: function() { var e = this.expression, ps = Selector.patterns, x = Selector.xpath, le, m; if (Selector._cache[e]) { this.xpath = Selector._cache[e]; return; } this.matcher = ['.//*']; while (e && le != e && (/\S/).test(e)) { le = e; for (var i in ps) { if (m = e.match(ps[i])) { this.matcher.push(Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).evaluate(m)); e = e.replace(m[0], ''); break; } } } this.xpath = this.matcher.join(''); Selector._cache[this.expression] = this.xpath; }, findElements: function(root) { root = root || document; if (this.xpath) return document._getElementsByXPath(this.xpath, root); return this.matcher(root); }, match: function(element) { this.tokens = []; var e = this.expression, ps = Selector.patterns, as = Selector.assertions; var le, p, m; while (e && le !== e && (/\S/).test(e)) { le = e; for (var i in ps) { p = ps[i]; if (m = e.match(p)) { // use the Selector.assertions methods unless the selector // is too complex. if (as[i]) { this.tokens.push([i, Object.clone(m)]); e = e.replace(m[0], ''); } else { // reluctantly do a document-wide search // and look for a match in the array return this.findElements(document).include(element); } } } } var match = true, name, matches; for (var i = 0, token; token = this.tokens[i]; i++) { name = token[0], matches = token[1]; if (!Selector.assertions[name](element, matches)) { match = false; break; } } return match; }, toString: function() { return this.expression; }, inspect: function() { return "#<Selector:" + this.expression.inspect() + ">"; } }); Object.extend(Selector, { _cache: { }, xpath: { descendant: "//*", child: "/*", adjacent: "/following-sibling::*[1]", laterSibling: '/following-sibling::*', tagName: function(m) { if (m[1] == '*') return ''; return "[local-name()='" + m[1].toLowerCase() + "' or local-name()='" + m[1].toUpperCase() + "']"; }, className: "[contains(concat(' ', @class, ' '), ' #{1} ')]", id: "[@id='#{1}']", attrPresence: "[@#{1}]", attr: function(m) { m[3] = m[5] || m[6]; return new Template(Selector.xpath.operators[m[2]]).evaluate(m); }, pseudo: function(m) { var h = Selector.xpath.pseudos[m[1]]; if (!h) return ''; if (Object.isFunction(h)) return h(m); return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m); }, operators: { '=': "[@#{1}='#{3}']", '!=': "[@#{1}!='#{3}']", '^=': "[starts-with(@#{1}, '#{3}')]", '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']", '*=': "[contains(@#{1}, '#{3}')]", '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]", '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]" }, pseudos: { 'first-child': '[not(preceding-sibling::*)]', 'last-child': '[not(following-sibling::*)]', 'only-child': '[not(preceding-sibling::* or following-sibling::*)]', 'empty': "[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]", 'checked': "[@checked]", 'disabled': "[@disabled]", 'enabled': "[not(@disabled)]", 'not': function(m) { var e = m[6], p = Selector.patterns, x = Selector.xpath, le, m, v; var exclusion = []; while (e && le != e && (/\S/).test(e)) { le = e; for (var i in p) { if (m = e.match(p[i])) { v = Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).evaluate(m); exclusion.push("(" + v.substring(1, v.length - 1) + ")"); e = e.replace(m[0], ''); break; } } } return "[not(" + exclusion.join(" and ") + ")]"; }, 'nth-child': function(m) { return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m); }, 'nth-last-child': function(m) { return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m); }, 'nth-of-type': function(m) { return Selector.xpath.pseudos.nth("position() ", m); }, 'nth-last-of-type': function(m) { return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m); }, 'first-of-type': function(m) { m[6] = "1"; return Selector.xpath.pseudos['nth-of-type'](m); }, 'last-of-type': function(m) { m[6] = "1"; return Selector.xpath.pseudos['nth-last-of-type'](m); }, 'only-of-type': function(m) { var p = Selector.xpath.pseudos; return p['first-of-type'](m) + p['last-of-type'](m); }, nth: function(fragment, m) { var mm, formula = m[6], predicate; if (formula == 'even') formula = '2n+0'; if (formula == 'odd') formula = '2n+1'; if (mm = formula.match(/^(\d+)$/)) // digit only return '[' + fragment + "= " + mm[1] + ']'; if (mm = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b if (mm[1] == "-") mm[1] = -1; var a = mm[1] ? Number(mm[1]) : 1; var b = mm[2] ? Number(mm[2]) : 0; predicate = "[((#{fragment} - #{b}) mod #{a} = 0) and " + "((#{fragment} - #{b}) div #{a} >= 0)]"; return new Template(predicate).evaluate({ fragment: fragment, a: a, b: b }); } } } }, criteria: { tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;', className: 'n = h.className(n, r, "#{1}", c); c = false;', id: 'n = h.id(n, r, "#{1}", c); c = false;', attrPresence: 'n = h.attrPresence(n, r, "#{1}"); c = false;', attr: function(m) { m[3] = (m[5] || m[6]); return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(m); }, pseudo: function(m) { if (m[6]) m[6] = m[6].replace(/"/g, '\\"'); return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m); }, descendant: 'c = "descendant";', child: 'c = "child";', adjacent: 'c = "adjacent";', laterSibling: 'c = "laterSibling";' }, patterns: { // combinators must be listed first // (and descendant needs to be last combinator) laterSibling: /^\s*~\s*/, child: /^\s*>\s*/, adjacent: /^\s*\+\s*/, descendant: /^\s/, // selectors follow tagName: /^\s*(\*|[\w\-]+)(\b|$)?/, id: /^#([\w\-\*]+)(\b|$)/, className: /^\.([\w\-\*]+)(\b|$)/, pseudo: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s)|(?=:))/, attrPresence: /^\[([\w]+)\]/, attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/ }, // for Selector.match and Element#match assertions: { tagName: function(element, matches) { return matches[1].toUpperCase() == element.tagName.toUpperCase(); }, className: function(element, matches) { return Element.hasClassName(element, matches[1]); }, id: function(element, matches) { return element.id === matches[1]; }, attrPresence: function(element, matches) { return Element.hasAttribute(element, matches[1]); }, attr: function(element, matches) { var nodeValue = Element.readAttribute(element, matches[1]); return Selector.operators[matches[2]](nodeValue, matches[3]); } }, handlers: { // UTILITY FUNCTIONS // joins two collections concat: function(a, b) { for (var i = 0, node; node = b[i]; i++) a.push(node); return a; }, // marks an array of nodes for counting mark: function(nodes) { for (var i = 0, node; node = nodes[i]; i++) node._counted = true; return nodes; }, unmark: function(nodes) { for (var i = 0, node; node = nodes[i]; i++) node._counted = undefined; return nodes; }, // mark each child node with its position (for nth calls) // "ofType" flag indicates whether we're indexing for nth-of-type // rather than nth-child index: function(parentNode, reverse, ofType) { parentNode._counted = true; if (reverse) { for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) { var node = nodes[i]; if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++; } } else { for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++) if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++; } }, // filters out duplicates and extends all nodes unique: function(nodes) { if (nodes.length == 0) return nodes; var results = [], n; for (var i = 0, l = nodes.length; i < l; i++) if (!(n = nodes[i])._counted) { n._counted = true; results.push(Element.extend(n)); } return Selector.handlers.unmark(results); }, // COMBINATOR FUNCTIONS descendant: function(nodes) { var h = Selector.handlers; for (var i = 0, results = [], node; node = nodes[i]; i++) h.concat(results, node.getElementsByTagName('*')); return results; }, child: function(nodes) { var h = Selector.handlers; for (var i = 0, results = [], node; node = nodes[i]; i++) { for (var j = 0, children = [], child; child = node.childNodes[j]; j++) if (child.nodeType == 1 && child.tagName != '!') results.push(child); } return results; }, adjacent: function(nodes) { for (var i = 0, results = [], node; node = nodes[i]; i++) { var next = this.nextElementSibling(node); if (next) results.push(next); } return results; }, laterSibling: function(nodes) { var h = Selector.handlers; for (var i = 0, results = [], node; node = nodes[i]; i++) h.concat(results, Element.nextSiblings(node)); return results; }, nextElementSibling: function(node) { while (node = node.nextSibling) if (node.nodeType == 1) return node; return null; }, previousElementSibling: function(node) { while (node = node.previousSibling) if (node.nodeType == 1) return node; return null; }, // TOKEN FUNCTIONS tagName: function(nodes, root, tagName, combinator) { tagName = tagName.toUpperCase(); var results = [], h = Selector.handlers; if (nodes) { if (combinator) { // fastlane for ordinary descendant combinators if (combinator == "descendant") { for (var i = 0, node; node = nodes[i]; i++) h.concat(results, node.getElementsByTagName(tagName)); return results; } else nodes = this[combinator](nodes); if (tagName == "*") return nodes; } for (var i = 0, node; node = nodes[i]; i++) if (node.tagName.toUpperCase() == tagName) results.push(node); return results; } else return root.getElementsByTagName(tagName); }, id: function(nodes, root, id, combinator) { var targetNode = $(id), h = Selector.handlers; if (!targetNode) return []; if (!nodes && root == document) return [targetNode]; if (nodes) { if (combinator) { if (combinator == 'child') { for (var i = 0, node; node = nodes[i]; i++) if (targetNode.parentNode == node) return [targetNode]; } else if (combinator == 'descendant') { for (var i = 0, node; node = nodes[i]; i++) if (Element.descendantOf(targetNode, node)) return [targetNode]; } else if (combinator == 'adjacent') { for (var i = 0, node; node = nodes[i]; i++) if (Selector.handlers.previousElementSibling(targetNode) == node) return [targetNode]; } else nodes = h[combinator](nodes); } for (var i = 0, node; node = nodes[i]; i++) if (node == targetNode) return [targetNode]; return []; } return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : []; }, className: function(nodes, root, className, combinator) { if (nodes && combinator) nodes = this[combinator](nodes); return Selector.handlers.byClassName(nodes, root, className); }, byClassName: function(nodes, root, className) { if (!nodes) nodes = Selector.handlers.descendant([root]); var needle = ' ' + className + ' '; for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) { nodeClassName = node.className; if (nodeClassName.length == 0) continue; if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle)) results.push(node); } return results; }, attrPresence: function(nodes, root, attr) { if (!nodes) nodes = root.getElementsByTagName("*"); var results = []; for (var i = 0, node; node = nodes[i]; i++) if (Element.hasAttribute(node, attr)) results.push(node); return results; }, attr: function(nodes, root, attr, value, operator) { if (!nodes) nodes = root.getElementsByTagName("*"); var handler = Selector.operators[operator], results = []; for (var i = 0, node; node = nodes[i]; i++) { var nodeValue = Element.readAttribute(node, attr); if (nodeValue === null) continue; if (handler(nodeValue, value)) results.push(node); } return results; }, pseudo: function(nodes, name, value, root, combinator) { if (nodes && combinator) nodes = this[combinator](nodes); if (!nodes) nodes = root.getElementsByTagName("*"); return Selector.pseudos[name](nodes, value, root); } }, pseudos: { 'first-child': function(nodes, value, root) { for (var i = 0, results = [], node; node = nodes[i]; i++) { if (Selector.handlers.previousElementSibling(node)) continue; results.push(node); } return results; }, 'last-child': function(nodes, value, root) { for (var i = 0, results = [], node; node = nodes[i]; i++) { if (Selector.handlers.nextElementSibling(node)) continue; results.push(node); } return results; }, 'only-child': function(nodes, value, root) { var h = Selector.handlers; for (var i = 0, results = [], node; node = nodes[i]; i++) if (!h.previousElementSibling(node) && !h.nextElementSibling(node)) results.push(node); return results; }, 'nth-child': function(nodes, formula, root) { return Selector.pseudos.nth(nodes, formula, root); }, 'nth-last-child': function(nodes, formula, root) { return Selector.pseudos.nth(nodes, formula, root, true); }, 'nth-of-type': function(nodes, formula, root) { return Selector.pseudos.nth(nodes, formula, root, false, true); }, 'nth-last-of-type': function(nodes, formula, root) { return Selector.pseudos.nth(nodes, formula, root, true, true); }, 'first-of-type': function(nodes, formula, root) { return Selector.pseudos.nth(nodes, "1", root, false, true); }, 'last-of-type': function(nodes, formula, root) { return Selector.pseudos.nth(nodes, "1", root, true, true); }, 'only-of-type': function(nodes, formula, root) { var p = Selector.pseudos; return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root); }, // handles the an+b logic getIndices: function(a, b, total) { if (a == 0) return b > 0 ? [b] : []; return $R(1, total).inject([], function(memo, i) { if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i); return memo; }); }, // handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-type nth: function(nodes, formula, root, reverse, ofType) { if (nodes.length == 0) return []; if (formula == 'even') formula = '2n+0'; if (formula == 'odd') formula = '2n+1'; var h = Selector.handlers, results = [], indexed = [], m; h.mark(nodes); for (var i = 0, node; node = nodes[i]; i++) { if (!node.parentNode._counted) { h.index(node.parentNode, reverse, ofType); indexed.push(node.parentNode); } } if (formula.match(/^\d+$/)) { // just a number formula = Number(formula); for (var i = 0, node; node = nodes[i]; i++) if (node.nodeIndex == formula) results.push(node); } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b if (m[1] == "-") m[1] = -1; var a = m[1] ? Number(m[1]) : 1; var b = m[2] ? Number(m[2]) : 0; var indices = Selector.pseudos.getIndices(a, b, nodes.length); for (var i = 0, node, l = indices.length; node = nodes[i]; i++) { for (var j = 0; j < l; j++) if (node.nodeIndex == indices[j]) results.push(node); } } h.unmark(nodes); h.unmark(indexed); return results; }, 'empty': function(nodes, value, root) { for (var i = 0, results = [], node; node = nodes[i]; i++) { // IE treats comments as element nodes if (node.tagName == '!' || (node.firstChild && !node.innerHTML.match(/^\s*$/))) continue; results.push(node); } return results; }, 'not': function(nodes, selector, root) { var h = Selector.handlers, selectorType, m; var exclusions = new Selector(selector).findElements(root); h.mark(exclusions); for (var i = 0, results = [], node; node = nodes[i]; i++) if (!node._counted) results.push(node); h.unmark(exclusions); return results; }, 'enabled': function(nodes, value, root) { for (var i = 0, results = [], node; node = nodes[i]; i++) if (!node.disabled) results.push(node); return results; }, 'disabled': function(nodes, value, root) { for (var i = 0, results = [], node; node = nodes[i]; i++) if (node.disabled) results.push(node); return results; }, 'checked': function(nodes, value, root) { for (var i = 0, results = [], node; node = nodes[i]; i++) if (node.checked) results.push(node); return results; } }, operators: { '=': function(nv, v) { return nv == v; }, '!=': function(nv, v) { return nv != v; }, '^=': function(nv, v) { return nv.startsWith(v); }, '$=': function(nv, v) { return nv.endsWith(v); }, '*=': function(nv, v) { return nv.include(v); }, '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); }, '|=': function(nv, v) { return ('-' + nv.toUpperCase() + '-').include('-' + v.toUpperCase() + '-'); } }, matchElements: function(elements, expression) { var matches = new Selector(expression).findElements(), h = Selector.handlers; h.mark(matches); for (var i = 0, results = [], element; element = elements[i]; i++) if (element._counted) results.push(element); h.unmark(matches); return results; }, findElement: function(elements, expression, index) { if (Object.isNumber(expression)) { index = expression; expression = false; } return Selector.matchElements(elements, expression || '*')[index || 0]; }, findChildElements: function(element, expressions) { var exprs = expressions.join(','), expressions = []; exprs.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) { expressions.push(m[1].strip()); }); var results = [], h = Selector.handlers; for (var i = 0, l = expressions.length, selector; i < l; i++) { selector = new Selector(expressions[i].strip()); h.concat(results, selector.findElements(element)); } return (l > 1) ? h.unique(results) : results; } }); function $$() { return Selector.findChildElements(document, $A(arguments)); } var Form = { reset: function(form) { $(form).reset(); return form; }, serializeElements: function(elements, options) { if (typeof options != 'object') options = { hash: !!options }; else if (options.hash === undefined) options.hash = true; var key, value, submitted = false, submit = options.submit; var data = elements.inject({ }, function(result, element) { if (!element.disabled && element.name) { key = element.name; value = $(element).getValue(); if (value != null && (element.type != 'submit' || (!submitted && submit !== false && (!submit || key == submit) && (submitted = true)))) { if (key in result) { // a key is already present; construct an array of values if (!Object.isArray(result[key])) result[key] = [result[key]]; result[key].push(value); } else result[key] = value; } } return result; }); return options.hash ? data : Object.toQueryString(data); } }; Form.Methods = { serialize: function(form, options) { return Form.serializeElements(Form.getElements(form), options); }, getElements: function(form) { return $A($(form).getElementsByTagName('*')).inject([], function(elements, child) { if (Form.Element.Serializers[child.tagName.toLowerCase()]) elements.push(Element.extend(child)); return elements; } ); }, getInputs: function(form, typeName, name) { form = $(form); var inputs = form.getElementsByTagName('input'); if (!typeName && !name) return $A(inputs).map(Element.extend); for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) { var input = inputs[i]; if ((typeName && input.type != typeName) || (name && input.name != name)) continue; matchingInputs.push(Element.extend(input)); } return matchingInputs; }, disable: function(form) { form = $(form); Form.getElements(form).invoke('disable'); return form; }, enable: function(form) { form = $(form); Form.getElements(form).invoke('enable'); return form; }, findFirstElement: function(form) { var elements = $(form).getElements().findAll(function(element) { return 'hidden' != element.type && !element.disabled; }); var firstByIndex = elements.findAll(function(element) { return element.hasAttribute('tabIndex') && element.tabIndex >= 0; }).sortBy(function(element) { return element.tabIndex }).first(); return firstByIndex ? firstByIndex : elements.find(function(element) { return ['input', 'select', 'textarea'].include(element.tagName.toLowerCase()); }); }, focusFirstElement: function(form) { form = $(form); form.findFirstElement().activate(); return form; }, request: function(form, options) { form = $(form), options = Object.clone(options || { }); var params = options.parameters, action = form.readAttribute('action') || ''; if (action.blank()) action = window.location.href; options.parameters = form.serialize(true); if (params) { if (Object.isString(params)) params = params.toQueryParams(); Object.extend(options.parameters, params); } if (form.hasAttribute('method') && !options.method) options.method = form.method; return new Ajax.Request(action, options); } }; /*--------------------------------------------------------------------------*/ Form.Element = { focus: function(element) { $(element).focus(); return element; }, select: function(element) { $(element).select(); return element; } }; Form.Element.Methods = { serialize: function(element) { element = $(element); if (!element.disabled && element.name) { var value = element.getValue(); if (value != undefined) { var pair = { }; pair[element.name] = value; return Object.toQueryString(pair); } } return ''; }, getValue: function(element) { element = $(element); var method = element.tagName.toLowerCase(); return Form.Element.Serializers[method](element); }, setValue: function(element, value) { element = $(element); var method = element.tagName.toLowerCase(); Form.Element.Serializers[method](element, value); return element; }, clear: function(element) { $(element).value = ''; return element; }, present: function(element) { return $(element).value != ''; }, activate: function(element) { element = $(element); try { element.focus(); if (element.select && (element.tagName.toLowerCase() != 'input' || !['button', 'reset', 'submit'].include(element.type))) element.select(); } catch (e) { } return element; }, disable: function(element) { element = $(element); element.blur(); element.disabled = true; return element; }, enable: function(element) { element = $(element); element.disabled = false; return element; } }; /*--------------------------------------------------------------------------*/ var Field = Form.Element; var $F = Form.Element.Methods.getValue; /*--------------------------------------------------------------------------*/ Form.Element.Serializers = { input: function(element, value) { switch (element.type.toLowerCase()) { case 'checkbox': case 'radio': return Form.Element.Serializers.inputSelector(element, value); default: return Form.Element.Serializers.textarea(element, value); } }, inputSelector: function(element, value) { if (value === undefined) return element.checked ? element.value : null; else element.checked = !!value; }, textarea: function(element, value) { if (value === undefined) return element.value; else element.value = value; }, select: function(element, index) { if (index === undefined) return this[element.type == 'select-one' ? 'selectOne' : 'selectMany'](element); else { var opt, value, single = !Object.isArray(index); for (var i = 0, length = element.length; i < length; i++) { opt = element.options[i]; value = this.optionValue(opt); if (single) { if (value == index) { opt.selected = true; return; } } else opt.selected = index.include(value); } } }, selectOne: function(element) { var index = element.selectedIndex; return index >= 0 ? this.optionValue(element.options[index]) : null; }, selectMany: function(element) { var values, length = element.length; if (!length) return null; for (var i = 0, values = []; i < length; i++) { var opt = element.options[i]; if (opt.selected) values.push(this.optionValue(opt)); } return values; }, optionValue: function(opt) { // extend element because hasAttribute may not be native return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text; } }; /*--------------------------------------------------------------------------*/ Abstract.TimedObserver = Class.create(PeriodicalExecuter, { initialize: function($super, element, frequency, callback) { $super(callback, frequency); this.element = $(element); this.lastValue = this.getValue(); }, execute: function() { var value = this.getValue(); if (Object.isString(this.lastValue) && Object.isString(value) ? this.lastValue != value : String(this.lastValue) != String(value)) { this.callback(this.element, value); this.lastValue = value; } } }); Form.Element.Observer = Class.create(Abstract.TimedObserver, { getValue: function() { return Form.Element.getValue(this.element); } }); Form.Observer = Class.create(Abstract.TimedObserver, { getValue: function() { return Form.serialize(this.element); } }); /*--------------------------------------------------------------------------*/ Abstract.EventObserver = Class.create({ initialize: function(element, callback) { this.element = $(element); this.callback = callback; this.lastValue = this.getValue(); if (this.element.tagName.toLowerCase() == 'form') this.registerFormCallbacks(); else this.registerCallback(this.element); }, onElementEvent: function() { var value = this.getValue(); if (this.lastValue != value) { this.callback(this.element, value); this.lastValue = value; } }, registerFormCallbacks: function() { Form.getElements(this.element).each(this.registerCallback, this); }, registerCallback: function(element) { if (element.type) { switch (element.type.toLowerCase()) { case 'checkbox': case 'radio': Event.observe(element, 'click', this.onElementEvent.bind(this)); break; default: Event.observe(element, 'change', this.onElementEvent.bind(this)); break; } } } }); Form.Element.EventObserver = Class.create(Abstract.EventObserver, { getValue: function() { return Form.Element.getValue(this.element); } }); Form.EventObserver = Class.create(Abstract.EventObserver, { getValue: function() { return Form.serialize(this.element); } }); if (!window.Event) var Event = { }; Object.extend(Event, { KEY_BACKSPACE: 8, KEY_TAB: 9, KEY_RETURN: 13, KEY_ESC: 27, KEY_LEFT: 37, KEY_UP: 38, KEY_RIGHT: 39, KEY_DOWN: 40, KEY_DELETE: 46, KEY_HOME: 36, KEY_END: 35, KEY_PAGEUP: 33, KEY_PAGEDOWN: 34, KEY_INSERT: 45, cache: { }, relatedTarget: function(event) { var element; switch(event.type) { case 'mouseover': element = event.fromElement; break; case 'mouseout': element = event.toElement; break; default: return null; } return Element.extend(element); } }); Event.Methods = (function() { var isButton; if (Prototype.Browser.IE) { var buttonMap = { 0: 1, 1: 4, 2: 2 }; isButton = function(event, code) { return event.button == buttonMap[code]; }; } else if (Prototype.Browser.WebKit) { isButton = function(event, code) { switch (code) { case 0: return event.which == 1 && !event.metaKey; case 1: return event.which == 1 && event.metaKey; default: return false; } }; } else { isButton = function(event, code) { return event.which ? (event.which === code + 1) : (event.button === code); }; } return { isLeftClick: function(event) { return isButton(event, 0) }, isMiddleClick: function(event) { return isButton(event, 1) }, isRightClick: function(event) { return isButton(event, 2) }, element: function(event) { var node = Event.extend(event).target; return Element.extend(node.nodeType == Node.TEXT_NODE ? node.parentNode : node); }, findElement: function(event, expression) { var element = Event.element(event); return element.match(expression) ? element : element.up(expression); }, pointer: function(event) { return { x: event.pageX || (event.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)), y: event.pageY || (event.clientY + (document.documentElement.scrollTop || document.body.scrollTop)) }; }, pointerX: function(event) { return Event.pointer(event).x }, pointerY: function(event) { return Event.pointer(event).y }, stop: function(event) { Event.extend(event); event.preventDefault(); event.stopPropagation(); event.stopped = true; } }; })(); Event.extend = (function() { var methods = Object.keys(Event.Methods).inject({ }, function(m, name) { m[name] = Event.Methods[name].methodize(); return m; }); if (Prototype.Browser.IE) { Object.extend(methods, { stopPropagation: function() { this.cancelBubble = true }, preventDefault: function() { this.returnValue = false }, inspect: function() { return "[object Event]" } }); return function(event) { if (!event) return false; if (event._extendedByPrototype) return event; event._extendedByPrototype = Prototype.emptyFunction; var pointer = Event.pointer(event); Object.extend(event, { target: event.srcElement, relatedTarget: Event.relatedTarget(event), pageX: pointer.x, pageY: pointer.y }); return Object.extend(event, methods); }; } else { Event.prototype = Event.prototype || document.createEvent("HTMLEvents").__proto__; Object.extend(Event.prototype, methods); return Prototype.K; } })(); Object.extend(Event, (function() { var cache = Event.cache; function getEventID(element) { if (element._eventID) return element._eventID; arguments.callee.id = arguments.callee.id || 1; return element._eventID = ++arguments.callee.id; } function getDOMEventName(eventName) { if (eventName && eventName.include(':')) return "dataavailable"; return eventName; } function getCacheForID(id) { return cache[id] = cache[id] || { }; } function getWrappersForEventName(id, eventName) { var c = getCacheForID(id); return c[eventName] = c[eventName] || []; } function createWrapper(element, eventName, handler) { var id = getEventID(element); var c = getWrappersForEventName(id, eventName); if (c.pluck("handler").include(handler)) return false; var wrapper = function(event) { if (!Event || !Event.extend || (event.eventName && event.eventName != eventName)) return false; Event.extend(event); handler.call(element, event) }; wrapper.handler = handler; c.push(wrapper); return wrapper; } function findWrapper(id, eventName, handler) { var c = getWrappersForEventName(id, eventName); return c.find(function(wrapper) { return wrapper.handler == handler }); } function destroyWrapper(id, eventName, handler) { var c = getCacheForID(id); if (!c[eventName]) return false; c[eventName] = c[eventName].without(findWrapper(id, eventName, handler)); } function destroyCache() { for (var id in cache) for (var eventName in cache[id]) cache[id][eventName] = null; } if (window.attachEvent) { window.attachEvent("onunload", destroyCache); } return { observe: function(element, eventName, handler) { element = $(element); var name = getDOMEventName(eventName); var wrapper = createWrapper(element, eventName, handler); if (!wrapper) return element; if (element.addEventListener) { element.addEventListener(name, wrapper, false); } else { element.attachEvent("on" + name, wrapper); } return element; }, stopObserving: function(element, eventName, handler) { element = $(element); var id = getEventID(element), name = getDOMEventName(eventName); if (!handler && eventName) { getWrappersForEventName(id, eventName).each(function(wrapper) { element.stopObserving(eventName, wrapper.handler); }); return element; } else if (!eventName) { Object.keys(getCacheForID(id)).each(function(eventName) { element.stopObserving(eventName); }); return element; } var wrapper = findWrapper(id, eventName, handler); if (!wrapper) return element; if (element.removeEventListener) { element.removeEventListener(name, wrapper, false); } else { element.detachEvent("on" + name, wrapper); } destroyWrapper(id, eventName, handler); return element; }, fire: function(element, eventName, memo) { element = $(element); if (element == document && document.createEvent && !element.dispatchEvent) element = document.documentElement; if (document.createEvent) { var event = document.createEvent("HTMLEvents"); event.initEvent("dataavailable", true, true); } else { var event = document.createEventObject(); event.eventType = "ondataavailable"; } event.eventName = eventName; event.memo = memo || { }; if (document.createEvent) { element.dispatchEvent(event); } else { element.fireEvent(event.eventType, event); } return event; } }; })()); Object.extend(Event, Event.Methods); Element.addMethods({ fire: Event.fire, observe: Event.observe, stopObserving: Event.stopObserving }); Object.extend(document, { fire: Element.Methods.fire.methodize(), observe: Element.Methods.observe.methodize(), stopObserving: Element.Methods.stopObserving.methodize() }); (function() { /* Support for the DOMContentLoaded event is based on work by Dan Webb, Matthias Miller, Dean Edwards and John Resig. */ var timer, fired = false; function fireContentLoadedEvent() { if (fired) return; if (timer) window.clearInterval(timer); document.fire("dom:loaded"); fired = true; } if (document.addEventListener) { if (Prototype.Browser.WebKit) { timer = window.setInterval(function() { if (/loaded|complete/.test(document.readyState)) fireContentLoadedEvent(); }, 0); Event.observe(window, "load", fireContentLoadedEvent); } else { document.addEventListener("DOMContentLoaded", fireContentLoadedEvent, false); } } else { document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>"); $("__onDOMContentLoaded").onreadystatechange = function() { if (this.readyState == "complete") { this.onreadystatechange = null; fireContentLoadedEvent(); } }; } })(); /*------------------------------- DEPRECATED -------------------------------*/ Hash.toQueryString = Object.toQueryString; var Toggle = { display: Element.toggle }; Element.Methods.childOf = Element.Methods.descendantOf; var Insertion = { Before: function(element, content) { return Element.insert(element, {before:content}); }, Top: function(element, content) { return Element.insert(element, {top:content}); }, Bottom: function(element, content) { return Element.insert(element, {bottom:content}); }, After: function(element, content) { return Element.insert(element, {after:content}); } }; var $continue = new Error('"throw $continue" is deprecated, use "return" instead'); // This should be moved to script.aculo.us; notice the deprecated methods // further below, that map to the newer Element methods. var Position = { // set to true if needed, warning: firefox performance problems // NOT neeeded for page scrolling, only if draggable contained in // scrollable elements includeScrollOffsets: false, // must be called before calling withinIncludingScrolloffset, every time the // page is scrolled prepare: function() { this.deltaX = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0; this.deltaY = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; }, // caches x/y coordinate pair to use with overlap within: function(element, x, y) { if (this.includeScrollOffsets) return this.withinIncludingScrolloffsets(element, x, y); this.xcomp = x; this.ycomp = y; this.offset = Element.cumulativeOffset(element); return (y >= this.offset[1] && y < this.offset[1] + element.offsetHeight && x >= this.offset[0] && x < this.offset[0] + element.offsetWidth); }, withinIncludingScrolloffsets: function(element, x, y) { var offsetcache = Element.cumulativeScrollOffset(element); this.xcomp = x + offsetcache[0] - this.deltaX; this.ycomp = y + offsetcache[1] - this.deltaY; this.offset = Element.cumulativeOffset(element); return (this.ycomp >= this.offset[1] && this.ycomp < this.offset[1] + element.offsetHeight && this.xcomp >= this.offset[0] && this.xcomp < this.offset[0] + element.offsetWidth); }, // within must be called directly before overlap: function(mode, element) { if (!mode) return 0; if (mode == 'vertical') return ((this.offset[1] + element.offsetHeight) - this.ycomp) / element.offsetHeight; if (mode == 'horizontal') return ((this.offset[0] + element.offsetWidth) - this.xcomp) / element.offsetWidth; }, // Deprecation layer -- use newer Element methods now (1.5.2). cumulativeOffset: Element.Methods.cumulativeOffset, positionedOffset: Element.Methods.positionedOffset, absolutize: function(element) { Position.prepare(); return Element.absolutize(element); }, relativize: function(element) { Position.prepare(); return Element.relativize(element); }, realOffset: Element.Methods.cumulativeScrollOffset, offsetParent: Element.Methods.getOffsetParent, page: Element.Methods.viewportOffset, clone: function(source, target, options) { options = options || { }; return Element.clonePosition(target, source, options); } }; /*--------------------------------------------------------------------------*/ if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){ function iter(name) { return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]"; } instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ? function(element, className) { className = className.toString().strip(); var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className); return cond ? document._getElementsByXPath('.//*' + cond, element) : []; } : function(element, className) { className = className.toString().strip(); var elements = [], classNames = (/\s/.test(className) ? $w(className) : null); if (!classNames && !className) return elements; var nodes = $(element).getElementsByTagName('*'); className = ' ' + className + ' '; for (var i = 0, child, cn; child = nodes[i]; i++) { if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) || (classNames && classNames.all(function(name) { return !name.toString().blank() && cn.include(' ' + name + ' '); })))) elements.push(Element.extend(child)); } return elements; }; return function(className, parentElement) { return $(parentElement || document.body).getElementsByClassName(className); }; }(Element.Methods); /*--------------------------------------------------------------------------*/ Element.ClassNames = Class.create(); Element.ClassNames.prototype = { initialize: function(element) { this.element = $(element); }, _each: function(iterator) { this.element.className.split(/\s+/).select(function(name) { return name.length > 0; })._each(iterator); }, set: function(className) { this.element.className = className; }, add: function(classNameToAdd) { if (this.include(classNameToAdd)) return; this.set($A(this).concat(classNameToAdd).join(' ')); }, remove: function(classNameToRemove) { if (!this.include(classNameToRemove)) return; this.set($A(this).without(classNameToRemove).join(' ')); }, toString: function() { return $A(this).join(' '); } }; Object.extend(Element.ClassNames.prototype, Enumerable); /*--------------------------------------------------------------------------*/ Element.addMethods();����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/scriptaculous/����������������������������������������������������������������0000755�0001066�0001066�00000000000�11051167751�014754� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/scriptaculous/unittest.js�����������������������������������������������������0000644�0001066�0001066�00000047345�10762616541�017212� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// script.aculo.us unittest.js v1.8.0, Tue Nov 06 15:01:40 +0300 2007 // Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) // (c) 2005-2007 Jon Tirsen (http://www.tirsen.com) // (c) 2005-2007 Michael Schuerig (http://www.schuerig.de/michael/) // // script.aculo.us is freely distributable under the terms of an MIT-style license. // For details, see the script.aculo.us web site: http://script.aculo.us/ // experimental, Firefox-only Event.simulateMouse = function(element, eventName) { var options = Object.extend({ pointerX: 0, pointerY: 0, buttons: 0, ctrlKey: false, altKey: false, shiftKey: false, metaKey: false }, arguments[2] || {}); var oEvent = document.createEvent("MouseEvents"); oEvent.initMouseEvent(eventName, true, true, document.defaultView, options.buttons, options.pointerX, options.pointerY, options.pointerX, options.pointerY, options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, 0, $(element)); if(this.mark) Element.remove(this.mark); this.mark = document.createElement('div'); this.mark.appendChild(document.createTextNode(" ")); document.body.appendChild(this.mark); this.mark.style.position = 'absolute'; this.mark.style.top = options.pointerY + "px"; this.mark.style.left = options.pointerX + "px"; this.mark.style.width = "5px"; this.mark.style.height = "5px;"; this.mark.style.borderTop = "1px solid red;" this.mark.style.borderLeft = "1px solid red;" if(this.step) alert('['+new Date().getTime().toString()+'] '+eventName+'/'+Test.Unit.inspect(options)); $(element).dispatchEvent(oEvent); }; // Note: Due to a fix in Firefox 1.0.5/6 that probably fixed "too much", this doesn't work in 1.0.6 or DP2. // You need to downgrade to 1.0.4 for now to get this working // See https://bugzilla.mozilla.org/show_bug.cgi?id=289940 for the fix that fixed too much Event.simulateKey = function(element, eventName) { var options = Object.extend({ ctrlKey: false, altKey: false, shiftKey: false, metaKey: false, keyCode: 0, charCode: 0 }, arguments[2] || {}); var oEvent = document.createEvent("KeyEvents"); oEvent.initKeyEvent(eventName, true, true, window, options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, options.keyCode, options.charCode ); $(element).dispatchEvent(oEvent); }; Event.simulateKeys = function(element, command) { for(var i=0; i<command.length; i++) { Event.simulateKey(element,'keypress',{charCode:command.charCodeAt(i)}); } }; var Test = {} Test.Unit = {}; // security exception workaround Test.Unit.inspect = Object.inspect; Test.Unit.Logger = Class.create(); Test.Unit.Logger.prototype = { initialize: function(log) { this.log = $(log); if (this.log) { this._createLogTable(); } }, start: function(testName) { if (!this.log) return; this.testName = testName; this.lastLogLine = document.createElement('tr'); this.statusCell = document.createElement('td'); this.nameCell = document.createElement('td'); this.nameCell.className = "nameCell"; this.nameCell.appendChild(document.createTextNode(testName)); this.messageCell = document.createElement('td'); this.lastLogLine.appendChild(this.statusCell); this.lastLogLine.appendChild(this.nameCell); this.lastLogLine.appendChild(this.messageCell); this.loglines.appendChild(this.lastLogLine); }, finish: function(status, summary) { if (!this.log) return; this.lastLogLine.className = status; this.statusCell.innerHTML = status; this.messageCell.innerHTML = this._toHTML(summary); this.addLinksToResults(); }, message: function(message) { if (!this.log) return; this.messageCell.innerHTML = this._toHTML(message); }, summary: function(summary) { if (!this.log) return; this.logsummary.innerHTML = this._toHTML(summary); }, _createLogTable: function() { this.log.innerHTML = '<div id="logsummary"></div>' + '<table id="logtable">' + '<thead><tr><th>Status</th><th>Test</th><th>Message</th></tr></thead>' + '<tbody id="loglines"></tbody>' + '</table>'; this.logsummary = $('logsummary') this.loglines = $('loglines'); }, _toHTML: function(txt) { return txt.escapeHTML().replace(/\n/g,"<br/>"); }, addLinksToResults: function(){ $$("tr.failed .nameCell").each( function(td){ // todo: limit to children of this.log td.title = "Run only this test" Event.observe(td, 'click', function(){ window.location.search = "?tests=" + td.innerHTML;}); }); $$("tr.passed .nameCell").each( function(td){ // todo: limit to children of this.log td.title = "Run all tests" Event.observe(td, 'click', function(){ window.location.search = "";}); }); } } Test.Unit.Runner = Class.create(); Test.Unit.Runner.prototype = { initialize: function(testcases) { this.options = Object.extend({ testLog: 'testlog' }, arguments[1] || {}); this.options.resultsURL = this.parseResultsURLQueryParameter(); this.options.tests = this.parseTestsQueryParameter(); if (this.options.testLog) { this.options.testLog = $(this.options.testLog) || null; } if(this.options.tests) { this.tests = []; for(var i = 0; i < this.options.tests.length; i++) { if(/^test/.test(this.options.tests[i])) { this.tests.push(new Test.Unit.Testcase(this.options.tests[i], testcases[this.options.tests[i]], testcases["setup"], testcases["teardown"])); } } } else { if (this.options.test) { this.tests = [new Test.Unit.Testcase(this.options.test, testcases[this.options.test], testcases["setup"], testcases["teardown"])]; } else { this.tests = []; for(var testcase in testcases) { if(/^test/.test(testcase)) { this.tests.push( new Test.Unit.Testcase( this.options.context ? ' -> ' + this.options.titles[testcase] : testcase, testcases[testcase], testcases["setup"], testcases["teardown"] )); } } } } this.currentTest = 0; this.logger = new Test.Unit.Logger(this.options.testLog); setTimeout(this.runTests.bind(this), 1000); }, parseResultsURLQueryParameter: function() { return window.location.search.parseQuery()["resultsURL"]; }, parseTestsQueryParameter: function(){ if (window.location.search.parseQuery()["tests"]){ return window.location.search.parseQuery()["tests"].split(','); }; }, // Returns: // "ERROR" if there was an error, // "FAILURE" if there was a failure, or // "SUCCESS" if there was neither getResult: function() { var hasFailure = false; for(var i=0;i<this.tests.length;i++) { if (this.tests[i].errors > 0) { return "ERROR"; } if (this.tests[i].failures > 0) { hasFailure = true; } } if (hasFailure) { return "FAILURE"; } else { return "SUCCESS"; } }, postResults: function() { if (this.options.resultsURL) { new Ajax.Request(this.options.resultsURL, { method: 'get', parameters: 'result=' + this.getResult(), asynchronous: false }); } }, runTests: function() { var test = this.tests[this.currentTest]; if (!test) { // finished! this.postResults(); this.logger.summary(this.summary()); return; } if(!test.isWaiting) { this.logger.start(test.name); } test.run(); if(test.isWaiting) { this.logger.message("Waiting for " + test.timeToWait + "ms"); setTimeout(this.runTests.bind(this), test.timeToWait || 1000); } else { this.logger.finish(test.status(), test.summary()); this.currentTest++; // tail recursive, hopefully the browser will skip the stackframe this.runTests(); } }, summary: function() { var assertions = 0; var failures = 0; var errors = 0; var messages = []; for(var i=0;i<this.tests.length;i++) { assertions += this.tests[i].assertions; failures += this.tests[i].failures; errors += this.tests[i].errors; } return ( (this.options.context ? this.options.context + ': ': '') + this.tests.length + " tests, " + assertions + " assertions, " + failures + " failures, " + errors + " errors"); } } Test.Unit.Assertions = Class.create(); Test.Unit.Assertions.prototype = { initialize: function() { this.assertions = 0; this.failures = 0; this.errors = 0; this.messages = []; }, summary: function() { return ( this.assertions + " assertions, " + this.failures + " failures, " + this.errors + " errors" + "\n" + this.messages.join("\n")); }, pass: function() { this.assertions++; }, fail: function(message) { this.failures++; this.messages.push("Failure: " + message); }, info: function(message) { this.messages.push("Info: " + message); }, error: function(error) { this.errors++; this.messages.push(error.name + ": "+ error.message + "(" + Test.Unit.inspect(error) +")"); }, status: function() { if (this.failures > 0) return 'failed'; if (this.errors > 0) return 'error'; return 'passed'; }, assert: function(expression) { var message = arguments[1] || 'assert: got "' + Test.Unit.inspect(expression) + '"'; try { expression ? this.pass() : this.fail(message); } catch(e) { this.error(e); } }, assertEqual: function(expected, actual) { var message = arguments[2] || "assertEqual"; try { (expected == actual) ? this.pass() : this.fail(message + ': expected "' + Test.Unit.inspect(expected) + '", actual "' + Test.Unit.inspect(actual) + '"'); } catch(e) { this.error(e); } }, assertInspect: function(expected, actual) { var message = arguments[2] || "assertInspect"; try { (expected == actual.inspect()) ? this.pass() : this.fail(message + ': expected "' + Test.Unit.inspect(expected) + '", actual "' + Test.Unit.inspect(actual) + '"'); } catch(e) { this.error(e); } }, assertEnumEqual: function(expected, actual) { var message = arguments[2] || "assertEnumEqual"; try { $A(expected).length == $A(actual).length && expected.zip(actual).all(function(pair) { return pair[0] == pair[1] }) ? this.pass() : this.fail(message + ': expected ' + Test.Unit.inspect(expected) + ', actual ' + Test.Unit.inspect(actual)); } catch(e) { this.error(e); } }, assertNotEqual: function(expected, actual) { var message = arguments[2] || "assertNotEqual"; try { (expected != actual) ? this.pass() : this.fail(message + ': got "' + Test.Unit.inspect(actual) + '"'); } catch(e) { this.error(e); } }, assertIdentical: function(expected, actual) { var message = arguments[2] || "assertIdentical"; try { (expected === actual) ? this.pass() : this.fail(message + ': expected "' + Test.Unit.inspect(expected) + '", actual "' + Test.Unit.inspect(actual) + '"'); } catch(e) { this.error(e); } }, assertNotIdentical: function(expected, actual) { var message = arguments[2] || "assertNotIdentical"; try { !(expected === actual) ? this.pass() : this.fail(message + ': expected "' + Test.Unit.inspect(expected) + '", actual "' + Test.Unit.inspect(actual) + '"'); } catch(e) { this.error(e); } }, assertNull: function(obj) { var message = arguments[1] || 'assertNull' try { (obj==null) ? this.pass() : this.fail(message + ': got "' + Test.Unit.inspect(obj) + '"'); } catch(e) { this.error(e); } }, assertMatch: function(expected, actual) { var message = arguments[2] || 'assertMatch'; var regex = new RegExp(expected); try { (regex.exec(actual)) ? this.pass() : this.fail(message + ' : regex: "' + Test.Unit.inspect(expected) + ' did not match: ' + Test.Unit.inspect(actual) + '"'); } catch(e) { this.error(e); } }, assertHidden: function(element) { var message = arguments[1] || 'assertHidden'; this.assertEqual("none", element.style.display, message); }, assertNotNull: function(object) { var message = arguments[1] || 'assertNotNull'; this.assert(object != null, message); }, assertType: function(expected, actual) { var message = arguments[2] || 'assertType'; try { (actual.constructor == expected) ? this.pass() : this.fail(message + ': expected "' + Test.Unit.inspect(expected) + '", actual "' + (actual.constructor) + '"'); } catch(e) { this.error(e); } }, assertNotOfType: function(expected, actual) { var message = arguments[2] || 'assertNotOfType'; try { (actual.constructor != expected) ? this.pass() : this.fail(message + ': expected "' + Test.Unit.inspect(expected) + '", actual "' + (actual.constructor) + '"'); } catch(e) { this.error(e); } }, assertInstanceOf: function(expected, actual) { var message = arguments[2] || 'assertInstanceOf'; try { (actual instanceof expected) ? this.pass() : this.fail(message + ": object was not an instance of the expected type"); } catch(e) { this.error(e); } }, assertNotInstanceOf: function(expected, actual) { var message = arguments[2] || 'assertNotInstanceOf'; try { !(actual instanceof expected) ? this.pass() : this.fail(message + ": object was an instance of the not expected type"); } catch(e) { this.error(e); } }, assertRespondsTo: function(method, obj) { var message = arguments[2] || 'assertRespondsTo'; try { (obj[method] && typeof obj[method] == 'function') ? this.pass() : this.fail(message + ": object doesn't respond to [" + method + "]"); } catch(e) { this.error(e); } }, assertReturnsTrue: function(method, obj) { var message = arguments[2] || 'assertReturnsTrue'; try { var m = obj[method]; if(!m) m = obj['is'+method.charAt(0).toUpperCase()+method.slice(1)]; m() ? this.pass() : this.fail(message + ": method returned false"); } catch(e) { this.error(e); } }, assertReturnsFalse: function(method, obj) { var message = arguments[2] || 'assertReturnsFalse'; try { var m = obj[method]; if(!m) m = obj['is'+method.charAt(0).toUpperCase()+method.slice(1)]; !m() ? this.pass() : this.fail(message + ": method returned true"); } catch(e) { this.error(e); } }, assertRaise: function(exceptionName, method) { var message = arguments[2] || 'assertRaise'; try { method(); this.fail(message + ": exception expected but none was raised"); } catch(e) { ((exceptionName == null) || (e.name==exceptionName)) ? this.pass() : this.error(e); } }, assertElementsMatch: function() { var expressions = $A(arguments), elements = $A(expressions.shift()); if (elements.length != expressions.length) { this.fail('assertElementsMatch: size mismatch: ' + elements.length + ' elements, ' + expressions.length + ' expressions'); return false; } elements.zip(expressions).all(function(pair, index) { var element = $(pair.first()), expression = pair.last(); if (element.match(expression)) return true; this.fail('assertElementsMatch: (in index ' + index + ') expected ' + expression.inspect() + ' but got ' + element.inspect()); }.bind(this)) && this.pass(); }, assertElementMatches: function(element, expression) { this.assertElementsMatch([element], expression); }, benchmark: function(operation, iterations) { var startAt = new Date(); (iterations || 1).times(operation); var timeTaken = ((new Date())-startAt); this.info((arguments[2] || 'Operation') + ' finished ' + iterations + ' iterations in ' + (timeTaken/1000)+'s' ); return timeTaken; }, _isVisible: function(element) { element = $(element); if(!element.parentNode) return true; this.assertNotNull(element); if(element.style && Element.getStyle(element, 'display') == 'none') return false; return this._isVisible(element.parentNode); }, assertNotVisible: function(element) { this.assert(!this._isVisible(element), Test.Unit.inspect(element) + " was not hidden and didn't have a hidden parent either. " + ("" || arguments[1])); }, assertVisible: function(element) { this.assert(this._isVisible(element), Test.Unit.inspect(element) + " was not visible. " + ("" || arguments[1])); }, benchmark: function(operation, iterations) { var startAt = new Date(); (iterations || 1).times(operation); var timeTaken = ((new Date())-startAt); this.info((arguments[2] || 'Operation') + ' finished ' + iterations + ' iterations in ' + (timeTaken/1000)+'s' ); return timeTaken; } } Test.Unit.Testcase = Class.create(); Object.extend(Object.extend(Test.Unit.Testcase.prototype, Test.Unit.Assertions.prototype), { initialize: function(name, test, setup, teardown) { Test.Unit.Assertions.prototype.initialize.bind(this)(); this.name = name; if(typeof test == 'string') { test = test.gsub(/(\.should[^\(]+\()/,'#{0}this,'); test = test.gsub(/(\.should[^\(]+)\(this,\)/,'#{1}(this)'); this.test = function() { eval('with(this){'+test+'}'); } } else { this.test = test || function() {}; } this.setup = setup || function() {}; this.teardown = teardown || function() {}; this.isWaiting = false; this.timeToWait = 1000; }, wait: function(time, nextPart) { this.isWaiting = true; this.test = nextPart; this.timeToWait = time; }, run: function() { try { try { if (!this.isWaiting) this.setup.bind(this)(); this.isWaiting = false; this.test.bind(this)(); } finally { if(!this.isWaiting) { this.teardown.bind(this)(); } } } catch(e) { this.error(e); } } }); // *EXPERIMENTAL* BDD-style testing to please non-technical folk // This draws many ideas from RSpec http://rspec.rubyforge.org/ Test.setupBDDExtensionMethods = function(){ var METHODMAP = { shouldEqual: 'assertEqual', shouldNotEqual: 'assertNotEqual', shouldEqualEnum: 'assertEnumEqual', shouldBeA: 'assertType', shouldNotBeA: 'assertNotOfType', shouldBeAn: 'assertType', shouldNotBeAn: 'assertNotOfType', shouldBeNull: 'assertNull', shouldNotBeNull: 'assertNotNull', shouldBe: 'assertReturnsTrue', shouldNotBe: 'assertReturnsFalse', shouldRespondTo: 'assertRespondsTo' }; var makeAssertion = function(assertion, args, object) { this[assertion].apply(this,(args || []).concat([object])); } Test.BDDMethods = {}; $H(METHODMAP).each(function(pair) { Test.BDDMethods[pair.key] = function() { var args = $A(arguments); var scope = args.shift(); makeAssertion.apply(scope, [pair.value, args, this]); }; }); [Array.prototype, String.prototype, Number.prototype, Boolean.prototype].each( function(p){ Object.extend(p, Test.BDDMethods) } ); } Test.context = function(name, spec, log){ Test.setupBDDExtensionMethods(); var compiledSpec = {}; var titles = {}; for(specName in spec) { switch(specName){ case "setup": case "teardown": compiledSpec[specName] = spec[specName]; break; default: var testName = 'test'+specName.gsub(/\s+/,'-').camelize(); var body = spec[specName].toString().split('\n').slice(1); if(/^\{/.test(body[0])) body = body.slice(1); body.pop(); body = body.map(function(statement){ return statement.strip() }); compiledSpec[testName] = body.join('\n'); titles[testName] = specName; } } new Test.Unit.Runner(compiledSpec, { titles: titles, testLog: log || 'testlog', context: name }); };�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/scriptaculous/dragdrop.js�����������������������������������������������������0000644�0001066�0001066�00000075565�10762616541�017142� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// script.aculo.us dragdrop.js v1.8.0, Tue Nov 06 15:01:40 +0300 2007 // Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) // (c) 2005-2007 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz) // // script.aculo.us is freely distributable under the terms of an MIT-style license. // For details, see the script.aculo.us web site: http://script.aculo.us/ if(Object.isUndefined(Effect)) throw("dragdrop.js requires including script.aculo.us' effects.js library"); var Droppables = { drops: [], remove: function(element) { this.drops = this.drops.reject(function(d) { return d.element==$(element) }); }, add: function(element) { element = $(element); var options = Object.extend({ greedy: true, hoverclass: null, tree: false }, arguments[1] || { }); // cache containers if(options.containment) { options._containers = []; var containment = options.containment; if(Object.isArray(containment)) { containment.each( function(c) { options._containers.push($(c)) }); } else { options._containers.push($(containment)); } } if(options.accept) options.accept = [options.accept].flatten(); Element.makePositioned(element); // fix IE options.element = element; this.drops.push(options); }, findDeepestChild: function(drops) { deepest = drops[0]; for (i = 1; i < drops.length; ++i) if (Element.isParent(drops[i].element, deepest.element)) deepest = drops[i]; return deepest; }, isContained: function(element, drop) { var containmentNode; if(drop.tree) { containmentNode = element.treeNode; } else { containmentNode = element.parentNode; } return drop._containers.detect(function(c) { return containmentNode == c }); }, isAffected: function(point, element, drop) { return ( (drop.element!=element) && ((!drop._containers) || this.isContained(element, drop)) && ((!drop.accept) || (Element.classNames(element).detect( function(v) { return drop.accept.include(v) } ) )) && Position.within(drop.element, point[0], point[1]) ); }, deactivate: function(drop) { if(drop.hoverclass) Element.removeClassName(drop.element, drop.hoverclass); this.last_active = null; }, activate: function(drop) { if(drop.hoverclass) Element.addClassName(drop.element, drop.hoverclass); this.last_active = drop; }, show: function(point, element) { if(!this.drops.length) return; var drop, affected = []; this.drops.each( function(drop) { if(Droppables.isAffected(point, element, drop)) affected.push(drop); }); if(affected.length>0) drop = Droppables.findDeepestChild(affected); if(this.last_active && this.last_active != drop) this.deactivate(this.last_active); if (drop) { Position.within(drop.element, point[0], point[1]); if(drop.onHover) drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); if (drop != this.last_active) Droppables.activate(drop); } }, fire: function(event, element) { if(!this.last_active) return; Position.prepare(); if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active)) if (this.last_active.onDrop) { this.last_active.onDrop(element, this.last_active.element, event); return true; } }, reset: function() { if(this.last_active) this.deactivate(this.last_active); } } var Draggables = { drags: [], observers: [], register: function(draggable) { if(this.drags.length == 0) { this.eventMouseUp = this.endDrag.bindAsEventListener(this); this.eventMouseMove = this.updateDrag.bindAsEventListener(this); this.eventKeypress = this.keyPress.bindAsEventListener(this); Event.observe(document, "mouseup", this.eventMouseUp); Event.observe(document, "mousemove", this.eventMouseMove); Event.observe(document, "keypress", this.eventKeypress); } this.drags.push(draggable); }, unregister: function(draggable) { this.drags = this.drags.reject(function(d) { return d==draggable }); if(this.drags.length == 0) { Event.stopObserving(document, "mouseup", this.eventMouseUp); Event.stopObserving(document, "mousemove", this.eventMouseMove); Event.stopObserving(document, "keypress", this.eventKeypress); } }, activate: function(draggable) { if(draggable.options.delay) { this._timeout = setTimeout(function() { Draggables._timeout = null; window.focus(); Draggables.activeDraggable = draggable; }.bind(this), draggable.options.delay); } else { window.focus(); // allows keypress events if window isn't currently focused, fails for Safari this.activeDraggable = draggable; } }, deactivate: function() { this.activeDraggable = null; }, updateDrag: function(event) { if(!this.activeDraggable) return; var pointer = [Event.pointerX(event), Event.pointerY(event)]; // Mozilla-based browsers fire successive mousemove events with // the same coordinates, prevent needless redrawing (moz bug?) if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return; this._lastPointer = pointer; this.activeDraggable.updateDrag(event, pointer); }, endDrag: function(event) { if(this._timeout) { clearTimeout(this._timeout); this._timeout = null; } if(!this.activeDraggable) return; this._lastPointer = null; this.activeDraggable.endDrag(event); this.activeDraggable = null; }, keyPress: function(event) { if(this.activeDraggable) this.activeDraggable.keyPress(event); }, addObserver: function(observer) { this.observers.push(observer); this._cacheObserverCallbacks(); }, removeObserver: function(element) { // element instead of observer fixes mem leaks this.observers = this.observers.reject( function(o) { return o.element==element }); this._cacheObserverCallbacks(); }, notify: function(eventName, draggable, event) { // 'onStart', 'onEnd', 'onDrag' if(this[eventName+'Count'] > 0) this.observers.each( function(o) { if(o[eventName]) o[eventName](eventName, draggable, event); }); if(draggable.options[eventName]) draggable.options[eventName](draggable, event); }, _cacheObserverCallbacks: function() { ['onStart','onEnd','onDrag'].each( function(eventName) { Draggables[eventName+'Count'] = Draggables.observers.select( function(o) { return o[eventName]; } ).length; }); } } /*--------------------------------------------------------------------------*/ var Draggable = Class.create({ initialize: function(element) { var defaults = { handle: false, reverteffect: function(element, top_offset, left_offset) { var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02; new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur, queue: {scope:'_draggable', position:'end'} }); }, endeffect: function(element) { var toOpacity = Object.isNumber(element._opacity) ? element._opacity : 1.0; new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity, queue: {scope:'_draggable', position:'end'}, afterFinish: function(){ Draggable._dragging[element] = false } }); }, zindex: 1000, revert: false, quiet: false, scroll: false, scrollSensitivity: 20, scrollSpeed: 15, snap: false, // false, or xy or [x,y] or function(x,y){ return [x,y] } delay: 0 }; if(!arguments[1] || Object.isUndefined(arguments[1].endeffect)) Object.extend(defaults, { starteffect: function(element) { element._opacity = Element.getOpacity(element); Draggable._dragging[element] = true; new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7}); } }); var options = Object.extend(defaults, arguments[1] || { }); this.element = $(element); if(options.handle && Object.isString(options.handle)) this.handle = this.element.down('.'+options.handle, 0); if(!this.handle) this.handle = $(options.handle); if(!this.handle) this.handle = this.element; if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) { options.scroll = $(options.scroll); this._isScrollChild = Element.childOf(this.element, options.scroll); } Element.makePositioned(this.element); // fix IE this.options = options; this.dragging = false; this.eventMouseDown = this.initDrag.bindAsEventListener(this); Event.observe(this.handle, "mousedown", this.eventMouseDown); Draggables.register(this); }, destroy: function() { Event.stopObserving(this.handle, "mousedown", this.eventMouseDown); Draggables.unregister(this); }, currentDelta: function() { return([ parseInt(Element.getStyle(this.element,'left') || '0'), parseInt(Element.getStyle(this.element,'top') || '0')]); }, initDrag: function(event) { if(!Object.isUndefined(Draggable._dragging[this.element]) && Draggable._dragging[this.element]) return; if(Event.isLeftClick(event)) { // abort on form elements, fixes a Firefox issue var src = Event.element(event); if((tag_name = src.tagName.toUpperCase()) && ( tag_name=='INPUT' || tag_name=='SELECT' || tag_name=='OPTION' || tag_name=='BUTTON' || tag_name=='TEXTAREA')) return; var pointer = [Event.pointerX(event), Event.pointerY(event)]; var pos = Position.cumulativeOffset(this.element); this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) }); Draggables.activate(this); Event.stop(event); } }, startDrag: function(event) { this.dragging = true; if(!this.delta) this.delta = this.currentDelta(); if(this.options.zindex) { this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0); this.element.style.zIndex = this.options.zindex; } if(this.options.ghosting) { this._clone = this.element.cloneNode(true); this.element._originallyAbsolute = (this.element.getStyle('position') == 'absolute'); if (!this.element._originallyAbsolute) Position.absolutize(this.element); this.element.parentNode.insertBefore(this._clone, this.element); } if(this.options.scroll) { if (this.options.scroll == window) { var where = this._getWindowScroll(this.options.scroll); this.originalScrollLeft = where.left; this.originalScrollTop = where.top; } else { this.originalScrollLeft = this.options.scroll.scrollLeft; this.originalScrollTop = this.options.scroll.scrollTop; } } Draggables.notify('onStart', this, event); if(this.options.starteffect) this.options.starteffect(this.element); }, updateDrag: function(event, pointer) { if(!this.dragging) this.startDrag(event); if(!this.options.quiet){ Position.prepare(); Droppables.show(pointer, this.element); } Draggables.notify('onDrag', this, event); this.draw(pointer); if(this.options.change) this.options.change(this); if(this.options.scroll) { this.stopScrolling(); var p; if (this.options.scroll == window) { with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; } } else { p = Position.page(this.options.scroll); p[0] += this.options.scroll.scrollLeft + Position.deltaX; p[1] += this.options.scroll.scrollTop + Position.deltaY; p.push(p[0]+this.options.scroll.offsetWidth); p.push(p[1]+this.options.scroll.offsetHeight); } var speed = [0,0]; if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity); if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity); if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity); if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity); this.startScrolling(speed); } // fix AppleWebKit rendering if(Prototype.Browser.WebKit) window.scrollBy(0,0); Event.stop(event); }, finishDrag: function(event, success) { this.dragging = false; if(this.options.quiet){ Position.prepare(); var pointer = [Event.pointerX(event), Event.pointerY(event)]; Droppables.show(pointer, this.element); } if(this.options.ghosting) { if (!this.element._originallyAbsolute) Position.relativize(this.element); delete this.element._originallyAbsolute; Element.remove(this._clone); this._clone = null; } var dropped = false; if(success) { dropped = Droppables.fire(event, this.element); if (!dropped) dropped = false; } if(dropped && this.options.onDropped) this.options.onDropped(this.element); Draggables.notify('onEnd', this, event); var revert = this.options.revert; if(revert && Object.isFunction(revert)) revert = revert(this.element); var d = this.currentDelta(); if(revert && this.options.reverteffect) { if (dropped == 0 || revert != 'failure') this.options.reverteffect(this.element, d[1]-this.delta[1], d[0]-this.delta[0]); } else { this.delta = d; } if(this.options.zindex) this.element.style.zIndex = this.originalZ; if(this.options.endeffect) this.options.endeffect(this.element); Draggables.deactivate(this); Droppables.reset(); }, keyPress: function(event) { if(event.keyCode!=Event.KEY_ESC) return; this.finishDrag(event, false); Event.stop(event); }, endDrag: function(event) { if(!this.dragging) return; this.stopScrolling(); this.finishDrag(event, true); Event.stop(event); }, draw: function(point) { var pos = Position.cumulativeOffset(this.element); if(this.options.ghosting) { var r = Position.realOffset(this.element); pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY; } var d = this.currentDelta(); pos[0] -= d[0]; pos[1] -= d[1]; if(this.options.scroll && (this.options.scroll != window && this._isScrollChild)) { pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft; pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop; } var p = [0,1].map(function(i){ return (point[i]-pos[i]-this.offset[i]) }.bind(this)); if(this.options.snap) { if(Object.isFunction(this.options.snap)) { p = this.options.snap(p[0],p[1],this); } else { if(Object.isArray(this.options.snap)) { p = p.map( function(v, i) { return (v/this.options.snap[i]).round()*this.options.snap[i] }.bind(this)) } else { p = p.map( function(v) { return (v/this.options.snap).round()*this.options.snap }.bind(this)) } }} var style = this.element.style; if((!this.options.constraint) || (this.options.constraint=='horizontal')) style.left = p[0] + "px"; if((!this.options.constraint) || (this.options.constraint=='vertical')) style.top = p[1] + "px"; if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering }, stopScrolling: function() { if(this.scrollInterval) { clearInterval(this.scrollInterval); this.scrollInterval = null; Draggables._lastScrollPointer = null; } }, startScrolling: function(speed) { if(!(speed[0] || speed[1])) return; this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed]; this.lastScrolled = new Date(); this.scrollInterval = setInterval(this.scroll.bind(this), 10); }, scroll: function() { var current = new Date(); var delta = current - this.lastScrolled; this.lastScrolled = current; if(this.options.scroll == window) { with (this._getWindowScroll(this.options.scroll)) { if (this.scrollSpeed[0] || this.scrollSpeed[1]) { var d = delta / 1000; this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] ); } } } else { this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000; this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000; } Position.prepare(); Droppables.show(Draggables._lastPointer, this.element); Draggables.notify('onDrag', this); if (this._isScrollChild) { Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer); Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000; Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000; if (Draggables._lastScrollPointer[0] < 0) Draggables._lastScrollPointer[0] = 0; if (Draggables._lastScrollPointer[1] < 0) Draggables._lastScrollPointer[1] = 0; this.draw(Draggables._lastScrollPointer); } if(this.options.change) this.options.change(this); }, _getWindowScroll: function(w) { var T, L, W, H; with (w.document) { if (w.document.documentElement && documentElement.scrollTop) { T = documentElement.scrollTop; L = documentElement.scrollLeft; } else if (w.document.body) { T = body.scrollTop; L = body.scrollLeft; } if (w.innerWidth) { W = w.innerWidth; H = w.innerHeight; } else if (w.document.documentElement && documentElement.clientWidth) { W = documentElement.clientWidth; H = documentElement.clientHeight; } else { W = body.offsetWidth; H = body.offsetHeight } } return { top: T, left: L, width: W, height: H }; } }); Draggable._dragging = { }; /*--------------------------------------------------------------------------*/ var SortableObserver = Class.create({ initialize: function(element, observer) { this.element = $(element); this.observer = observer; this.lastValue = Sortable.serialize(this.element); }, onStart: function() { this.lastValue = Sortable.serialize(this.element); }, onEnd: function() { Sortable.unmark(); if(this.lastValue != Sortable.serialize(this.element)) this.observer(this.element) } }); var Sortable = { SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/, sortables: { }, _findRootElement: function(element) { while (element.tagName.toUpperCase() != "BODY") { if(element.id && Sortable.sortables[element.id]) return element; element = element.parentNode; } }, options: function(element) { element = Sortable._findRootElement($(element)); if(!element) return; return Sortable.sortables[element.id]; }, destroy: function(element){ var s = Sortable.options(element); if(s) { Draggables.removeObserver(s.element); s.droppables.each(function(d){ Droppables.remove(d) }); s.draggables.invoke('destroy'); delete Sortable.sortables[s.element.id]; } }, create: function(element) { element = $(element); var options = Object.extend({ element: element, tag: 'li', // assumes li children, override with tag: 'tagname' dropOnEmpty: false, tree: false, treeTag: 'ul', overlap: 'vertical', // one of 'vertical', 'horizontal' constraint: 'vertical', // one of 'vertical', 'horizontal', false containment: element, // also takes array of elements (or id's); or false handle: false, // or a CSS class only: false, delay: 0, hoverclass: null, ghosting: false, quiet: false, scroll: false, scrollSensitivity: 20, scrollSpeed: 15, format: this.SERIALIZE_RULE, // these take arrays of elements or ids and can be // used for better initialization performance elements: false, handles: false, onChange: Prototype.emptyFunction, onUpdate: Prototype.emptyFunction }, arguments[1] || { }); // clear any old sortable with same element this.destroy(element); // build options for the draggables var options_for_draggable = { revert: true, quiet: options.quiet, scroll: options.scroll, scrollSpeed: options.scrollSpeed, scrollSensitivity: options.scrollSensitivity, delay: options.delay, ghosting: options.ghosting, constraint: options.constraint, handle: options.handle }; if(options.starteffect) options_for_draggable.starteffect = options.starteffect; if(options.reverteffect) options_for_draggable.reverteffect = options.reverteffect; else if(options.ghosting) options_for_draggable.reverteffect = function(element) { element.style.top = 0; element.style.left = 0; }; if(options.endeffect) options_for_draggable.endeffect = options.endeffect; if(options.zindex) options_for_draggable.zindex = options.zindex; // build options for the droppables var options_for_droppable = { overlap: options.overlap, containment: options.containment, tree: options.tree, hoverclass: options.hoverclass, onHover: Sortable.onHover } var options_for_tree = { onHover: Sortable.onEmptyHover, overlap: options.overlap, containment: options.containment, hoverclass: options.hoverclass } // fix for gecko engine Element.cleanWhitespace(element); options.draggables = []; options.droppables = []; // drop on empty handling if(options.dropOnEmpty || options.tree) { Droppables.add(element, options_for_tree); options.droppables.push(element); } (options.elements || this.findElements(element, options) || []).each( function(e,i) { var handle = options.handles ? $(options.handles[i]) : (options.handle ? $(e).select('.' + options.handle)[0] : e); options.draggables.push( new Draggable(e, Object.extend(options_for_draggable, { handle: handle }))); Droppables.add(e, options_for_droppable); if(options.tree) e.treeNode = element; options.droppables.push(e); }); if(options.tree) { (Sortable.findTreeElements(element, options) || []).each( function(e) { Droppables.add(e, options_for_tree); e.treeNode = element; options.droppables.push(e); }); } // keep reference this.sortables[element.id] = options; // for onupdate Draggables.addObserver(new SortableObserver(element, options.onUpdate)); }, // return all suitable-for-sortable elements in a guaranteed order findElements: function(element, options) { return Element.findChildren( element, options.only, options.tree ? true : false, options.tag); }, findTreeElements: function(element, options) { return Element.findChildren( element, options.only, options.tree ? true : false, options.treeTag); }, onHover: function(element, dropon, overlap) { if(Element.isParent(dropon, element)) return; if(overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) { return; } else if(overlap>0.5) { Sortable.mark(dropon, 'before'); if(dropon.previousSibling != element) { var oldParentNode = element.parentNode; element.style.visibility = "hidden"; // fix gecko rendering dropon.parentNode.insertBefore(element, dropon); if(dropon.parentNode!=oldParentNode) Sortable.options(oldParentNode).onChange(element); Sortable.options(dropon.parentNode).onChange(element); } } else { Sortable.mark(dropon, 'after'); var nextElement = dropon.nextSibling || null; if(nextElement != element) { var oldParentNode = element.parentNode; element.style.visibility = "hidden"; // fix gecko rendering dropon.parentNode.insertBefore(element, nextElement); if(dropon.parentNode!=oldParentNode) Sortable.options(oldParentNode).onChange(element); Sortable.options(dropon.parentNode).onChange(element); } } }, onEmptyHover: function(element, dropon, overlap) { var oldParentNode = element.parentNode; var droponOptions = Sortable.options(dropon); if(!Element.isParent(dropon, element)) { var index; var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only}); var child = null; if(children) { var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap); for (index = 0; index < children.length; index += 1) { if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) { offset -= Element.offsetSize (children[index], droponOptions.overlap); } else if (offset - (Element.offsetSize (children[index], droponOptions.overlap) / 2) >= 0) { child = index + 1 < children.length ? children[index + 1] : null; break; } else { child = children[index]; break; } } } dropon.insertBefore(element, child); Sortable.options(oldParentNode).onChange(element); droponOptions.onChange(element); } }, unmark: function() { if(Sortable._marker) Sortable._marker.hide(); }, mark: function(dropon, position) { // mark on ghosting only var sortable = Sortable.options(dropon.parentNode); if(sortable && !sortable.ghosting) return; if(!Sortable._marker) { Sortable._marker = ($('dropmarker') || Element.extend(document.createElement('DIV'))). hide().addClassName('dropmarker').setStyle({position:'absolute'}); document.getElementsByTagName("body").item(0).appendChild(Sortable._marker); } var offsets = Position.cumulativeOffset(dropon); Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'}); if(position=='after') if(sortable.overlap == 'horizontal') Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'}); else Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'}); Sortable._marker.show(); }, _tree: function(element, options, parent) { var children = Sortable.findElements(element, options) || []; for (var i = 0; i < children.length; ++i) { var match = children[i].id.match(options.format); if (!match) continue; var child = { id: encodeURIComponent(match ? match[1] : null), element: element, parent: parent, children: [], position: parent.children.length, container: $(children[i]).down(options.treeTag) } /* Get the element containing the children and recurse over it */ if (child.container) this._tree(child.container, options, child) parent.children.push (child); } return parent; }, tree: function(element) { element = $(element); var sortableOptions = this.options(element); var options = Object.extend({ tag: sortableOptions.tag, treeTag: sortableOptions.treeTag, only: sortableOptions.only, name: element.id, format: sortableOptions.format }, arguments[1] || { }); var root = { id: null, parent: null, children: [], container: element, position: 0 } return Sortable._tree(element, options, root); }, /* Construct a [i] index for a particular node */ _constructIndex: function(node) { var index = ''; do { if (node.id) index = '[' + node.position + ']' + index; } while ((node = node.parent) != null); return index; }, sequence: function(element) { element = $(element); var options = Object.extend(this.options(element), arguments[1] || { }); return $(this.findElements(element, options) || []).map( function(item) { return item.id.match(options.format) ? item.id.match(options.format)[1] : ''; }); }, setSequence: function(element, new_sequence) { element = $(element); var options = Object.extend(this.options(element), arguments[2] || { }); var nodeMap = { }; this.findElements(element, options).each( function(n) { if (n.id.match(options.format)) nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode]; n.parentNode.removeChild(n); }); new_sequence.each(function(ident) { var n = nodeMap[ident]; if (n) { n[1].appendChild(n[0]); delete nodeMap[ident]; } }); }, serialize: function(element) { element = $(element); var options = Object.extend(Sortable.options(element), arguments[1] || { }); var name = encodeURIComponent( (arguments[1] && arguments[1].name) ? arguments[1].name : element.id); if (options.tree) { return Sortable.tree(element, arguments[1]).children.map( function (item) { return [name + Sortable._constructIndex(item) + "[id]=" + encodeURIComponent(item.id)].concat(item.children.map(arguments.callee)); }).flatten().join('&'); } else { return Sortable.sequence(element, arguments[1]).map( function(item) { return name + "[]=" + encodeURIComponent(item); }).join('&'); } } } // Returns true if child is contained within element Element.isParent = function(child, element) { if (!child.parentNode || child == element) return false; if (child.parentNode == element) return true; return Element.isParent(child.parentNode, element); } Element.findChildren = function(element, only, recursive, tagName) { if(!element.hasChildNodes()) return null; tagName = tagName.toUpperCase(); if(only) only = [only].flatten(); var elements = []; $A(element.childNodes).each( function(e) { if(e.tagName && e.tagName.toUpperCase()==tagName && (!only || (Element.classNames(e).detect(function(v) { return only.include(v) })))) elements.push(e); if(recursive) { var grandchildren = Element.findChildren(e, only, recursive, tagName); if(grandchildren) elements.push(grandchildren); } }); return (elements.length>0 ? elements.flatten() : []); } Element.offsetSize = function (element, type) { return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')]; } �������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/scriptaculous/slider.js�������������������������������������������������������0000644�0001066�0001066�00000024070�10762616541�016603� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// script.aculo.us slider.js v1.8.0, Tue Nov 06 15:01:40 +0300 2007 // Copyright (c) 2005-2007 Marty Haught, Thomas Fuchs // // script.aculo.us is freely distributable under the terms of an MIT-style license. // For details, see the script.aculo.us web site: http://script.aculo.us/ if (!Control) var Control = { }; // options: // axis: 'vertical', or 'horizontal' (default) // // callbacks: // onChange(value) // onSlide(value) Control.Slider = Class.create({ initialize: function(handle, track, options) { var slider = this; if (Object.isArray(handle)) { this.handles = handle.collect( function(e) { return $(e) }); } else { this.handles = [$(handle)]; } this.track = $(track); this.options = options || { }; this.axis = this.options.axis || 'horizontal'; this.increment = this.options.increment || 1; this.step = parseInt(this.options.step || '1'); this.range = this.options.range || $R(0,1); this.value = 0; // assure backwards compat this.values = this.handles.map( function() { return 0 }); this.spans = this.options.spans ? this.options.spans.map(function(s){ return $(s) }) : false; this.options.startSpan = $(this.options.startSpan || null); this.options.endSpan = $(this.options.endSpan || null); this.restricted = this.options.restricted || false; this.maximum = this.options.maximum || this.range.end; this.minimum = this.options.minimum || this.range.start; // Will be used to align the handle onto the track, if necessary this.alignX = parseInt(this.options.alignX || '0'); this.alignY = parseInt(this.options.alignY || '0'); this.trackLength = this.maximumOffset() - this.minimumOffset(); this.handleLength = this.isVertical() ? (this.handles[0].offsetHeight != 0 ? this.handles[0].offsetHeight : this.handles[0].style.height.replace(/px$/,"")) : (this.handles[0].offsetWidth != 0 ? this.handles[0].offsetWidth : this.handles[0].style.width.replace(/px$/,"")); this.active = false; this.dragging = false; this.disabled = false; if (this.options.disabled) this.setDisabled(); // Allowed values array this.allowedValues = this.options.values ? this.options.values.sortBy(Prototype.K) : false; if (this.allowedValues) { this.minimum = this.allowedValues.min(); this.maximum = this.allowedValues.max(); } this.eventMouseDown = this.startDrag.bindAsEventListener(this); this.eventMouseUp = this.endDrag.bindAsEventListener(this); this.eventMouseMove = this.update.bindAsEventListener(this); // Initialize handles in reverse (make sure first handle is active) this.handles.each( function(h,i) { i = slider.handles.length-1-i; slider.setValue(parseFloat( (Object.isArray(slider.options.sliderValue) ? slider.options.sliderValue[i] : slider.options.sliderValue) || slider.range.start), i); h.makePositioned().observe("mousedown", slider.eventMouseDown); }); this.track.observe("mousedown", this.eventMouseDown); document.observe("mouseup", this.eventMouseUp); document.observe("mousemove", this.eventMouseMove); this.initialized = true; }, dispose: function() { var slider = this; Event.stopObserving(this.track, "mousedown", this.eventMouseDown); Event.stopObserving(document, "mouseup", this.eventMouseUp); Event.stopObserving(document, "mousemove", this.eventMouseMove); this.handles.each( function(h) { Event.stopObserving(h, "mousedown", slider.eventMouseDown); }); }, setDisabled: function(){ this.disabled = true; }, setEnabled: function(){ this.disabled = false; }, getNearestValue: function(value){ if (this.allowedValues){ if (value >= this.allowedValues.max()) return(this.allowedValues.max()); if (value <= this.allowedValues.min()) return(this.allowedValues.min()); var offset = Math.abs(this.allowedValues[0] - value); var newValue = this.allowedValues[0]; this.allowedValues.each( function(v) { var currentOffset = Math.abs(v - value); if (currentOffset <= offset){ newValue = v; offset = currentOffset; } }); return newValue; } if (value > this.range.end) return this.range.end; if (value < this.range.start) return this.range.start; return value; }, setValue: function(sliderValue, handleIdx){ if (!this.active) { this.activeHandleIdx = handleIdx || 0; this.activeHandle = this.handles[this.activeHandleIdx]; this.updateStyles(); } handleIdx = handleIdx || this.activeHandleIdx || 0; if (this.initialized && this.restricted) { if ((handleIdx>0) && (sliderValue<this.values[handleIdx-1])) sliderValue = this.values[handleIdx-1]; if ((handleIdx < (this.handles.length-1)) && (sliderValue>this.values[handleIdx+1])) sliderValue = this.values[handleIdx+1]; } sliderValue = this.getNearestValue(sliderValue); this.values[handleIdx] = sliderValue; this.value = this.values[0]; // assure backwards compat this.handles[handleIdx].style[this.isVertical() ? 'top' : 'left'] = this.translateToPx(sliderValue); this.drawSpans(); if (!this.dragging || !this.event) this.updateFinished(); }, setValueBy: function(delta, handleIdx) { this.setValue(this.values[handleIdx || this.activeHandleIdx || 0] + delta, handleIdx || this.activeHandleIdx || 0); }, translateToPx: function(value) { return Math.round( ((this.trackLength-this.handleLength)/(this.range.end-this.range.start)) * (value - this.range.start)) + "px"; }, translateToValue: function(offset) { return ((offset/(this.trackLength-this.handleLength) * (this.range.end-this.range.start)) + this.range.start); }, getRange: function(range) { var v = this.values.sortBy(Prototype.K); range = range || 0; return $R(v[range],v[range+1]); }, minimumOffset: function(){ return(this.isVertical() ? this.alignY : this.alignX); }, maximumOffset: function(){ return(this.isVertical() ? (this.track.offsetHeight != 0 ? this.track.offsetHeight : this.track.style.height.replace(/px$/,"")) - this.alignY : (this.track.offsetWidth != 0 ? this.track.offsetWidth : this.track.style.width.replace(/px$/,"")) - this.alignX); }, isVertical: function(){ return (this.axis == 'vertical'); }, drawSpans: function() { var slider = this; if (this.spans) $R(0, this.spans.length-1).each(function(r) { slider.setSpan(slider.spans[r], slider.getRange(r)) }); if (this.options.startSpan) this.setSpan(this.options.startSpan, $R(0, this.values.length>1 ? this.getRange(0).min() : this.value )); if (this.options.endSpan) this.setSpan(this.options.endSpan, $R(this.values.length>1 ? this.getRange(this.spans.length-1).max() : this.value, this.maximum)); }, setSpan: function(span, range) { if (this.isVertical()) { span.style.top = this.translateToPx(range.start); span.style.height = this.translateToPx(range.end - range.start + this.range.start); } else { span.style.left = this.translateToPx(range.start); span.style.width = this.translateToPx(range.end - range.start + this.range.start); } }, updateStyles: function() { this.handles.each( function(h){ Element.removeClassName(h, 'selected') }); Element.addClassName(this.activeHandle, 'selected'); }, startDrag: function(event) { if (Event.isLeftClick(event)) { if (!this.disabled){ this.active = true; var handle = Event.element(event); var pointer = [Event.pointerX(event), Event.pointerY(event)]; var track = handle; if (track==this.track) { var offsets = Position.cumulativeOffset(this.track); this.event = event; this.setValue(this.translateToValue( (this.isVertical() ? pointer[1]-offsets[1] : pointer[0]-offsets[0])-(this.handleLength/2) )); var offsets = Position.cumulativeOffset(this.activeHandle); this.offsetX = (pointer[0] - offsets[0]); this.offsetY = (pointer[1] - offsets[1]); } else { // find the handle (prevents issues with Safari) while((this.handles.indexOf(handle) == -1) && handle.parentNode) handle = handle.parentNode; if (this.handles.indexOf(handle)!=-1) { this.activeHandle = handle; this.activeHandleIdx = this.handles.indexOf(this.activeHandle); this.updateStyles(); var offsets = Position.cumulativeOffset(this.activeHandle); this.offsetX = (pointer[0] - offsets[0]); this.offsetY = (pointer[1] - offsets[1]); } } } Event.stop(event); } }, update: function(event) { if (this.active) { if (!this.dragging) this.dragging = true; this.draw(event); if (Prototype.Browser.WebKit) window.scrollBy(0,0); Event.stop(event); } }, draw: function(event) { var pointer = [Event.pointerX(event), Event.pointerY(event)]; var offsets = Position.cumulativeOffset(this.track); pointer[0] -= this.offsetX + offsets[0]; pointer[1] -= this.offsetY + offsets[1]; this.event = event; this.setValue(this.translateToValue( this.isVertical() ? pointer[1] : pointer[0] )); if (this.initialized && this.options.onSlide) this.options.onSlide(this.values.length>1 ? this.values : this.value, this); }, endDrag: function(event) { if (this.active && this.dragging) { this.finishDrag(event, true); Event.stop(event); } this.active = false; this.dragging = false; }, finishDrag: function(event, success) { this.active = false; this.dragging = false; this.updateFinished(); }, updateFinished: function() { if (this.initialized && this.options.onChange) this.options.onChange(this.values.length>1 ? this.values : this.value, this); this.event = null; } }); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/scriptaculous/sound.js��������������������������������������������������������0000644�0001066�0001066�00000003600�10762616541�016445� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// script.aculo.us sound.js v1.8.0, Tue Nov 06 15:01:40 +0300 2007 // Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) // // Based on code created by Jules Gravinese (http://www.webveteran.com/) // // script.aculo.us is freely distributable under the terms of an MIT-style license. // For details, see the script.aculo.us web site: http://script.aculo.us/ Sound = { tracks: {}, _enabled: true, template: new Template('<embed style="height:0" id="sound_#{track}_#{id}" src="#{url}" loop="false" autostart="true" hidden="true"/>'), enable: function(){ Sound._enabled = true; }, disable: function(){ Sound._enabled = false; }, play: function(url){ if(!Sound._enabled) return; var options = Object.extend({ track: 'global', url: url, replace: false }, arguments[1] || {}); if(options.replace && this.tracks[options.track]) { $R(0, this.tracks[options.track].id).each(function(id){ var sound = $('sound_'+options.track+'_'+id); sound.Stop && sound.Stop(); sound.remove(); }) this.tracks[options.track] = null; } if(!this.tracks[options.track]) this.tracks[options.track] = { id: 0 } else this.tracks[options.track].id++; options.id = this.tracks[options.track].id; $$('body')[0].insert( Prototype.Browser.IE ? new Element('bgsound',{ id: 'sound_'+options.track+'_'+options.id, src: options.url, loop: 1, autostart: true }) : Sound.template.evaluate(options)); } }; if(Prototype.Browser.Gecko && navigator.userAgent.indexOf("Win") > 0){ if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('QuickTime') != -1 })) Sound.template = new Template('<object id="sound_#{track}_#{id}" width="0" height="0" type="audio/mpeg" data="#{url}"/>') else Sound.play = function(){} } ��������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/scriptaculous/controls.js�����������������������������������������������������0000644�0001066�0001066�00000104157�10762616541�017171� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// script.aculo.us controls.js v1.8.0, Tue Nov 06 15:01:40 +0300 2007 // Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) // (c) 2005-2007 Ivan Krstic (http://blogs.law.harvard.edu/ivan) // (c) 2005-2007 Jon Tirsen (http://www.tirsen.com) // Contributors: // Richard Livsey // Rahul Bhargava // Rob Wills // // script.aculo.us is freely distributable under the terms of an MIT-style license. // For details, see the script.aculo.us web site: http://script.aculo.us/ // Autocompleter.Base handles all the autocompletion functionality // that's independent of the data source for autocompletion. This // includes drawing the autocompletion menu, observing keyboard // and mouse events, and similar. // // Specific autocompleters need to provide, at the very least, // a getUpdatedChoices function that will be invoked every time // the text inside the monitored textbox changes. This method // should get the text for which to provide autocompletion by // invoking this.getToken(), NOT by directly accessing // this.element.value. This is to allow incremental tokenized // autocompletion. Specific auto-completion logic (AJAX, etc) // belongs in getUpdatedChoices. // // Tokenized incremental autocompletion is enabled automatically // when an autocompleter is instantiated with the 'tokens' option // in the options parameter, e.g.: // new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' }); // will incrementally autocomplete with a comma as the token. // Additionally, ',' in the above example can be replaced with // a token array, e.g. { tokens: [',', '\n'] } which // enables autocompletion on multiple tokens. This is most // useful when one of the tokens is \n (a newline), as it // allows smart autocompletion after linebreaks. if(typeof Effect == 'undefined') throw("controls.js requires including script.aculo.us' effects.js library"); var Autocompleter = { } Autocompleter.Base = Class.create({ baseInitialize: function(element, update, options) { element = $(element) this.element = element; this.update = $(update); this.hasFocus = false; this.changed = false; this.active = false; this.index = 0; this.entryCount = 0; this.oldElementValue = this.element.value; if(this.setOptions) this.setOptions(options); else this.options = options || { }; this.options.paramName = this.options.paramName || this.element.name; this.options.tokens = this.options.tokens || []; this.options.frequency = this.options.frequency || 0.4; this.options.minChars = this.options.minChars || 1; this.options.onShow = this.options.onShow || function(element, update){ if(!update.style.position || update.style.position=='absolute') { update.style.position = 'absolute'; Position.clone(element, update, { setHeight: false, offsetTop: element.offsetHeight }); } Effect.Appear(update,{duration:0.15}); }; this.options.onHide = this.options.onHide || function(element, update){ new Effect.Fade(update,{duration:0.15}) }; if(typeof(this.options.tokens) == 'string') this.options.tokens = new Array(this.options.tokens); // Force carriage returns as token delimiters anyway if (!this.options.tokens.include('\n')) this.options.tokens.push('\n'); this.observer = null; this.element.setAttribute('autocomplete','off'); Element.hide(this.update); Event.observe(this.element, 'blur', this.onBlur.bindAsEventListener(this)); Event.observe(this.element, 'keypress', this.onKeyPress.bindAsEventListener(this)); }, show: function() { if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update); if(!this.iefix && (Prototype.Browser.IE) && (Element.getStyle(this.update, 'position')=='absolute')) { new Insertion.After(this.update, '<iframe id="' + this.update.id + '_iefix" '+ 'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' + 'src="javascript:false;" frameborder="0" scrolling="no"></iframe>'); this.iefix = $(this.update.id+'_iefix'); } if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50); }, fixIEOverlapping: function() { Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)}); this.iefix.style.zIndex = 1; this.update.style.zIndex = 2; Element.show(this.iefix); }, hide: function() { this.stopIndicator(); if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update); if(this.iefix) Element.hide(this.iefix); }, startIndicator: function() { if(this.options.indicator) Element.show(this.options.indicator); }, stopIndicator: function() { if(this.options.indicator) Element.hide(this.options.indicator); }, onKeyPress: function(event) { if(this.active) switch(event.keyCode) { case Event.KEY_TAB: case Event.KEY_RETURN: this.selectEntry(); Event.stop(event); case Event.KEY_ESC: this.hide(); this.active = false; Event.stop(event); return; case Event.KEY_LEFT: case Event.KEY_RIGHT: return; case Event.KEY_UP: this.markPrevious(); this.render(); if(Prototype.Browser.WebKit) Event.stop(event); return; case Event.KEY_DOWN: this.markNext(); this.render(); if(Prototype.Browser.WebKit) Event.stop(event); return; } else if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN || (Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return; this.changed = true; this.hasFocus = true; if(this.observer) clearTimeout(this.observer); this.observer = setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000); }, activate: function() { this.changed = false; this.hasFocus = true; this.getUpdatedChoices(); }, onHover: function(event) { var element = Event.findElement(event, 'LI'); if(this.index != element.autocompleteIndex) { this.index = element.autocompleteIndex; this.render(); } Event.stop(event); }, onClick: function(event) { var element = Event.findElement(event, 'LI'); this.index = element.autocompleteIndex; this.selectEntry(); this.hide(); }, onBlur: function(event) { // needed to make click events working setTimeout(this.hide.bind(this), 250); this.hasFocus = false; this.active = false; }, render: function() { if(this.entryCount > 0) { for (var i = 0; i < this.entryCount; i++) this.index==i ? Element.addClassName(this.getEntry(i),"selected") : Element.removeClassName(this.getEntry(i),"selected"); if(this.hasFocus) { this.show(); this.active = true; } } else { this.active = false; this.hide(); } }, markPrevious: function() { if(this.index > 0) this.index-- else this.index = this.entryCount-1; this.getEntry(this.index).scrollIntoView(true); }, markNext: function() { if(this.index < this.entryCount-1) this.index++ else this.index = 0; this.getEntry(this.index).scrollIntoView(false); }, getEntry: function(index) { return this.update.firstChild.childNodes[index]; }, getCurrentEntry: function() { return this.getEntry(this.index); }, selectEntry: function() { this.active = false; this.updateElement(this.getCurrentEntry()); }, updateElement: function(selectedElement) { if (this.options.updateElement) { this.options.updateElement(selectedElement); return; } var value = ''; if (this.options.select) { var nodes = $(selectedElement).select('.' + this.options.select) || []; if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select); } else value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal'); var bounds = this.getTokenBounds(); if (bounds[0] != -1) { var newValue = this.element.value.substr(0, bounds[0]); var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/); if (whitespace) newValue += whitespace[0]; this.element.value = newValue + value + this.element.value.substr(bounds[1]); } else { this.element.value = value; } this.oldElementValue = this.element.value; this.element.focus(); if (this.options.afterUpdateElement) this.options.afterUpdateElement(this.element, selectedElement); }, updateChoices: function(choices) { if(!this.changed && this.hasFocus) { this.update.innerHTML = choices; Element.cleanWhitespace(this.update); Element.cleanWhitespace(this.update.down()); if(this.update.firstChild && this.update.down().childNodes) { this.entryCount = this.update.down().childNodes.length; for (var i = 0; i < this.entryCount; i++) { var entry = this.getEntry(i); entry.autocompleteIndex = i; this.addObservers(entry); } } else { this.entryCount = 0; } this.stopIndicator(); this.index = 0; if(this.entryCount==1 && this.options.autoSelect) { this.selectEntry(); this.hide(); } else { this.render(); } } }, addObservers: function(element) { Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this)); Event.observe(element, "click", this.onClick.bindAsEventListener(this)); }, onObserverEvent: function() { this.changed = false; this.tokenBounds = null; if(this.getToken().length>=this.options.minChars) { this.getUpdatedChoices(); } else { this.active = false; this.hide(); } this.oldElementValue = this.element.value; }, getToken: function() { var bounds = this.getTokenBounds(); return this.element.value.substring(bounds[0], bounds[1]).strip(); }, getTokenBounds: function() { if (null != this.tokenBounds) return this.tokenBounds; var value = this.element.value; if (value.strip().empty()) return [-1, 0]; var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue); var offset = (diff == this.oldElementValue.length ? 1 : 0); var prevTokenPos = -1, nextTokenPos = value.length; var tp; for (var index = 0, l = this.options.tokens.length; index < l; ++index) { tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1); if (tp > prevTokenPos) prevTokenPos = tp; tp = value.indexOf(this.options.tokens[index], diff + offset); if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp; } return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]); } }); Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos = function(newS, oldS) { var boundary = Math.min(newS.length, oldS.length); for (var index = 0; index < boundary; ++index) if (newS[index] != oldS[index]) return index; return boundary; }; Ajax.Autocompleter = Class.create(Autocompleter.Base, { initialize: function(element, update, url, options) { this.baseInitialize(element, update, options); this.options.asynchronous = true; this.options.onComplete = this.onComplete.bind(this); this.options.defaultParams = this.options.parameters || null; this.url = url; }, getUpdatedChoices: function() { this.startIndicator(); var entry = encodeURIComponent(this.options.paramName) + '=' + encodeURIComponent(this.getToken()); this.options.parameters = this.options.callback ? this.options.callback(this.element, entry) : entry; if(this.options.defaultParams) this.options.parameters += '&' + this.options.defaultParams; new Ajax.Request(this.url, this.options); }, onComplete: function(request) { this.updateChoices(request.responseText); } }); // The local array autocompleter. Used when you'd prefer to // inject an array of autocompletion options into the page, rather // than sending out Ajax queries, which can be quite slow sometimes. // // The constructor takes four parameters. The first two are, as usual, // the id of the monitored textbox, and id of the autocompletion menu. // The third is the array you want to autocomplete from, and the fourth // is the options block. // // Extra local autocompletion options: // - choices - How many autocompletion choices to offer // // - partialSearch - If false, the autocompleter will match entered // text only at the beginning of strings in the // autocomplete array. Defaults to true, which will // match text at the beginning of any *word* in the // strings in the autocomplete array. If you want to // search anywhere in the string, additionally set // the option fullSearch to true (default: off). // // - fullSsearch - Search anywhere in autocomplete array strings. // // - partialChars - How many characters to enter before triggering // a partial match (unlike minChars, which defines // how many characters are required to do any match // at all). Defaults to 2. // // - ignoreCase - Whether to ignore case when autocompleting. // Defaults to true. // // It's possible to pass in a custom function as the 'selector' // option, if you prefer to write your own autocompletion logic. // In that case, the other options above will not apply unless // you support them. Autocompleter.Local = Class.create(Autocompleter.Base, { initialize: function(element, update, array, options) { this.baseInitialize(element, update, options); this.options.array = array; }, getUpdatedChoices: function() { this.updateChoices(this.options.selector(this)); }, setOptions: function(options) { this.options = Object.extend({ choices: 10, partialSearch: true, partialChars: 2, ignoreCase: true, fullSearch: false, selector: function(instance) { var ret = []; // Beginning matches var partial = []; // Inside matches var entry = instance.getToken(); var count = 0; for (var i = 0; i < instance.options.array.length && ret.length < instance.options.choices ; i++) { var elem = instance.options.array[i]; var foundPos = instance.options.ignoreCase ? elem.toLowerCase().indexOf(entry.toLowerCase()) : elem.indexOf(entry); while (foundPos != -1) { if (foundPos == 0 && elem.length != entry.length) { ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" + elem.substr(entry.length) + "</li>"); break; } else if (entry.length >= instance.options.partialChars && instance.options.partialSearch && foundPos != -1) { if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) { partial.push("<li>" + elem.substr(0, foundPos) + "<strong>" + elem.substr(foundPos, entry.length) + "</strong>" + elem.substr( foundPos + entry.length) + "</li>"); break; } } foundPos = instance.options.ignoreCase ? elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) : elem.indexOf(entry, foundPos + 1); } } if (partial.length) ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) return "<ul>" + ret.join('') + "</ul>"; } }, options || { }); } }); // AJAX in-place editor and collection editor // Full rewrite by Christophe Porteneuve <tdd@tddsworld.com> (April 2007). // Use this if you notice weird scrolling problems on some browsers, // the DOM might be a bit confused when this gets called so do this // waits 1 ms (with setTimeout) until it does the activation Field.scrollFreeActivate = function(field) { setTimeout(function() { Field.activate(field); }, 1); } Ajax.InPlaceEditor = Class.create({ initialize: function(element, url, options) { this.url = url; this.element = element = $(element); this.prepareOptions(); this._controls = { }; arguments.callee.dealWithDeprecatedOptions(options); // DEPRECATION LAYER!!! Object.extend(this.options, options || { }); if (!this.options.formId && this.element.id) { this.options.formId = this.element.id + '-inplaceeditor'; if ($(this.options.formId)) this.options.formId = ''; } if (this.options.externalControl) this.options.externalControl = $(this.options.externalControl); if (!this.options.externalControl) this.options.externalControlOnly = false; this._originalBackground = this.element.getStyle('background-color') || 'transparent'; this.element.title = this.options.clickToEditText; this._boundCancelHandler = this.handleFormCancellation.bind(this); this._boundComplete = (this.options.onComplete || Prototype.emptyFunction).bind(this); this._boundFailureHandler = this.handleAJAXFailure.bind(this); this._boundSubmitHandler = this.handleFormSubmission.bind(this); this._boundWrapperHandler = this.wrapUp.bind(this); this.registerListeners(); }, checkForEscapeOrReturn: function(e) { if (!this._editing || e.ctrlKey || e.altKey || e.shiftKey) return; if (Event.KEY_ESC == e.keyCode) this.handleFormCancellation(e); else if (Event.KEY_RETURN == e.keyCode) this.handleFormSubmission(e); }, createControl: function(mode, handler, extraClasses) { var control = this.options[mode + 'Control']; var text = this.options[mode + 'Text']; if ('button' == control) { var btn = document.createElement('input'); btn.type = 'submit'; btn.value = text; btn.className = 'editor_' + mode + '_button'; if ('cancel' == mode) btn.onclick = this._boundCancelHandler; this._form.appendChild(btn); this._controls[mode] = btn; } else if ('link' == control) { var link = document.createElement('a'); link.href = '#'; link.appendChild(document.createTextNode(text)); link.onclick = 'cancel' == mode ? this._boundCancelHandler : this._boundSubmitHandler; link.className = 'editor_' + mode + '_link'; if (extraClasses) link.className += ' ' + extraClasses; this._form.appendChild(link); this._controls[mode] = link; } }, createEditField: function() { var text = (this.options.loadTextURL ? this.options.loadingText : this.getText()); var fld; if (1 >= this.options.rows && !/\r|\n/.test(this.getText())) { fld = document.createElement('input'); fld.type = 'text'; var size = this.options.size || this.options.cols || 0; if (0 < size) fld.size = size; } else { fld = document.createElement('textarea'); fld.rows = (1 >= this.options.rows ? this.options.autoRows : this.options.rows); fld.cols = this.options.cols || 40; } fld.name = this.options.paramName; fld.value = text; // No HTML breaks conversion anymore fld.className = 'editor_field'; if (this.options.submitOnBlur) fld.onblur = this._boundSubmitHandler; this._controls.editor = fld; if (this.options.loadTextURL) this.loadExternalText(); this._form.appendChild(this._controls.editor); }, createForm: function() { var ipe = this; function addText(mode, condition) { var text = ipe.options['text' + mode + 'Controls']; if (!text || condition === false) return; ipe._form.appendChild(document.createTextNode(text)); }; this._form = $(document.createElement('form')); this._form.id = this.options.formId; this._form.addClassName(this.options.formClassName); this._form.onsubmit = this._boundSubmitHandler; this.createEditField(); if ('textarea' == this._controls.editor.tagName.toLowerCase()) this._form.appendChild(document.createElement('br')); if (this.options.onFormCustomization) this.options.onFormCustomization(this, this._form); addText('Before', this.options.okControl || this.options.cancelControl); this.createControl('ok', this._boundSubmitHandler); addText('Between', this.options.okControl && this.options.cancelControl); this.createControl('cancel', this._boundCancelHandler, 'editor_cancel'); addText('After', this.options.okControl || this.options.cancelControl); }, destroy: function() { if (this._oldInnerHTML) this.element.innerHTML = this._oldInnerHTML; this.leaveEditMode(); this.unregisterListeners(); }, enterEditMode: function(e) { if (this._saving || this._editing) return; this._editing = true; this.triggerCallback('onEnterEditMode'); if (this.options.externalControl) this.options.externalControl.hide(); this.element.hide(); this.createForm(); this.element.parentNode.insertBefore(this._form, this.element); if (!this.options.loadTextURL) this.postProcessEditField(); if (e) Event.stop(e); }, enterHover: function(e) { if (this.options.hoverClassName) this.element.addClassName(this.options.hoverClassName); if (this._saving) return; this.triggerCallback('onEnterHover'); }, getText: function() { return this.element.innerHTML; }, handleAJAXFailure: function(transport) { this.triggerCallback('onFailure', transport); if (this._oldInnerHTML) { this.element.innerHTML = this._oldInnerHTML; this._oldInnerHTML = null; } }, handleFormCancellation: function(e) { this.wrapUp(); if (e) Event.stop(e); }, handleFormSubmission: function(e) { var form = this._form; var value = $F(this._controls.editor); this.prepareSubmission(); var params = this.options.callback(form, value) || ''; if (Object.isString(params)) params = params.toQueryParams(); params.editorId = this.element.id; if (this.options.htmlResponse) { var options = Object.extend({ evalScripts: true }, this.options.ajaxOptions); Object.extend(options, { parameters: params, onComplete: this._boundWrapperHandler, onFailure: this._boundFailureHandler }); new Ajax.Updater({ success: this.element }, this.url, options); } else { var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); Object.extend(options, { parameters: params, onComplete: this._boundWrapperHandler, onFailure: this._boundFailureHandler }); new Ajax.Request(this.url, options); } if (e) Event.stop(e); }, leaveEditMode: function() { this.element.removeClassName(this.options.savingClassName); this.removeForm(); this.leaveHover(); this.element.style.backgroundColor = this._originalBackground; this.element.show(); if (this.options.externalControl) this.options.externalControl.show(); this._saving = false; this._editing = false; this._oldInnerHTML = null; this.triggerCallback('onLeaveEditMode'); }, leaveHover: function(e) { if (this.options.hoverClassName) this.element.removeClassName(this.options.hoverClassName); if (this._saving) return; this.triggerCallback('onLeaveHover'); }, loadExternalText: function() { this._form.addClassName(this.options.loadingClassName); this._controls.editor.disabled = true; var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); Object.extend(options, { parameters: 'editorId=' + encodeURIComponent(this.element.id), onComplete: Prototype.emptyFunction, onSuccess: function(transport) { this._form.removeClassName(this.options.loadingClassName); var text = transport.responseText; if (this.options.stripLoadedTextTags) text = text.stripTags(); this._controls.editor.value = text; this._controls.editor.disabled = false; this.postProcessEditField(); }.bind(this), onFailure: this._boundFailureHandler }); new Ajax.Request(this.options.loadTextURL, options); }, postProcessEditField: function() { var fpc = this.options.fieldPostCreation; if (fpc) $(this._controls.editor)['focus' == fpc ? 'focus' : 'activate'](); }, prepareOptions: function() { this.options = Object.clone(Ajax.InPlaceEditor.DefaultOptions); Object.extend(this.options, Ajax.InPlaceEditor.DefaultCallbacks); [this._extraDefaultOptions].flatten().compact().each(function(defs) { Object.extend(this.options, defs); }.bind(this)); }, prepareSubmission: function() { this._saving = true; this.removeForm(); this.leaveHover(); this.showSaving(); }, registerListeners: function() { this._listeners = { }; var listener; $H(Ajax.InPlaceEditor.Listeners).each(function(pair) { listener = this[pair.value].bind(this); this._listeners[pair.key] = listener; if (!this.options.externalControlOnly) this.element.observe(pair.key, listener); if (this.options.externalControl) this.options.externalControl.observe(pair.key, listener); }.bind(this)); }, removeForm: function() { if (!this._form) return; this._form.remove(); this._form = null; this._controls = { }; }, showSaving: function() { this._oldInnerHTML = this.element.innerHTML; this.element.innerHTML = this.options.savingText; this.element.addClassName(this.options.savingClassName); this.element.style.backgroundColor = this._originalBackground; this.element.show(); }, triggerCallback: function(cbName, arg) { if ('function' == typeof this.options[cbName]) { this.options[cbName](this, arg); } }, unregisterListeners: function() { $H(this._listeners).each(function(pair) { if (!this.options.externalControlOnly) this.element.stopObserving(pair.key, pair.value); if (this.options.externalControl) this.options.externalControl.stopObserving(pair.key, pair.value); }.bind(this)); }, wrapUp: function(transport) { this.leaveEditMode(); // Can't use triggerCallback due to backward compatibility: requires // binding + direct element this._boundComplete(transport, this.element); } }); Object.extend(Ajax.InPlaceEditor.prototype, { dispose: Ajax.InPlaceEditor.prototype.destroy }); Ajax.InPlaceCollectionEditor = Class.create(Ajax.InPlaceEditor, { initialize: function($super, element, url, options) { this._extraDefaultOptions = Ajax.InPlaceCollectionEditor.DefaultOptions; $super(element, url, options); }, createEditField: function() { var list = document.createElement('select'); list.name = this.options.paramName; list.size = 1; this._controls.editor = list; this._collection = this.options.collection || []; if (this.options.loadCollectionURL) this.loadCollection(); else this.checkForExternalText(); this._form.appendChild(this._controls.editor); }, loadCollection: function() { this._form.addClassName(this.options.loadingClassName); this.showLoadingText(this.options.loadingCollectionText); var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); Object.extend(options, { parameters: 'editorId=' + encodeURIComponent(this.element.id), onComplete: Prototype.emptyFunction, onSuccess: function(transport) { var js = transport.responseText.strip(); if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check throw 'Server returned an invalid collection representation.'; this._collection = eval(js); this.checkForExternalText(); }.bind(this), onFailure: this.onFailure }); new Ajax.Request(this.options.loadCollectionURL, options); }, showLoadingText: function(text) { this._controls.editor.disabled = true; var tempOption = this._controls.editor.firstChild; if (!tempOption) { tempOption = document.createElement('option'); tempOption.value = ''; this._controls.editor.appendChild(tempOption); tempOption.selected = true; } tempOption.update((text || '').stripScripts().stripTags()); }, checkForExternalText: function() { this._text = this.getText(); if (this.options.loadTextURL) this.loadExternalText(); else this.buildOptionList(); }, loadExternalText: function() { this.showLoadingText(this.options.loadingText); var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); Object.extend(options, { parameters: 'editorId=' + encodeURIComponent(this.element.id), onComplete: Prototype.emptyFunction, onSuccess: function(transport) { this._text = transport.responseText.strip(); this.buildOptionList(); }.bind(this), onFailure: this.onFailure }); new Ajax.Request(this.options.loadTextURL, options); }, buildOptionList: function() { this._form.removeClassName(this.options.loadingClassName); this._collection = this._collection.map(function(entry) { return 2 === entry.length ? entry : [entry, entry].flatten(); }); var marker = ('value' in this.options) ? this.options.value : this._text; var textFound = this._collection.any(function(entry) { return entry[0] == marker; }.bind(this)); this._controls.editor.update(''); var option; this._collection.each(function(entry, index) { option = document.createElement('option'); option.value = entry[0]; option.selected = textFound ? entry[0] == marker : 0 == index; option.appendChild(document.createTextNode(entry[1])); this._controls.editor.appendChild(option); }.bind(this)); this._controls.editor.disabled = false; Field.scrollFreeActivate(this._controls.editor); } }); //**** DEPRECATION LAYER FOR InPlace[Collection]Editor! **** //**** This only exists for a while, in order to let **** //**** users adapt to the new API. Read up on the new **** //**** API and convert your code to it ASAP! **** Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions = function(options) { if (!options) return; function fallback(name, expr) { if (name in options || expr === undefined) return; options[name] = expr; }; fallback('cancelControl', (options.cancelLink ? 'link' : (options.cancelButton ? 'button' : options.cancelLink == options.cancelButton == false ? false : undefined))); fallback('okControl', (options.okLink ? 'link' : (options.okButton ? 'button' : options.okLink == options.okButton == false ? false : undefined))); fallback('highlightColor', options.highlightcolor); fallback('highlightEndColor', options.highlightendcolor); }; Object.extend(Ajax.InPlaceEditor, { DefaultOptions: { ajaxOptions: { }, autoRows: 3, // Use when multi-line w/ rows == 1 cancelControl: 'link', // 'link'|'button'|false cancelText: 'cancel', clickToEditText: 'Click to edit', externalControl: null, // id|elt externalControlOnly: false, fieldPostCreation: 'activate', // 'activate'|'focus'|false formClassName: 'inplaceeditor-form', formId: null, // id|elt highlightColor: '#ffff99', highlightEndColor: '#ffffff', hoverClassName: '', htmlResponse: true, loadingClassName: 'inplaceeditor-loading', loadingText: 'Loading...', okControl: 'button', // 'link'|'button'|false okText: 'ok', paramName: 'value', rows: 1, // If 1 and multi-line, uses autoRows savingClassName: 'inplaceeditor-saving', savingText: 'Saving...', size: 0, stripLoadedTextTags: false, submitOnBlur: false, textAfterControls: '', textBeforeControls: '', textBetweenControls: '' }, DefaultCallbacks: { callback: function(form) { return Form.serialize(form); }, onComplete: function(transport, element) { // For backward compatibility, this one is bound to the IPE, and passes // the element directly. It was too often customized, so we don't break it. new Effect.Highlight(element, { startcolor: this.options.highlightColor, keepBackgroundImage: true }); }, onEnterEditMode: null, onEnterHover: function(ipe) { ipe.element.style.backgroundColor = ipe.options.highlightColor; if (ipe._effect) ipe._effect.cancel(); }, onFailure: function(transport, ipe) { alert('Error communication with the server: ' + transport.responseText.stripTags()); }, onFormCustomization: null, // Takes the IPE and its generated form, after editor, before controls. onLeaveEditMode: null, onLeaveHover: function(ipe) { ipe._effect = new Effect.Highlight(ipe.element, { startcolor: ipe.options.highlightColor, endcolor: ipe.options.highlightEndColor, restorecolor: ipe._originalBackground, keepBackgroundImage: true }); } }, Listeners: { click: 'enterEditMode', keydown: 'checkForEscapeOrReturn', mouseover: 'enterHover', mouseout: 'leaveHover' } }); Ajax.InPlaceCollectionEditor.DefaultOptions = { loadingCollectionText: 'Loading options...' }; // Delayed observer, like Form.Element.Observer, // but waits for delay after last key input // Ideal for live-search fields Form.Element.DelayedObserver = Class.create({ initialize: function(element, delay, callback) { this.delay = delay || 0.5; this.element = $(element); this.callback = callback; this.timer = null; this.lastValue = $F(this.element); Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this)); }, delayedListener: function(event) { if(this.lastValue == $F(this.element)) return; if(this.timer) clearTimeout(this.timer); this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000); this.lastValue = $F(this.element); }, onTimerEvent: function() { this.timer = null; this.callback(this.element, $F(this.element)); } }); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/scriptaculous/wp-scriptaculous.js���������������������������������������������0000644�0001066�0001066�00000005071�10762616541�020645� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// script.aculo.us scriptaculous.js v1.7.1_beta3, Fri May 25 17:19:41 +0200 2007 // Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // For details, see the script.aculo.us web site: http://script.aculo.us/ var Scriptaculous = { Version: '1.8.0', require: function(libraryName) { // inserting via DOM fails in Safari 2.0, so brute force approach document.write('<script type="text/javascript" src="'+libraryName+'"></script>'); }, REQUIRED_PROTOTYPE: '1.6', load: function() { function convertVersionString(versionString){ var r = versionString.split('.'); return parseInt(r[0])*100000 + parseInt(r[1])*1000 + parseInt(r[2]); } if((typeof Prototype=='undefined') || (typeof Element == 'undefined') || (typeof Element.Methods=='undefined') || (convertVersionString(Prototype.Version) < convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE))) throw("script.aculo.us requires the Prototype JavaScript framework >= " + Scriptaculous.REQUIRED_PROTOTYPE); $A(document.getElementsByTagName("script")).findAll( function(s) { return (s.src && s.src.match(/scriptaculous\.js(\?.*)?$/)) }).each( function(s) { var path = s.src.replace(/scriptaculous\.js(\?.*)?$/,''); var includes = s.src.match(/\?.*load=([a-z,]*)/); if ( includes ) includes[1].split(',').each( function(include) { Scriptaculous.require(path+include+'.js') }); }); } } Scriptaculous.load(); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/scriptaculous/prototype.js����������������������������������������������������0000644�0001066�0001066�00000362350�10762616541�017374� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Prototype JavaScript framework, version 1.6.0 * (c) 2005-2007 Sam Stephenson * * Prototype is freely distributable under the terms of an MIT-style license. * For details, see the Prototype web site: http://www.prototypejs.org/ * *--------------------------------------------------------------------------*/ var Prototype = { Version: '1.6.0', Browser: { IE: !!(window.attachEvent && !window.opera), Opera: !!window.opera, WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1, Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1, MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/) }, BrowserFeatures: { XPath: !!document.evaluate, ElementExtensions: !!window.HTMLElement, SpecificElementExtensions: document.createElement('div').__proto__ && document.createElement('div').__proto__ !== document.createElement('form').__proto__ }, ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>', JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/, emptyFunction: function() { }, K: function(x) { return x } }; if (Prototype.Browser.MobileSafari) Prototype.BrowserFeatures.SpecificElementExtensions = false; if (Prototype.Browser.WebKit) Prototype.BrowserFeatures.XPath = false; /* Based on Alex Arnell's inheritance implementation. */ var Class = { create: function() { var parent = null, properties = $A(arguments); if (Object.isFunction(properties[0])) parent = properties.shift(); function klass() { this.initialize.apply(this, arguments); } Object.extend(klass, Class.Methods); klass.superclass = parent; klass.subclasses = []; if (parent) { var subclass = function() { }; subclass.prototype = parent.prototype; klass.prototype = new subclass; parent.subclasses.push(klass); } for (var i = 0; i < properties.length; i++) klass.addMethods(properties[i]); if (!klass.prototype.initialize) klass.prototype.initialize = Prototype.emptyFunction; klass.prototype.constructor = klass; return klass; } }; Class.Methods = { addMethods: function(source) { var ancestor = this.superclass && this.superclass.prototype; var properties = Object.keys(source); if (!Object.keys({ toString: true }).length) properties.push("toString", "valueOf"); for (var i = 0, length = properties.length; i < length; i++) { var property = properties[i], value = source[property]; if (ancestor && Object.isFunction(value) && value.argumentNames().first() == "$super") { var method = value, value = Object.extend((function(m) { return function() { return ancestor[m].apply(this, arguments) }; })(property).wrap(method), { valueOf: function() { return method }, toString: function() { return method.toString() } }); } this.prototype[property] = value; } return this; } }; var Abstract = { }; Object.extend = function(destination, source) { for (var property in source) destination[property] = source[property]; return destination; }; Object.extend(Object, { inspect: function(object) { try { if (object === undefined) return 'undefined'; if (object === null) return 'null'; return object.inspect ? object.inspect() : object.toString(); } catch (e) { if (e instanceof RangeError) return '...'; throw e; } }, toJSON: function(object) { var type = typeof object; switch (type) { case 'undefined': case 'function': case 'unknown': return; case 'boolean': return object.toString(); } if (object === null) return 'null'; if (object.toJSON) return object.toJSON(); if (Object.isElement(object)) return; var results = []; for (var property in object) { var value = Object.toJSON(object[property]); if (value !== undefined) results.push(property.toJSON() + ': ' + value); } return '{' + results.join(', ') + '}'; }, toQueryString: function(object) { return $H(object).toQueryString(); }, toHTML: function(object) { return object && object.toHTML ? object.toHTML() : String.interpret(object); }, keys: function(object) { var keys = []; for (var property in object) keys.push(property); return keys; }, values: function(object) { var values = []; for (var property in object) values.push(object[property]); return values; }, clone: function(object) { return Object.extend({ }, object); }, isElement: function(object) { return object && object.nodeType == 1; }, isArray: function(object) { return object && object.constructor === Array; }, isHash: function(object) { return object instanceof Hash; }, isFunction: function(object) { return typeof object == "function"; }, isString: function(object) { return typeof object == "string"; }, isNumber: function(object) { return typeof object == "number"; }, isUndefined: function(object) { return typeof object == "undefined"; } }); Object.extend(Function.prototype, { argumentNames: function() { var names = this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip"); return names.length == 1 && !names[0] ? [] : names; }, bind: function() { if (arguments.length < 2 && arguments[0] === undefined) return this; var __method = this, args = $A(arguments), object = args.shift(); return function() { return __method.apply(object, args.concat($A(arguments))); } }, bindAsEventListener: function() { var __method = this, args = $A(arguments), object = args.shift(); return function(event) { return __method.apply(object, [event || window.event].concat(args)); } }, curry: function() { if (!arguments.length) return this; var __method = this, args = $A(arguments); return function() { return __method.apply(this, args.concat($A(arguments))); } }, delay: function() { var __method = this, args = $A(arguments), timeout = args.shift() * 1000; return window.setTimeout(function() { return __method.apply(__method, args); }, timeout); }, wrap: function(wrapper) { var __method = this; return function() { return wrapper.apply(this, [__method.bind(this)].concat($A(arguments))); } }, methodize: function() { if (this._methodized) return this._methodized; var __method = this; return this._methodized = function() { return __method.apply(null, [this].concat($A(arguments))); }; } }); Function.prototype.defer = Function.prototype.delay.curry(0.01); Date.prototype.toJSON = function() { return '"' + this.getUTCFullYear() + '-' + (this.getUTCMonth() + 1).toPaddedString(2) + '-' + this.getUTCDate().toPaddedString(2) + 'T' + this.getUTCHours().toPaddedString(2) + ':' + this.getUTCMinutes().toPaddedString(2) + ':' + this.getUTCSeconds().toPaddedString(2) + 'Z"'; }; var Try = { these: function() { var returnValue; for (var i = 0, length = arguments.length; i < length; i++) { var lambda = arguments[i]; try { returnValue = lambda(); break; } catch (e) { } } return returnValue; } }; RegExp.prototype.match = RegExp.prototype.test; RegExp.escape = function(str) { return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); }; /*--------------------------------------------------------------------------*/ var PeriodicalExecuter = Class.create({ initialize: function(callback, frequency) { this.callback = callback; this.frequency = frequency; this.currentlyExecuting = false; this.registerCallback(); }, registerCallback: function() { this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); }, execute: function() { this.callback(this); }, stop: function() { if (!this.timer) return; clearInterval(this.timer); this.timer = null; }, onTimerEvent: function() { if (!this.currentlyExecuting) { try { this.currentlyExecuting = true; this.execute(); } finally { this.currentlyExecuting = false; } } } }); Object.extend(String, { interpret: function(value) { return value == null ? '' : String(value); }, specialChar: { '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '\\': '\\\\' } }); Object.extend(String.prototype, { gsub: function(pattern, replacement) { var result = '', source = this, match; replacement = arguments.callee.prepareReplacement(replacement); while (source.length > 0) { if (match = source.match(pattern)) { result += source.slice(0, match.index); result += String.interpret(replacement(match)); source = source.slice(match.index + match[0].length); } else { result += source, source = ''; } } return result; }, sub: function(pattern, replacement, count) { replacement = this.gsub.prepareReplacement(replacement); count = count === undefined ? 1 : count; return this.gsub(pattern, function(match) { if (--count < 0) return match[0]; return replacement(match); }); }, scan: function(pattern, iterator) { this.gsub(pattern, iterator); return String(this); }, truncate: function(length, truncation) { length = length || 30; truncation = truncation === undefined ? '...' : truncation; return this.length > length ? this.slice(0, length - truncation.length) + truncation : String(this); }, strip: function() { return this.replace(/^\s+/, '').replace(/\s+$/, ''); }, stripTags: function() { return this.replace(/<\/?[^>]+>/gi, ''); }, stripScripts: function() { return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); }, extractScripts: function() { var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); var matchOne = new RegExp(Prototype.ScriptFragment, 'im'); return (this.match(matchAll) || []).map(function(scriptTag) { return (scriptTag.match(matchOne) || ['', ''])[1]; }); }, evalScripts: function() { return this.extractScripts().map(function(script) { return eval(script) }); }, escapeHTML: function() { var self = arguments.callee; self.text.data = this; return self.div.innerHTML; }, unescapeHTML: function() { var div = new Element('div'); div.innerHTML = this.stripTags(); return div.childNodes[0] ? (div.childNodes.length > 1 ? $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) : div.childNodes[0].nodeValue) : ''; }, toQueryParams: function(separator) { var match = this.strip().match(/([^?#]*)(#.*)?$/); if (!match) return { }; return match[1].split(separator || '&').inject({ }, function(hash, pair) { if ((pair = pair.split('='))[0]) { var key = decodeURIComponent(pair.shift()); var value = pair.length > 1 ? pair.join('=') : pair[0]; if (value != undefined) value = decodeURIComponent(value); if (key in hash) { if (!Object.isArray(hash[key])) hash[key] = [hash[key]]; hash[key].push(value); } else hash[key] = value; } return hash; }); }, toArray: function() { return this.split(''); }, succ: function() { return this.slice(0, this.length - 1) + String.fromCharCode(this.charCodeAt(this.length - 1) + 1); }, times: function(count) { return count < 1 ? '' : new Array(count + 1).join(this); }, camelize: function() { var parts = this.split('-'), len = parts.length; if (len == 1) return parts[0]; var camelized = this.charAt(0) == '-' ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) : parts[0]; for (var i = 1; i < len; i++) camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1); return camelized; }, capitalize: function() { return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); }, underscore: function() { return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase(); }, dasherize: function() { return this.gsub(/_/,'-'); }, inspect: function(useDoubleQuotes) { var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) { var character = String.specialChar[match[0]]; return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16); }); if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"'; return "'" + escapedString.replace(/'/g, '\\\'') + "'"; }, toJSON: function() { return this.inspect(true); }, unfilterJSON: function(filter) { return this.sub(filter || Prototype.JSONFilter, '#{1}'); }, isJSON: function() { var str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); }, evalJSON: function(sanitize) { var json = this.unfilterJSON(); try { if (!sanitize || json.isJSON()) return eval('(' + json + ')'); } catch (e) { } throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); }, include: function(pattern) { return this.indexOf(pattern) > -1; }, startsWith: function(pattern) { return this.indexOf(pattern) === 0; }, endsWith: function(pattern) { var d = this.length - pattern.length; return d >= 0 && this.lastIndexOf(pattern) === d; }, empty: function() { return this == ''; }, blank: function() { return /^\s*$/.test(this); }, interpolate: function(object, pattern) { return new Template(this, pattern).evaluate(object); } }); if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, { escapeHTML: function() { return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); }, unescapeHTML: function() { return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); } }); String.prototype.gsub.prepareReplacement = function(replacement) { if (Object.isFunction(replacement)) return replacement; var template = new Template(replacement); return function(match) { return template.evaluate(match) }; }; String.prototype.parseQuery = String.prototype.toQueryParams; Object.extend(String.prototype.escapeHTML, { div: document.createElement('div'), text: document.createTextNode('') }); with (String.prototype.escapeHTML) div.appendChild(text); var Template = Class.create({ initialize: function(template, pattern) { this.template = template.toString(); this.pattern = pattern || Template.Pattern; }, evaluate: function(object) { if (Object.isFunction(object.toTemplateReplacements)) object = object.toTemplateReplacements(); return this.template.gsub(this.pattern, function(match) { if (object == null) return ''; var before = match[1] || ''; if (before == '\\') return match[2]; var ctx = object, expr = match[3]; var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/, match = pattern.exec(expr); if (match == null) return before; while (match != null) { var comp = match[1].startsWith('[') ? match[2].gsub('\\\\]', ']') : match[1]; ctx = ctx[comp]; if (null == ctx || '' == match[3]) break; expr = expr.substring('[' == match[3] ? match[1].length : match[0].length); match = pattern.exec(expr); } return before + String.interpret(ctx); }.bind(this)); } }); Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; var $break = { }; var Enumerable = { each: function(iterator, context) { var index = 0; iterator = iterator.bind(context); try { this._each(function(value) { iterator(value, index++); }); } catch (e) { if (e != $break) throw e; } return this; }, eachSlice: function(number, iterator, context) { iterator = iterator ? iterator.bind(context) : Prototype.K; var index = -number, slices = [], array = this.toArray(); while ((index += number) < array.length) slices.push(array.slice(index, index+number)); return slices.collect(iterator, context); }, all: function(iterator, context) { iterator = iterator ? iterator.bind(context) : Prototype.K; var result = true; this.each(function(value, index) { result = result && !!iterator(value, index); if (!result) throw $break; }); return result; }, any: function(iterator, context) { iterator = iterator ? iterator.bind(context) : Prototype.K; var result = false; this.each(function(value, index) { if (result = !!iterator(value, index)) throw $break; }); return result; }, collect: function(iterator, context) { iterator = iterator ? iterator.bind(context) : Prototype.K; var results = []; this.each(function(value, index) { results.push(iterator(value, index)); }); return results; }, detect: function(iterator, context) { iterator = iterator.bind(context); var result; this.each(function(value, index) { if (iterator(value, index)) { result = value; throw $break; } }); return result; }, findAll: function(iterator, context) { iterator = iterator.bind(context); var results = []; this.each(function(value, index) { if (iterator(value, index)) results.push(value); }); return results; }, grep: function(filter, iterator, context) { iterator = iterator ? iterator.bind(context) : Prototype.K; var results = []; if (Object.isString(filter)) filter = new RegExp(filter); this.each(function(value, index) { if (filter.match(value)) results.push(iterator(value, index)); }); return results; }, include: function(object) { if (Object.isFunction(this.indexOf)) if (this.indexOf(object) != -1) return true; var found = false; this.each(function(value) { if (value == object) { found = true; throw $break; } }); return found; }, inGroupsOf: function(number, fillWith) { fillWith = fillWith === undefined ? null : fillWith; return this.eachSlice(number, function(slice) { while(slice.length < number) slice.push(fillWith); return slice; }); }, inject: function(memo, iterator, context) { iterator = iterator.bind(context); this.each(function(value, index) { memo = iterator(memo, value, index); }); return memo; }, invoke: function(method) { var args = $A(arguments).slice(1); return this.map(function(value) { return value[method].apply(value, args); }); }, max: function(iterator, context) { iterator = iterator ? iterator.bind(context) : Prototype.K; var result; this.each(function(value, index) { value = iterator(value, index); if (result == undefined || value >= result) result = value; }); return result; }, min: function(iterator, context) { iterator = iterator ? iterator.bind(context) : Prototype.K; var result; this.each(function(value, index) { value = iterator(value, index); if (result == undefined || value < result) result = value; }); return result; }, partition: function(iterator, context) { iterator = iterator ? iterator.bind(context) : Prototype.K; var trues = [], falses = []; this.each(function(value, index) { (iterator(value, index) ? trues : falses).push(value); }); return [trues, falses]; }, pluck: function(property) { var results = []; this.each(function(value) { results.push(value[property]); }); return results; }, reject: function(iterator, context) { iterator = iterator.bind(context); var results = []; this.each(function(value, index) { if (!iterator(value, index)) results.push(value); }); return results; }, sortBy: function(iterator, context) { iterator = iterator.bind(context); return this.map(function(value, index) { return {value: value, criteria: iterator(value, index)}; }).sort(function(left, right) { var a = left.criteria, b = right.criteria; return a < b ? -1 : a > b ? 1 : 0; }).pluck('value'); }, toArray: function() { return this.map(); }, zip: function() { var iterator = Prototype.K, args = $A(arguments); if (Object.isFunction(args.last())) iterator = args.pop(); var collections = [this].concat(args).map($A); return this.map(function(value, index) { return iterator(collections.pluck(index)); }); }, size: function() { return this.toArray().length; }, inspect: function() { return '#<Enumerable:' + this.toArray().inspect() + '>'; } }; Object.extend(Enumerable, { map: Enumerable.collect, find: Enumerable.detect, select: Enumerable.findAll, filter: Enumerable.findAll, member: Enumerable.include, entries: Enumerable.toArray, every: Enumerable.all, some: Enumerable.any }); function $A(iterable) { if (!iterable) return []; if (iterable.toArray) return iterable.toArray(); var length = iterable.length, results = new Array(length); while (length--) results[length] = iterable[length]; return results; } if (Prototype.Browser.WebKit) { function $A(iterable) { if (!iterable) return []; if (!(Object.isFunction(iterable) && iterable == '[object NodeList]') && iterable.toArray) return iterable.toArray(); var length = iterable.length, results = new Array(length); while (length--) results[length] = iterable[length]; return results; } } Array.from = $A; Object.extend(Array.prototype, Enumerable); if (!Array.prototype._reverse) Array.prototype._reverse = Array.prototype.reverse; Object.extend(Array.prototype, { _each: function(iterator) { for (var i = 0, length = this.length; i < length; i++) iterator(this[i]); }, clear: function() { this.length = 0; return this; }, first: function() { return this[0]; }, last: function() { return this[this.length - 1]; }, compact: function() { return this.select(function(value) { return value != null; }); }, flatten: function() { return this.inject([], function(array, value) { return array.concat(Object.isArray(value) ? value.flatten() : [value]); }); }, without: function() { var values = $A(arguments); return this.select(function(value) { return !values.include(value); }); }, reverse: function(inline) { return (inline !== false ? this : this.toArray())._reverse(); }, reduce: function() { return this.length > 1 ? this : this[0]; }, uniq: function(sorted) { return this.inject([], function(array, value, index) { if (0 == index || (sorted ? array.last() != value : !array.include(value))) array.push(value); return array; }); }, intersect: function(array) { return this.uniq().findAll(function(item) { return array.detect(function(value) { return item === value }); }); }, clone: function() { return [].concat(this); }, size: function() { return this.length; }, inspect: function() { return '[' + this.map(Object.inspect).join(', ') + ']'; }, toJSON: function() { var results = []; this.each(function(object) { var value = Object.toJSON(object); if (value !== undefined) results.push(value); }); return '[' + results.join(', ') + ']'; } }); // use native browser JS 1.6 implementation if available if (Object.isFunction(Array.prototype.forEach)) Array.prototype._each = Array.prototype.forEach; if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) { i || (i = 0); var length = this.length; if (i < 0) i = length + i; for (; i < length; i++) if (this[i] === item) return i; return -1; }; if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) { i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1; var n = this.slice(0, i).reverse().indexOf(item); return (n < 0) ? n : i - n - 1; }; Array.prototype.toArray = Array.prototype.clone; function $w(string) { if (!Object.isString(string)) return []; string = string.strip(); return string ? string.split(/\s+/) : []; } if (Prototype.Browser.Opera){ Array.prototype.concat = function() { var array = []; for (var i = 0, length = this.length; i < length; i++) array.push(this[i]); for (var i = 0, length = arguments.length; i < length; i++) { if (Object.isArray(arguments[i])) { for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++) array.push(arguments[i][j]); } else { array.push(arguments[i]); } } return array; }; } Object.extend(Number.prototype, { toColorPart: function() { return this.toPaddedString(2, 16); }, succ: function() { return this + 1; }, times: function(iterator) { $R(0, this, true).each(iterator); return this; }, toPaddedString: function(length, radix) { var string = this.toString(radix || 10); return '0'.times(length - string.length) + string; }, toJSON: function() { return isFinite(this) ? this.toString() : 'null'; } }); $w('abs round ceil floor').each(function(method){ Number.prototype[method] = Math[method].methodize(); }); function $H(object) { return new Hash(object); }; var Hash = Class.create(Enumerable, (function() { if (function() { var i = 0, Test = function(value) { this.key = value }; Test.prototype.key = 'foo'; for (var property in new Test('bar')) i++; return i > 1; }()) { function each(iterator) { var cache = []; for (var key in this._object) { var value = this._object[key]; if (cache.include(key)) continue; cache.push(key); var pair = [key, value]; pair.key = key; pair.value = value; iterator(pair); } } } else { function each(iterator) { for (var key in this._object) { var value = this._object[key], pair = [key, value]; pair.key = key; pair.value = value; iterator(pair); } } } function toQueryPair(key, value) { if (Object.isUndefined(value)) return key; return key + '=' + encodeURIComponent(String.interpret(value)); } return { initialize: function(object) { this._object = Object.isHash(object) ? object.toObject() : Object.clone(object); }, _each: each, set: function(key, value) { return this._object[key] = value; }, get: function(key) { return this._object[key]; }, unset: function(key) { var value = this._object[key]; delete this._object[key]; return value; }, toObject: function() { return Object.clone(this._object); }, keys: function() { return this.pluck('key'); }, values: function() { return this.pluck('value'); }, index: function(value) { var match = this.detect(function(pair) { return pair.value === value; }); return match && match.key; }, merge: function(object) { return this.clone().update(object); }, update: function(object) { return new Hash(object).inject(this, function(result, pair) { result.set(pair.key, pair.value); return result; }); }, toQueryString: function() { return this.map(function(pair) { var key = encodeURIComponent(pair.key), values = pair.value; if (values && typeof values == 'object') { if (Object.isArray(values)) return values.map(toQueryPair.curry(key)).join('&'); } return toQueryPair(key, values); }).join('&'); }, inspect: function() { return '#<Hash:{' + this.map(function(pair) { return pair.map(Object.inspect).join(': '); }).join(', ') + '}>'; }, toJSON: function() { return Object.toJSON(this.toObject()); }, clone: function() { return new Hash(this); } } })()); Hash.prototype.toTemplateReplacements = Hash.prototype.toObject; Hash.from = $H; var ObjectRange = Class.create(Enumerable, { initialize: function(start, end, exclusive) { this.start = start; this.end = end; this.exclusive = exclusive; }, _each: function(iterator) { var value = this.start; while (this.include(value)) { iterator(value); value = value.succ(); } }, include: function(value) { if (value < this.start) return false; if (this.exclusive) return value < this.end; return value <= this.end; } }); var $R = function(start, end, exclusive) { return new ObjectRange(start, end, exclusive); }; var Ajax = { getTransport: function() { return Try.these( function() {return new XMLHttpRequest()}, function() {return new ActiveXObject('Msxml2.XMLHTTP')}, function() {return new ActiveXObject('Microsoft.XMLHTTP')} ) || false; }, activeRequestCount: 0 }; Ajax.Responders = { responders: [], _each: function(iterator) { this.responders._each(iterator); }, register: function(responder) { if (!this.include(responder)) this.responders.push(responder); }, unregister: function(responder) { this.responders = this.responders.without(responder); }, dispatch: function(callback, request, transport, json) { this.each(function(responder) { if (Object.isFunction(responder[callback])) { try { responder[callback].apply(responder, [request, transport, json]); } catch (e) { } } }); } }; Object.extend(Ajax.Responders, Enumerable); Ajax.Responders.register({ onCreate: function() { Ajax.activeRequestCount++ }, onComplete: function() { Ajax.activeRequestCount-- } }); Ajax.Base = Class.create({ initialize: function(options) { this.options = { method: 'post', asynchronous: true, contentType: 'application/x-www-form-urlencoded', encoding: 'UTF-8', parameters: '', evalJSON: true, evalJS: true }; Object.extend(this.options, options || { }); this.options.method = this.options.method.toLowerCase(); if (Object.isString(this.options.parameters)) this.options.parameters = this.options.parameters.toQueryParams(); } }); Ajax.Request = Class.create(Ajax.Base, { _complete: false, initialize: function($super, url, options) { $super(options); this.transport = Ajax.getTransport(); this.request(url); }, request: function(url) { this.url = url; this.method = this.options.method; var params = Object.clone(this.options.parameters); if (!['get', 'post'].include(this.method)) { // simulate other verbs over post params['_method'] = this.method; this.method = 'post'; } this.parameters = params; if (params = Object.toQueryString(params)) { // when GET, append parameters to URL if (this.method == 'get') this.url += (this.url.include('?') ? '&' : '?') + params; else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) params += '&_='; } try { var response = new Ajax.Response(this); if (this.options.onCreate) this.options.onCreate(response); Ajax.Responders.dispatch('onCreate', this, response); this.transport.open(this.method.toUpperCase(), this.url, this.options.asynchronous); if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1); this.transport.onreadystatechange = this.onStateChange.bind(this); this.setRequestHeaders(); this.body = this.method == 'post' ? (this.options.postBody || params) : null; this.transport.send(this.body); /* Force Firefox to handle ready state 4 for synchronous requests */ if (!this.options.asynchronous && this.transport.overrideMimeType) this.onStateChange(); } catch (e) { this.dispatchException(e); } }, onStateChange: function() { var readyState = this.transport.readyState; if (readyState > 1 && !((readyState == 4) && this._complete)) this.respondToReadyState(this.transport.readyState); }, setRequestHeaders: function() { var headers = { 'X-Requested-With': 'XMLHttpRequest', 'X-Prototype-Version': Prototype.Version, 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' }; if (this.method == 'post') { headers['Content-type'] = this.options.contentType + (this.options.encoding ? '; charset=' + this.options.encoding : ''); /* Force "Connection: close" for older Mozilla browsers to work * around a bug where XMLHttpRequest sends an incorrect * Content-length header. See Mozilla Bugzilla #246651. */ if (this.transport.overrideMimeType && (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) headers['Connection'] = 'close'; } // user-defined headers if (typeof this.options.requestHeaders == 'object') { var extras = this.options.requestHeaders; if (Object.isFunction(extras.push)) for (var i = 0, length = extras.length; i < length; i += 2) headers[extras[i]] = extras[i+1]; else $H(extras).each(function(pair) { headers[pair.key] = pair.value }); } for (var name in headers) this.transport.setRequestHeader(name, headers[name]); }, success: function() { var status = this.getStatus(); return !status || (status >= 200 && status < 300); }, getStatus: function() { try { return this.transport.status || 0; } catch (e) { return 0 } }, respondToReadyState: function(readyState) { var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this); if (state == 'Complete') { try { this._complete = true; (this.options['on' + response.status] || this.options['on' + (this.success() ? 'Success' : 'Failure')] || Prototype.emptyFunction)(response, response.headerJSON); } catch (e) { this.dispatchException(e); } var contentType = response.getHeader('Content-type'); if (this.options.evalJS == 'force' || (this.options.evalJS && contentType && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))) this.evalResponse(); } try { (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON); Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON); } catch (e) { this.dispatchException(e); } if (state == 'Complete') { // avoid memory leak in MSIE: clean up this.transport.onreadystatechange = Prototype.emptyFunction; } }, getHeader: function(name) { try { return this.transport.getResponseHeader(name); } catch (e) { return null } }, evalResponse: function() { try { return eval((this.transport.responseText || '').unfilterJSON()); } catch (e) { this.dispatchException(e); } }, dispatchException: function(exception) { (this.options.onException || Prototype.emptyFunction)(this, exception); Ajax.Responders.dispatch('onException', this, exception); } }); Ajax.Request.Events = ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; Ajax.Response = Class.create({ initialize: function(request){ this.request = request; var transport = this.transport = request.transport, readyState = this.readyState = transport.readyState; if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) { this.status = this.getStatus(); this.statusText = this.getStatusText(); this.responseText = String.interpret(transport.responseText); this.headerJSON = this._getHeaderJSON(); } if(readyState == 4) { var xml = transport.responseXML; this.responseXML = xml === undefined ? null : xml; this.responseJSON = this._getResponseJSON(); } }, status: 0, statusText: '', getStatus: Ajax.Request.prototype.getStatus, getStatusText: function() { try { return this.transport.statusText || ''; } catch (e) { return '' } }, getHeader: Ajax.Request.prototype.getHeader, getAllHeaders: function() { try { return this.getAllResponseHeaders(); } catch (e) { return null } }, getResponseHeader: function(name) { return this.transport.getResponseHeader(name); }, getAllResponseHeaders: function() { return this.transport.getAllResponseHeaders(); }, _getHeaderJSON: function() { var json = this.getHeader('X-JSON'); if (!json) return null; json = decodeURIComponent(escape(json)); try { return json.evalJSON(this.request.options.sanitizeJSON); } catch (e) { this.request.dispatchException(e); } }, _getResponseJSON: function() { var options = this.request.options; if (!options.evalJSON || (options.evalJSON != 'force' && !(this.getHeader('Content-type') || '').include('application/json'))) return null; try { return this.transport.responseText.evalJSON(options.sanitizeJSON); } catch (e) { this.request.dispatchException(e); } } }); Ajax.Updater = Class.create(Ajax.Request, { initialize: function($super, container, url, options) { this.container = { success: (container.success || container), failure: (container.failure || (container.success ? null : container)) }; options = options || { }; var onComplete = options.onComplete; options.onComplete = (function(response, param) { this.updateContent(response.responseText); if (Object.isFunction(onComplete)) onComplete(response, param); }).bind(this); $super(url, options); }, updateContent: function(responseText) { var receiver = this.container[this.success() ? 'success' : 'failure'], options = this.options; if (!options.evalScripts) responseText = responseText.stripScripts(); if (receiver = $(receiver)) { if (options.insertion) { if (Object.isString(options.insertion)) { var insertion = { }; insertion[options.insertion] = responseText; receiver.insert(insertion); } else options.insertion(receiver, responseText); } else receiver.update(responseText); } if (this.success()) { if (this.onComplete) this.onComplete.bind(this).defer(); } } }); Ajax.PeriodicalUpdater = Class.create(Ajax.Base, { initialize: function($super, container, url, options) { $super(options); this.onComplete = this.options.onComplete; this.frequency = (this.options.frequency || 2); this.decay = (this.options.decay || 1); this.updater = { }; this.container = container; this.url = url; this.start(); }, start: function() { this.options.onComplete = this.updateComplete.bind(this); this.onTimerEvent(); }, stop: function() { this.updater.options.onComplete = undefined; clearTimeout(this.timer); (this.onComplete || Prototype.emptyFunction).apply(this, arguments); }, updateComplete: function(response) { if (this.options.decay) { this.decay = (response.responseText == this.lastText ? this.decay * this.options.decay : 1); this.lastText = response.responseText; } this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency); }, onTimerEvent: function() { this.updater = new Ajax.Updater(this.container, this.url, this.options); } }); function $(element) { if (arguments.length > 1) { for (var i = 0, elements = [], length = arguments.length; i < length; i++) elements.push($(arguments[i])); return elements; } if (Object.isString(element)) element = document.getElementById(element); return Element.extend(element); } if (Prototype.BrowserFeatures.XPath) { document._getElementsByXPath = function(expression, parentElement) { var results = []; var query = document.evaluate(expression, $(parentElement) || document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0, length = query.snapshotLength; i < length; i++) results.push(Element.extend(query.snapshotItem(i))); return results; }; } /*--------------------------------------------------------------------------*/ if (!window.Node) var Node = { }; if (!Node.ELEMENT_NODE) { // DOM level 2 ECMAScript Language Binding Object.extend(Node, { ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, CDATA_SECTION_NODE: 4, ENTITY_REFERENCE_NODE: 5, ENTITY_NODE: 6, PROCESSING_INSTRUCTION_NODE: 7, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_TYPE_NODE: 10, DOCUMENT_FRAGMENT_NODE: 11, NOTATION_NODE: 12 }); } (function() { var element = this.Element; this.Element = function(tagName, attributes) { attributes = attributes || { }; tagName = tagName.toLowerCase(); var cache = Element.cache; if (Prototype.Browser.IE && attributes.name) { tagName = '<' + tagName + ' name="' + attributes.name + '">'; delete attributes.name; return Element.writeAttribute(document.createElement(tagName), attributes); } if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName)); return Element.writeAttribute(cache[tagName].cloneNode(false), attributes); }; Object.extend(this.Element, element || { }); }).call(window); Element.cache = { }; Element.Methods = { visible: function(element) { return $(element).style.display != 'none'; }, toggle: function(element) { element = $(element); Element[Element.visible(element) ? 'hide' : 'show'](element); return element; }, hide: function(element) { $(element).style.display = 'none'; return element; }, show: function(element) { $(element).style.display = ''; return element; }, remove: function(element) { element = $(element); element.parentNode.removeChild(element); return element; }, update: function(element, content) { element = $(element); if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) return element.update().insert(content); content = Object.toHTML(content); element.innerHTML = content.stripScripts(); content.evalScripts.bind(content).defer(); return element; }, replace: function(element, content) { element = $(element); if (content && content.toElement) content = content.toElement(); else if (!Object.isElement(content)) { content = Object.toHTML(content); var range = element.ownerDocument.createRange(); range.selectNode(element); content.evalScripts.bind(content).defer(); content = range.createContextualFragment(content.stripScripts()); } element.parentNode.replaceChild(content, element); return element; }, insert: function(element, insertions) { element = $(element); if (Object.isString(insertions) || Object.isNumber(insertions) || Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML))) insertions = {bottom:insertions}; var content, t, range; for (position in insertions) { content = insertions[position]; position = position.toLowerCase(); t = Element._insertionTranslations[position]; if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) { t.insert(element, content); continue; } content = Object.toHTML(content); range = element.ownerDocument.createRange(); t.initializeRange(element, range); t.insert(element, range.createContextualFragment(content.stripScripts())); content.evalScripts.bind(content).defer(); } return element; }, wrap: function(element, wrapper, attributes) { element = $(element); if (Object.isElement(wrapper)) $(wrapper).writeAttribute(attributes || { }); else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes); else wrapper = new Element('div', wrapper); if (element.parentNode) element.parentNode.replaceChild(wrapper, element); wrapper.appendChild(element); return wrapper; }, inspect: function(element) { element = $(element); var result = '<' + element.tagName.toLowerCase(); $H({'id': 'id', 'className': 'class'}).each(function(pair) { var property = pair.first(), attribute = pair.last(); var value = (element[property] || '').toString(); if (value) result += ' ' + attribute + '=' + value.inspect(true); }); return result + '>'; }, recursivelyCollect: function(element, property) { element = $(element); var elements = []; while (element = element[property]) if (element.nodeType == 1) elements.push(Element.extend(element)); return elements; }, ancestors: function(element) { return $(element).recursivelyCollect('parentNode'); }, descendants: function(element) { return $A($(element).getElementsByTagName('*')).each(Element.extend); }, firstDescendant: function(element) { element = $(element).firstChild; while (element && element.nodeType != 1) element = element.nextSibling; return $(element); }, immediateDescendants: function(element) { if (!(element = $(element).firstChild)) return []; while (element && element.nodeType != 1) element = element.nextSibling; if (element) return [element].concat($(element).nextSiblings()); return []; }, previousSiblings: function(element) { return $(element).recursivelyCollect('previousSibling'); }, nextSiblings: function(element) { return $(element).recursivelyCollect('nextSibling'); }, siblings: function(element) { element = $(element); return element.previousSiblings().reverse().concat(element.nextSiblings()); }, match: function(element, selector) { if (Object.isString(selector)) selector = new Selector(selector); return selector.match($(element)); }, up: function(element, expression, index) { element = $(element); if (arguments.length == 1) return $(element.parentNode); var ancestors = element.ancestors(); return expression ? Selector.findElement(ancestors, expression, index) : ancestors[index || 0]; }, down: function(element, expression, index) { element = $(element); if (arguments.length == 1) return element.firstDescendant(); var descendants = element.descendants(); return expression ? Selector.findElement(descendants, expression, index) : descendants[index || 0]; }, previous: function(element, expression, index) { element = $(element); if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element)); var previousSiblings = element.previousSiblings(); return expression ? Selector.findElement(previousSiblings, expression, index) : previousSiblings[index || 0]; }, next: function(element, expression, index) { element = $(element); if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element)); var nextSiblings = element.nextSiblings(); return expression ? Selector.findElement(nextSiblings, expression, index) : nextSiblings[index || 0]; }, select: function() { var args = $A(arguments), element = $(args.shift()); return Selector.findChildElements(element, args); }, adjacent: function() { var args = $A(arguments), element = $(args.shift()); return Selector.findChildElements(element.parentNode, args).without(element); }, identify: function(element) { element = $(element); var id = element.readAttribute('id'), self = arguments.callee; if (id) return id; do { id = 'anonymous_element_' + self.counter++ } while ($(id)); element.writeAttribute('id', id); return id; }, readAttribute: function(element, name) { element = $(element); if (Prototype.Browser.IE) { var t = Element._attributeTranslations.read; if (t.values[name]) return t.values[name](element, name); if (t.names[name]) name = t.names[name]; if (name.include(':')) { return (!element.attributes || !element.attributes[name]) ? null : element.attributes[name].value; } } return element.getAttribute(name); }, writeAttribute: function(element, name, value) { element = $(element); var attributes = { }, t = Element._attributeTranslations.write; if (typeof name == 'object') attributes = name; else attributes[name] = value === undefined ? true : value; for (var attr in attributes) { var name = t.names[attr] || attr, value = attributes[attr]; if (t.values[attr]) name = t.values[attr](element, value); if (value === false || value === null) element.removeAttribute(name); else if (value === true) element.setAttribute(name, name); else element.setAttribute(name, value); } return element; }, getHeight: function(element) { return $(element).getDimensions().height; }, getWidth: function(element) { return $(element).getDimensions().width; }, classNames: function(element) { return new Element.ClassNames(element); }, hasClassName: function(element, className) { if (!(element = $(element))) return; var elementClassName = element.className; return (elementClassName.length > 0 && (elementClassName == className || new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName))); }, addClassName: function(element, className) { if (!(element = $(element))) return; if (!element.hasClassName(className)) element.className += (element.className ? ' ' : '') + className; return element; }, removeClassName: function(element, className) { if (!(element = $(element))) return; element.className = element.className.replace( new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip(); return element; }, toggleClassName: function(element, className) { if (!(element = $(element))) return; return element[element.hasClassName(className) ? 'removeClassName' : 'addClassName'](className); }, // removes whitespace-only text node children cleanWhitespace: function(element) { element = $(element); var node = element.firstChild; while (node) { var nextNode = node.nextSibling; if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) element.removeChild(node); node = nextNode; } return element; }, empty: function(element) { return $(element).innerHTML.blank(); }, descendantOf: function(element, ancestor) { element = $(element), ancestor = $(ancestor); if (element.compareDocumentPosition) return (element.compareDocumentPosition(ancestor) & 8) === 8; if (element.sourceIndex && !Prototype.Browser.Opera) { var e = element.sourceIndex, a = ancestor.sourceIndex, nextAncestor = ancestor.nextSibling; if (!nextAncestor) { do { ancestor = ancestor.parentNode; } while (!(nextAncestor = ancestor.nextSibling) && ancestor.parentNode); } if (nextAncestor) return (e > a && e < nextAncestor.sourceIndex); } while (element = element.parentNode) if (element == ancestor) return true; return false; }, scrollTo: function(element) { element = $(element); var pos = element.cumulativeOffset(); window.scrollTo(pos[0], pos[1]); return element; }, getStyle: function(element, style) { element = $(element); style = style == 'float' ? 'cssFloat' : style.camelize(); var value = element.style[style]; if (!value) { var css = document.defaultView.getComputedStyle(element, null); value = css ? css[style] : null; } if (style == 'opacity') return value ? parseFloat(value) : 1.0; return value == 'auto' ? null : value; }, getOpacity: function(element) { return $(element).getStyle('opacity'); }, setStyle: function(element, styles) { element = $(element); var elementStyle = element.style, match; if (Object.isString(styles)) { element.style.cssText += ';' + styles; return styles.include('opacity') ? element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element; } for (var property in styles) if (property == 'opacity') element.setOpacity(styles[property]); else elementStyle[(property == 'float' || property == 'cssFloat') ? (elementStyle.styleFloat === undefined ? 'cssFloat' : 'styleFloat') : property] = styles[property]; return element; }, setOpacity: function(element, value) { element = $(element); element.style.opacity = (value == 1 || value === '') ? '' : (value < 0.00001) ? 0 : value; return element; }, getDimensions: function(element) { element = $(element); var display = $(element).getStyle('display'); if (display != 'none' && display != null) // Safari bug return {width: element.offsetWidth, height: element.offsetHeight}; // All *Width and *Height properties give 0 on elements with display none, // so enable the element temporarily var els = element.style; var originalVisibility = els.visibility; var originalPosition = els.position; var originalDisplay = els.display; els.visibility = 'hidden'; els.position = 'absolute'; els.display = 'block'; var originalWidth = element.clientWidth; var originalHeight = element.clientHeight; els.display = originalDisplay; els.position = originalPosition; els.visibility = originalVisibility; return {width: originalWidth, height: originalHeight}; }, makePositioned: function(element) { element = $(element); var pos = Element.getStyle(element, 'position'); if (pos == 'static' || !pos) { element._madePositioned = true; element.style.position = 'relative'; // Opera returns the offset relative to the positioning context, when an // element is position relative but top and left have not been defined if (window.opera) { element.style.top = 0; element.style.left = 0; } } return element; }, undoPositioned: function(element) { element = $(element); if (element._madePositioned) { element._madePositioned = undefined; element.style.position = element.style.top = element.style.left = element.style.bottom = element.style.right = ''; } return element; }, makeClipping: function(element) { element = $(element); if (element._overflow) return element; element._overflow = Element.getStyle(element, 'overflow') || 'auto'; if (element._overflow !== 'hidden') element.style.overflow = 'hidden'; return element; }, undoClipping: function(element) { element = $(element); if (!element._overflow) return element; element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; element._overflow = null; return element; }, cumulativeOffset: function(element) { var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; element = element.offsetParent; } while (element); return Element._returnOffset(valueL, valueT); }, positionedOffset: function(element) { var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; element = element.offsetParent; if (element) { if (element.tagName == 'BODY') break; var p = Element.getStyle(element, 'position'); if (p == 'relative' || p == 'absolute') break; } } while (element); return Element._returnOffset(valueL, valueT); }, absolutize: function(element) { element = $(element); if (element.getStyle('position') == 'absolute') return; // Position.prepare(); // To be done manually by Scripty when it needs it. var offsets = element.positionedOffset(); var top = offsets[1]; var left = offsets[0]; var width = element.clientWidth; var height = element.clientHeight; element._originalLeft = left - parseFloat(element.style.left || 0); element._originalTop = top - parseFloat(element.style.top || 0); element._originalWidth = element.style.width; element._originalHeight = element.style.height; element.style.position = 'absolute'; element.style.top = top + 'px'; element.style.left = left + 'px'; element.style.width = width + 'px'; element.style.height = height + 'px'; return element; }, relativize: function(element) { element = $(element); if (element.getStyle('position') == 'relative') return; // Position.prepare(); // To be done manually by Scripty when it needs it. element.style.position = 'relative'; var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); element.style.top = top + 'px'; element.style.left = left + 'px'; element.style.height = element._originalHeight; element.style.width = element._originalWidth; return element; }, cumulativeScrollOffset: function(element) { var valueT = 0, valueL = 0; do { valueT += element.scrollTop || 0; valueL += element.scrollLeft || 0; element = element.parentNode; } while (element); return Element._returnOffset(valueL, valueT); }, getOffsetParent: function(element) { if (element.offsetParent) return $(element.offsetParent); if (element == document.body) return $(element); while ((element = element.parentNode) && element != document.body) if (Element.getStyle(element, 'position') != 'static') return $(element); return $(document.body); }, viewportOffset: function(forElement) { var valueT = 0, valueL = 0; var element = forElement; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; // Safari fix if (element.offsetParent == document.body && Element.getStyle(element, 'position') == 'absolute') break; } while (element = element.offsetParent); element = forElement; do { if (!Prototype.Browser.Opera || element.tagName == 'BODY') { valueT -= element.scrollTop || 0; valueL -= element.scrollLeft || 0; } } while (element = element.parentNode); return Element._returnOffset(valueL, valueT); }, clonePosition: function(element, source) { var options = Object.extend({ setLeft: true, setTop: true, setWidth: true, setHeight: true, offsetTop: 0, offsetLeft: 0 }, arguments[2] || { }); // find page position of source source = $(source); var p = source.viewportOffset(); // find coordinate system to use element = $(element); var delta = [0, 0]; var parent = null; // delta [0,0] will do fine with position: fixed elements, // position:absolute needs offsetParent deltas if (Element.getStyle(element, 'position') == 'absolute') { parent = element.getOffsetParent(); delta = parent.viewportOffset(); } // correct by body offsets (fixes Safari) if (parent == document.body) { delta[0] -= document.body.offsetLeft; delta[1] -= document.body.offsetTop; } // set position if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; if (options.setWidth) element.style.width = source.offsetWidth + 'px'; if (options.setHeight) element.style.height = source.offsetHeight + 'px'; return element; } }; Element.Methods.identify.counter = 1; Object.extend(Element.Methods, { getElementsBySelector: Element.Methods.select, childElements: Element.Methods.immediateDescendants }); Element._attributeTranslations = { write: { names: { className: 'class', htmlFor: 'for' }, values: { } } }; if (!document.createRange || Prototype.Browser.Opera) { Element.Methods.insert = function(element, insertions) { element = $(element); if (Object.isString(insertions) || Object.isNumber(insertions) || Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML))) insertions = { bottom: insertions }; var t = Element._insertionTranslations, content, position, pos, tagName; for (position in insertions) { content = insertions[position]; position = position.toLowerCase(); pos = t[position]; if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) { pos.insert(element, content); continue; } content = Object.toHTML(content); tagName = ((position == 'before' || position == 'after') ? element.parentNode : element).tagName.toUpperCase(); if (t.tags[tagName]) { var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); if (position == 'top' || position == 'after') fragments.reverse(); fragments.each(pos.insert.curry(element)); } else element.insertAdjacentHTML(pos.adjacency, content.stripScripts()); content.evalScripts.bind(content).defer(); } return element; }; } if (Prototype.Browser.Opera) { Element.Methods._getStyle = Element.Methods.getStyle; Element.Methods.getStyle = function(element, style) { switch(style) { case 'left': case 'top': case 'right': case 'bottom': if (Element._getStyle(element, 'position') == 'static') return null; default: return Element._getStyle(element, style); } }; Element.Methods._readAttribute = Element.Methods.readAttribute; Element.Methods.readAttribute = function(element, attribute) { if (attribute == 'title') return element.title; return Element._readAttribute(element, attribute); }; } else if (Prototype.Browser.IE) { $w('positionedOffset getOffsetParent viewportOffset').each(function(method) { Element.Methods[method] = Element.Methods[method].wrap( function(proceed, element) { element = $(element); var position = element.getStyle('position'); if (position != 'static') return proceed(element); element.setStyle({ position: 'relative' }); var value = proceed(element); element.setStyle({ position: position }); return value; } ); }); Element.Methods.getStyle = function(element, style) { element = $(element); style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize(); var value = element.style[style]; if (!value && element.currentStyle) value = element.currentStyle[style]; if (style == 'opacity') { if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) if (value[1]) return parseFloat(value[1]) / 100; return 1.0; } if (value == 'auto') { if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none')) return element['offset' + style.capitalize()] + 'px'; return null; } return value; }; Element.Methods.setOpacity = function(element, value) { function stripAlpha(filter){ return filter.replace(/alpha\([^\)]*\)/gi,''); } element = $(element); var currentStyle = element.currentStyle; if ((currentStyle && !currentStyle.hasLayout) || (!currentStyle && element.style.zoom == 'normal')) element.style.zoom = 1; var filter = element.getStyle('filter'), style = element.style; if (value == 1 || value === '') { (filter = stripAlpha(filter)) ? style.filter = filter : style.removeAttribute('filter'); return element; } else if (value < 0.00001) value = 0; style.filter = stripAlpha(filter) + 'alpha(opacity=' + (value * 100) + ')'; return element; }; Element._attributeTranslations = { read: { names: { 'class': 'className', 'for': 'htmlFor' }, values: { _getAttr: function(element, attribute) { return element.getAttribute(attribute, 2); }, _getAttrNode: function(element, attribute) { var node = element.getAttributeNode(attribute); return node ? node.value : ""; }, _getEv: function(element, attribute) { var attribute = element.getAttribute(attribute); return attribute ? attribute.toString().slice(23, -2) : null; }, _flag: function(element, attribute) { return $(element).hasAttribute(attribute) ? attribute : null; }, style: function(element) { return element.style.cssText.toLowerCase(); }, title: function(element) { return element.title; } } } }; Element._attributeTranslations.write = { names: Object.clone(Element._attributeTranslations.read.names), values: { checked: function(element, value) { element.checked = !!value; }, style: function(element, value) { element.style.cssText = value ? value : ''; } } }; Element._attributeTranslations.has = {}; $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' + 'encType maxLength readOnly longDesc').each(function(attr) { Element._attributeTranslations.write.names[attr.toLowerCase()] = attr; Element._attributeTranslations.has[attr.toLowerCase()] = attr; }); (function(v) { Object.extend(v, { href: v._getAttr, src: v._getAttr, type: v._getAttr, action: v._getAttrNode, disabled: v._flag, checked: v._flag, readonly: v._flag, multiple: v._flag, onload: v._getEv, onunload: v._getEv, onclick: v._getEv, ondblclick: v._getEv, onmousedown: v._getEv, onmouseup: v._getEv, onmouseover: v._getEv, onmousemove: v._getEv, onmouseout: v._getEv, onfocus: v._getEv, onblur: v._getEv, onkeypress: v._getEv, onkeydown: v._getEv, onkeyup: v._getEv, onsubmit: v._getEv, onreset: v._getEv, onselect: v._getEv, onchange: v._getEv }); })(Element._attributeTranslations.read.values); } else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) { Element.Methods.setOpacity = function(element, value) { element = $(element); element.style.opacity = (value == 1) ? 0.999999 : (value === '') ? '' : (value < 0.00001) ? 0 : value; return element; }; } else if (Prototype.Browser.WebKit) { Element.Methods.setOpacity = function(element, value) { element = $(element); element.style.opacity = (value == 1 || value === '') ? '' : (value < 0.00001) ? 0 : value; if (value == 1) if(element.tagName == 'IMG' && element.width) { element.width++; element.width--; } else try { var n = document.createTextNode(' '); element.appendChild(n); element.removeChild(n); } catch (e) { } return element; }; // Safari returns margins on body which is incorrect if the child is absolutely // positioned. For performance reasons, redefine Position.cumulativeOffset for // KHTML/WebKit only. Element.Methods.cumulativeOffset = function(element) { var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; if (element.offsetParent == document.body) if (Element.getStyle(element, 'position') == 'absolute') break; element = element.offsetParent; } while (element); return Element._returnOffset(valueL, valueT); }; } if (Prototype.Browser.IE || Prototype.Browser.Opera) { // IE and Opera are missing .innerHTML support for TABLE-related and SELECT elements Element.Methods.update = function(element, content) { element = $(element); if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) return element.update().insert(content); content = Object.toHTML(content); var tagName = element.tagName.toUpperCase(); if (tagName in Element._insertionTranslations.tags) { $A(element.childNodes).each(function(node) { element.removeChild(node) }); Element._getContentFromAnonymousElement(tagName, content.stripScripts()) .each(function(node) { element.appendChild(node) }); } else element.innerHTML = content.stripScripts(); content.evalScripts.bind(content).defer(); return element; }; } if (document.createElement('div').outerHTML) { Element.Methods.replace = function(element, content) { element = $(element); if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) { element.parentNode.replaceChild(content, element); return element; } content = Object.toHTML(content); var parent = element.parentNode, tagName = parent.tagName.toUpperCase(); if (Element._insertionTranslations.tags[tagName]) { var nextSibling = element.next(); var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); parent.removeChild(element); if (nextSibling) fragments.each(function(node) { parent.insertBefore(node, nextSibling) }); else fragments.each(function(node) { parent.appendChild(node) }); } else element.outerHTML = content.stripScripts(); content.evalScripts.bind(content).defer(); return element; }; } Element._returnOffset = function(l, t) { var result = [l, t]; result.left = l; result.top = t; return result; }; Element._getContentFromAnonymousElement = function(tagName, html) { var div = new Element('div'), t = Element._insertionTranslations.tags[tagName]; div.innerHTML = t[0] + html + t[1]; t[2].times(function() { div = div.firstChild }); return $A(div.childNodes); }; Element._insertionTranslations = { before: { adjacency: 'beforeBegin', insert: function(element, node) { element.parentNode.insertBefore(node, element); }, initializeRange: function(element, range) { range.setStartBefore(element); } }, top: { adjacency: 'afterBegin', insert: function(element, node) { element.insertBefore(node, element.firstChild); }, initializeRange: function(element, range) { range.selectNodeContents(element); range.collapse(true); } }, bottom: { adjacency: 'beforeEnd', insert: function(element, node) { element.appendChild(node); } }, after: { adjacency: 'afterEnd', insert: function(element, node) { element.parentNode.insertBefore(node, element.nextSibling); }, initializeRange: function(element, range) { range.setStartAfter(element); } }, tags: { TABLE: ['<table>', '</table>', 1], TBODY: ['<table><tbody>', '</tbody></table>', 2], TR: ['<table><tbody><tr>', '</tr></tbody></table>', 3], TD: ['<table><tbody><tr><td>', '</td></tr></tbody></table>', 4], SELECT: ['<select>', '</select>', 1] } }; (function() { this.bottom.initializeRange = this.top.initializeRange; Object.extend(this.tags, { THEAD: this.tags.TBODY, TFOOT: this.tags.TBODY, TH: this.tags.TD }); }).call(Element._insertionTranslations); Element.Methods.Simulated = { hasAttribute: function(element, attribute) { attribute = Element._attributeTranslations.has[attribute] || attribute; var node = $(element).getAttributeNode(attribute); return node && node.specified; } }; Element.Methods.ByTag = { }; Object.extend(Element, Element.Methods); if (!Prototype.BrowserFeatures.ElementExtensions && document.createElement('div').__proto__) { window.HTMLElement = { }; window.HTMLElement.prototype = document.createElement('div').__proto__; Prototype.BrowserFeatures.ElementExtensions = true; } Element.extend = (function() { if (Prototype.BrowserFeatures.SpecificElementExtensions) return Prototype.K; var Methods = { }, ByTag = Element.Methods.ByTag; var extend = Object.extend(function(element) { if (!element || element._extendedByPrototype || element.nodeType != 1 || element == window) return element; var methods = Object.clone(Methods), tagName = element.tagName, property, value; // extend methods for specific tags if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]); for (property in methods) { value = methods[property]; if (Object.isFunction(value) && !(property in element)) element[property] = value.methodize(); } element._extendedByPrototype = Prototype.emptyFunction; return element; }, { refresh: function() { // extend methods for all tags (Safari doesn't need this) if (!Prototype.BrowserFeatures.ElementExtensions) { Object.extend(Methods, Element.Methods); Object.extend(Methods, Element.Methods.Simulated); } } }); extend.refresh(); return extend; })(); Element.hasAttribute = function(element, attribute) { if (element.hasAttribute) return element.hasAttribute(attribute); return Element.Methods.Simulated.hasAttribute(element, attribute); }; Element.addMethods = function(methods) { var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag; if (!methods) { Object.extend(Form, Form.Methods); Object.extend(Form.Element, Form.Element.Methods); Object.extend(Element.Methods.ByTag, { "FORM": Object.clone(Form.Methods), "INPUT": Object.clone(Form.Element.Methods), "SELECT": Object.clone(Form.Element.Methods), "TEXTAREA": Object.clone(Form.Element.Methods) }); } if (arguments.length == 2) { var tagName = methods; methods = arguments[1]; } if (!tagName) Object.extend(Element.Methods, methods || { }); else { if (Object.isArray(tagName)) tagName.each(extend); else extend(tagName); } function extend(tagName) { tagName = tagName.toUpperCase(); if (!Element.Methods.ByTag[tagName]) Element.Methods.ByTag[tagName] = { }; Object.extend(Element.Methods.ByTag[tagName], methods); } function copy(methods, destination, onlyIfAbsent) { onlyIfAbsent = onlyIfAbsent || false; for (var property in methods) { var value = methods[property]; if (!Object.isFunction(value)) continue; if (!onlyIfAbsent || !(property in destination)) destination[property] = value.methodize(); } } function findDOMClass(tagName) { var klass; var trans = { "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph", "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList", "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading", "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote", "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION": "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD": "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR": "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET": "FrameSet", "IFRAME": "IFrame" }; if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element'; if (window[klass]) return window[klass]; klass = 'HTML' + tagName + 'Element'; if (window[klass]) return window[klass]; klass = 'HTML' + tagName.capitalize() + 'Element'; if (window[klass]) return window[klass]; window[klass] = { }; window[klass].prototype = document.createElement(tagName).__proto__; return window[klass]; } if (F.ElementExtensions) { copy(Element.Methods, HTMLElement.prototype); copy(Element.Methods.Simulated, HTMLElement.prototype, true); } if (F.SpecificElementExtensions) { for (var tag in Element.Methods.ByTag) { var klass = findDOMClass(tag); if (Object.isUndefined(klass)) continue; copy(T[tag], klass.prototype); } } Object.extend(Element, Element.Methods); delete Element.ByTag; if (Element.extend.refresh) Element.extend.refresh(); Element.cache = { }; }; document.viewport = { getDimensions: function() { var dimensions = { }; $w('width height').each(function(d) { var D = d.capitalize(); dimensions[d] = self['inner' + D] || (document.documentElement['client' + D] || document.body['client' + D]); }); return dimensions; }, getWidth: function() { return this.getDimensions().width; }, getHeight: function() { return this.getDimensions().height; }, getScrollOffsets: function() { return Element._returnOffset( window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop); } }; /* Portions of the Selector class are derived from Jack Slocum’s DomQuery, * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style * license. Please see http://www.yui-ext.com/ for more information. */ var Selector = Class.create({ initialize: function(expression) { this.expression = expression.strip(); this.compileMatcher(); }, compileMatcher: function() { // Selectors with namespaced attributes can't use the XPath version if (Prototype.BrowserFeatures.XPath && !(/(\[[\w-]*?:|:checked)/).test(this.expression)) return this.compileXPathMatcher(); var e = this.expression, ps = Selector.patterns, h = Selector.handlers, c = Selector.criteria, le, p, m; if (Selector._cache[e]) { this.matcher = Selector._cache[e]; return; } this.matcher = ["this.matcher = function(root) {", "var r = root, h = Selector.handlers, c = false, n;"]; while (e && le != e && (/\S/).test(e)) { le = e; for (var i in ps) { p = ps[i]; if (m = e.match(p)) { this.matcher.push(Object.isFunction(c[i]) ? c[i](m) : new Template(c[i]).evaluate(m)); e = e.replace(m[0], ''); break; } } } this.matcher.push("return h.unique(n);\n}"); eval(this.matcher.join('\n')); Selector._cache[this.expression] = this.matcher; }, compileXPathMatcher: function() { var e = this.expression, ps = Selector.patterns, x = Selector.xpath, le, m; if (Selector._cache[e]) { this.xpath = Selector._cache[e]; return; } this.matcher = ['.//*']; while (e && le != e && (/\S/).test(e)) { le = e; for (var i in ps) { if (m = e.match(ps[i])) { this.matcher.push(Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).evaluate(m)); e = e.replace(m[0], ''); break; } } } this.xpath = this.matcher.join(''); Selector._cache[this.expression] = this.xpath; }, findElements: function(root) { root = root || document; if (this.xpath) return document._getElementsByXPath(this.xpath, root); return this.matcher(root); }, match: function(element) { this.tokens = []; var e = this.expression, ps = Selector.patterns, as = Selector.assertions; var le, p, m; while (e && le !== e && (/\S/).test(e)) { le = e; for (var i in ps) { p = ps[i]; if (m = e.match(p)) { // use the Selector.assertions methods unless the selector // is too complex. if (as[i]) { this.tokens.push([i, Object.clone(m)]); e = e.replace(m[0], ''); } else { // reluctantly do a document-wide search // and look for a match in the array return this.findElements(document).include(element); } } } } var match = true, name, matches; for (var i = 0, token; token = this.tokens[i]; i++) { name = token[0], matches = token[1]; if (!Selector.assertions[name](element, matches)) { match = false; break; } } return match; }, toString: function() { return this.expression; }, inspect: function() { return "#<Selector:" + this.expression.inspect() + ">"; } }); Object.extend(Selector, { _cache: { }, xpath: { descendant: "//*", child: "/*", adjacent: "/following-sibling::*[1]", laterSibling: '/following-sibling::*', tagName: function(m) { if (m[1] == '*') return ''; return "[local-name()='" + m[1].toLowerCase() + "' or local-name()='" + m[1].toUpperCase() + "']"; }, className: "[contains(concat(' ', @class, ' '), ' #{1} ')]", id: "[@id='#{1}']", attrPresence: "[@#{1}]", attr: function(m) { m[3] = m[5] || m[6]; return new Template(Selector.xpath.operators[m[2]]).evaluate(m); }, pseudo: function(m) { var h = Selector.xpath.pseudos[m[1]]; if (!h) return ''; if (Object.isFunction(h)) return h(m); return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m); }, operators: { '=': "[@#{1}='#{3}']", '!=': "[@#{1}!='#{3}']", '^=': "[starts-with(@#{1}, '#{3}')]", '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']", '*=': "[contains(@#{1}, '#{3}')]", '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]", '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]" }, pseudos: { 'first-child': '[not(preceding-sibling::*)]', 'last-child': '[not(following-sibling::*)]', 'only-child': '[not(preceding-sibling::* or following-sibling::*)]', 'empty': "[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]", 'checked': "[@checked]", 'disabled': "[@disabled]", 'enabled': "[not(@disabled)]", 'not': function(m) { var e = m[6], p = Selector.patterns, x = Selector.xpath, le, m, v; var exclusion = []; while (e && le != e && (/\S/).test(e)) { le = e; for (var i in p) { if (m = e.match(p[i])) { v = Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).evaluate(m); exclusion.push("(" + v.substring(1, v.length - 1) + ")"); e = e.replace(m[0], ''); break; } } } return "[not(" + exclusion.join(" and ") + ")]"; }, 'nth-child': function(m) { return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m); }, 'nth-last-child': function(m) { return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m); }, 'nth-of-type': function(m) { return Selector.xpath.pseudos.nth("position() ", m); }, 'nth-last-of-type': function(m) { return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m); }, 'first-of-type': function(m) { m[6] = "1"; return Selector.xpath.pseudos['nth-of-type'](m); }, 'last-of-type': function(m) { m[6] = "1"; return Selector.xpath.pseudos['nth-last-of-type'](m); }, 'only-of-type': function(m) { var p = Selector.xpath.pseudos; return p['first-of-type'](m) + p['last-of-type'](m); }, nth: function(fragment, m) { var mm, formula = m[6], predicate; if (formula == 'even') formula = '2n+0'; if (formula == 'odd') formula = '2n+1'; if (mm = formula.match(/^(\d+)$/)) // digit only return '[' + fragment + "= " + mm[1] + ']'; if (mm = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b if (mm[1] == "-") mm[1] = -1; var a = mm[1] ? Number(mm[1]) : 1; var b = mm[2] ? Number(mm[2]) : 0; predicate = "[((#{fragment} - #{b}) mod #{a} = 0) and " + "((#{fragment} - #{b}) div #{a} >= 0)]"; return new Template(predicate).evaluate({ fragment: fragment, a: a, b: b }); } } } }, criteria: { tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;', className: 'n = h.className(n, r, "#{1}", c); c = false;', id: 'n = h.id(n, r, "#{1}", c); c = false;', attrPresence: 'n = h.attrPresence(n, r, "#{1}"); c = false;', attr: function(m) { m[3] = (m[5] || m[6]); return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(m); }, pseudo: function(m) { if (m[6]) m[6] = m[6].replace(/"/g, '\\"'); return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m); }, descendant: 'c = "descendant";', child: 'c = "child";', adjacent: 'c = "adjacent";', laterSibling: 'c = "laterSibling";' }, patterns: { // combinators must be listed first // (and descendant needs to be last combinator) laterSibling: /^\s*~\s*/, child: /^\s*>\s*/, adjacent: /^\s*\+\s*/, descendant: /^\s/, // selectors follow tagName: /^\s*(\*|[\w\-]+)(\b|$)?/, id: /^#([\w\-\*]+)(\b|$)/, className: /^\.([\w\-\*]+)(\b|$)/, pseudo: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s)|(?=:))/, attrPresence: /^\[([\w]+)\]/, attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/ }, // for Selector.match and Element#match assertions: { tagName: function(element, matches) { return matches[1].toUpperCase() == element.tagName.toUpperCase(); }, className: function(element, matches) { return Element.hasClassName(element, matches[1]); }, id: function(element, matches) { return element.id === matches[1]; }, attrPresence: function(element, matches) { return Element.hasAttribute(element, matches[1]); }, attr: function(element, matches) { var nodeValue = Element.readAttribute(element, matches[1]); return Selector.operators[matches[2]](nodeValue, matches[3]); } }, handlers: { // UTILITY FUNCTIONS // joins two collections concat: function(a, b) { for (var i = 0, node; node = b[i]; i++) a.push(node); return a; }, // marks an array of nodes for counting mark: function(nodes) { for (var i = 0, node; node = nodes[i]; i++) node._counted = true; return nodes; }, unmark: function(nodes) { for (var i = 0, node; node = nodes[i]; i++) node._counted = undefined; return nodes; }, // mark each child node with its position (for nth calls) // "ofType" flag indicates whether we're indexing for nth-of-type // rather than nth-child index: function(parentNode, reverse, ofType) { parentNode._counted = true; if (reverse) { for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) { var node = nodes[i]; if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++; } } else { for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++) if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++; } }, // filters out duplicates and extends all nodes unique: function(nodes) { if (nodes.length == 0) return nodes; var results = [], n; for (var i = 0, l = nodes.length; i < l; i++) if (!(n = nodes[i])._counted) { n._counted = true; results.push(Element.extend(n)); } return Selector.handlers.unmark(results); }, // COMBINATOR FUNCTIONS descendant: function(nodes) { var h = Selector.handlers; for (var i = 0, results = [], node; node = nodes[i]; i++) h.concat(results, node.getElementsByTagName('*')); return results; }, child: function(nodes) { var h = Selector.handlers; for (var i = 0, results = [], node; node = nodes[i]; i++) { for (var j = 0, children = [], child; child = node.childNodes[j]; j++) if (child.nodeType == 1 && child.tagName != '!') results.push(child); } return results; }, adjacent: function(nodes) { for (var i = 0, results = [], node; node = nodes[i]; i++) { var next = this.nextElementSibling(node); if (next) results.push(next); } return results; }, laterSibling: function(nodes) { var h = Selector.handlers; for (var i = 0, results = [], node; node = nodes[i]; i++) h.concat(results, Element.nextSiblings(node)); return results; }, nextElementSibling: function(node) { while (node = node.nextSibling) if (node.nodeType == 1) return node; return null; }, previousElementSibling: function(node) { while (node = node.previousSibling) if (node.nodeType == 1) return node; return null; }, // TOKEN FUNCTIONS tagName: function(nodes, root, tagName, combinator) { tagName = tagName.toUpperCase(); var results = [], h = Selector.handlers; if (nodes) { if (combinator) { // fastlane for ordinary descendant combinators if (combinator == "descendant") { for (var i = 0, node; node = nodes[i]; i++) h.concat(results, node.getElementsByTagName(tagName)); return results; } else nodes = this[combinator](nodes); if (tagName == "*") return nodes; } for (var i = 0, node; node = nodes[i]; i++) if (node.tagName.toUpperCase() == tagName) results.push(node); return results; } else return root.getElementsByTagName(tagName); }, id: function(nodes, root, id, combinator) { var targetNode = $(id), h = Selector.handlers; if (!targetNode) return []; if (!nodes && root == document) return [targetNode]; if (nodes) { if (combinator) { if (combinator == 'child') { for (var i = 0, node; node = nodes[i]; i++) if (targetNode.parentNode == node) return [targetNode]; } else if (combinator == 'descendant') { for (var i = 0, node; node = nodes[i]; i++) if (Element.descendantOf(targetNode, node)) return [targetNode]; } else if (combinator == 'adjacent') { for (var i = 0, node; node = nodes[i]; i++) if (Selector.handlers.previousElementSibling(targetNode) == node) return [targetNode]; } else nodes = h[combinator](nodes); } for (var i = 0, node; node = nodes[i]; i++) if (node == targetNode) return [targetNode]; return []; } return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : []; }, className: function(nodes, root, className, combinator) { if (nodes && combinator) nodes = this[combinator](nodes); return Selector.handlers.byClassName(nodes, root, className); }, byClassName: function(nodes, root, className) { if (!nodes) nodes = Selector.handlers.descendant([root]); var needle = ' ' + className + ' '; for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) { nodeClassName = node.className; if (nodeClassName.length == 0) continue; if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle)) results.push(node); } return results; }, attrPresence: function(nodes, root, attr) { if (!nodes) nodes = root.getElementsByTagName("*"); var results = []; for (var i = 0, node; node = nodes[i]; i++) if (Element.hasAttribute(node, attr)) results.push(node); return results; }, attr: function(nodes, root, attr, value, operator) { if (!nodes) nodes = root.getElementsByTagName("*"); var handler = Selector.operators[operator], results = []; for (var i = 0, node; node = nodes[i]; i++) { var nodeValue = Element.readAttribute(node, attr); if (nodeValue === null) continue; if (handler(nodeValue, value)) results.push(node); } return results; }, pseudo: function(nodes, name, value, root, combinator) { if (nodes && combinator) nodes = this[combinator](nodes); if (!nodes) nodes = root.getElementsByTagName("*"); return Selector.pseudos[name](nodes, value, root); } }, pseudos: { 'first-child': function(nodes, value, root) { for (var i = 0, results = [], node; node = nodes[i]; i++) { if (Selector.handlers.previousElementSibling(node)) continue; results.push(node); } return results; }, 'last-child': function(nodes, value, root) { for (var i = 0, results = [], node; node = nodes[i]; i++) { if (Selector.handlers.nextElementSibling(node)) continue; results.push(node); } return results; }, 'only-child': function(nodes, value, root) { var h = Selector.handlers; for (var i = 0, results = [], node; node = nodes[i]; i++) if (!h.previousElementSibling(node) && !h.nextElementSibling(node)) results.push(node); return results; }, 'nth-child': function(nodes, formula, root) { return Selector.pseudos.nth(nodes, formula, root); }, 'nth-last-child': function(nodes, formula, root) { return Selector.pseudos.nth(nodes, formula, root, true); }, 'nth-of-type': function(nodes, formula, root) { return Selector.pseudos.nth(nodes, formula, root, false, true); }, 'nth-last-of-type': function(nodes, formula, root) { return Selector.pseudos.nth(nodes, formula, root, true, true); }, 'first-of-type': function(nodes, formula, root) { return Selector.pseudos.nth(nodes, "1", root, false, true); }, 'last-of-type': function(nodes, formula, root) { return Selector.pseudos.nth(nodes, "1", root, true, true); }, 'only-of-type': function(nodes, formula, root) { var p = Selector.pseudos; return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root); }, // handles the an+b logic getIndices: function(a, b, total) { if (a == 0) return b > 0 ? [b] : []; return $R(1, total).inject([], function(memo, i) { if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i); return memo; }); }, // handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-type nth: function(nodes, formula, root, reverse, ofType) { if (nodes.length == 0) return []; if (formula == 'even') formula = '2n+0'; if (formula == 'odd') formula = '2n+1'; var h = Selector.handlers, results = [], indexed = [], m; h.mark(nodes); for (var i = 0, node; node = nodes[i]; i++) { if (!node.parentNode._counted) { h.index(node.parentNode, reverse, ofType); indexed.push(node.parentNode); } } if (formula.match(/^\d+$/)) { // just a number formula = Number(formula); for (var i = 0, node; node = nodes[i]; i++) if (node.nodeIndex == formula) results.push(node); } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b if (m[1] == "-") m[1] = -1; var a = m[1] ? Number(m[1]) : 1; var b = m[2] ? Number(m[2]) : 0; var indices = Selector.pseudos.getIndices(a, b, nodes.length); for (var i = 0, node, l = indices.length; node = nodes[i]; i++) { for (var j = 0; j < l; j++) if (node.nodeIndex == indices[j]) results.push(node); } } h.unmark(nodes); h.unmark(indexed); return results; }, 'empty': function(nodes, value, root) { for (var i = 0, results = [], node; node = nodes[i]; i++) { // IE treats comments as element nodes if (node.tagName == '!' || (node.firstChild && !node.innerHTML.match(/^\s*$/))) continue; results.push(node); } return results; }, 'not': function(nodes, selector, root) { var h = Selector.handlers, selectorType, m; var exclusions = new Selector(selector).findElements(root); h.mark(exclusions); for (var i = 0, results = [], node; node = nodes[i]; i++) if (!node._counted) results.push(node); h.unmark(exclusions); return results; }, 'enabled': function(nodes, value, root) { for (var i = 0, results = [], node; node = nodes[i]; i++) if (!node.disabled) results.push(node); return results; }, 'disabled': function(nodes, value, root) { for (var i = 0, results = [], node; node = nodes[i]; i++) if (node.disabled) results.push(node); return results; }, 'checked': function(nodes, value, root) { for (var i = 0, results = [], node; node = nodes[i]; i++) if (node.checked) results.push(node); return results; } }, operators: { '=': function(nv, v) { return nv == v; }, '!=': function(nv, v) { return nv != v; }, '^=': function(nv, v) { return nv.startsWith(v); }, '$=': function(nv, v) { return nv.endsWith(v); }, '*=': function(nv, v) { return nv.include(v); }, '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); }, '|=': function(nv, v) { return ('-' + nv.toUpperCase() + '-').include('-' + v.toUpperCase() + '-'); } }, matchElements: function(elements, expression) { var matches = new Selector(expression).findElements(), h = Selector.handlers; h.mark(matches); for (var i = 0, results = [], element; element = elements[i]; i++) if (element._counted) results.push(element); h.unmark(matches); return results; }, findElement: function(elements, expression, index) { if (Object.isNumber(expression)) { index = expression; expression = false; } return Selector.matchElements(elements, expression || '*')[index || 0]; }, findChildElements: function(element, expressions) { var exprs = expressions.join(','), expressions = []; exprs.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) { expressions.push(m[1].strip()); }); var results = [], h = Selector.handlers; for (var i = 0, l = expressions.length, selector; i < l; i++) { selector = new Selector(expressions[i].strip()); h.concat(results, selector.findElements(element)); } return (l > 1) ? h.unique(results) : results; } }); function $$() { return Selector.findChildElements(document, $A(arguments)); } var Form = { reset: function(form) { $(form).reset(); return form; }, serializeElements: function(elements, options) { if (typeof options != 'object') options = { hash: !!options }; else if (options.hash === undefined) options.hash = true; var key, value, submitted = false, submit = options.submit; var data = elements.inject({ }, function(result, element) { if (!element.disabled && element.name) { key = element.name; value = $(element).getValue(); if (value != null && (element.type != 'submit' || (!submitted && submit !== false && (!submit || key == submit) && (submitted = true)))) { if (key in result) { // a key is already present; construct an array of values if (!Object.isArray(result[key])) result[key] = [result[key]]; result[key].push(value); } else result[key] = value; } } return result; }); return options.hash ? data : Object.toQueryString(data); } }; Form.Methods = { serialize: function(form, options) { return Form.serializeElements(Form.getElements(form), options); }, getElements: function(form) { return $A($(form).getElementsByTagName('*')).inject([], function(elements, child) { if (Form.Element.Serializers[child.tagName.toLowerCase()]) elements.push(Element.extend(child)); return elements; } ); }, getInputs: function(form, typeName, name) { form = $(form); var inputs = form.getElementsByTagName('input'); if (!typeName && !name) return $A(inputs).map(Element.extend); for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) { var input = inputs[i]; if ((typeName && input.type != typeName) || (name && input.name != name)) continue; matchingInputs.push(Element.extend(input)); } return matchingInputs; }, disable: function(form) { form = $(form); Form.getElements(form).invoke('disable'); return form; }, enable: function(form) { form = $(form); Form.getElements(form).invoke('enable'); return form; }, findFirstElement: function(form) { var elements = $(form).getElements().findAll(function(element) { return 'hidden' != element.type && !element.disabled; }); var firstByIndex = elements.findAll(function(element) { return element.hasAttribute('tabIndex') && element.tabIndex >= 0; }).sortBy(function(element) { return element.tabIndex }).first(); return firstByIndex ? firstByIndex : elements.find(function(element) { return ['input', 'select', 'textarea'].include(element.tagName.toLowerCase()); }); }, focusFirstElement: function(form) { form = $(form); form.findFirstElement().activate(); return form; }, request: function(form, options) { form = $(form), options = Object.clone(options || { }); var params = options.parameters, action = form.readAttribute('action') || ''; if (action.blank()) action = window.location.href; options.parameters = form.serialize(true); if (params) { if (Object.isString(params)) params = params.toQueryParams(); Object.extend(options.parameters, params); } if (form.hasAttribute('method') && !options.method) options.method = form.method; return new Ajax.Request(action, options); } }; /*--------------------------------------------------------------------------*/ Form.Element = { focus: function(element) { $(element).focus(); return element; }, select: function(element) { $(element).select(); return element; } }; Form.Element.Methods = { serialize: function(element) { element = $(element); if (!element.disabled && element.name) { var value = element.getValue(); if (value != undefined) { var pair = { }; pair[element.name] = value; return Object.toQueryString(pair); } } return ''; }, getValue: function(element) { element = $(element); var method = element.tagName.toLowerCase(); return Form.Element.Serializers[method](element); }, setValue: function(element, value) { element = $(element); var method = element.tagName.toLowerCase(); Form.Element.Serializers[method](element, value); return element; }, clear: function(element) { $(element).value = ''; return element; }, present: function(element) { return $(element).value != ''; }, activate: function(element) { element = $(element); try { element.focus(); if (element.select && (element.tagName.toLowerCase() != 'input' || !['button', 'reset', 'submit'].include(element.type))) element.select(); } catch (e) { } return element; }, disable: function(element) { element = $(element); element.blur(); element.disabled = true; return element; }, enable: function(element) { element = $(element); element.disabled = false; return element; } }; /*--------------------------------------------------------------------------*/ var Field = Form.Element; var $F = Form.Element.Methods.getValue; /*--------------------------------------------------------------------------*/ Form.Element.Serializers = { input: function(element, value) { switch (element.type.toLowerCase()) { case 'checkbox': case 'radio': return Form.Element.Serializers.inputSelector(element, value); default: return Form.Element.Serializers.textarea(element, value); } }, inputSelector: function(element, value) { if (value === undefined) return element.checked ? element.value : null; else element.checked = !!value; }, textarea: function(element, value) { if (value === undefined) return element.value; else element.value = value; }, select: function(element, index) { if (index === undefined) return this[element.type == 'select-one' ? 'selectOne' : 'selectMany'](element); else { var opt, value, single = !Object.isArray(index); for (var i = 0, length = element.length; i < length; i++) { opt = element.options[i]; value = this.optionValue(opt); if (single) { if (value == index) { opt.selected = true; return; } } else opt.selected = index.include(value); } } }, selectOne: function(element) { var index = element.selectedIndex; return index >= 0 ? this.optionValue(element.options[index]) : null; }, selectMany: function(element) { var values, length = element.length; if (!length) return null; for (var i = 0, values = []; i < length; i++) { var opt = element.options[i]; if (opt.selected) values.push(this.optionValue(opt)); } return values; }, optionValue: function(opt) { // extend element because hasAttribute may not be native return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text; } }; /*--------------------------------------------------------------------------*/ Abstract.TimedObserver = Class.create(PeriodicalExecuter, { initialize: function($super, element, frequency, callback) { $super(callback, frequency); this.element = $(element); this.lastValue = this.getValue(); }, execute: function() { var value = this.getValue(); if (Object.isString(this.lastValue) && Object.isString(value) ? this.lastValue != value : String(this.lastValue) != String(value)) { this.callback(this.element, value); this.lastValue = value; } } }); Form.Element.Observer = Class.create(Abstract.TimedObserver, { getValue: function() { return Form.Element.getValue(this.element); } }); Form.Observer = Class.create(Abstract.TimedObserver, { getValue: function() { return Form.serialize(this.element); } }); /*--------------------------------------------------------------------------*/ Abstract.EventObserver = Class.create({ initialize: function(element, callback) { this.element = $(element); this.callback = callback; this.lastValue = this.getValue(); if (this.element.tagName.toLowerCase() == 'form') this.registerFormCallbacks(); else this.registerCallback(this.element); }, onElementEvent: function() { var value = this.getValue(); if (this.lastValue != value) { this.callback(this.element, value); this.lastValue = value; } }, registerFormCallbacks: function() { Form.getElements(this.element).each(this.registerCallback, this); }, registerCallback: function(element) { if (element.type) { switch (element.type.toLowerCase()) { case 'checkbox': case 'radio': Event.observe(element, 'click', this.onElementEvent.bind(this)); break; default: Event.observe(element, 'change', this.onElementEvent.bind(this)); break; } } } }); Form.Element.EventObserver = Class.create(Abstract.EventObserver, { getValue: function() { return Form.Element.getValue(this.element); } }); Form.EventObserver = Class.create(Abstract.EventObserver, { getValue: function() { return Form.serialize(this.element); } }); if (!window.Event) var Event = { }; Object.extend(Event, { KEY_BACKSPACE: 8, KEY_TAB: 9, KEY_RETURN: 13, KEY_ESC: 27, KEY_LEFT: 37, KEY_UP: 38, KEY_RIGHT: 39, KEY_DOWN: 40, KEY_DELETE: 46, KEY_HOME: 36, KEY_END: 35, KEY_PAGEUP: 33, KEY_PAGEDOWN: 34, KEY_INSERT: 45, cache: { }, relatedTarget: function(event) { var element; switch(event.type) { case 'mouseover': element = event.fromElement; break; case 'mouseout': element = event.toElement; break; default: return null; } return Element.extend(element); } }); Event.Methods = (function() { var isButton; if (Prototype.Browser.IE) { var buttonMap = { 0: 1, 1: 4, 2: 2 }; isButton = function(event, code) { return event.button == buttonMap[code]; }; } else if (Prototype.Browser.WebKit) { isButton = function(event, code) { switch (code) { case 0: return event.which == 1 && !event.metaKey; case 1: return event.which == 1 && event.metaKey; default: return false; } }; } else { isButton = function(event, code) { return event.which ? (event.which === code + 1) : (event.button === code); }; } return { isLeftClick: function(event) { return isButton(event, 0) }, isMiddleClick: function(event) { return isButton(event, 1) }, isRightClick: function(event) { return isButton(event, 2) }, element: function(event) { var node = Event.extend(event).target; return Element.extend(node.nodeType == Node.TEXT_NODE ? node.parentNode : node); }, findElement: function(event, expression) { var element = Event.element(event); return element.match(expression) ? element : element.up(expression); }, pointer: function(event) { return { x: event.pageX || (event.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)), y: event.pageY || (event.clientY + (document.documentElement.scrollTop || document.body.scrollTop)) }; }, pointerX: function(event) { return Event.pointer(event).x }, pointerY: function(event) { return Event.pointer(event).y }, stop: function(event) { Event.extend(event); event.preventDefault(); event.stopPropagation(); event.stopped = true; } }; })(); Event.extend = (function() { var methods = Object.keys(Event.Methods).inject({ }, function(m, name) { m[name] = Event.Methods[name].methodize(); return m; }); if (Prototype.Browser.IE) { Object.extend(methods, { stopPropagation: function() { this.cancelBubble = true }, preventDefault: function() { this.returnValue = false }, inspect: function() { return "[object Event]" } }); return function(event) { if (!event) return false; if (event._extendedByPrototype) return event; event._extendedByPrototype = Prototype.emptyFunction; var pointer = Event.pointer(event); Object.extend(event, { target: event.srcElement, relatedTarget: Event.relatedTarget(event), pageX: pointer.x, pageY: pointer.y }); return Object.extend(event, methods); }; } else { Event.prototype = Event.prototype || document.createEvent("HTMLEvents").__proto__; Object.extend(Event.prototype, methods); return Prototype.K; } })(); Object.extend(Event, (function() { var cache = Event.cache; function getEventID(element) { if (element._eventID) return element._eventID; arguments.callee.id = arguments.callee.id || 1; return element._eventID = ++arguments.callee.id; } function getDOMEventName(eventName) { if (eventName && eventName.include(':')) return "dataavailable"; return eventName; } function getCacheForID(id) { return cache[id] = cache[id] || { }; } function getWrappersForEventName(id, eventName) { var c = getCacheForID(id); return c[eventName] = c[eventName] || []; } function createWrapper(element, eventName, handler) { var id = getEventID(element); var c = getWrappersForEventName(id, eventName); if (c.pluck("handler").include(handler)) return false; var wrapper = function(event) { if (!Event || !Event.extend || (event.eventName && event.eventName != eventName)) return false; Event.extend(event); handler.call(element, event) }; wrapper.handler = handler; c.push(wrapper); return wrapper; } function findWrapper(id, eventName, handler) { var c = getWrappersForEventName(id, eventName); return c.find(function(wrapper) { return wrapper.handler == handler }); } function destroyWrapper(id, eventName, handler) { var c = getCacheForID(id); if (!c[eventName]) return false; c[eventName] = c[eventName].without(findWrapper(id, eventName, handler)); } function destroyCache() { for (var id in cache) for (var eventName in cache[id]) cache[id][eventName] = null; } if (window.attachEvent) { window.attachEvent("onunload", destroyCache); } return { observe: function(element, eventName, handler) { element = $(element); var name = getDOMEventName(eventName); var wrapper = createWrapper(element, eventName, handler); if (!wrapper) return element; if (element.addEventListener) { element.addEventListener(name, wrapper, false); } else { element.attachEvent("on" + name, wrapper); } return element; }, stopObserving: function(element, eventName, handler) { element = $(element); var id = getEventID(element), name = getDOMEventName(eventName); if (!handler && eventName) { getWrappersForEventName(id, eventName).each(function(wrapper) { element.stopObserving(eventName, wrapper.handler); }); return element; } else if (!eventName) { Object.keys(getCacheForID(id)).each(function(eventName) { element.stopObserving(eventName); }); return element; } var wrapper = findWrapper(id, eventName, handler); if (!wrapper) return element; if (element.removeEventListener) { element.removeEventListener(name, wrapper, false); } else { element.detachEvent("on" + name, wrapper); } destroyWrapper(id, eventName, handler); return element; }, fire: function(element, eventName, memo) { element = $(element); if (element == document && document.createEvent && !element.dispatchEvent) element = document.documentElement; if (document.createEvent) { var event = document.createEvent("HTMLEvents"); event.initEvent("dataavailable", true, true); } else { var event = document.createEventObject(); event.eventType = "ondataavailable"; } event.eventName = eventName; event.memo = memo || { }; if (document.createEvent) { element.dispatchEvent(event); } else { element.fireEvent(event.eventType, event); } return event; } }; })()); Object.extend(Event, Event.Methods); Element.addMethods({ fire: Event.fire, observe: Event.observe, stopObserving: Event.stopObserving }); Object.extend(document, { fire: Element.Methods.fire.methodize(), observe: Element.Methods.observe.methodize(), stopObserving: Element.Methods.stopObserving.methodize() }); (function() { /* Support for the DOMContentLoaded event is based on work by Dan Webb, Matthias Miller, Dean Edwards and John Resig. */ var timer, fired = false; function fireContentLoadedEvent() { if (fired) return; if (timer) window.clearInterval(timer); document.fire("dom:loaded"); fired = true; } if (document.addEventListener) { if (Prototype.Browser.WebKit) { timer = window.setInterval(function() { if (/loaded|complete/.test(document.readyState)) fireContentLoadedEvent(); }, 0); Event.observe(window, "load", fireContentLoadedEvent); } else { document.addEventListener("DOMContentLoaded", fireContentLoadedEvent, false); } } else { document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>"); $("__onDOMContentLoaded").onreadystatechange = function() { if (this.readyState == "complete") { this.onreadystatechange = null; fireContentLoadedEvent(); } }; } })(); /*------------------------------- DEPRECATED -------------------------------*/ Hash.toQueryString = Object.toQueryString; var Toggle = { display: Element.toggle }; Element.Methods.childOf = Element.Methods.descendantOf; var Insertion = { Before: function(element, content) { return Element.insert(element, {before:content}); }, Top: function(element, content) { return Element.insert(element, {top:content}); }, Bottom: function(element, content) { return Element.insert(element, {bottom:content}); }, After: function(element, content) { return Element.insert(element, {after:content}); } }; var $continue = new Error('"throw $continue" is deprecated, use "return" instead'); // This should be moved to script.aculo.us; notice the deprecated methods // further below, that map to the newer Element methods. var Position = { // set to true if needed, warning: firefox performance problems // NOT neeeded for page scrolling, only if draggable contained in // scrollable elements includeScrollOffsets: false, // must be called before calling withinIncludingScrolloffset, every time the // page is scrolled prepare: function() { this.deltaX = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0; this.deltaY = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; }, // caches x/y coordinate pair to use with overlap within: function(element, x, y) { if (this.includeScrollOffsets) return this.withinIncludingScrolloffsets(element, x, y); this.xcomp = x; this.ycomp = y; this.offset = Element.cumulativeOffset(element); return (y >= this.offset[1] && y < this.offset[1] + element.offsetHeight && x >= this.offset[0] && x < this.offset[0] + element.offsetWidth); }, withinIncludingScrolloffsets: function(element, x, y) { var offsetcache = Element.cumulativeScrollOffset(element); this.xcomp = x + offsetcache[0] - this.deltaX; this.ycomp = y + offsetcache[1] - this.deltaY; this.offset = Element.cumulativeOffset(element); return (this.ycomp >= this.offset[1] && this.ycomp < this.offset[1] + element.offsetHeight && this.xcomp >= this.offset[0] && this.xcomp < this.offset[0] + element.offsetWidth); }, // within must be called directly before overlap: function(mode, element) { if (!mode) return 0; if (mode == 'vertical') return ((this.offset[1] + element.offsetHeight) - this.ycomp) / element.offsetHeight; if (mode == 'horizontal') return ((this.offset[0] + element.offsetWidth) - this.xcomp) / element.offsetWidth; }, // Deprecation layer -- use newer Element methods now (1.5.2). cumulativeOffset: Element.Methods.cumulativeOffset, positionedOffset: Element.Methods.positionedOffset, absolutize: function(element) { Position.prepare(); return Element.absolutize(element); }, relativize: function(element) { Position.prepare(); return Element.relativize(element); }, realOffset: Element.Methods.cumulativeScrollOffset, offsetParent: Element.Methods.getOffsetParent, page: Element.Methods.viewportOffset, clone: function(source, target, options) { options = options || { }; return Element.clonePosition(target, source, options); } }; /*--------------------------------------------------------------------------*/ if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){ function iter(name) { return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]"; } instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ? function(element, className) { className = className.toString().strip(); var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className); return cond ? document._getElementsByXPath('.//*' + cond, element) : []; } : function(element, className) { className = className.toString().strip(); var elements = [], classNames = (/\s/.test(className) ? $w(className) : null); if (!classNames && !className) return elements; var nodes = $(element).getElementsByTagName('*'); className = ' ' + className + ' '; for (var i = 0, child, cn; child = nodes[i]; i++) { if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) || (classNames && classNames.all(function(name) { return !name.toString().blank() && cn.include(' ' + name + ' '); })))) elements.push(Element.extend(child)); } return elements; }; return function(className, parentElement) { return $(parentElement || document.body).getElementsByClassName(className); }; }(Element.Methods); /*--------------------------------------------------------------------------*/ Element.ClassNames = Class.create(); Element.ClassNames.prototype = { initialize: function(element) { this.element = $(element); }, _each: function(iterator) { this.element.className.split(/\s+/).select(function(name) { return name.length > 0; })._each(iterator); }, set: function(className) { this.element.className = className; }, add: function(classNameToAdd) { if (this.include(classNameToAdd)) return; this.set($A(this).concat(classNameToAdd).join(' ')); }, remove: function(classNameToRemove) { if (!this.include(classNameToRemove)) return; this.set($A(this).without(classNameToRemove).join(' ')); }, toString: function() { return $A(this).join(' '); } }; Object.extend(Element.ClassNames.prototype, Enumerable); /*--------------------------------------------------------------------------*/ Element.addMethods();����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/scriptaculous/effects.js������������������������������������������������������0000644�0001066�0001066�00000114112�10762616541�016735� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// script.aculo.us effects.js v1.8.0, Tue Nov 06 15:01:40 +0300 2007 // Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) // Contributors: // Justin Palmer (http://encytemedia.com/) // Mark Pilgrim (http://diveintomark.org/) // Martin Bialasinki // // script.aculo.us is freely distributable under the terms of an MIT-style license. // For details, see the script.aculo.us web site: http://script.aculo.us/ // converts rgb() and #xxx to #xxxxxx format, // returns self (or first argument) if not convertable String.prototype.parseColor = function() { var color = '#'; if (this.slice(0,4) == 'rgb(') { var cols = this.slice(4,this.length-1).split(','); var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3); } else { if (this.slice(0,1) == '#') { if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase(); if (this.length==7) color = this.toLowerCase(); } } return (color.length==7 ? color : (arguments[0] || this)); }; /*--------------------------------------------------------------------------*/ Element.collectTextNodes = function(element) { return $A($(element).childNodes).collect( function(node) { return (node.nodeType==3 ? node.nodeValue : (node.hasChildNodes() ? Element.collectTextNodes(node) : '')); }).flatten().join(''); }; Element.collectTextNodesIgnoreClass = function(element, className) { return $A($(element).childNodes).collect( function(node) { return (node.nodeType==3 ? node.nodeValue : ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? Element.collectTextNodesIgnoreClass(node, className) : '')); }).flatten().join(''); }; Element.setContentZoom = function(element, percent) { element = $(element); element.setStyle({fontSize: (percent/100) + 'em'}); if (Prototype.Browser.WebKit) window.scrollBy(0,0); return element; }; Element.getInlineOpacity = function(element){ return $(element).style.opacity || ''; }; Element.forceRerendering = function(element) { try { element = $(element); var n = document.createTextNode(' '); element.appendChild(n); element.removeChild(n); } catch(e) { } }; /*--------------------------------------------------------------------------*/ var Effect = { _elementDoesNotExistError: { name: 'ElementDoesNotExistError', message: 'The specified DOM element does not exist, but is required for this effect to operate' }, Transitions: { linear: Prototype.K, sinoidal: function(pos) { return (-Math.cos(pos*Math.PI)/2) + 0.5; }, reverse: function(pos) { return 1-pos; }, flicker: function(pos) { var pos = ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4; return pos > 1 ? 1 : pos; }, wobble: function(pos) { return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5; }, pulse: function(pos, pulses) { pulses = pulses || 5; return ( ((pos % (1/pulses)) * pulses).round() == 0 ? ((pos * pulses * 2) - (pos * pulses * 2).floor()) : 1 - ((pos * pulses * 2) - (pos * pulses * 2).floor()) ); }, spring: function(pos) { return 1 - (Math.cos(pos * 4.5 * Math.PI) * Math.exp(-pos * 6)); }, none: function(pos) { return 0; }, full: function(pos) { return 1; } }, DefaultOptions: { duration: 1.0, // seconds fps: 100, // 100= assume 66fps max. sync: false, // true for combining from: 0.0, to: 1.0, delay: 0.0, queue: 'parallel' }, tagifyText: function(element) { var tagifyStyle = 'position:relative'; if (Prototype.Browser.IE) tagifyStyle += ';zoom:1'; element = $(element); $A(element.childNodes).each( function(child) { if (child.nodeType==3) { child.nodeValue.toArray().each( function(character) { element.insertBefore( new Element('span', {style: tagifyStyle}).update( character == ' ' ? String.fromCharCode(160) : character), child); }); Element.remove(child); } }); }, multiple: function(element, effect) { var elements; if (((typeof element == 'object') || Object.isFunction(element)) && (element.length)) elements = element; else elements = $(element).childNodes; var options = Object.extend({ speed: 0.1, delay: 0.0 }, arguments[2] || { }); var masterDelay = options.delay; $A(elements).each( function(element, index) { new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay })); }); }, PAIRS: { 'slide': ['SlideDown','SlideUp'], 'blind': ['BlindDown','BlindUp'], 'appear': ['Appear','Fade'] }, toggle: function(element, effect) { element = $(element); effect = (effect || 'appear').toLowerCase(); var options = Object.extend({ queue: { position:'end', scope:(element.id || 'global'), limit: 1 } }, arguments[2] || { }); Effect[element.visible() ? Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options); } }; Effect.DefaultOptions.transition = Effect.Transitions.sinoidal; /* ------------- core effects ------------- */ Effect.ScopedQueue = Class.create(Enumerable, { initialize: function() { this.effects = []; this.interval = null; }, _each: function(iterator) { this.effects._each(iterator); }, add: function(effect) { var timestamp = new Date().getTime(); var position = Object.isString(effect.options.queue) ? effect.options.queue : effect.options.queue.position; switch(position) { case 'front': // move unstarted effects after this effect this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) { e.startOn += effect.finishOn; e.finishOn += effect.finishOn; }); break; case 'with-last': timestamp = this.effects.pluck('startOn').max() || timestamp; break; case 'end': // start effect after last queued effect has finished timestamp = this.effects.pluck('finishOn').max() || timestamp; break; } effect.startOn += timestamp; effect.finishOn += timestamp; if (!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit)) this.effects.push(effect); if (!this.interval) this.interval = setInterval(this.loop.bind(this), 15); }, remove: function(effect) { this.effects = this.effects.reject(function(e) { return e==effect }); if (this.effects.length == 0) { clearInterval(this.interval); this.interval = null; } }, loop: function() { var timePos = new Date().getTime(); for(var i=0, len=this.effects.length;i<len;i++) this.effects[i] && this.effects[i].loop(timePos); } }); Effect.Queues = { instances: $H(), get: function(queueName) { if (!Object.isString(queueName)) return queueName; return this.instances.get(queueName) || this.instances.set(queueName, new Effect.ScopedQueue()); } }; Effect.Queue = Effect.Queues.get('global'); Effect.Base = Class.create({ position: null, start: function(options) { function codeForEvent(options,eventName){ return ( (options[eventName+'Internal'] ? 'this.options.'+eventName+'Internal(this);' : '') + (options[eventName] ? 'this.options.'+eventName+'(this);' : '') ); } if (options && options.transition === false) options.transition = Effect.Transitions.linear; this.options = Object.extend(Object.extend({ },Effect.DefaultOptions), options || { }); this.currentFrame = 0; this.state = 'idle'; this.startOn = this.options.delay*1000; this.finishOn = this.startOn+(this.options.duration*1000); this.fromToDelta = this.options.to-this.options.from; this.totalTime = this.finishOn-this.startOn; this.totalFrames = this.options.fps*this.options.duration; eval('this.render = function(pos){ '+ 'if (this.state=="idle"){this.state="running";'+ codeForEvent(this.options,'beforeSetup')+ (this.setup ? 'this.setup();':'')+ codeForEvent(this.options,'afterSetup')+ '};if (this.state=="running"){'+ 'pos=this.options.transition(pos)*'+this.fromToDelta+'+'+this.options.from+';'+ 'this.position=pos;'+ codeForEvent(this.options,'beforeUpdate')+ (this.update ? 'this.update(pos);':'')+ codeForEvent(this.options,'afterUpdate')+ '}}'); this.event('beforeStart'); if (!this.options.sync) Effect.Queues.get(Object.isString(this.options.queue) ? 'global' : this.options.queue.scope).add(this); }, loop: function(timePos) { if (timePos >= this.startOn) { if (timePos >= this.finishOn) { this.render(1.0); this.cancel(); this.event('beforeFinish'); if (this.finish) this.finish(); this.event('afterFinish'); return; } var pos = (timePos - this.startOn) / this.totalTime, frame = (pos * this.totalFrames).round(); if (frame > this.currentFrame) { this.render(pos); this.currentFrame = frame; } } }, cancel: function() { if (!this.options.sync) Effect.Queues.get(Object.isString(this.options.queue) ? 'global' : this.options.queue.scope).remove(this); this.state = 'finished'; }, event: function(eventName) { if (this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this); if (this.options[eventName]) this.options[eventName](this); }, inspect: function() { var data = $H(); for(property in this) if (!Object.isFunction(this[property])) data.set(property, this[property]); return '#<Effect:' + data.inspect() + ',options:' + $H(this.options).inspect() + '>'; } }); Effect.Parallel = Class.create(Effect.Base, { initialize: function(effects) { this.effects = effects || []; this.start(arguments[1]); }, update: function(position) { this.effects.invoke('render', position); }, finish: function(position) { this.effects.each( function(effect) { effect.render(1.0); effect.cancel(); effect.event('beforeFinish'); if (effect.finish) effect.finish(position); effect.event('afterFinish'); }); } }); Effect.Tween = Class.create(Effect.Base, { initialize: function(object, from, to) { object = Object.isString(object) ? $(object) : object; var args = $A(arguments), method = args.last(), options = args.length == 5 ? args[3] : null; this.method = Object.isFunction(method) ? method.bind(object) : Object.isFunction(object[method]) ? object[method].bind(object) : function(value) { object[method] = value }; this.start(Object.extend({ from: from, to: to }, options || { })); }, update: function(position) { this.method(position); } }); Effect.Event = Class.create(Effect.Base, { initialize: function() { this.start(Object.extend({ duration: 0 }, arguments[0] || { })); }, update: Prototype.emptyFunction }); Effect.Opacity = Class.create(Effect.Base, { initialize: function(element) { this.element = $(element); if (!this.element) throw(Effect._elementDoesNotExistError); // make this work on IE on elements without 'layout' if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout)) this.element.setStyle({zoom: 1}); var options = Object.extend({ from: this.element.getOpacity() || 0.0, to: 1.0 }, arguments[1] || { }); this.start(options); }, update: function(position) { this.element.setOpacity(position); } }); Effect.Move = Class.create(Effect.Base, { initialize: function(element) { this.element = $(element); if (!this.element) throw(Effect._elementDoesNotExistError); var options = Object.extend({ x: 0, y: 0, mode: 'relative' }, arguments[1] || { }); this.start(options); }, setup: function() { this.element.makePositioned(); this.originalLeft = parseFloat(this.element.getStyle('left') || '0'); this.originalTop = parseFloat(this.element.getStyle('top') || '0'); if (this.options.mode == 'absolute') { this.options.x = this.options.x - this.originalLeft; this.options.y = this.options.y - this.originalTop; } }, update: function(position) { this.element.setStyle({ left: (this.options.x * position + this.originalLeft).round() + 'px', top: (this.options.y * position + this.originalTop).round() + 'px' }); } }); // for backwards compatibility Effect.MoveBy = function(element, toTop, toLeft) { return new Effect.Move(element, Object.extend({ x: toLeft, y: toTop }, arguments[3] || { })); }; Effect.Scale = Class.create(Effect.Base, { initialize: function(element, percent) { this.element = $(element); if (!this.element) throw(Effect._elementDoesNotExistError); var options = Object.extend({ scaleX: true, scaleY: true, scaleContent: true, scaleFromCenter: false, scaleMode: 'box', // 'box' or 'contents' or { } with provided values scaleFrom: 100.0, scaleTo: percent }, arguments[2] || { }); this.start(options); }, setup: function() { this.restoreAfterFinish = this.options.restoreAfterFinish || false; this.elementPositioning = this.element.getStyle('position'); this.originalStyle = { }; ['top','left','width','height','fontSize'].each( function(k) { this.originalStyle[k] = this.element.style[k]; }.bind(this)); this.originalTop = this.element.offsetTop; this.originalLeft = this.element.offsetLeft; var fontSize = this.element.getStyle('font-size') || '100%'; ['em','px','%','pt'].each( function(fontSizeType) { if (fontSize.indexOf(fontSizeType)>0) { this.fontSize = parseFloat(fontSize); this.fontSizeType = fontSizeType; } }.bind(this)); this.factor = (this.options.scaleTo - this.options.scaleFrom)/100; this.dims = null; if (this.options.scaleMode=='box') this.dims = [this.element.offsetHeight, this.element.offsetWidth]; if (/^content/.test(this.options.scaleMode)) this.dims = [this.element.scrollHeight, this.element.scrollWidth]; if (!this.dims) this.dims = [this.options.scaleMode.originalHeight, this.options.scaleMode.originalWidth]; }, update: function(position) { var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position); if (this.options.scaleContent && this.fontSize) this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType }); this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale); }, finish: function(position) { if (this.restoreAfterFinish) this.element.setStyle(this.originalStyle); }, setDimensions: function(height, width) { var d = { }; if (this.options.scaleX) d.width = width.round() + 'px'; if (this.options.scaleY) d.height = height.round() + 'px'; if (this.options.scaleFromCenter) { var topd = (height - this.dims[0])/2; var leftd = (width - this.dims[1])/2; if (this.elementPositioning == 'absolute') { if (this.options.scaleY) d.top = this.originalTop-topd + 'px'; if (this.options.scaleX) d.left = this.originalLeft-leftd + 'px'; } else { if (this.options.scaleY) d.top = -topd + 'px'; if (this.options.scaleX) d.left = -leftd + 'px'; } } this.element.setStyle(d); } }); Effect.Highlight = Class.create(Effect.Base, { initialize: function(element) { this.element = $(element); if (!this.element) throw(Effect._elementDoesNotExistError); var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || { }); this.start(options); }, setup: function() { // Prevent executing on elements not in the layout flow if (this.element.getStyle('display')=='none') { this.cancel(); return; } // Disable background image during the effect this.oldStyle = { }; if (!this.options.keepBackgroundImage) { this.oldStyle.backgroundImage = this.element.getStyle('background-image'); this.element.setStyle({backgroundImage: 'none'}); } if (!this.options.endcolor) this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff'); if (!this.options.restorecolor) this.options.restorecolor = this.element.getStyle('background-color'); // init color calculations this._base = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this)); this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this)); }, update: function(position) { this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){ return m+((this._base[i]+(this._delta[i]*position)).round().toColorPart()); }.bind(this)) }); }, finish: function() { this.element.setStyle(Object.extend(this.oldStyle, { backgroundColor: this.options.restorecolor })); } }); Effect.ScrollTo = function(element) { var options = arguments[1] || { }, scrollOffsets = document.viewport.getScrollOffsets(), elementOffsets = $(element).cumulativeOffset(), max = (window.height || document.body.scrollHeight) - document.viewport.getHeight(); if (options.offset) elementOffsets[1] += options.offset; return new Effect.Tween(null, scrollOffsets.top, elementOffsets[1] > max ? max : elementOffsets[1], options, function(p){ scrollTo(scrollOffsets.left, p.round()) } ); }; /* ------------- combination effects ------------- */ Effect.Fade = function(element) { element = $(element); var oldOpacity = element.getInlineOpacity(); var options = Object.extend({ from: element.getOpacity() || 1.0, to: 0.0, afterFinishInternal: function(effect) { if (effect.options.to!=0) return; effect.element.hide().setStyle({opacity: oldOpacity}); } }, arguments[1] || { }); return new Effect.Opacity(element,options); }; Effect.Appear = function(element) { element = $(element); var options = Object.extend({ from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0), to: 1.0, // force Safari to render floated elements properly afterFinishInternal: function(effect) { effect.element.forceRerendering(); }, beforeSetup: function(effect) { effect.element.setOpacity(effect.options.from).show(); }}, arguments[1] || { }); return new Effect.Opacity(element,options); }; Effect.Puff = function(element) { element = $(element); var oldStyle = { opacity: element.getInlineOpacity(), position: element.getStyle('position'), top: element.style.top, left: element.style.left, width: element.style.width, height: element.style.height }; return new Effect.Parallel( [ new Effect.Scale(element, 200, { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], Object.extend({ duration: 1.0, beforeSetupInternal: function(effect) { Position.absolutize(effect.effects[0].element) }, afterFinishInternal: function(effect) { effect.effects[0].element.hide().setStyle(oldStyle); } }, arguments[1] || { }) ); }; Effect.BlindUp = function(element) { element = $(element); element.makeClipping(); return new Effect.Scale(element, 0, Object.extend({ scaleContent: false, scaleX: false, restoreAfterFinish: true, afterFinishInternal: function(effect) { effect.element.hide().undoClipping(); } }, arguments[1] || { }) ); }; Effect.BlindDown = function(element) { element = $(element); var elementDimensions = element.getDimensions(); return new Effect.Scale(element, 100, Object.extend({ scaleContent: false, scaleX: false, scaleFrom: 0, scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, restoreAfterFinish: true, afterSetup: function(effect) { effect.element.makeClipping().setStyle({height: '0px'}).show(); }, afterFinishInternal: function(effect) { effect.element.undoClipping(); } }, arguments[1] || { })); }; Effect.SwitchOff = function(element) { element = $(element); var oldOpacity = element.getInlineOpacity(); return new Effect.Appear(element, Object.extend({ duration: 0.4, from: 0, transition: Effect.Transitions.flicker, afterFinishInternal: function(effect) { new Effect.Scale(effect.element, 1, { duration: 0.3, scaleFromCenter: true, scaleX: false, scaleContent: false, restoreAfterFinish: true, beforeSetup: function(effect) { effect.element.makePositioned().makeClipping(); }, afterFinishInternal: function(effect) { effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity}); } }) } }, arguments[1] || { })); }; Effect.DropOut = function(element) { element = $(element); var oldStyle = { top: element.getStyle('top'), left: element.getStyle('left'), opacity: element.getInlineOpacity() }; return new Effect.Parallel( [ new Effect.Move(element, {x: 0, y: 100, sync: true }), new Effect.Opacity(element, { sync: true, to: 0.0 }) ], Object.extend( { duration: 0.5, beforeSetup: function(effect) { effect.effects[0].element.makePositioned(); }, afterFinishInternal: function(effect) { effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle); } }, arguments[1] || { })); }; Effect.Shake = function(element) { element = $(element); var options = Object.extend({ distance: 20, duration: 0.5 }, arguments[1] || {}); var distance = parseFloat(options.distance); var split = parseFloat(options.duration) / 10.0; var oldStyle = { top: element.getStyle('top'), left: element.getStyle('left') }; return new Effect.Move(element, { x: distance, y: 0, duration: split, afterFinishInternal: function(effect) { new Effect.Move(effect.element, { x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { new Effect.Move(effect.element, { x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { new Effect.Move(effect.element, { x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { new Effect.Move(effect.element, { x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { new Effect.Move(effect.element, { x: -distance, y: 0, duration: split, afterFinishInternal: function(effect) { effect.element.undoPositioned().setStyle(oldStyle); }}) }}) }}) }}) }}) }}); }; Effect.SlideDown = function(element) { element = $(element).cleanWhitespace(); // SlideDown need to have the content of the element wrapped in a container element with fixed height! var oldInnerBottom = element.down().getStyle('bottom'); var elementDimensions = element.getDimensions(); return new Effect.Scale(element, 100, Object.extend({ scaleContent: false, scaleX: false, scaleFrom: window.opera ? 0 : 1, scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, restoreAfterFinish: true, afterSetup: function(effect) { effect.element.makePositioned(); effect.element.down().makePositioned(); if (window.opera) effect.element.setStyle({top: ''}); effect.element.makeClipping().setStyle({height: '0px'}).show(); }, afterUpdateInternal: function(effect) { effect.element.down().setStyle({bottom: (effect.dims[0] - effect.element.clientHeight) + 'px' }); }, afterFinishInternal: function(effect) { effect.element.undoClipping().undoPositioned(); effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); } }, arguments[1] || { }) ); }; Effect.SlideUp = function(element) { element = $(element).cleanWhitespace(); var oldInnerBottom = element.down().getStyle('bottom'); var elementDimensions = element.getDimensions(); return new Effect.Scale(element, window.opera ? 0 : 1, Object.extend({ scaleContent: false, scaleX: false, scaleMode: 'box', scaleFrom: 100, scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, restoreAfterFinish: true, afterSetup: function(effect) { effect.element.makePositioned(); effect.element.down().makePositioned(); if (window.opera) effect.element.setStyle({top: ''}); effect.element.makeClipping().show(); }, afterUpdateInternal: function(effect) { effect.element.down().setStyle({bottom: (effect.dims[0] - effect.element.clientHeight) + 'px' }); }, afterFinishInternal: function(effect) { effect.element.hide().undoClipping().undoPositioned(); effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); } }, arguments[1] || { }) ); }; // Bug in opera makes the TD containing this element expand for a instance after finish Effect.Squish = function(element) { return new Effect.Scale(element, window.opera ? 1 : 0, { restoreAfterFinish: true, beforeSetup: function(effect) { effect.element.makeClipping(); }, afterFinishInternal: function(effect) { effect.element.hide().undoClipping(); } }); }; Effect.Grow = function(element) { element = $(element); var options = Object.extend({ direction: 'center', moveTransition: Effect.Transitions.sinoidal, scaleTransition: Effect.Transitions.sinoidal, opacityTransition: Effect.Transitions.full }, arguments[1] || { }); var oldStyle = { top: element.style.top, left: element.style.left, height: element.style.height, width: element.style.width, opacity: element.getInlineOpacity() }; var dims = element.getDimensions(); var initialMoveX, initialMoveY; var moveX, moveY; switch (options.direction) { case 'top-left': initialMoveX = initialMoveY = moveX = moveY = 0; break; case 'top-right': initialMoveX = dims.width; initialMoveY = moveY = 0; moveX = -dims.width; break; case 'bottom-left': initialMoveX = moveX = 0; initialMoveY = dims.height; moveY = -dims.height; break; case 'bottom-right': initialMoveX = dims.width; initialMoveY = dims.height; moveX = -dims.width; moveY = -dims.height; break; case 'center': initialMoveX = dims.width / 2; initialMoveY = dims.height / 2; moveX = -dims.width / 2; moveY = -dims.height / 2; break; } return new Effect.Move(element, { x: initialMoveX, y: initialMoveY, duration: 0.01, beforeSetup: function(effect) { effect.element.hide().makeClipping().makePositioned(); }, afterFinishInternal: function(effect) { new Effect.Parallel( [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }), new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }), new Effect.Scale(effect.element, 100, { scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true}) ], Object.extend({ beforeSetup: function(effect) { effect.effects[0].element.setStyle({height: '0px'}).show(); }, afterFinishInternal: function(effect) { effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); } }, options) ) } }); }; Effect.Shrink = function(element) { element = $(element); var options = Object.extend({ direction: 'center', moveTransition: Effect.Transitions.sinoidal, scaleTransition: Effect.Transitions.sinoidal, opacityTransition: Effect.Transitions.none }, arguments[1] || { }); var oldStyle = { top: element.style.top, left: element.style.left, height: element.style.height, width: element.style.width, opacity: element.getInlineOpacity() }; var dims = element.getDimensions(); var moveX, moveY; switch (options.direction) { case 'top-left': moveX = moveY = 0; break; case 'top-right': moveX = dims.width; moveY = 0; break; case 'bottom-left': moveX = 0; moveY = dims.height; break; case 'bottom-right': moveX = dims.width; moveY = dims.height; break; case 'center': moveX = dims.width / 2; moveY = dims.height / 2; break; } return new Effect.Parallel( [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }), new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}), new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }) ], Object.extend({ beforeStartInternal: function(effect) { effect.effects[0].element.makePositioned().makeClipping(); }, afterFinishInternal: function(effect) { effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); } }, options) ); }; Effect.Pulsate = function(element) { element = $(element); var options = arguments[1] || { }; var oldOpacity = element.getInlineOpacity(); var transition = options.transition || Effect.Transitions.sinoidal; var reverser = function(pos){ return transition(1-Effect.Transitions.pulse(pos, options.pulses)) }; reverser.bind(transition); return new Effect.Opacity(element, Object.extend(Object.extend({ duration: 2.0, from: 0, afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); } }, options), {transition: reverser})); }; Effect.Fold = function(element) { element = $(element); var oldStyle = { top: element.style.top, left: element.style.left, width: element.style.width, height: element.style.height }; element.makeClipping(); return new Effect.Scale(element, 5, Object.extend({ scaleContent: false, scaleX: false, afterFinishInternal: function(effect) { new Effect.Scale(element, 1, { scaleContent: false, scaleY: false, afterFinishInternal: function(effect) { effect.element.hide().undoClipping().setStyle(oldStyle); } }); }}, arguments[1] || { })); }; Effect.Morph = Class.create(Effect.Base, { initialize: function(element) { this.element = $(element); if (!this.element) throw(Effect._elementDoesNotExistError); var options = Object.extend({ style: { } }, arguments[1] || { }); if (!Object.isString(options.style)) this.style = $H(options.style); else { if (options.style.include(':')) this.style = options.style.parseStyle(); else { this.element.addClassName(options.style); this.style = $H(this.element.getStyles()); this.element.removeClassName(options.style); var css = this.element.getStyles(); this.style = this.style.reject(function(style) { return style.value == css[style.key]; }); options.afterFinishInternal = function(effect) { effect.element.addClassName(effect.options.style); effect.transforms.each(function(transform) { effect.element.style[transform.style] = ''; }); } } } this.start(options); }, setup: function(){ function parseColor(color){ if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff'; color = color.parseColor(); return $R(0,2).map(function(i){ return parseInt( color.slice(i*2+1,i*2+3), 16 ) }); } this.transforms = this.style.map(function(pair){ var property = pair[0], value = pair[1], unit = null; if (value.parseColor('#zzzzzz') != '#zzzzzz') { value = value.parseColor(); unit = 'color'; } else if (property == 'opacity') { value = parseFloat(value); if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout)) this.element.setStyle({zoom: 1}); } else if (Element.CSS_LENGTH.test(value)) { var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/); value = parseFloat(components[1]); unit = (components.length == 3) ? components[2] : null; } var originalValue = this.element.getStyle(property); return { style: property.camelize(), originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), targetValue: unit=='color' ? parseColor(value) : value, unit: unit }; }.bind(this)).reject(function(transform){ return ( (transform.originalValue == transform.targetValue) || ( transform.unit != 'color' && (isNaN(transform.originalValue) || isNaN(transform.targetValue)) ) ) }); }, update: function(position) { var style = { }, transform, i = this.transforms.length; while(i--) style[(transform = this.transforms[i]).style] = transform.unit=='color' ? '#'+ (Math.round(transform.originalValue[0]+ (transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() + (Math.round(transform.originalValue[1]+ (transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart() + (Math.round(transform.originalValue[2]+ (transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() : (transform.originalValue + (transform.targetValue - transform.originalValue) * position).toFixed(3) + (transform.unit === null ? '' : transform.unit); this.element.setStyle(style, true); } }); Effect.Transform = Class.create({ initialize: function(tracks){ this.tracks = []; this.options = arguments[1] || { }; this.addTracks(tracks); }, addTracks: function(tracks){ tracks.each(function(track){ track = $H(track); var data = track.values().first(); this.tracks.push($H({ ids: track.keys().first(), effect: Effect.Morph, options: { style: data } })); }.bind(this)); return this; }, play: function(){ return new Effect.Parallel( this.tracks.map(function(track){ var ids = track.get('ids'), effect = track.get('effect'), options = track.get('options'); var elements = [$(ids) || $$(ids)].flatten(); return elements.map(function(e){ return new effect(e, Object.extend({ sync:true }, options)) }); }).flatten(), this.options ); } }); Element.CSS_PROPERTIES = $w( 'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' + 'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' + 'borderRightColor borderRightStyle borderRightWidth borderSpacing ' + 'borderTopColor borderTopStyle borderTopWidth bottom clip color ' + 'fontSize fontWeight height left letterSpacing lineHeight ' + 'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+ 'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' + 'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' + 'right textIndent top width wordSpacing zIndex'); Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/; String.__parseStyleElement = document.createElement('div'); String.prototype.parseStyle = function(){ var style, styleRules = $H(); if (Prototype.Browser.WebKit) style = new Element('div',{style:this}).style; else { String.__parseStyleElement.innerHTML = '<div style="' + this + '"></div>'; style = String.__parseStyleElement.childNodes[0].style; } Element.CSS_PROPERTIES.each(function(property){ if (style[property]) styleRules.set(property, style[property]); }); if (Prototype.Browser.IE && this.include('opacity')) styleRules.set('opacity', this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]); return styleRules; }; if (document.defaultView && document.defaultView.getComputedStyle) { Element.getStyles = function(element) { var css = document.defaultView.getComputedStyle($(element), null); return Element.CSS_PROPERTIES.inject({ }, function(styles, property) { styles[property] = css[property]; return styles; }); }; } else { Element.getStyles = function(element) { element = $(element); var css = element.currentStyle, styles; styles = Element.CSS_PROPERTIES.inject({ }, function(hash, property) { hash.set(property, css[property]); return hash; }); if (!styles.opacity) styles.set('opacity', element.getOpacity()); return styles; }; }; Effect.Methods = { morph: function(element, style) { element = $(element); new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || { })); return element; }, visualEffect: function(element, effect, options) { element = $(element) var s = effect.dasherize().camelize(), klass = s.charAt(0).toUpperCase() + s.substring(1); new Effect[klass](element, options); return element; }, highlight: function(element, options) { element = $(element); new Effect.Highlight(element, options); return element; } }; $w('fade appear grow shrink fold blindUp blindDown slideUp slideDown '+ 'pulsate shake puff squish switchOff dropOut').each( function(effect) { Effect.Methods[effect] = function(element, options){ element = $(element); Effect[effect.charAt(0).toUpperCase() + effect.substring(1)](element, options); return element; } } ); $w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each( function(f) { Effect.Methods[f] = Element[f]; } ); Element.addMethods(Effect.Methods); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/scriptaculous/MIT-LICENSE�����������������������������������������������������0000644�0001066�0001066�00000002145�10762616541�016416� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/scriptaculous/scriptaculous.js������������������������������������������������0000644�0001066�0001066�00000005136�10762616541�020223� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// script.aculo.us scriptaculous.js v1.8.0, Tue Nov 06 15:01:40 +0300 2007 // Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // For details, see the script.aculo.us web site: http://script.aculo.us/ var Scriptaculous = { Version: '1.8.0', require: function(libraryName) { // inserting via DOM fails in Safari 2.0, so brute force approach document.write('<script type="text/javascript" src="'+libraryName+'"><\/script>'); }, REQUIRED_PROTOTYPE: '1.6.0', load: function() { function convertVersionString(versionString){ var r = versionString.split('.'); return parseInt(r[0])*100000 + parseInt(r[1])*1000 + parseInt(r[2]); } if((typeof Prototype=='undefined') || (typeof Element == 'undefined') || (typeof Element.Methods=='undefined') || (convertVersionString(Prototype.Version) < convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE))) throw("script.aculo.us requires the Prototype JavaScript framework >= " + Scriptaculous.REQUIRED_PROTOTYPE); $A(document.getElementsByTagName("script")).findAll( function(s) { return (s.src && s.src.match(/scriptaculous\.js(\?.*)?$/)) }).each( function(s) { var path = s.src.replace(/scriptaculous\.js(\?.*)?$/,''); var includes = s.src.match(/\?.*load=([a-z,]*)/); (includes ? includes[1] : 'builder,effects,dragdrop,controls,slider,sound').split(',').each( function(include) { Scriptaculous.require(path+include+'.js') }); }); } } Scriptaculous.load();����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/scriptaculous/builder.js������������������������������������������������������0000644�0001066�0001066�00000011242�10762616541�016744� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// script.aculo.us builder.js v1.8.0, Tue Nov 06 15:01:40 +0300 2007 // Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) // // script.aculo.us is freely distributable under the terms of an MIT-style license. // For details, see the script.aculo.us web site: http://script.aculo.us/ var Builder = { NODEMAP: { AREA: 'map', CAPTION: 'table', COL: 'table', COLGROUP: 'table', LEGEND: 'fieldset', OPTGROUP: 'select', OPTION: 'select', PARAM: 'object', TBODY: 'table', TD: 'table', TFOOT: 'table', TH: 'table', THEAD: 'table', TR: 'table' }, // note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken, // due to a Firefox bug node: function(elementName) { elementName = elementName.toUpperCase(); // try innerHTML approach var parentTag = this.NODEMAP[elementName] || 'div'; var parentElement = document.createElement(parentTag); try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 parentElement.innerHTML = "<" + elementName + "></" + elementName + ">"; } catch(e) {} var element = parentElement.firstChild || null; // see if browser added wrapping tags if(element && (element.tagName.toUpperCase() != elementName)) element = element.getElementsByTagName(elementName)[0]; // fallback to createElement approach if(!element) element = document.createElement(elementName); // abort if nothing could be created if(!element) return; // attributes (or text) if(arguments[1]) if(this._isStringOrNumber(arguments[1]) || (arguments[1] instanceof Array) || arguments[1].tagName) { this._children(element, arguments[1]); } else { var attrs = this._attributes(arguments[1]); if(attrs.length) { try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 parentElement.innerHTML = "<" +elementName + " " + attrs + "></" + elementName + ">"; } catch(e) {} element = parentElement.firstChild || null; // workaround firefox 1.0.X bug if(!element) { element = document.createElement(elementName); for(attr in arguments[1]) element[attr == 'class' ? 'className' : attr] = arguments[1][attr]; } if(element.tagName.toUpperCase() != elementName) element = parentElement.getElementsByTagName(elementName)[0]; } } // text, or array of children if(arguments[2]) this._children(element, arguments[2]); return element; }, _text: function(text) { return document.createTextNode(text); }, ATTR_MAP: { 'className': 'class', 'htmlFor': 'for' }, _attributes: function(attributes) { var attrs = []; for(attribute in attributes) attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) + '="' + attributes[attribute].toString().escapeHTML().gsub(/"/,'"') + '"'); return attrs.join(" "); }, _children: function(element, children) { if(children.tagName) { element.appendChild(children); return; } if(typeof children=='object') { // array can hold nodes and text children.flatten().each( function(e) { if(typeof e=='object') element.appendChild(e) else if(Builder._isStringOrNumber(e)) element.appendChild(Builder._text(e)); }); } else if(Builder._isStringOrNumber(children)) element.appendChild(Builder._text(children)); }, _isStringOrNumber: function(param) { return(typeof param=='string' || typeof param=='number'); }, build: function(html) { var element = this.node('div'); $(element).update(html.strip()); return element.down(); }, dump: function(scope) { if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " + "BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " + "FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+ "KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+ "PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+ "TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/); tags.each( function(tag){ scope[tag] = function() { return Builder.node.apply(Builder, [tag].concat($A(arguments))); } }); } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/autosave.js�������������������������������������������������������������������0000644�0001066�0001066�00000017703�11027744666�014262� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������var autosaveLast = ''; var autosavePeriodical; var autosaveOldMessage = ''; var autosaveDelayURL = null; var previewwin; jQuery(function($) { autosaveLast = $('#post #title').val()+$('#post #content').val(); autosavePeriodical = $.schedule({time: autosaveL10n.autosaveInterval * 1000, func: function() { autosave(); }, repeat: true, protect: true}); //Disable autosave after the form has been submitted $("#post").submit(function() { $.cancel(autosavePeriodical); }); // Autosave when the preview button is clicked. $('#previewview a').click(function(e) { autosave(); autosaveDelayURL = this.href; previewwin = window.open('','_blank'); e.preventDefault(); return false; }); }); function autosave_parse_response(response) { var res = wpAjax.parseAjaxResponse(response, 'autosave'); // parse the ajax response var message = ''; if ( res && res.responses && res.responses.length ) { message = res.responses[0].data; // The saved message or error. // someone else is editing: disable autosave, set errors if ( res.responses[0].supplemental ) { if ( 'disable' == res.responses[0].supplemental['disable_autosave'] ) { autosave = function() {}; res = { errors: true }; } jQuery.each(res.responses[0].supplemental, function(selector, value) { if ( selector.match(/^replace-/) ) { jQuery('#'+selector.replace('replace-', '')).val(value); } }); } // if no errors: add preview link and slug UI if ( !res.errors ) { var postID = parseInt( res.responses[0].id ); if ( !isNaN(postID) && postID > 0 ) { autosave_update_preview_link(postID); autosave_update_slug(postID); } } } if ( message ) { jQuery('#autosave').html(message); } // update autosave message else if ( autosaveOldMessage && res ) { jQuery('#autosave').html( autosaveOldMessage ); } return res; } // called when autosaving pre-existing post function autosave_saved(response) { autosave_parse_response(response); // parse the ajax response autosave_enable_buttons(); // re-enable disabled form buttons } // called when autosaving new post function autosave_saved_new(response) { var res = autosave_parse_response(response); // parse the ajax response // if no errors: update post_ID from the temporary value, grab new save-nonce for that new ID if ( res && res.responses.length && !res.errors ) { var tempID = jQuery('#post_ID').val(); var postID = parseInt( res.responses[0].id ); autosave_update_post_ID( postID ); // disabled form buttons are re-enabled here if ( tempID < 0 && postID > 0) // update media buttons jQuery('#media-buttons a').each(function(){ this.href = this.href.replace(tempID, postID); }); } else { autosave_enable_buttons(); // re-enable disabled form buttons } } function autosave_update_post_ID( postID ) { if ( !isNaN(postID) && postID > 0 ) { if ( postID == parseInt(jQuery('#post_ID').val()) ) { return; } // no need to do this more than once jQuery('#post_ID').attr({name: "post_ID"}); jQuery('#post_ID').val(postID); // We need new nonces jQuery.post(autosaveL10n.requestFile, { action: "autosave-generate-nonces", post_ID: postID, autosavenonce: jQuery('#autosavenonce').val(), post_type: jQuery('#post_type').val() }, function(html) { jQuery('#_wpnonce').val(html); autosave_enable_buttons(); // re-enable disabled form buttons }); jQuery('#hiddenaction').val('editpost'); } } function autosave_update_preview_link(post_id) { // Add preview button if not already there if ( !jQuery('#previewview > *').size() ) { var post_type = jQuery('#post_type').val(); var previewText = 'page' == post_type ? autosaveL10n.previewPageText : autosaveL10n.previewPostText; jQuery.post(autosaveL10n.requestFile, { action: "get-permalink", post_id: post_id, getpermalinknonce: jQuery('#getpermalinknonce').val() }, function(permalink) { jQuery('#previewview').html('<a target="_blank" href="'+permalink+'" tabindex="4">'+previewText+'</a>'); // Autosave when the preview button is clicked. jQuery('#previewview a').click(function(e) { autosave(); autosaveDelayURL = this.href; previewwin = window.open('','_blank'); e.preventDefault(); return false; }); }); } } function autosave_update_slug(post_id) { // create slug area only if not already there if ( jQuery.isFunction(make_slugedit_clickable) && !jQuery('#edit-slug-box > *').size() ) { jQuery.post( slugL10n.requestFile, { action: 'sample-permalink', post_id: post_id, new_title: jQuery('#title').val(), samplepermalinknonce: jQuery('#samplepermalinknonce').val() }, function(data) { jQuery('#edit-slug-box').html(data); make_slugedit_clickable(); } ); } } function autosave_loading() { jQuery('#autosave').html(autosaveL10n.savingText); } function autosave_enable_buttons() { jQuery("#submitpost :button:disabled, #submitpost :submit:disabled").attr('disabled', ''); if ( autosaveDelayURL ) { previewwin.location = autosaveDelayURL; autosaveDelayURL = null; } } function autosave_disable_buttons() { jQuery("#submitpost :button:enabled, #submitpost :submit:enabled").attr('disabled', 'disabled'); setTimeout(autosave_enable_buttons, 5000); // Re-enable 5 sec later. Just gives autosave a head start to avoid collisions. } var autosave = function() { // (bool) is rich editor enabled and active var rich = (typeof tinyMCE != "undefined") && tinyMCE.activeEditor && !tinyMCE.activeEditor.isHidden(); var post_data = { action: "autosave", post_ID: jQuery("#post_ID").val() || 0, post_title: jQuery("#title").val() || "", autosavenonce: jQuery('#autosavenonce').val(), tags_input: jQuery("#tags-input").val() || "", post_type: jQuery('#post_type').val() || "", autosave: 1 }; // We always send the ajax request in order to keep the post lock fresh. // This (bool) tells whether or not to write the post to the DB during the ajax request. var doAutoSave = true; // No autosave while thickbox is open (media buttons) if ( jQuery("#TB_window").css('display') == 'block' ) doAutoSave = false; /* Gotta do this up here so we can check the length when tinyMCE is in use */ if ( rich ) { var ed = tinyMCE.activeEditor; if ( 'mce_fullscreen' == ed.id ) tinyMCE.get('content').setContent(ed.getContent({format : 'raw'}), {format : 'raw'}); tinyMCE.get('content').save(); } post_data["content"] = jQuery("#content").val(); if ( jQuery('#post_name').val() ) post_data["post_name"] = jQuery('#post_name').val(); // Nothing to save or no change. if( (post_data["post_title"].length==0 && post_data["content"].length==0) || post_data["post_title"] + post_data["content"] == autosaveLast) { doAutoSave = false } autosave_disable_buttons(); var origStatus = jQuery('#original_post_status').val(); autosaveLast = jQuery("#title").val()+jQuery("#content").val(); goodcats = ([]); jQuery("[@name='post_category[]']:checked").each( function(i) { goodcats.push(this.value); } ); post_data["catslist"] = goodcats.join(","); if ( jQuery("#comment_status").attr("checked") ) post_data["comment_status"] = 'open'; if ( jQuery("#ping_status").attr("checked") ) post_data["ping_status"] = 'open'; if ( jQuery("#excerpt").size() ) post_data["excerpt"] = jQuery("#excerpt").val(); if ( jQuery("#post_author").size() ) post_data["post_author"] = jQuery("#post_author").val(); // Don't run while the TinyMCE spellcheck is on. Why? Who knows. if ( rich && tinyMCE.activeEditor.plugins.spellchecker && tinyMCE.activeEditor.plugins.spellchecker.active ) { doAutoSave = false; } if(parseInt(post_data["post_ID"]) < 1) { post_data["temp_ID"] = post_data["post_ID"]; var successCallback = autosave_saved_new;; // new post } else { var successCallback = autosave_saved; // pre-existing post } if ( !doAutoSave ) { post_data['autosave'] = 0; } autosaveOldMessage = jQuery('#autosave').html(); jQuery.ajax({ data: post_data, beforeSend: doAutoSave ? autosave_loading : null, type: "POST", url: autosaveL10n.requestFile, success: successCallback }); } �������������������������������������������������������������wp/dev/wp-includes/js/tinymce/����������������������������������������������������������������������0000755�0001066�0001066�00000000000�11051167752�013525� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/tinymce/utils/����������������������������������������������������������������0000755�0001066�0001066�00000000000�11051167751�014664� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/tinymce/utils/editable_selects.js���������������������������������������������0000644�0001066�0001066�00000003623�11026507626�020522� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * $Id: editable_selects.js 867 2008-06-09 20:33:40Z spocke $ * * Makes select boxes editable. * * @author Moxiecode * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. */ var TinyMCE_EditableSelects = { editSelectElm : null, init : function() { var nl = document.getElementsByTagName("select"), i, d = document, o; for (i=0; i<nl.length; i++) { if (nl[i].className.indexOf('mceEditableSelect') != -1) { o = new Option('(value)', '__mce_add_custom__'); o.className = 'mceAddSelectValue'; nl[i].options[nl[i].options.length] = o; nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect; } } }, onChangeEditableSelect : function(e) { var d = document, ne, se = window.event ? window.event.srcElement : e.target; if (se.options[se.selectedIndex].value == '__mce_add_custom__') { ne = d.createElement("input"); ne.id = se.id + "_custom"; ne.name = se.name + "_custom"; ne.type = "text"; ne.style.width = se.offsetWidth + 'px'; se.parentNode.insertBefore(ne, se); se.style.display = 'none'; ne.focus(); ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput; ne.onkeydown = TinyMCE_EditableSelects.onKeyDown; TinyMCE_EditableSelects.editSelectElm = se; } }, onBlurEditableSelectInput : function() { var se = TinyMCE_EditableSelects.editSelectElm; if (se) { if (se.previousSibling.value != '') { addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value); selectByValue(document.forms[0], se.id, se.previousSibling.value); } else selectByValue(document.forms[0], se.id, ''); se.style.display = 'inline'; se.parentNode.removeChild(se.previousSibling); TinyMCE_EditableSelects.editSelectElm = null; } }, onKeyDown : function(e) { e = e || window.event; if (e.keyCode == 13) TinyMCE_EditableSelects.onBlurEditableSelectInput(); } }; �������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/tinymce/utils/form_utils.js���������������������������������������������������0000644�0001066�0001066�00000012216�10766056557�017424� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * $Id: form_utils.js 673 2008-03-06 13:26:20Z spocke $ * * Various form utilitiy functions. * * @author Moxiecode * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. */ var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme")); function getColorPickerHTML(id, target_form_element) { var h = ""; h += '<a id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">'; h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"></span></a>'; return h; } function updateColor(img_id, form_element_id) { document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; } function setBrowserDisabled(id, state) { var img = document.getElementById(id); var lnk = document.getElementById(id + "_link"); if (lnk) { if (state) { lnk.setAttribute("realhref", lnk.getAttribute("href")); lnk.removeAttribute("href"); tinyMCEPopup.dom.addClass(img, 'disabled'); } else { if (lnk.getAttribute("realhref")) lnk.setAttribute("href", lnk.getAttribute("realhref")); tinyMCEPopup.dom.removeClass(img, 'disabled'); } } } function getBrowserHTML(id, target_form_element, type, prefix) { var option = prefix + "_" + type + "_browser_callback", cb, html; cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback")); if (!cb) return ""; html = ""; html += '<a id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;" class="browse">'; html += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"></span></a>'; return html; } function openBrowser(img_id, target_form_element, type, option) { var img = document.getElementById(img_id); if (img.className != "mceButtonDisabled") tinyMCEPopup.openBrowser(target_form_element, type, option); } function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { if (!form_obj || !form_obj.elements[field_name]) return; var sel = form_obj.elements[field_name]; var found = false; for (var i=0; i<sel.options.length; i++) { var option = sel.options[i]; if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) { option.selected = true; found = true; } else option.selected = false; } if (!found && add_custom && value != '') { var option = new Option(value, value); option.selected = true; sel.options[sel.options.length] = option; sel.selectedIndex = sel.options.length - 1; } return found; } function getSelectValue(form_obj, field_name) { var elm = form_obj.elements[field_name]; if (elm == null || elm.options == null) return ""; return elm.options[elm.selectedIndex].value; } function addSelectValue(form_obj, field_name, name, value) { var s = form_obj.elements[field_name]; var o = new Option(name, value); s.options[s.options.length] = o; } function addClassesToList(list_id, specific_option) { // Setup class droplist var styleSelectElm = document.getElementById(list_id); var styles = tinyMCEPopup.getParam('theme_advanced_styles', false); styles = tinyMCEPopup.getParam(specific_option, styles); if (styles) { var stylesAr = styles.split(';'); for (var i=0; i<stylesAr.length; i++) { if (stylesAr != "") { var key, value; key = stylesAr[i].split('=')[0]; value = stylesAr[i].split('=')[1]; styleSelectElm.options[styleSelectElm.length] = new Option(key, value); } } } else { tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) { styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']); }); } } function isVisible(element_id) { var elm = document.getElementById(element_id); return elm && elm.style.display != "none"; } function convertRGBToHex(col) { var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); var rgb = col.replace(re, "$1,$2,$3").split(','); if (rgb.length == 3) { r = parseInt(rgb[0]).toString(16); g = parseInt(rgb[1]).toString(16); b = parseInt(rgb[2]).toString(16); r = r.length == 1 ? '0' + r : r; g = g.length == 1 ? '0' + g : g; b = b.length == 1 ? '0' + b : b; return "#" + r + g + b; } return col; } function convertHexToRGB(col) { if (col.indexOf('#') != -1) { col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); r = parseInt(col.substring(0, 2), 16); g = parseInt(col.substring(2, 4), 16); b = parseInt(col.substring(4, 6), 16); return "rgb(" + r + "," + g + "," + b + ")"; } return col; } function trimSize(size) { return size.replace(/([0-9\.]+)px|(%|in|cm|mm|em|ex|pt|pc)/, '$1$2'); } function getCSSSize(size) { size = trimSize(size); if (size == "") return ""; // Add px if (/^[0-9]+$/.test(size)) size += 'px'; return size; } function getStyle(elm, attrib, style) { var val = tinyMCEPopup.dom.getAttrib(elm, attrib); if (val != '') return '' + val; if (typeof(style) == 'undefined') style = attrib; return tinyMCEPopup.dom.getStyle(elm, style); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/tinymce/utils/mctabs.js�������������������������������������������������������0000644�0001066�0001066�00000003372�11021532502�016463� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * $Id: mctabs.js 758 2008-03-30 13:53:29Z spocke $ * * Moxiecode DHTML Tabs script. * * @author Moxiecode * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. */ function MCTabs() { this.settings = []; }; MCTabs.prototype.init = function(settings) { this.settings = settings; }; MCTabs.prototype.getParam = function(name, default_value) { var value = null; value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name]; // Fix bool values if (value == "true" || value == "false") return (value == "true"); return value; }; MCTabs.prototype.displayTab = function(tab_id, panel_id) { var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i; panelElm= document.getElementById(panel_id); panelContainerElm = panelElm ? panelElm.parentNode : null; tabElm = document.getElementById(tab_id); tabContainerElm = tabElm ? tabElm.parentNode : null; selectionClass = this.getParam('selection_class', 'current'); if (tabElm && tabContainerElm) { nodes = tabContainerElm.childNodes; // Hide all other tabs for (i = 0; i < nodes.length; i++) { if (nodes[i].nodeName == "LI") nodes[i].className = ''; } // Show selected tab tabElm.className = 'current'; } if (panelElm && panelContainerElm) { nodes = panelContainerElm.childNodes; // Hide all other panels for (i = 0; i < nodes.length; i++) { if (nodes[i].nodeName == "DIV") nodes[i].className = 'panel'; } // Show selected panel panelElm.className = 'current'; } }; MCTabs.prototype.getAnchor = function() { var pos, url = document.location.href; if ((pos = url.lastIndexOf('#')) != -1) return url.substring(pos + 1); return ""; }; // Global instance var mcTabs = new MCTabs(); ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/tinymce/utils/mclayer.js������������������������������������������������������0000644�0001066�0001066�00000010030�10743673705�016660� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * $Id: mclayer.js 520 2008-01-07 16:30:32Z spocke $ * * Moxiecode floating layer script. * * @author Moxiecode * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. */ function MCLayer(id) { this.id = id; this.settings = new Array(); this.blockerElement = null; this.isMSIE = navigator.appName == "Microsoft Internet Explorer"; this.events = false; this.autoHideCallback = null; } MCLayer.prototype = { moveRelativeTo : function(re, p, a) { var rep = this.getAbsPosition(re); var w = parseInt(re.offsetWidth); var h = parseInt(re.offsetHeight); var x, y; switch (p) { case "tl": break; case "tr": x = rep.absLeft + w; y = rep.absTop; break; case "bl": break; case "br": break; } this.moveTo(x, y); }, moveBy : function(dx, dy) { var e = this.getElement(); var x = parseInt(e.style.left); var y = parseInt(e.style.top); e.style.left = (x + dx) + "px"; e.style.top = (y + dy) + "px"; this.updateBlocker(); }, moveTo : function(x, y) { var e = this.getElement(); e.style.left = x + "px"; e.style.top = y + "px"; this.updateBlocker(); }, show : function() { MCLayer.visibleLayer = this; this.getElement().style.display = 'block'; this.updateBlocker(); }, hide : function() { this.getElement().style.display = 'none'; this.updateBlocker(); }, setAutoHide : function(s, cb) { this.autoHideCallback = cb; this.registerEventHandlers(); }, getElement : function() { return document.getElementById(this.id); }, updateBlocker : function() { if (!this.isMSIE) return; var e = this.getElement(); var b = this.getBlocker(); var x = this.parseInt(e.style.left); var y = this.parseInt(e.style.top); var w = this.parseInt(e.offsetWidth); var h = this.parseInt(e.offsetHeight); b.style.left = x + 'px'; b.style.top = y + 'px'; b.style.width = w + 'px'; b.style.height = h + 'px'; b.style.display = e.style.display; }, getBlocker : function() { if (!this.blockerElement) { var d = document, b = d.createElement("iframe"); b.style.cssText = 'display: none; left: 0px; position: absolute; top: 0'; b.src = 'javascript:false;'; b.frameBorder = '0'; b.scrolling = 'no'; d.body.appendChild(b); this.blockerElement = b; } return this.blockerElement; }, getAbsPosition : function(n) { var p = {absLeft : 0, absTop : 0}; while (n) { p.absLeft += n.offsetLeft; p.absTop += n.offsetTop; n = n.offsetParent; } return p; }, registerEventHandlers : function() { if (!this.events) { var d = document; this.addEvent(d, 'mousedown', MCLayer.prototype.onMouseDown); this.events = true; } }, addEvent : function(o, n, h) { if (o.attachEvent) o.attachEvent("on" + n, h); else o.addEventListener(n, h, false); }, onMouseDown : function(e) { e = typeof(e) == "undefined" ? window.event : e; var b = document.body; var l = MCLayer.visibleLayer; if (l) { var mx = l.isMSIE ? e.clientX + b.scrollLeft : e.pageX; var my = l.isMSIE ? e.clientY + b.scrollTop : e.pageY; var el = l.getElement(); var x = parseInt(el.style.left); var y = parseInt(el.style.top); var w = parseInt(el.offsetWidth); var h = parseInt(el.offsetHeight); if (!(mx > x && mx < x + w && my > y && my < y + h)) { MCLayer.visibleLayer = null; if (l.autoHideCallback && l.autoHideCallback(l, e, mx, my)) return true; l.hide(); } } }, addCSSClass : function(e, c) { this.removeCSSClass(e, c); var a = this.explode(' ', e.className); a[a.length] = c; e.className = a.join(' '); }, removeCSSClass : function(e, c) { var a = this.explode(' ', e.className), i; for (i=0; i<a.length; i++) { if (a[i] == c) a[i] = ''; } e.className = a.join(' '); }, explode : function(d, s) { var ar = s.split(d); var oar = new Array(); for (var i = 0; i<ar.length; i++) { if (ar[i] != "") oar[oar.length] = ar[i]; } return oar; }, parseInt : function(s) { if (s == null || s == '') return 0; return parseInt(s); } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/tinymce/utils/validate.js�����������������������������������������������������0000644�0001066�0001066�00000011234�11021532502�016777� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * $Id: validate.js 758 2008-03-30 13:53:29Z spocke $ * * Various form validation methods. * * @author Moxiecode * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. */ /** // String validation: if (!Validator.isEmail('myemail')) alert('Invalid email.'); // Form validation: var f = document.forms['myform']; if (!Validator.isEmail(f.myemail)) alert('Invalid email.'); */ var Validator = { isEmail : function(s) { return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$'); }, isAbsUrl : function(s) { return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$'); }, isSize : function(s) { return this.test(s, '^[0-9]+(%|in|cm|mm|em|ex|pt|pc|px)?$'); }, isId : function(s) { return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$'); }, isEmpty : function(s) { var nl, i; if (s.nodeName == 'SELECT' && s.selectedIndex < 1) return true; if (s.type == 'checkbox' && !s.checked) return true; if (s.type == 'radio') { for (i=0, nl = s.form.elements; i<nl.length; i++) { if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked) return false; } return true; } return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s); }, isNumber : function(s, d) { return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$')); }, test : function(s, p) { s = s.nodeType == 1 ? s.value : s; return s == '' || new RegExp(p).test(s); } }; var AutoValidator = { settings : { id_cls : 'id', int_cls : 'int', url_cls : 'url', number_cls : 'number', email_cls : 'email', size_cls : 'size', required_cls : 'required', invalid_cls : 'invalid', min_cls : 'min', max_cls : 'max' }, init : function(s) { var n; for (n in s) this.settings[n] = s[n]; }, validate : function(f) { var i, nl, s = this.settings, c = 0; nl = this.tags(f, 'label'); for (i=0; i<nl.length; i++) this.removeClass(nl[i], s.invalid_cls); c += this.validateElms(f, 'input'); c += this.validateElms(f, 'select'); c += this.validateElms(f, 'textarea'); return c == 3; }, invalidate : function(n) { this.mark(n.form, n); }, reset : function(e) { var t = ['label', 'input', 'select', 'textarea']; var i, j, nl, s = this.settings; if (e == null) return; for (i=0; i<t.length; i++) { nl = this.tags(e.form ? e.form : e, t[i]); for (j=0; j<nl.length; j++) this.removeClass(nl[j], s.invalid_cls); } }, validateElms : function(f, e) { var nl, i, n, s = this.settings, st = true, va = Validator, v; nl = this.tags(f, e); for (i=0; i<nl.length; i++) { n = nl[i]; this.removeClass(n, s.invalid_cls); if (this.hasClass(n, s.required_cls) && va.isEmpty(n)) st = this.mark(f, n); if (this.hasClass(n, s.number_cls) && !va.isNumber(n)) st = this.mark(f, n); if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true)) st = this.mark(f, n); if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n)) st = this.mark(f, n); if (this.hasClass(n, s.email_cls) && !va.isEmail(n)) st = this.mark(f, n); if (this.hasClass(n, s.size_cls) && !va.isSize(n)) st = this.mark(f, n); if (this.hasClass(n, s.id_cls) && !va.isId(n)) st = this.mark(f, n); if (this.hasClass(n, s.min_cls, true)) { v = this.getNum(n, s.min_cls); if (isNaN(v) || parseInt(n.value) < parseInt(v)) st = this.mark(f, n); } if (this.hasClass(n, s.max_cls, true)) { v = this.getNum(n, s.max_cls); if (isNaN(v) || parseInt(n.value) > parseInt(v)) st = this.mark(f, n); } } return st; }, hasClass : function(n, c, d) { return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className); }, getNum : function(n, c) { c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0]; c = c.replace(/[^0-9]/g, ''); return c; }, addClass : function(n, c, b) { var o = this.removeClass(n, c); n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c; }, removeClass : function(n, c) { c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' '); return n.className = c != ' ' ? c : ''; }, tags : function(f, s) { return f.getElementsByTagName(s); }, mark : function(f, n) { var s = this.settings; this.addClass(n, s.invalid_cls); this.markLabels(f, n, s.invalid_cls); return false; }, markLabels : function(f, n, ic) { var nl, i; nl = this.tags(f, "label"); for (i=0; i<nl.length; i++) { if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id) this.addClass(nl[i], ic); } return null; } }; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/tinymce/langs/����������������������������������������������������������������0000755�0001066�0001066�00000000000�11051167752�014631� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/tinymce/langs/wp-langs.php����������������������������������������������������0000644�0001066�0001066�00000054124�11035435462�017076� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php // escape text only if it needs translating function mce_escape($text) { global $language; if ( 'en' == $language ) return $text; else return js_escape($text); } $strings = 'tinyMCE.addI18n({' . $language . ':{ common:{ edit_confirm:"' . mce_escape( __('Do you want to use the WYSIWYG mode for this textarea?') ) . '", apply:"' . mce_escape( __('Apply') ) . '", insert:"' . mce_escape( __('Insert') ) . '", update:"' . mce_escape( __('Update') ) . '", cancel:"' . mce_escape( __('Cancel') ) . '", close:"' . mce_escape( __('Close') ) . '", browse:"' . mce_escape( __('Browse') ) . '", class_name:"' . mce_escape( __('Class') ) . '", not_set:"' . mce_escape( __('-- Not set --') ) . '", clipboard_msg:"' . mce_escape( __('Copy/Cut/Paste is not available in Mozilla and Firefox.') ) . '", clipboard_no_support:"' . mce_escape( __('Currently not supported by your browser, use keyboard shortcuts instead.') ) . '", popup_blocked:"' . mce_escape( __('Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.') ) . '", invalid_data:"' . mce_escape( __('Error: Invalid values entered, these are marked in red.') ) . '", more_colors:"' . mce_escape( __('More colors') ) . '" }, contextmenu:{ align:"' . mce_escape( __('Alignment') ) . '", left:"' . mce_escape( __('Left') ) . '", center:"' . mce_escape( __('Center') ) . '", right:"' . mce_escape( __('Right') ) . '", full:"' . mce_escape( __('Full') ) . '" }, insertdatetime:{ date_fmt:"' . mce_escape( __('%Y-%m-%d') ) . '", time_fmt:"' . mce_escape( __('%H:%M:%S') ) . '", insertdate_desc:"' . mce_escape( __('Insert date') ) . '", inserttime_desc:"' . mce_escape( __('Insert time') ) . '", months_long:"' . mce_escape( __('January').','.__('February').','.__('March').','.__('April').','.__('May').','.__('June').','.__('July').','.__('August').','.__('September').','.__('October').','.__('November').','.__('December') ) . '", months_short:"' . mce_escape( __('Jan_January_abbreviation').','.__('Feb_February_abbreviation').','.__('Mar_March_abbreviation').','.__('Apr_April_abbreviation').','.__('May_May_abbreviation').','.__('Jun_June_abbreviation').','.__('Jul_July_abbreviation').','.__('Aug_August_abbreviation').','.__('Sep_September_abbreviation').','.__('Oct_October_abbreviation').','.__('Nov_November_abbreviation').','.__('Dec_December_abbreviation') ) . '", day_long:"' . mce_escape( __('Sunday').','.__('Monday').','.__('Tuesday').','.__('Wednesday').','.__('Thursday').','.__('Friday').','.__('Saturday') ) . '", day_short:"' . mce_escape( __('Sun').','.__('Mon').','.__('Tue').','.__('Wed').','.__('Thu').','.__('Fri').','.__('Sat') ) . '" }, print:{ print_desc:"' . mce_escape( __('Print') ) . '" }, preview:{ preview_desc:"' . mce_escape( __('Preview') ) . '" }, directionality:{ ltr_desc:"' . mce_escape( __('Direction left to right') ) . '", rtl_desc:"' . mce_escape( __('Direction right to left') ) . '" }, layer:{ insertlayer_desc:"' . mce_escape( __('Insert new layer') ) . '", forward_desc:"' . mce_escape( __('Move forward') ) . '", backward_desc:"' . mce_escape( __('Move backward') ) . '", absolute_desc:"' . mce_escape( __('Toggle absolute positioning') ) . '", content:"' . mce_escape( __('New layer...') ) . '" }, save:{ save_desc:"' . mce_escape( __('Save') ) . '", cancel_desc:"' . mce_escape( __('Cancel all changes') ) . '" }, nonbreaking:{ nonbreaking_desc:"' . mce_escape( __('Insert non-breaking space character') ) . '" }, iespell:{ iespell_desc:"' . mce_escape( __('Run spell checking') ) . '", download:"' . mce_escape( __('ieSpell not detected. Do you want to install it now?') ) . '" }, advhr:{ advhr_desc:"' . mce_escape( __('Horizontale rule') ) . '" }, emotions:{ emotions_desc:"' . mce_escape( __('Emotions') ) . '" }, searchreplace:{ search_desc:"' . mce_escape( __('Find') ) . '", replace_desc:"' . mce_escape( __('Find/Replace') ) . '" }, advimage:{ image_desc:"' . mce_escape( __('Insert/edit image') ) . '" }, advlink:{ link_desc:"' . mce_escape( __('Insert/edit link') ) . '" }, xhtmlxtras:{ cite_desc:"' . mce_escape( __('Citation') ) . '", abbr_desc:"' . mce_escape( __('Abbreviation') ) . '", acronym_desc:"' . mce_escape( __('Acronym') ) . '", del_desc:"' . mce_escape( __('Deletion') ) . '", ins_desc:"' . mce_escape( __('Insertion') ) . '", attribs_desc:"' . mce_escape( __('Insert/Edit Attributes') ) . '" }, style:{ desc:"' . mce_escape( __('Edit CSS Style') ) . '" }, paste:{ paste_text_desc:"' . mce_escape( __('Paste as Plain Text') ) . '", paste_word_desc:"' . mce_escape( __('Paste from Word') ) . '", selectall_desc:"' . mce_escape( __('Select All') ) . '" }, paste_dlg:{ text_title:"' . mce_escape( __('Use CTRL+V on your keyboard to paste the text into the window.') ) . '", text_linebreaks:"' . mce_escape( __('Keep linebreaks') ) . '", word_title:"' . mce_escape( __('Use CTRL+V on your keyboard to paste the text into the window.') ) . '" }, table:{ desc:"' . mce_escape( __('Inserts a new table') ) . '", row_before_desc:"' . mce_escape( __('Insert row before') ) . '", row_after_desc:"' . mce_escape( __('Insert row after') ) . '", delete_row_desc:"' . mce_escape( __('Delete row') ) . '", col_before_desc:"' . mce_escape( __('Insert column before') ) . '", col_after_desc:"' . mce_escape( __('Insert column after') ) . '", delete_col_desc:"' . mce_escape( __('Remove column') ) . '", split_cells_desc:"' . mce_escape( __('Split merged table cells') ) . '", merge_cells_desc:"' . mce_escape( __('Merge table cells') ) . '", row_desc:"' . mce_escape( __('Table row properties') ) . '", cell_desc:"' . mce_escape( __('Table cell properties') ) . '", props_desc:"' . mce_escape( __('Table properties') ) . '", paste_row_before_desc:"' . mce_escape( __('Paste table row before') ) . '", paste_row_after_desc:"' . mce_escape( __('Paste table row after') ) . '", cut_row_desc:"' . mce_escape( __('Cut table row') ) . '", copy_row_desc:"' . mce_escape( __('Copy table row') ) . '", del:"' . mce_escape( __('Delete table') ) . '", row:"' . mce_escape( __('Row') ) . '", col:"' . mce_escape( __('Column') ) . '", cell:"' . mce_escape( __('Cell') ) . '" }, autosave:{ unload_msg:"' . mce_escape( __('The changes you made will be lost if you navigate away from this page.') ) . '" }, fullscreen:{ desc:"' . mce_escape( __('Toggle fullscreen mode') ) . ' (Alt+Shift+G)" }, media:{ desc:"' . mce_escape( __('Insert / edit embedded media') ) . '", delta_width:"' . mce_escape( _c('0| Extra width for the media popup in pixels') ) . '", delta_height:"' . mce_escape( _c('0| Extra height for the media popup in pixels') ) . '", edit:"' . mce_escape( __('Edit embedded media') ) . '" }, fullpage:{ desc:"' . mce_escape( __('Document properties') ) . '" }, template:{ desc:"' . mce_escape( __('Insert predefined template content') ) . '" }, visualchars:{ desc:"' . mce_escape( __('Visual control characters on/off.') ) . '" }, spellchecker:{ desc:"' . mce_escape( __('Toggle spellchecker') ) . ' (Alt+Shift+N)", menu:"' . mce_escape( __('Spellchecker settings') ) . '", ignore_word:"' . mce_escape( __('Ignore word') ) . '", ignore_words:"' . mce_escape( __('Ignore all') ) . '", langs:"' . mce_escape( __('Languages') ) . '", wait:"' . mce_escape( __('Please wait...') ) . '", sug:"' . mce_escape( __('Suggestions') ) . '", no_sug:"' . mce_escape( __('No suggestions') ) . '", no_mpell:"' . mce_escape( __('No misspellings found.') ) . '" }, pagebreak:{ desc:"' . mce_escape( __('Insert page break.') ) . '" }}}); tinyMCE.addI18n("' . $language . '.advanced",{ style_select:"' . mce_escape( __('Styles') ) . '", font_size:"' . mce_escape( __('Font size') ) . '", fontdefault:"' . mce_escape( __('Font family') ) . '", block:"' . mce_escape( __('Format') ) . '", paragraph:"' . mce_escape( __('Paragraph') ) . '", div:"' . mce_escape( __('Div') ) . '", address:"' . mce_escape( __('Address') ) . '", pre:"' . mce_escape( __('Preformatted') ) . '", h1:"' . mce_escape( __('Heading 1') ) . '", h2:"' . mce_escape( __('Heading 2') ) . '", h3:"' . mce_escape( __('Heading 3') ) . '", h4:"' . mce_escape( __('Heading 4') ) . '", h5:"' . mce_escape( __('Heading 5') ) . '", h6:"' . mce_escape( __('Heading 6') ) . '", blockquote:"' . mce_escape( __('Blockquote') ) . '", code:"' . mce_escape( __('Code') ) . '", samp:"' . mce_escape( __('Code sample') ) . '", dt:"' . mce_escape( __('Definition term ') ) . '", dd:"' . mce_escape( __('Definition description') ) . '", bold_desc:"' . mce_escape( __('Bold') ) . ' (Ctrl / Alt+Shift + B)", italic_desc:"' . mce_escape( __('Italic') ) . ' (Ctrl / Alt+Shift + I)", underline_desc:"' . mce_escape( __('Underline') ) . '", striketrough_desc:"' . mce_escape( __('Strikethrough') ) . ' (Alt+Shift+D)", justifyleft_desc:"' . mce_escape( __('Align left') ) . ' (Alt+Shift+L)", justifycenter_desc:"' . mce_escape( __('Align center') ) . ' (Alt+Shift+C)", justifyright_desc:"' . mce_escape( __('Align right') ) . ' (Alt+Shift+R)", justifyfull_desc:"' . mce_escape( __('Align full') ) . ' (Alt+Shift+J)", bullist_desc:"' . mce_escape( __('Unordered list') ) . ' (Alt+Shift+U)", numlist_desc:"' . mce_escape( __('Ordered list') ) . ' (Alt+Shift+O)", outdent_desc:"' . mce_escape( __('Outdent') ) . '", indent_desc:"' . mce_escape( __('Indent') ) . '", undo_desc:"' . mce_escape( __('Undo') ) . ' (Ctrl+Z)", redo_desc:"' . mce_escape( __('Redo') ) . ' (Ctrl+Y)", link_desc:"' . mce_escape( __('Insert/edit link') ) . ' (Alt+Shift+A)", link_delta_width:"' . mce_escape( _c('0| Extra width for the link popup in pixels') ) . '", link_delta_height:"' . mce_escape( _c('0| Extra height for the link popup in pixels') ) . '", unlink_desc:"' . mce_escape( __('Unlink') ) . ' (Alt+Shift+S)", image_desc:"' . mce_escape( __('Insert/edit image') ) . ' (Alt+Shift+M)", image_delta_width:"' . mce_escape( _c('0| Extra width for the image popup in pixels') ) . '", image_delta_height:"' . mce_escape( _c('0| Extra height for the image popup in pixels') ) . '", cleanup_desc:"' . mce_escape( __('Cleanup messy code') ) . '", code_desc:"' . mce_escape( __('Edit HTML Source') ) . '", sub_desc:"' . mce_escape( __('Subscript') ) . '", sup_desc:"' . mce_escape( __('Superscript') ) . '", hr_desc:"' . mce_escape( __('Insert horizontal ruler') ) . '", removeformat_desc:"' . mce_escape( __('Remove formatting') ) . '", forecolor_desc:"' . mce_escape( __('Select text color') ) . '", backcolor_desc:"' . mce_escape( __('Select background color') ) . '", charmap_desc:"' . mce_escape( __('Insert custom character') ) . '", visualaid_desc:"' . mce_escape( __('Toggle guidelines/invisible elements') ) . '", anchor_desc:"' . mce_escape( __('Insert/edit anchor') ) . '", cut_desc:"' . mce_escape( __('Cut') ) . '", copy_desc:"' . mce_escape( __('Copy') ) . '", paste_desc:"' . mce_escape( __('Paste') ) . '", image_props_desc:"' . mce_escape( __('Image properties') ) . '", newdocument_desc:"' . mce_escape( __('New document') ) . '", help_desc:"' . mce_escape( __('Help') ) . '", blockquote_desc:"' . mce_escape( __('Blockquote') ) . ' (Alt+Shift+Q)", clipboard_msg:"' . mce_escape( __('Copy/Cut/Paste is not available in Mozilla and Firefox.') ) . '", path:"' . mce_escape( __('Path') ) . '", newdocument:"' . mce_escape( __('Are you sure you want to clear all contents?') ) . '", toolbar_focus:"' . mce_escape( __('Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X') ) . '", more_colors:"' . mce_escape( __('More colors') ) . '", colorpicker_delta_width:"' . mce_escape( _c('0| Extra width for the colorpicker popup in pixels') ) . '", colorpicker_delta_height:"' . mce_escape( _c('0| Extra height for the colorpicker popup in pixels') ) . '" }); tinyMCE.addI18n("' . $language . '.advanced_dlg",{ about_title:"' . mce_escape( __('About TinyMCE') ) . '", about_general:"' . mce_escape( __('About') ) . '", about_help:"' . mce_escape( __('Help') ) . '", about_license:"' . mce_escape( __('License') ) . '", about_plugins:"' . mce_escape( __('Plugins') ) . '", about_plugin:"' . mce_escape( __('Plugin') ) . '", about_author:"' . mce_escape( __('Author') ) . '", about_version:"' . mce_escape( __('Version') ) . '", about_loaded:"' . mce_escape( __('Loaded plugins') ) . '", anchor_title:"' . mce_escape( __('Insert/edit anchor') ) . '", anchor_name:"' . mce_escape( __('Anchor name') ) . '", code_title:"' . mce_escape( __('HTML Source Editor') ) . '", code_wordwrap:"' . mce_escape( __('Word wrap') ) . '", colorpicker_title:"' . mce_escape( __('Select a color') ) . '", colorpicker_picker_tab:"' . mce_escape( __('Picker') ) . '", colorpicker_picker_title:"' . mce_escape( __('Color picker') ) . '", colorpicker_palette_tab:"' . mce_escape( __('Palette') ) . '", colorpicker_palette_title:"' . mce_escape( __('Palette colors') ) . '", colorpicker_named_tab:"' . mce_escape( __('Named') ) . '", colorpicker_named_title:"' . mce_escape( __('Named colors') ) . '", colorpicker_color:"' . mce_escape( __('Color:') ) . '", colorpicker_name:"' . mce_escape( __('Name:') ) . '", charmap_title:"' . mce_escape( __('Select custom character') ) . '", image_title:"' . mce_escape( __('Insert/edit image') ) . '", image_src:"' . mce_escape( __('Image URL') ) . '", image_alt:"' . mce_escape( __('Image description') ) . '", image_list:"' . mce_escape( __('Image list') ) . '", image_border:"' . mce_escape( __('Border') ) . '", image_dimensions:"' . mce_escape( __('Dimensions') ) . '", image_vspace:"' . mce_escape( __('Vertical space') ) . '", image_hspace:"' . mce_escape( __('Horizontal space') ) . '", image_align:"' . mce_escape( __('Alignment') ) . '", image_align_baseline:"' . mce_escape( __('Baseline') ) . '", image_align_top:"' . mce_escape( __('Top') ) . '", image_align_middle:"' . mce_escape( __('Middle') ) . '", image_align_bottom:"' . mce_escape( __('Bottom') ) . '", image_align_texttop:"' . mce_escape( __('Text top') ) . '", image_align_textbottom:"' . mce_escape( __('Text bottom') ) . '", image_align_left:"' . mce_escape( __('Left') ) . '", image_align_right:"' . mce_escape( __('Right') ) . '", link_title:"' . mce_escape( __('Insert/edit link') ) . '", link_url:"' . mce_escape( __('Link URL') ) . '", link_target:"' . mce_escape( __('Target') ) . '", link_target_same:"' . mce_escape( __('Open link in the same window') ) . '", link_target_blank:"' . mce_escape( __('Open link in a new window') ) . '", link_titlefield:"' . mce_escape( __('Title') ) . '", link_is_email:"' . mce_escape( __('The URL you entered seems to be an email address, do you want to add the required mailto: prefix?') ) . '", link_is_external:"' . mce_escape( __('The URL you entered seems to external link, do you want to add the required http:// prefix?') ) . '", link_list:"' . mce_escape( __('Link list') ) . '" }); tinyMCE.addI18n("' . $language . '.media_dlg",{ title:"' . mce_escape( __('Insert / edit embedded media') ) . '", general:"' . mce_escape( __('General') ) . '", advanced:"' . mce_escape( __('Advanced') ) . '", file:"' . mce_escape( __('File/URL') ) . '", list:"' . mce_escape( __('List') ) . '", size:"' . mce_escape( __('Dimensions') ) . '", preview:"' . mce_escape( __('Preview') ) . '", constrain_proportions:"' . mce_escape( __('Constrain proportions') ) . '", type:"' . mce_escape( __('Type') ) . '", id:"' . mce_escape( __('Id') ) . '", name:"' . mce_escape( __('Name') ) . '", class_name:"' . mce_escape( __('Class') ) . '", vspace:"' . mce_escape( __('V-Space') ) . '", hspace:"' . mce_escape( __('H-Space') ) . '", play:"' . mce_escape( __('Auto play') ) . '", loop:"' . mce_escape( __('Loop') ) . '", menu:"' . mce_escape( __('Show menu') ) . '", quality:"' . mce_escape( __('Quality') ) . '", scale:"' . mce_escape( __('Scale') ) . '", align:"' . mce_escape( __('Align') ) . '", salign:"' . mce_escape( __('SAlign') ) . '", wmode:"' . mce_escape( __('WMode') ) . '", bgcolor:"' . mce_escape( __('Background') ) . '", base:"' . mce_escape( __('Base') ) . '", flashvars:"' . mce_escape( __('Flashvars') ) . '", liveconnect:"' . mce_escape( __('SWLiveConnect') ) . '", autohref:"' . mce_escape( __('AutoHREF') ) . '", cache:"' . mce_escape( __('Cache') ) . '", hidden:"' . mce_escape( __('Hidden') ) . '", controller:"' . mce_escape( __('Controller') ) . '", kioskmode:"' . mce_escape( __('Kiosk mode') ) . '", playeveryframe:"' . mce_escape( __('Play every frame') ) . '", targetcache:"' . mce_escape( __('Target cache') ) . '", correction:"' . mce_escape( __('No correction') ) . '", enablejavascript:"' . mce_escape( __('Enable JavaScript') ) . '", starttime:"' . mce_escape( __('Start time') ) . '", endtime:"' . mce_escape( __('End time') ) . '", href:"' . mce_escape( __('Href') ) . '", qtsrcchokespeed:"' . mce_escape( __('Choke speed') ) . '", target:"' . mce_escape( __('Target') ) . '", volume:"' . mce_escape( __('Volume') ) . '", autostart:"' . mce_escape( __('Auto start') ) . '", enabled:"' . mce_escape( __('Enabled') ) . '", fullscreen:"' . mce_escape( __('Fullscreen') ) . '", invokeurls:"' . mce_escape( __('Invoke URLs') ) . '", mute:"' . mce_escape( __('Mute') ) . '", stretchtofit:"' . mce_escape( __('Stretch to fit') ) . '", windowlessvideo:"' . mce_escape( __('Windowless video') ) . '", balance:"' . mce_escape( __('Balance') ) . '", baseurl:"' . mce_escape( __('Base URL') ) . '", captioningid:"' . mce_escape( __('Captioning id') ) . '", currentmarker:"' . mce_escape( __('Current marker') ) . '", currentposition:"' . mce_escape( __('Current position') ) . '", defaultframe:"' . mce_escape( __('Default frame') ) . '", playcount:"' . mce_escape( __('Play count') ) . '", rate:"' . mce_escape( __('Rate') ) . '", uimode:"' . mce_escape( __('UI Mode') ) . '", flash_options:"' . mce_escape( __('Flash options') ) . '", qt_options:"' . mce_escape( __('Quicktime options') ) . '", wmp_options:"' . mce_escape( __('Windows media player options') ) . '", rmp_options:"' . mce_escape( __('Real media player options') ) . '", shockwave_options:"' . mce_escape( __('Shockwave options') ) . '", autogotourl:"' . mce_escape( __('Auto goto URL') ) . '", center:"' . mce_escape( __('Center') ) . '", imagestatus:"' . mce_escape( __('Image status') ) . '", maintainaspect:"' . mce_escape( __('Maintain aspect') ) . '", nojava:"' . mce_escape( __('No java') ) . '", prefetch:"' . mce_escape( __('Prefetch') ) . '", shuffle:"' . mce_escape( __('Shuffle') ) . '", console:"' . mce_escape( __('Console') ) . '", numloop:"' . mce_escape( __('Num loops') ) . '", controls:"' . mce_escape( __('Controls') ) . '", scriptcallbacks:"' . mce_escape( __('Script callbacks') ) . '", swstretchstyle:"' . mce_escape( __('Stretch style') ) . '", swstretchhalign:"' . mce_escape( __('Stretch H-Align') ) . '", swstretchvalign:"' . mce_escape( __('Stretch V-Align') ) . '", sound:"' . mce_escape( __('Sound') ) . '", progress:"' . mce_escape( __('Progress') ) . '", qtsrc:"' . mce_escape( __('QT Src') ) . '", qt_stream_warn:"' . mce_escape( __('Streamed rtsp resources should be added to the QT Src field under the advanced tab.') ) . '", align_top:"' . mce_escape( __('Top') ) . '", align_right:"' . mce_escape( __('Right') ) . '", align_bottom:"' . mce_escape( __('Bottom') ) . '", align_left:"' . mce_escape( __('Left') ) . '", align_center:"' . mce_escape( __('Center') ) . '", align_top_left:"' . mce_escape( __('Top left') ) . '", align_top_right:"' . mce_escape( __('Top right') ) . '", align_bottom_left:"' . mce_escape( __('Bottom left') ) . '", align_bottom_right:"' . mce_escape( __('Bottom right') ) . '", flv_options:"' . mce_escape( __('Flash video options') ) . '", flv_scalemode:"' . mce_escape( __('Scale mode') ) . '", flv_buffer:"' . mce_escape( __('Buffer') ) . '", flv_startimage:"' . mce_escape( __('Start image') ) . '", flv_starttime:"' . mce_escape( __('Start time') ) . '", flv_defaultvolume:"' . mce_escape( __('Default volume') ) . '", flv_hiddengui:"' . mce_escape( __('Hidden GUI') ) . '", flv_autostart:"' . mce_escape( __('Auto start') ) . '", flv_loop:"' . mce_escape( __('Loop') ) . '", flv_showscalemodes:"' . mce_escape( __('Show scale modes') ) . '", flv_smoothvideo:"' . mce_escape( __('Smooth video') ) . '", flv_jscallback:"' . mce_escape( __('JS Callback') ) . '" }); tinyMCE.addI18n("' . $language . '.wordpress",{ wp_adv_desc:"' . mce_escape( __('Show/Hide Kitchen Sink') ) . ' (Alt+Shift+Z)", wp_more_desc:"' . mce_escape( __('Insert More tag') ) . ' (Alt+Shift+T)", wp_page_desc:"' . mce_escape( __('Insert Page break') ) . ' (Alt+Shift+P)", wp_help_desc:"' . mce_escape( __('Help') ) . ' (Alt+Shift+H)", wp_more_alt:"' . mce_escape( __('More...') ) . '", wp_page_alt:"' . mce_escape( __('Next page...') ) . '", add_media:"' . mce_escape( __('Add Media') ) . '", add_image:"' . mce_escape( __('Add an Image') ) . '", add_video:"' . mce_escape( __('Add Video') ) . '", add_audio:"' . mce_escape( __('Add Audio') ) . '" }); tinyMCE.addI18n("' . $language . '.wpeditimage",{ edit_img:"' . mce_escape( __('Edit Image') ) . '", del_img:"' . mce_escape( __('Delete Image') ) . '", adv_settings:"' . mce_escape( __('Advanced Settings') ) . '", none:"' . mce_escape( __('None') ) . '", size:"' . mce_escape( __('Size') ) . '", thumbnail:"' . mce_escape( __('Thumbnail') ) . '", medium:"' . mce_escape( __('Medium') ) . '", full_size:"' . mce_escape( __('Full Size') ) . '", current_link:"' . mce_escape( __('Current Link') ) . '", link_to_img:"' . mce_escape( __('Link to Image') ) . '", link_help:"' . mce_escape( __('Enter a link URL or click above for presets.') ) . '", adv_img_settings:"' . mce_escape( __('Advanced Image Settings') ) . '", source:"' . mce_escape( __('Source') ) . '", width:"' . mce_escape( __('Width') ) . '", height:"' . mce_escape( __('Height') ) . '", orig_size:"' . mce_escape( __('Original Size') ) . '", css:"' . mce_escape( __('CSS Class') ) . '", adv_link_settings:"' . mce_escape( __('Advanced Link Settings') ) . '", link_rel:"' . mce_escape( __('Link Rel') ) . '", height:"' . mce_escape( __('Height') ) . '", orig_size:"' . mce_escape( __('Original Size') ) . '", css:"' . mce_escape( __('CSS Class') ) . '", s60:"' . mce_escape( __('60%') ) . '", s70:"' . mce_escape( __('70%') ) . '", s80:"' . mce_escape( __('80%') ) . '", s90:"' . mce_escape( __('90%') ) . '", s100:"' . mce_escape( __('100%') ) . '", s110:"' . mce_escape( __('110%') ) . '", s120:"' . mce_escape( __('120%') ) . '", s130:"' . mce_escape( __('130%') ) . '", img_title:"' . mce_escape( __('Edit Image Title') ) . '", caption:"' . mce_escape( __('Edit Image Caption') ) . '", alt:"' . mce_escape( __('Edit Alternate Text') ) . '" }); '; ?>��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/tinymce/tiny_mce.js�����������������������������������������������������������0000644�0001066�0001066�00000457466�11031210647�015706� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������var tinymce={majorVersion:'3',minorVersion:'1.1',releaseDate:'2008-06-25',_init:function(){var t=this,d=document,w=window,na=navigator,ua=na.userAgent,i,nl,n,base,p,v;t.isOpera=w.opera&&opera.buildNumber;t.isWebKit=/WebKit/.test(ua);t.isOldWebKit=t.isWebKit&&!w.getSelection().getRangeAt;t.isIE=!t.isWebKit&&!t.isOpera&&(/MSIE/gi).test(ua)&&(/Explorer/gi).test(na.appName);t.isIE6=t.isIE&&/MSIE [56]/.test(ua);t.isGecko=!t.isWebKit&&/Gecko/.test(ua);t.isMac=ua.indexOf('Mac')!=-1;if(w.tinyMCEPreInit){t.suffix=tinyMCEPreInit.suffix;t.baseURL=tinyMCEPreInit.base;t.query=tinyMCEPreInit.query;return;}t.suffix='';nl=d.getElementsByTagName('base');for(i=0;i<nl.length;i++){if(v=nl[i].href){if(/^https?:\/\/[^\/]+$/.test(v))v+='/';base=v?v.match(/.*\//)[0]:'';}}function getBase(n){if(n.src&&/tiny_mce(|_dev|_src|_gzip|_jquery|_prototype).js/.test(n.src)){if(/_(src|dev)\.js/g.test(n.src))t.suffix='_src';if((p=n.src.indexOf('?'))!=-1)t.query=n.src.substring(p+1);t.baseURL=n.src.substring(0,n.src.lastIndexOf('/'));if(base&&t.baseURL.indexOf('://')==-1)t.baseURL=base+t.baseURL;return t.baseURL;}return null;};nl=d.getElementsByTagName('script');for(i=0;i<nl.length;i++){if(getBase(nl[i]))return;}n=d.getElementsByTagName('head')[0];if(n){nl=n.getElementsByTagName('script');for(i=0;i<nl.length;i++){if(getBase(nl[i]))return;}}return;},is:function(o,t){var n=typeof(o);if(!t)return n!='undefined';if(t=='array'&&(o instanceof Array))return true;return n==t;},each:function(o,cb,s){var n,l;if(!o)return 0;s=s||o;if(typeof(o.length)!='undefined'){for(n=0,l=o.length;n<l;n++){if(cb.call(s,o[n],n,o)===false)return 0;}}else{for(n in o){if(o.hasOwnProperty(n)){if(cb.call(s,o[n],n,o)===false)return 0;}}}return 1;},map:function(a,f){var o=[];tinymce.each(a,function(v){o.push(f(v));});return o;},grep:function(a,f){var o=[];tinymce.each(a,function(v){if(!f||f(v))o.push(v);});return o;},inArray:function(a,v){var i,l;if(a){for(i=0,l=a.length;i<l;i++){if(a[i]===v)return i;}}return-1;},extend:function(o,e){var i,a=arguments;for(i=1;i<a.length;i++){e=a[i];tinymce.each(e,function(v,n){if(typeof(v)!=='undefined')o[n]=v;});}return o;},trim:function(s){return(s?''+s:'').replace(/^\s*|\s*$/g,'');},create:function(s,p){var t=this,sp,ns,cn,scn,c,de=0;s=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);cn=s[3].match(/(^|\.)(\w+)$/i)[2];ns=t.createNS(s[3].replace(/\.\w+$/,''));if(ns[cn])return;if(s[2]=='static'){ns[cn]=p;if(this.onCreate)this.onCreate(s[2],s[3],ns[cn]);return;}if(!p[cn]){p[cn]=function(){};de=1;}ns[cn]=p[cn];t.extend(ns[cn].prototype,p);if(s[5]){sp=t.resolve(s[5]).prototype;scn=s[5].match(/\.(\w+)$/i)[1];c=ns[cn];if(de){ns[cn]=function(){return sp[scn].apply(this,arguments);};}else{ns[cn]=function(){this.parent=sp[scn];return c.apply(this,arguments);};}ns[cn].prototype[cn]=ns[cn];t.each(sp,function(f,n){ns[cn].prototype[n]=sp[n];});t.each(p,function(f,n){if(sp[n]){ns[cn].prototype[n]=function(){this.parent=sp[n];return f.apply(this,arguments);};}else{if(n!=cn)ns[cn].prototype[n]=f;}});}t.each(p['static'],function(f,n){ns[cn][n]=f;});if(this.onCreate)this.onCreate(s[2],s[3],ns[cn].prototype);},walk:function(o,f,n,s){s=s||this;if(o){if(n)o=o[n];tinymce.each(o,function(o,i){if(f.call(s,o,i,n)===false)return false;tinymce.walk(o,f,n,s);});}},createNS:function(n,o){var i,v;o=o||window;n=n.split('.');for(i=0;i<n.length;i++){v=n[i];if(!o[v])o[v]={};o=o[v];}return o;},resolve:function(n,o){var i,l;o=o||window;n=n.split('.');for(i=0,l=n.length;i<l;i++){o=o[n[i]];if(!o)break;}return o;},addUnload:function(f,s){var t=this,w=window;f={func:f,scope:s||this};if(!t.unloads){function unload(){var li=t.unloads,o,n;if(li){for(n in li){o=li[n];if(o&&o.func)o.func.call(o.scope,1);}if(w.detachEvent){w.detachEvent('onbeforeunload',fakeUnload);w.detachEvent('onunload',unload);}else if(w.removeEventListener)w.removeEventListener('unload',unload,false);t.unloads=o=li=w=unload=null;if(window.CollectGarbage)window.CollectGarbage();}};function fakeUnload(){var d=document;if(d.readyState=='interactive'){function stop(){d.detachEvent('onstop',stop);unload();d=null;};d.attachEvent('onstop',stop);window.setTimeout(function(){d.detachEvent('onstop',stop);},0);}};if(w.attachEvent){w.attachEvent('onunload',unload);w.attachEvent('onbeforeunload',fakeUnload);}else if(w.addEventListener)w.addEventListener('unload',unload,false);t.unloads=[f];}else t.unloads.push(f);return f;},removeUnload:function(f){var u=this.unloads,r=null;tinymce.each(u,function(o,i){if(o&&o.func==f){u.splice(i,1);r=f;return false;}});return r;},explode:function(s,d){return s?tinymce.map(s.split(d||','),tinymce.trim):s;},_addVer:function(u){var v;if(!this.query)return u;v=(u.indexOf('?')==-1?'?':'&')+this.query;if(u.indexOf('#')==-1)return u+v;return u.replace('#',v+'#');}};window.tinymce=tinymce;tinymce._init();tinymce.create('tinymce.util.Dispatcher',{scope:null,listeners:null,Dispatcher:function(s){this.scope=s||this;this.listeners=[];},add:function(cb,s){this.listeners.push({cb:cb,scope:s||this.scope});return cb;},addToTop:function(cb,s){this.listeners.unshift({cb:cb,scope:s||this.scope});return cb;},remove:function(cb){var l=this.listeners,o=null;tinymce.each(l,function(c,i){if(cb==c.cb){o=cb;l.splice(i,1);return false;}});return o;},dispatch:function(){var s,a=arguments,i,li=this.listeners,c;for(i=0;i<li.length;i++){c=li[i];s=c.cb.apply(c.scope,a);if(s===false)break;}return s;}});(function(){var each=tinymce.each;tinymce.create('tinymce.util.URI',{URI:function(u,s){var t=this,o,a,b;s=t.settings=s||{};if(/^(mailto|news|javascript|about):/i.test(u)||/^\s*#/.test(u)){t.source=u;return;}if(u.indexOf('/')===0&&u.indexOf('//')!==0)u=(s.base_uri?s.base_uri.protocol||'http':'http')+'://mce_host'+u;if(u.indexOf('://')===-1&&u.indexOf('//')!==0)u=(s.base_uri.protocol||'http')+'://mce_host'+t.toAbsPath(s.base_uri.path,u);u=u.replace(/@@/g,'(mce_at)');u=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(u);each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(v,i){var s=u[i];if(s)s=s.replace(/\(mce_at\)/g,'@@');t[v]=s;});if(b=s.base_uri){if(!t.protocol)t.protocol=b.protocol;if(!t.userInfo)t.userInfo=b.userInfo;if(!t.port&&t.host=='mce_host')t.port=b.port;if(!t.host||t.host=='mce_host')t.host=b.host;t.source='';}},setPath:function(p){var t=this;p=/^(.*?)\/?(\w+)?$/.exec(p);t.path=p[0];t.directory=p[1];t.file=p[2];t.source='';t.getURI();},toRelative:function(u){var t=this,o;u=new tinymce.util.URI(u,{base_uri:t});if((u.host!='mce_host'&&t.host!=u.host&&u.host)||t.port!=u.port||t.protocol!=u.protocol)return u.getURI();o=t.toRelPath(t.path,u.path);if(u.query)o+='?'+u.query;if(u.anchor)o+='#'+u.anchor;return o;},toAbsolute:function(u,nh){var u=new tinymce.util.URI(u,{base_uri:this});return u.getURI(this.host==u.host?nh:0);},toRelPath:function(base,path){var items,bp=0,out='',i;base=base.substring(0,base.lastIndexOf('/'));base=base.split('/');items=path.split('/');if(base.length>=items.length){for(i=0;i<base.length;i++){if(i>=items.length||base[i]!=items[i]){bp=i+1;break;}}}if(base.length<items.length){for(i=0;i<items.length;i++){if(i>=base.length||base[i]!=items[i]){bp=i+1;break;}}}if(bp==1)return path;for(i=0;i<base.length-(bp-1);i++)out+="../";for(i=bp-1;i<items.length;i++){if(i!=bp-1)out+="/"+items[i];else out+=items[i];}return out;},toAbsPath:function(base,path){var i,nb=0,o=[];base=base.split('/');path=path.split('/');each(base,function(k){if(k)o.push(k);});base=o;for(i=path.length-1,o=[];i>=0;i--){if(path[i].length==0||path[i]==".")continue;if(path[i]=='..'){nb++;continue;}if(nb>0){nb--;continue;}o.push(path[i]);}i=base.length-nb;if(i<=0)return'/'+o.reverse().join('/');return'/'+base.slice(0,i).join('/')+'/'+o.reverse().join('/');},getURI:function(nh){var s,t=this;if(!t.source||nh){s='';if(!nh){if(t.protocol)s+=t.protocol+'://';if(t.userInfo)s+=t.userInfo+'@';if(t.host)s+=t.host;if(t.port)s+=':'+t.port;}if(t.path)s+=t.path;if(t.query)s+='?'+t.query;if(t.anchor)s+='#'+t.anchor;t.source=s;}return t.source;}});})();(function(){var each=tinymce.each;tinymce.create('static tinymce.util.Cookie',{getHash:function(n){var v=this.get(n),h;if(v){each(v.split('&'),function(v){v=v.split('=');h=h||{};h[unescape(v[0])]=unescape(v[1]);});}return h;},setHash:function(n,v,e,p,d,s){var o='';each(v,function(v,k){o+=(!o?'':'&')+escape(k)+'='+escape(v);});this.set(n,o,e,p,d,s);},get:function(n){var c=document.cookie,e,p=n+"=",b;if(!c)return;b=c.indexOf("; "+p);if(b==-1){b=c.indexOf(p);if(b!=0)return null;}else b+=2;e=c.indexOf(";",b);if(e==-1)e=c.length;return unescape(c.substring(b+p.length,e));},set:function(n,v,e,p,d,s){document.cookie=n+"="+escape(v)+((e)?"; expires="+e.toGMTString():"")+((p)?"; path="+escape(p):"")+((d)?"; domain="+d:"")+((s)?"; secure":"");},remove:function(n,p){var d=new Date();d.setTime(d.getTime()-1000);this.set(n,'',d,p,d);}});})();tinymce.create('static tinymce.util.JSON',{serialize:function(o){var i,v,s=tinymce.util.JSON.serialize,t;if(o==null)return'null';t=typeof o;if(t=='string'){v='\bb\tt\nn\ff\rr\""\'\'\\\\';return'"'+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'])/g,function(a,b){i=v.indexOf(b);if(i+1)return'\\'+v.charAt(i+1);a=b.charCodeAt().toString(16);return'\\u'+'0000'.substring(a.length)+a;})+'"';}if(t=='object'){if(o instanceof Array){for(i=0,v='[';i<o.length;i++)v+=(i>0?',':'')+s(o[i]);return v+']';}v='{';for(i in o)v+=typeof o[i]!='function'?(v.length>1?',"':'"')+i+'":'+s(o[i]):'';return v+'}';}return''+o;},parse:function(s){try{return eval('('+s+')');}catch(ex){}}});tinymce.create('static tinymce.util.XHR',{send:function(o){var x,t,w=window,c=0;o.scope=o.scope||this;o.success_scope=o.success_scope||o.scope;o.error_scope=o.error_scope||o.scope;o.async=o.async===false?false:true;o.data=o.data||'';function get(s){x=0;try{x=new ActiveXObject(s);}catch(ex){}return x;};x=w.XMLHttpRequest?new XMLHttpRequest():get('Microsoft.XMLHTTP')||get('Msxml2.XMLHTTP');if(x){if(x.overrideMimeType)x.overrideMimeType(o.content_type);x.open(o.type||(o.data?'POST':'GET'),o.url,o.async);if(o.content_type)x.setRequestHeader('Content-Type',o.content_type);x.send(o.data);function ready(){if(!o.async||x.readyState==4||c++>10000){if(o.success&&c<10000&&x.status==200)o.success.call(o.success_scope,''+x.responseText,x,o);else if(o.error)o.error.call(o.error_scope,c>10000?'TIMED_OUT':'GENERAL',x,o);x=null;}else w.setTimeout(ready,10);};if(!o.async)return ready();t=w.setTimeout(ready,10);}}});(function(){var extend=tinymce.extend,JSON=tinymce.util.JSON,XHR=tinymce.util.XHR;tinymce.create('tinymce.util.JSONRequest',{JSONRequest:function(s){this.settings=extend({},s);this.count=0;},send:function(o){var ecb=o.error,scb=o.success;o=extend(this.settings,o);o.success=function(c,x){c=JSON.parse(c);if(typeof(c)=='undefined'){c={error:'JSON Parse error.'};}if(c.error)ecb.call(o.error_scope||o.scope,c.error,x);else scb.call(o.success_scope||o.scope,c.result);};o.error=function(ty,x){ecb.call(o.error_scope||o.scope,ty,x);};o.data=JSON.serialize({id:o.id||'c'+(this.count++),method:o.method,params:o.params});o.content_type='application/json';XHR.send(o);},'static':{sendRPC:function(o){return new tinymce.util.JSONRequest().send(o);}}});}());(function(){var each=tinymce.each,is=tinymce.is;var isWebKit=tinymce.isWebKit,isIE=tinymce.isIE;tinymce.create('tinymce.dom.DOMUtils',{doc:null,root:null,files:null,listeners:{},pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,cache:{},idPattern:/^#[\w]+$/,elmPattern:/^[\w_*]+$/,elmClassPattern:/^([\w_]*)\.([\w_]+)$/,DOMUtils:function(d,s){var t=this;t.doc=d;t.win=window;t.files={};t.cssFlicker=false;t.counter=0;t.boxModel=!tinymce.isIE||d.compatMode=="CSS1Compat";t.stdMode=d.documentMode===8;this.settings=s=tinymce.extend({keep_values:false,hex_colors:1,process_html:1},s);if(tinymce.isIE6){try{d.execCommand('BackgroundImageCache',false,true);}catch(e){t.cssFlicker=true;}}tinymce.addUnload(t.destroy,t);},getRoot:function(){var t=this,s=t.settings;return(s&&t.get(s.root_element))||t.doc.body;},getViewPort:function(w){var d,b;w=!w?this.win:w;d=w.document;b=this.boxModel?d.documentElement:d.body;return{x:w.pageXOffset||b.scrollLeft,y:w.pageYOffset||b.scrollTop,w:w.innerWidth||b.clientWidth,h:w.innerHeight||b.clientHeight};},getRect:function(e){var p,t=this,w,h;e=t.get(e);p=t.getPos(e);w=t.getStyle(e,'width');h=t.getStyle(e,'height');if(w.indexOf('px')===-1)w=0;if(h.indexOf('px')===-1)h=0;return{x:p.x,y:p.y,w:parseInt(w)||e.offsetWidth||e.clientWidth,h:parseInt(h)||e.offsetHeight||e.clientHeight};},getParent:function(n,f,r){var na,se=this.settings;n=this.get(n);if(se.strict_root)r=r||this.getRoot();if(is(f,'string')){na=f.toUpperCase();f=function(n){var s=false;if(n.nodeType==1&&na==='*'){s=true;return false;}each(na.split(','),function(v){if(n.nodeType==1&&((se.strict&&n.nodeName.toUpperCase()==v)||n.nodeName.toUpperCase()==v)){s=true;return false;}});return s;};}while(n){if(n==r)return null;if(f(n))return n;n=n.parentNode;}return null;},get:function(e){var n;if(e&&this.doc&&typeof(e)=='string'){n=e;e=this.doc.getElementById(e);if(e&&e.id!==n)return this.doc.getElementsByName(n)[1];}return e;},select:function(pa,s){var t=this,cs,c,pl,o=[],x,i,l,n;s=t.get(s)||t.doc;if(s.querySelectorAll){if(s!=t.doc){i=s.id;s.id='_mc_tmp';pa='#_mc_tmp '+pa;}l=tinymce.grep(s.querySelectorAll(pa));s.id=i;return l;}if(t.settings.strict){function get(s,n){return s.getElementsByTagName(n.toLowerCase());};}else{function get(s,n){return s.getElementsByTagName(n);};}if(t.elmPattern.test(pa)){x=get(s,pa);for(i=0,l=x.length;i<l;i++)o.push(x[i]);return o;}if(t.elmClassPattern.test(pa)){pl=t.elmClassPattern.exec(pa);x=get(s,pl[1]||'*');c=' '+pl[2]+' ';for(i=0,l=x.length;i<l;i++){n=x[i];if(n.className&&(' '+n.className+' ').indexOf(c)!==-1)o.push(n);}return o;}function collect(n){if(!n.mce_save){n.mce_save=1;o.push(n);}};function collectIE(n){if(!n.getAttribute('mce_save')){n.setAttribute('mce_save','1');o.push(n);}};function find(n,f,r){var i,l,nl=get(r,n);for(i=0,l=nl.length;i<l;i++)f(nl[i]);};each(pa.split(','),function(v,i){v=tinymce.trim(v);if(t.elmPattern.test(v)){each(get(s,v),function(n){collect(n);});return;}if(t.elmClassPattern.test(v)){x=t.elmClassPattern.exec(v);each(get(s,x[1]),function(n){if(t.hasClass(n,x[2]))collect(n);});return;}if(!(cs=t.cache[pa])){cs='x=(function(cf, s) {';pl=v.split(' ');each(pl,function(v){var p=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@([\w\\]+)([\^\$\*!]?=)([\w\\]+)\])?(?:\:([\w\\]+))?/i.exec(v);p[1]=p[1]||'*';cs+='find("'+p[1]+'", function(n) {';if(p[2])cs+='if (n.id !== "'+p[2]+'") return;';if(p[3]){cs+='var c = " " + n.className + " ";';cs+='if (';c='';each(p[3].split('.'),function(v){if(v)c+=(c?'||':'')+'c.indexOf(" '+v+' ") === -1';});cs+=c+') return;';}});cs+='cf(n);';for(i=pl.length-1;i>=0;i--)cs+='}, '+(i?'n':'s')+');';cs+='})';t.cache[pa]=cs=eval(cs);}cs(isIE?collectIE:collect,s);});each(o,function(n){if(isIE)n.removeAttribute('mce_save');else delete n.mce_save;});return o;},add:function(p,n,a,h,c){var t=this;return this.run(p,function(p){var e,k;e=is(n,'string')?t.doc.createElement(n):n;if(a){for(k in a){if(a.hasOwnProperty(k)&&!is(a[k],'object'))t.setAttrib(e,k,''+a[k]);}if(a.style&&!is(a.style,'string')){each(a.style,function(v,n){t.setStyle(e,n,v);});}}if(h){if(h.nodeType)e.appendChild(h);else t.setHTML(e,h);}return!c?p.appendChild(e):e;});},create:function(n,a,h){return this.add(this.doc.createElement(n),n,a,h,1);},createHTML:function(n,a,h){var o='',t=this,k;o+='<'+n;for(k in a){if(a.hasOwnProperty(k))o+=' '+k+'="'+t.encode(a[k])+'"';}if(tinymce.is(h))return o+'>'+h+'</'+n+'>';return o+' />';},remove:function(n,k){return this.run(n,function(n){var p,g;p=n.parentNode;if(!p)return null;if(k){each(n.childNodes,function(c){p.insertBefore(c.cloneNode(true),n);});}return p.removeChild(n);});},setStyle:function(n,na,v){var t=this;return t.run(n,function(e){var s,i;s=e.style;na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase();});if(t.pixelStyles.test(na)&&(tinymce.is(v,'number')||/^[\-0-9\.]+$/.test(v)))v+='px';switch(na){case'opacity':if(isIE){s.filter=v===''?'':"alpha(opacity="+(v*100)+")";if(!n.currentStyle||!n.currentStyle.hasLayout)s.display='inline-block';}s[na]=s['-moz-opacity']=s['-khtml-opacity']=v||'';break;case'float':isIE?s.styleFloat=v:s.cssFloat=v;break;default:s[na]=v||'';}if(t.settings.update_styles)t.setAttrib(e,'mce_style');});},getStyle:function(n,na,c){n=this.get(n);if(!n)return false;if(this.doc.defaultView&&c){na=na.replace(/[A-Z]/g,function(a){return'-'+a;});try{return this.doc.defaultView.getComputedStyle(n,null).getPropertyValue(na);}catch(ex){return null;}}na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase();});if(na=='float')na=isIE?'styleFloat':'cssFloat';if(n.currentStyle&&c)return n.currentStyle[na];return n.style[na];},setStyles:function(e,o){var t=this,s=t.settings,ol;ol=s.update_styles;s.update_styles=0;each(o,function(v,n){t.setStyle(e,n,v);});s.update_styles=ol;if(s.update_styles)t.setAttrib(e,s.cssText);},setAttrib:function(e,n,v){var t=this;if(t.settings.strict)n=n.toLowerCase();return this.run(e,function(e){var s=t.settings;switch(n){case"style":if(s.keep_values){if(v&&!t._isRes(v))e.setAttribute('mce_style',v,2);else e.removeAttribute('mce_style',2);}e.style.cssText=v;break;case"class":e.className=v||'';break;case"src":case"href":if(s.keep_values){if(s.url_converter)v=s.url_converter.call(s.url_converter_scope||t,v,n,e);t.setAttrib(e,'mce_'+n,v,2);}break;case"shape":e.setAttribute('mce_style',v);break;}if(is(v)&&v!==null&&v.length!==0)e.setAttribute(n,''+v,2);else e.removeAttribute(n,2);});},setAttribs:function(e,o){var t=this;return this.run(e,function(e){each(o,function(v,n){t.setAttrib(e,n,v);});});},getAttrib:function(e,n,dv){var v,t=this;e=t.get(e);if(!e||e.nodeType!==1)return false;if(!is(dv))dv="";if(/^(src|href|style|coords|shape)$/.test(n)){v=e.getAttribute("mce_"+n);if(v)return v;}v=e.getAttribute(n,2);if(!v){switch(n){case'class':v=e.className;break;default:if(isIE&&n==='name'&&e.nodeName==='A'){v=e.name;break;}v=e.attributes[n];v=v&&is(v.nodeValue)?v.nodeValue:v;}}switch(n){case'style':v=v||e.style.cssText;if(v){v=t.serializeStyle(t.parseStyle(v));if(t.settings.keep_values&&!t._isRes(v))e.setAttribute('mce_style',v);}break;}if(isWebKit&&n==="class"&&v)v=v.replace(/(apple|webkit)\-[a-z\-]+/gi,'');if(isIE){switch(n){case'rowspan':case'colspan':if(v===1)v='';break;case'size':if(v==='+0')v='';break;case'hspace':if(v===-1)v='';break;case'maxlength':case'tabindex':if(v===32768||v===2147483647)v='';break;case'noshade':if(v===65535)return'noshade';break;case'shape':v=v.toLowerCase();break;default:if(n.indexOf('on')===0&&v)v=(''+v).replace(/^function\s+anonymous\(\)\s+\{\s+(.*)\s+\}$/,'$1');}}return(v&&v!='')?''+v:dv;},getPos:function(n){var t=this,x=0,y=0,e,d=t.doc,r;n=t.get(n);if(n&&isIE){n=n.getBoundingClientRect();e=t.boxModel?d.documentElement:d.body;x=t.getStyle(t.select('html')[0],'borderWidth');x=(x=='medium'||t.boxModel&&!t.isIE6)&&2||x;n.top+=t.win.self!=t.win.top?2:0;return{x:n.left+e.scrollLeft-x,y:n.top+e.scrollTop-x};}r=n;while(r){x+=r.offsetLeft||0;y+=r.offsetTop||0;r=r.offsetParent;}r=n;while(r){if(!/^table-row|inline.*/i.test(t.getStyle(r,"display",1))){x-=r.scrollLeft||0;y-=r.scrollTop||0;}r=r.parentNode;if(r==d.body)break;}return{x:x,y:y};},parseStyle:function(st){var t=this,s=t.settings,o={};if(!st)return o;function compress(p,s,ot){var t,r,b,l;t=o[p+'-top'+s];if(!t)return;r=o[p+'-right'+s];if(t!=r)return;b=o[p+'-bottom'+s];if(r!=b)return;l=o[p+'-left'+s];if(b!=l)return;o[ot]=l;delete o[p+'-top'+s];delete o[p+'-right'+s];delete o[p+'-bottom'+s];delete o[p+'-left'+s];};function compress2(ta,a,b,c){var t;t=o[a];if(!t)return;t=o[b];if(!t)return;t=o[c];if(!t)return;o[ta]=o[a]+' '+o[b]+' '+o[c];delete o[a];delete o[b];delete o[c];};st=st.replace(/&(#?[a-z0-9]+);/g,'&$1_MCE_SEMI_');each(st.split(';'),function(v){var sv,ur=[];if(v){v=v.replace(/_MCE_SEMI_/g,';');v=v.replace(/url\([^\)]+\)/g,function(v){ur.push(v);return'url('+ur.length+')';});v=v.split(':');sv=tinymce.trim(v[1]);sv=sv.replace(/url\(([^\)]+)\)/g,function(a,b){return ur[parseInt(b)-1];});sv=sv.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v);});if(s.url_converter){sv=sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(x,c){return'url('+s.url_converter.call(s.url_converter_scope||t,t.decode(c),'style',null)+')';});}o[tinymce.trim(v[0]).toLowerCase()]=sv;}});compress("border","","border");compress("border","-width","border-width");compress("border","-color","border-color");compress("border","-style","border-style");compress("padding","","padding");compress("margin","","margin");compress2('border','border-width','border-style','border-color');if(isIE){if(o.border=='medium none')o.border='';}return o;},serializeStyle:function(o){var s='';each(o,function(v,k){if(k&&v){if(tinymce.isGecko&&k.indexOf('-moz-')===0)return;switch(k){case'color':case'background-color':v=v.toLowerCase();break;}s+=(s?' ':'')+k+': '+v+';';}});return s;},loadCSS:function(u){var t=this,d=t.doc;if(!u)u='';each(u.split(','),function(u){if(t.files[u])return;t.files[u]=true;t.add(t.select('head')[0],'link',{rel:'stylesheet',href:tinymce._addVer(u)});});},addClass:function(e,c){return this.run(e,function(e){var o;if(!c)return 0;if(this.hasClass(e,c))return e.className;o=this.removeClass(e,c);return e.className=(o!=''?(o+' '):'')+c;});},removeClass:function(e,c){var t=this,re;return t.run(e,function(e){var v;if(t.hasClass(e,c)){if(!re)re=new RegExp("(^|\\s+)"+c+"(\\s+|$)","g");v=e.className.replace(re,' ');return e.className=tinymce.trim(v!=' '?v:'');}return e.className;});},hasClass:function(n,c){n=this.get(n);if(!n||!c)return false;return(' '+n.className+' ').indexOf(' '+c+' ')!==-1;},show:function(e){return this.setStyle(e,'display','block');},hide:function(e){return this.setStyle(e,'display','none');},isHidden:function(e){e=this.get(e);return e.style.display=='none'||this.getStyle(e,'display')=='none';},uniqueId:function(p){return(!p?'mce_':p)+(this.counter++);},setHTML:function(e,h){var t=this;return this.run(e,function(e){var x,i,nl,n,p,x;h=t.processHTML(h);if(isIE){function set(){try{e.innerHTML='<br />'+h;e.removeChild(e.firstChild);}catch(ex){while(e.firstChild)e.firstChild.removeNode();x=t.create('div');x.innerHTML='<br />'+h;each(x.childNodes,function(n,i){if(i)e.appendChild(n);});}};if(t.settings.fix_ie_paragraphs)h=h.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 mce_keep="true"> </p>');set();if(t.settings.fix_ie_paragraphs){nl=e.getElementsByTagName("p");for(i=nl.length-1,x=0;i>=0;i--){n=nl[i];if(!n.hasChildNodes()){if(!n.mce_keep){x=1;break;}n.removeAttribute('mce_keep');}}}if(x){h=h.replace(/<p([^>]+)>|<p>/g,'<div$1 mce_tmp="1">');h=h.replace(/<\/p>/g,'</div>');set();if(t.settings.fix_ie_paragraphs){nl=e.getElementsByTagName("DIV");for(i=nl.length-1;i>=0;i--){n=nl[i];if(n.mce_tmp){p=t.doc.createElement('p');n.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(a,b){var v;if(b!=='mce_tmp'){v=n.getAttribute(b);if(!v&&b==='class')v=n.className;p.setAttribute(b,v);}});for(x=0;x<n.childNodes.length;x++)p.appendChild(n.childNodes[x].cloneNode(true));n.swapNode(p);}}}}}else e.innerHTML=h;return h;});},processHTML:function(h){var t=this,s=t.settings;if(!s.process_html)return h;if(tinymce.isGecko){h=h.replace(/<(\/?)strong>|<strong( [^>]+)>/gi,'<$1b$2>');h=h.replace(/<(\/?)em>|<em( [^>]+)>/gi,'<$1i$2>');}else if(isIE)h=h.replace(/'/g,''');h=h.replace(/<a( )([^>]+)\/>|<a\/>/gi,'<a$1$2></a>');if(s.keep_values){if(/<script|style/.test(h)){function trim(s){s=s.replace(/^[\r\n]*|[\r\n]*$/g,'');s=s.replace(/^\s*(\/\/\s*<!--|\/\/\s*<\[CDATA\[|<!--|<\[CDATA\[)[\r\n]*/g,'');s=s.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->)\s*$/g,'');return s;};h=h.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/g,function(v,a,b){b=trim(b);if(!a)a=' type="text/javascript"';if(b)b='<!--\n'+b+'\n// -->';return'<mce:script'+a+'>'+b+'</mce:script>';});h=h.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/g,function(v,a,b){b=trim(b);return'<mce:style'+a+'><!--\n'+b+'\n--></mce:style><style'+a+' mce_bogus="1">'+b+'</style>';});}h=h.replace(/<([\w:]+) [^>]*(src|href|style|shape|coords)[^>]*>/gi,function(a,n){function handle(m,b,c){var u=c;if(a.indexOf('mce_'+b)!=-1)return m;if(b=='style'){if(t._isRes(c))return m;if(s.hex_colors){u=u.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v);});}if(s.url_converter){u=u.replace(/url\([\'\"]?([^\)\'\"]+)\)/g,function(x,c){return'url('+t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n))+')';});}}else if(b!='coords'&&b!='shape'){if(s.url_converter)u=t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n));}return' '+b+'="'+c+'" mce_'+b+'="'+u+'"';};a=a.replace(/ (src|href|style|coords|shape)=[\"]([^\"]+)[\"]/gi,handle);a=a.replace(/ (src|href|style|coords|shape)=[\']([^\']+)[\']/gi,handle);return a.replace(/ (src|href|style|coords|shape)=([^\s\"\'>]+)/gi,handle);});}return h;},getOuterHTML:function(e){var d;e=this.get(e);if(!e)return null;if(isIE)return e.outerHTML;d=(e.ownerDocument||this.doc).createElement("body");d.appendChild(e.cloneNode(true));return d.innerHTML;},setOuterHTML:function(e,h,d){var t=this;return this.run(e,function(e){var n,tp;e=t.get(e);d=d||e.ownerDocument||t.doc;if(isIE&&e.nodeType==1)e.outerHTML=h;else{tp=d.createElement("body");tp.innerHTML=h;n=tp.lastChild;while(n){t.insertAfter(n.cloneNode(true),e);n=n.previousSibling;}t.remove(e);}});},decode:function(s){var e;if(/&[^;]+;/.test(s)){e=this.doc.createElement("div");e.innerHTML=s;return!e.firstChild?s:e.firstChild.nodeValue;}return s;},encode:function(s){return s?(''+s).replace(/[<>&\"]/g,function(c,b){switch(c){case'&':return'&';case'"':return'"';case'<':return'<';case'>':return'>';}return c;}):s;},insertAfter:function(n,r){var t=this;r=t.get(r);return this.run(n,function(n){var p,ns;p=r.parentNode;ns=r.nextSibling;if(ns)p.insertBefore(n,ns);else p.appendChild(n);return n;});},isBlock:function(n){if(n.nodeType&&n.nodeType!==1)return false;n=n.nodeName||n;return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n);},replace:function(n,o,k){if(is(o,'array'))n=n.cloneNode(true);return this.run(o,function(o){if(k){each(o.childNodes,function(c){n.appendChild(c.cloneNode(true));});}return o.parentNode.replaceChild(n,o);});},toHex:function(s){var c=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s);function hex(s){s=parseInt(s).toString(16);return s.length>1?s:'0'+s;};if(c){s='#'+hex(c[1])+hex(c[2])+hex(c[3]);return s;}return s;},getClasses:function(){var t=this,cl=[],i,lo={},f=t.settings.class_filter,ov;if(t.classes)return t.classes;function addClasses(s){each(s.imports,function(r){addClasses(r);});each(s.cssRules||s.rules,function(r){switch(r.type||1){case 1:if(r.selectorText){each(r.selectorText.split(','),function(v){v=v.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(v)||!/\.[\w\-]+$/.test(v))return;ov=v;v=v.replace(/.*\.([a-z0-9_\-]+).*/i,'$1');if(f&&!(v=f(v,ov)))return;if(!lo[v]){cl.push({'class':v});lo[v]=1;}});}break;case 3:addClasses(r.styleSheet);break;}});};try{each(t.doc.styleSheets,addClasses);}catch(ex){}if(cl.length>0)t.classes=cl;return cl;},run:function(e,f,s){var t=this,o;if(t.doc&&typeof(e)==='string')e=t.doc.getElementById(e);if(!e)return false;s=s||this;if(!e.nodeType&&(e.length||e.length===0)){o=[];each(e,function(e,i){if(e){if(typeof(e)=='string')e=t.doc.getElementById(e);o.push(f.call(s,e,i));}});return o;}return f.call(s,e);},getAttribs:function(n){var o;n=this.get(n);if(!n)return[];if(isIE){o=[];if(n.nodeName=='OBJECT')return n.attributes;n.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(a,b){o.push({specified:1,nodeName:b});});return o;}return n.attributes;},destroy:function(s){var t=this;t.win=t.doc=t.root=null;if(!s)tinymce.removeUnload(t.destroy);},_isRes:function(c){return/^(top|left|bottom|right|width|height)/i.test(c)||/;\s*(top|left|bottom|right|width|height)/i.test(c);}});tinymce.DOM=new tinymce.dom.DOMUtils(document,{process_html:0});})();(function(){var each=tinymce.each,DOM=tinymce.DOM,isIE=tinymce.isIE,isWebKit=tinymce.isWebKit,Event;tinymce.create('static tinymce.dom.Event',{inits:[],events:[],add:function(o,n,f,s){var cb,t=this,el=t.events,r;if(o&&o instanceof Array){r=[];each(o,function(o){o=DOM.get(o);r.push(t.add(o,n,f,s));});return r;}o=DOM.get(o);if(!o)return;cb=function(e){e=e||window.event;if(e&&!e.target&&isIE)e.target=e.srcElement;if(!s)return f(e);return f.call(s,e);};if(n=='unload'){tinymce.unloads.unshift({func:cb});return cb;}if(n=='init'){if(t.domLoaded)cb();else t.inits.push(cb);return cb;}el.push({obj:o,name:n,func:f,cfunc:cb,scope:s});t._add(o,n,cb);return f;},remove:function(o,n,f){var t=this,a=t.events,s=false,r;if(o&&o instanceof Array){r=[];each(o,function(o){o=DOM.get(o);r.push(t.remove(o,n,f));});return r;}o=DOM.get(o);each(a,function(e,i){if(e.obj==o&&e.name==n&&(!f||(e.func==f||e.cfunc==f))){a.splice(i,1);t._remove(o,n,e.cfunc);s=true;return false;}});return s;},clear:function(o){var t=this,a=t.events,i,e;if(o){o=DOM.get(o);for(i=a.length-1;i>=0;i--){e=a[i];if(e.obj===o){t._remove(e.obj,e.name,e.cfunc);e.obj=e.cfunc=null;a.splice(i,1);}}}},cancel:function(e){if(!e)return false;this.stop(e);return this.prevent(e);},stop:function(e){if(e.stopPropagation)e.stopPropagation();else e.cancelBubble=true;return false;},prevent:function(e){if(e.preventDefault)e.preventDefault();else e.returnValue=false;return false;},_unload:function(){var t=Event;each(t.events,function(e,i){t._remove(e.obj,e.name,e.cfunc);e.obj=e.cfunc=null;});t.events=[];t=null;},_add:function(o,n,f){if(o.attachEvent)o.attachEvent('on'+n,f);else if(o.addEventListener)o.addEventListener(n,f,false);else o['on'+n]=f;},_remove:function(o,n,f){if(o){try{if(o.detachEvent)o.detachEvent('on'+n,f);else if(o.removeEventListener)o.removeEventListener(n,f,false);else o['on'+n]=null;}catch(ex){}}},_pageInit:function(){var e=Event;e._remove(window,'DOMContentLoaded',e._pageInit);e.domLoaded=true;each(e.inits,function(c){c();});e.inits=[];},_wait:function(){var t;if(window.tinyMCE_GZ&&tinyMCE_GZ.loaded){Event.domLoaded=1;return;}if(isIE&&document.location.protocol!='https:'){document.write('<script id=__ie_onload defer src=\'javascript:""\';><\/script>');DOM.get("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){Event._pageInit();DOM.get("__ie_onload").onreadystatechange=null;}};}else{Event._add(window,'DOMContentLoaded',Event._pageInit,Event);if(isIE||isWebKit){t=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(t);Event._pageInit();}},10);}}}});Event=tinymce.dom.Event;Event._wait();tinymce.addUnload(Event._unload);})();(function(){var each=tinymce.each;tinymce.create('tinymce.dom.Element',{Element:function(id,s){var t=this,dom,el;s=s||{};t.id=id;t.dom=dom=s.dom||tinymce.DOM;t.settings=s;if(!tinymce.isIE)el=t.dom.get(t.id);each(['getPos','getRect','getParent','add','setStyle','getStyle','setStyles','setAttrib','setAttribs','getAttrib','addClass','removeClass','hasClass','getOuterHTML','setOuterHTML','remove','show','hide','isHidden','setHTML','get'],function(k){t[k]=function(){var a=arguments,o;if(tinymce.isOpera){a=[id];each(arguments,function(v){a.push(v);});}else Array.prototype.unshift.call(a,el||id);o=dom[k].apply(dom,a);t.update(k);return o;};});},on:function(n,f,s){return tinymce.dom.Event.add(this.id,n,f,s);},getXY:function(){return{x:parseInt(this.getStyle('left')),y:parseInt(this.getStyle('top'))};},getSize:function(){var n=this.dom.get(this.id);return{w:parseInt(this.getStyle('width')||n.clientWidth),h:parseInt(this.getStyle('height')||n.clientHeight)};},moveTo:function(x,y){this.setStyles({left:x,top:y});},moveBy:function(x,y){var p=this.getXY();this.moveTo(p.x+x,p.y+y);},resizeTo:function(w,h){this.setStyles({width:w,height:h});},resizeBy:function(w,h){var s=this.getSize();this.resizeTo(s.w+w,s.h+h);},update:function(k){var t=this,b,dom=t.dom;if(tinymce.isIE6&&t.settings.blocker){k=k||'';if(k.indexOf('get')===0||k.indexOf('has')===0||k.indexOf('is')===0)return;if(k=='remove'){dom.remove(t.blocker);return;}if(!t.blocker){t.blocker=dom.uniqueId();b=dom.add(t.settings.container||dom.getRoot(),'iframe',{id:t.blocker,style:'position:absolute;',frameBorder:0,src:'javascript:""'});dom.setStyle(b,'opacity',0);}else b=dom.get(t.blocker);dom.setStyle(b,'left',t.getStyle('left',1));dom.setStyle(b,'top',t.getStyle('top',1));dom.setStyle(b,'width',t.getStyle('width',1));dom.setStyle(b,'height',t.getStyle('height',1));dom.setStyle(b,'display',t.getStyle('display',1));dom.setStyle(b,'zIndex',parseInt(t.getStyle('zIndex',1)||0)-1);}}});})();(function(){function trimNl(s){return s.replace(/[\n\r]+/g,'');};var is=tinymce.is,isIE=tinymce.isIE,each=tinymce.each;tinymce.create('tinymce.dom.Selection',{Selection:function(dom,win,serializer){var t=this;t.dom=dom;t.win=win;t.serializer=serializer;tinymce.addUnload(t.destroy,t);},getContent:function(s){var t=this,r=t.getRng(),e=t.dom.create("body"),se=t.getSel(),wb,wa,n;s=s||{};wb=wa='';s.get=true;s.format=s.format||'html';if(s.format=='text')return t.isCollapsed()?'':(r.text||(se.toString?se.toString():''));if(r.cloneContents){n=r.cloneContents();if(n)e.appendChild(n);}else if(is(r.item)||is(r.htmlText))e.innerHTML=r.item?r.item(0).outerHTML:r.htmlText;else e.innerHTML=r.toString();if(/^\s/.test(e.innerHTML))wb=' ';if(/\s+$/.test(e.innerHTML))wa=' ';s.getInner=true;return t.isCollapsed()?'':wb+t.serializer.serialize(e,s)+wa;},setContent:function(h,s){var t=this,r=t.getRng(),d=t.win.document;s=s||{format:'html'};s.set=true;h=t.dom.processHTML(h);if(r.insertNode){if(tinymce.isGecko&&h.indexOf('<')==-1){r.deleteContents();r.insertNode(t.getRng().createContextualFragment(h+'<span id="__caret">_</span>'));t.select(t.dom.get('__caret'));t.getRng().deleteContents();return;}try{if(d.queryCommandEnabled('InsertHTML'))return d.execCommand('InsertHTML',false,h);}catch(ex){r.deleteContents();r.insertNode(t.getRng().createContextualFragment(h));}}else{if(r.item){d.execCommand('Delete',false,null);r=t.getRng();}r.pasteHTML(h);}},getStart:function(){var t=this,r=t.getRng(),e;if(isIE){if(r.item)return r.item(0);r=r.duplicate();r.collapse(1);e=r.parentElement();if(e&&e.nodeName=='BODY')return e.firstChild;return e;}else{e=r.startContainer;if(e.nodeName=='BODY')return e.firstChild;return t.dom.getParent(e,function(n){return n.nodeType==1;});}},getEnd:function(){var t=this,r=t.getRng(),e;if(isIE){if(r.item)return r.item(0);r=r.duplicate();r.collapse(0);e=r.parentElement();if(e&&e.nodeName=='BODY')return e.lastChild;return e;}else{e=r.endContainer;if(e.nodeName=='BODY')return e.lastChild;return t.dom.getParent(e,function(n){return n.nodeType==1;});}},getBookmark:function(si){var t=this,r=t.getRng(),tr,sx,sy,vp=t.dom.getViewPort(t.win),e,sp,bp,le,c=-0xFFFFFF,s,ro=t.dom.getRoot(),wb=0,wa=0,nv;sx=vp.x;sy=vp.y;if(si=='simple')return{rng:r,scrollX:sx,scrollY:sy};if(isIE){if(r.item){e=r.item(0);each(t.dom.select(e.nodeName),function(n,i){if(e==n){sp=i;return false;}});return{tag:e.nodeName,index:sp,scrollX:sx,scrollY:sy};}tr=t.dom.doc.body.createTextRange();tr.moveToElementText(ro);tr.collapse(true);bp=Math.abs(tr.move('character',c));tr=r.duplicate();tr.collapse(true);sp=Math.abs(tr.move('character',c));tr=r.duplicate();tr.collapse(false);le=Math.abs(tr.move('character',c))-sp;return{start:sp-bp,length:le,scrollX:sx,scrollY:sy};}e=t.getNode();s=t.getSel();if(!s)return null;if(e&&e.nodeName=='IMG'){return{scrollX:sx,scrollY:sy};}function getPos(r,sn,en){var w=t.dom.doc.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false),n,p=0,d={};while((n=w.nextNode())!=null){if(n==sn)d.start=p;if(n==en){d.end=p;return d;}p+=trimNl(n.nodeValue||'').length;}return null;};if(s.anchorNode==s.focusNode&&s.anchorOffset==s.focusOffset){e=getPos(ro,s.anchorNode,s.focusNode);if(!e)return{scrollX:sx,scrollY:sy};trimNl(s.anchorNode.nodeValue||'').replace(/^\s+/,function(a){wb=a.length;});return{start:Math.max(e.start+s.anchorOffset-wb,0),end:Math.max(e.end+s.focusOffset-wb,0),scrollX:sx,scrollY:sy,beg:s.anchorOffset-wb==0};}else{e=getPos(ro,r.startContainer,r.endContainer);if(!e)return{scrollX:sx,scrollY:sy};return{start:Math.max(e.start+r.startOffset-wb,0),end:Math.max(e.end+r.endOffset-wa,0),scrollX:sx,scrollY:sy,beg:r.startOffset-wb==0};}},moveToBookmark:function(b){var t=this,r=t.getRng(),s=t.getSel(),ro=t.dom.getRoot(),sd,nvl,nv;function getPos(r,sp,ep){var w=t.dom.doc.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false),n,p=0,d={},o,v,wa,wb;while((n=w.nextNode())!=null){wa=wb=0;nv=n.nodeValue||'';nvl=trimNl(nv).length;p+=nvl;if(p>=sp&&!d.startNode){o=sp-(p-nvl);if(b.beg&&o>=nvl)continue;d.startNode=n;d.startOffset=o+wb;}if(p>=ep){d.endNode=n;d.endOffset=ep-(p-nvl)+wb;return d;}}return null;};if(!b)return false;t.win.scrollTo(b.scrollX,b.scrollY);if(isIE){if(r=b.rng){try{r.select();}catch(ex){}return true;}t.win.focus();if(b.tag){r=ro.createControlRange();each(t.dom.select(b.tag),function(n,i){if(i==b.index)r.addElement(n);});}else{try{if(b.start<0)return true;r=s.createRange();r.moveToElementText(ro);r.collapse(true);r.moveStart('character',b.start);r.moveEnd('character',b.length);}catch(ex2){return true;}}try{r.select();}catch(ex){}return true;}if(!s)return false;if(b.rng){s.removeAllRanges();s.addRange(b.rng);}else{if(is(b.start)&&is(b.end)){try{sd=getPos(ro,b.start,b.end);if(sd){r=t.dom.doc.createRange();r.setStart(sd.startNode,sd.startOffset);r.setEnd(sd.endNode,sd.endOffset);s.removeAllRanges();s.addRange(r);}if(!tinymce.isOpera)t.win.focus();}catch(ex){}}}},select:function(n,c){var t=this,r=t.getRng(),s=t.getSel(),b,fn,ln,d=t.win.document;function first(n){return n?d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false).nextNode():null;};function last(n){var c,o,w;if(!n)return null;w=d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false);while(c=w.nextNode())o=c;return o;};if(isIE){try{b=d.body;if(/^(IMG|TABLE)$/.test(n.nodeName)){r=b.createControlRange();r.addElement(n);}else{r=b.createTextRange();r.moveToElementText(n);}r.select();}catch(ex){}}else{if(c){fn=first(n);ln=last(n);if(fn&&ln){r=d.createRange();r.setStart(fn,0);r.setEnd(ln,ln.nodeValue.length);}else r.selectNode(n);}else r.selectNode(n);t.setRng(r);}return n;},isCollapsed:function(){var t=this,r=t.getRng(),s=t.getSel();if(!r||r.item)return false;return!s||r.boundingWidth==0||s.isCollapsed;},collapse:function(b){var t=this,r=t.getRng(),n;if(r.item){n=r.item(0);r=this.win.document.body.createTextRange();r.moveToElementText(n);}r.collapse(!!b);t.setRng(r);},getSel:function(){var t=this,w=this.win;return w.getSelection?w.getSelection():w.document.selection;},getRng:function(){var t=this,s=t.getSel(),r;try{if(s)r=s.rangeCount>0?s.getRangeAt(0):(s.createRange?s.createRange():t.win.document.createRange());}catch(ex){}if(!r)r=isIE?t.win.document.body.createTextRange():t.win.document.createRange();return r;},setRng:function(r){var s;if(!isIE){s=this.getSel();if(s){s.removeAllRanges();s.addRange(r);}}else{try{r.select();}catch(ex){}}},setNode:function(n){var t=this;t.setContent(t.dom.getOuterHTML(n));return n;},getNode:function(){var t=this,r=t.getRng(),s=t.getSel(),e;if(!isIE){if(!r)return t.dom.getRoot();e=r.commonAncestorContainer;if(!r.collapsed){if(tinymce.isWebKit&&s.anchorNode&&s.anchorNode.nodeType==1)return s.anchorNode.childNodes[s.anchorOffset];if(r.startContainer==r.endContainer){if(r.startOffset-r.endOffset<2){if(r.startContainer.hasChildNodes())e=r.startContainer.childNodes[r.startOffset];}}}return t.dom.getParent(e,function(n){return n.nodeType==1;});}return r.item?r.item(0):r.parentElement();},destroy:function(s){var t=this;t.win=null;if(!s)tinymce.removeUnload(t.destroy);}});})();(function(){tinymce.create('tinymce.dom.XMLWriter',{node:null,XMLWriter:function(s){function getXML(){var i=document.implementation;if(!i||!i.createDocument){try{return new ActiveXObject('MSXML2.DOMDocument');}catch(ex){}try{return new ActiveXObject('Microsoft.XmlDom');}catch(ex){}}else return i.createDocument('','',null);};this.doc=getXML();this.valid=tinymce.isOpera||tinymce.isWebKit;this.reset();},reset:function(){var t=this,d=t.doc;if(d.firstChild)d.removeChild(d.firstChild);t.node=d.appendChild(d.createElement("html"));},writeStartElement:function(n){var t=this;t.node=t.node.appendChild(t.doc.createElement(n));},writeAttribute:function(n,v){if(this.valid)v=v.replace(/>/g,'%MCGT%');this.node.setAttribute(n,v);},writeEndElement:function(){this.node=this.node.parentNode;},writeFullEndElement:function(){var t=this,n=t.node;n.appendChild(t.doc.createTextNode(""));t.node=n.parentNode;},writeText:function(v){if(this.valid)v=v.replace(/>/g,'%MCGT%');this.node.appendChild(this.doc.createTextNode(v));},writeCDATA:function(v){this.node.appendChild(this.doc.createCDATA(v));},writeComment:function(v){this.node.appendChild(this.doc.createComment(v.replace(/\-\-/g,' ')));},getContent:function(){var h;h=this.doc.xml||new XMLSerializer().serializeToString(this.doc);h=h.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,'');h=h.replace(/ ?\/>/g,' />');if(this.valid)h=h.replace(/\%MCGT%/g,'>');return h;}});})();(function(){tinymce.create('tinymce.dom.StringWriter',{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(s){this.settings=tinymce.extend({indent_char:' ',indentation:1},s);this.reset();},reset:function(){this.indent='';this.str="";this.tags=[];this.count=0;},writeStartElement:function(n){this._writeAttributesEnd();this.writeRaw('<'+n);this.tags.push(n);this.inAttr=true;this.count++;this.elementCount=this.count;},writeAttribute:function(n,v){var t=this;t.writeRaw(" "+t.encode(n)+'="'+t.encode(v)+'"');},writeEndElement:function(){var n;if(this.tags.length>0){n=this.tags.pop();if(this._writeAttributesEnd(1))this.writeRaw('</'+n+'>');if(this.settings.indentation>0)this.writeRaw('\n');}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw('</'+this.tags.pop()+'>');if(this.settings.indentation>0)this.writeRaw('\n');}},writeText:function(v){this._writeAttributesEnd();this.writeRaw(this.encode(v));this.count++;},writeCDATA:function(v){this._writeAttributesEnd();this.writeRaw('<![CDATA['+v+']]>');this.count++;},writeComment:function(v){this._writeAttributesEnd();this.writeRaw('<!-- '+v+'-->');this.count++;},writeRaw:function(v){this.str+=v;},encode:function(s){return s.replace(/[<>&"]/g,function(v){switch(v){case'<':return'<';case'>':return'>';case'&':return'&';case'"':return'"';}return v;});},getContent:function(){return this.str;},_writeAttributesEnd:function(s){if(!this.inAttr)return;this.inAttr=false;if(s&&this.elementCount==this.count){this.writeRaw(' />');return false;}this.writeRaw('>');return true;}});})();(function(){var extend=tinymce.extend,each=tinymce.each,Dispatcher=tinymce.util.Dispatcher,isIE=tinymce.isIE,isGecko=tinymce.isGecko;function getIEAtts(n){var o=[];if(n.nodeName=='OBJECT')return n.attributes;n.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(a,b){o.push({specified:1,nodeName:b});});return o;};function wildcardToRE(s){return s.replace(/([?+*])/g,'.$1');};tinymce.create('tinymce.dom.Serializer',{Serializer:function(s){var t=this;t.key=0;t.onPreProcess=new Dispatcher(t);t.onPostProcess=new Dispatcher(t);if(tinymce.relaxedDomain&&tinymce.isGecko){t.writer=new tinymce.dom.StringWriter();}else{try{t.writer=new tinymce.dom.XMLWriter();}catch(ex){t.writer=new tinymce.dom.StringWriter();}}t.settings=s=extend({dom:tinymce.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(mce_|_moz_)/,closed:/(br|hr|input|meta|img|link|param)/,entity_encoding:'named',entities:'160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro',valid_elements:'*[*]',extended_valid_elements:0,valid_child_elements:0,invalid_elements:0,fix_table_elements:0,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,font_size_style_values:0,apply_source_formatting:0,indent_mode:'simple',indent_char:'\t',indent_levels:1,remove_linebreaks:1},s);t.dom=s.dom;if(s.fix_list_elements){t.onPreProcess.add(function(se,o){var nl,x,a=['ol','ul'],i,n,p,r=/^(OL|UL)$/,np;function prevNode(e,n){var a=n.split(','),i;while((e=e.previousSibling)!=null){for(i=0;i<a.length;i++){if(e.nodeName==a[i])return e;}}return null;};for(x=0;x<a.length;x++){nl=t.dom.select(a[x],o.node);for(i=0;i<nl.length;i++){n=nl[i];p=n.parentNode;if(r.test(p.nodeName)){np=prevNode(n,'LI');if(!np){np=t.dom.create('li');np.innerHTML=' ';np.appendChild(n);p.insertBefore(np,p.firstChild);}else np.appendChild(n);}}}});}if(s.fix_table_elements){t.onPreProcess.add(function(se,o){each(t.dom.select('table',o.node),function(e){var pa=t.dom.getParent(e,'H1,H2,H3,H4,H5,H6,P'),pa2,n,tm,pl=[],i,ns;if(pa){pa2=pa.cloneNode(false);pl.push(e);for(n=e;n=n.parentNode;){pl.push(n);if(n==pa)break;}tm=pa2;for(i=pl.length-1;i>=0;i--){if(i==pl.length-1){while(ns=pl[i-1].nextSibling)tm.appendChild(ns.parentNode.removeChild(ns));}else{n=pl[i].cloneNode(false);if(i!=0){while(ns=pl[i-1].nextSibling)n.appendChild(ns.parentNode.removeChild(ns));}tm=tm.appendChild(n);}}e=t.dom.insertAfter(e.parentNode.removeChild(e),pa);t.dom.insertAfter(e,pa);t.dom.insertAfter(pa2,e);}});});}},setEntities:function(s){var t=this,a,i,l={},re='',v;if(t.entityLookup)return;a=s.split(',');for(i=0;i<a.length;i+=2){v=a[i];if(v==34||v==38||v==60||v==62)continue;l[String.fromCharCode(a[i])]=a[i+1];v=parseInt(a[i]).toString(16);re+='\\u'+'0000'.substring(v.length)+v;}if(!re){t.settings.entity_encoding='raw';return;}t.entitiesRE=new RegExp('['+re+']','g');t.entityLookup=l;},setValidChildRules:function(s){this.childRules=null;this.addValidChildRules(s);},addValidChildRules:function(s){var t=this,inst,intr,bloc;if(!s)return;inst='A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment';intr='A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment';bloc='H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP';each(s.split(','),function(s){var p=s.split(/\[|\]/),re;s='';each(p[1].split('|'),function(v){if(s)s+='|';switch(v){case'%itrans':v=intr;break;case'%itrans_na':v=intr.substring(2);break;case'%istrict':v=inst;break;case'%istrict_na':v=inst.substring(2);break;case'%btrans':v=bloc;break;case'%bstrict':v=bloc;break;}s+=v;});re=new RegExp('^('+s.toLowerCase()+')$','i');each(p[0].split('/'),function(s){t.childRules=t.childRules||{};t.childRules[s]=re;});});s='';each(t.childRules,function(v,k){if(s)s+='|';s+=k;});t.parentElementsRE=new RegExp('^('+s.toLowerCase()+')$','i');},setRules:function(s){var t=this;t._setup();t.rules={};t.wildRules=[];t.validElements={};return t.addRules(s);},addRules:function(s){var t=this,dr;if(!s)return;t._setup();each(s.split(','),function(s){var p=s.split(/\[|\]/),tn=p[0].split('/'),ra,at,wat,va=[];if(dr)at=tinymce.extend([],dr.attribs);if(p.length>1){each(p[1].split('|'),function(s){var ar={},i;at=at||[];s=s.replace(/::/g,'~');s=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(s);s[2]=s[2].replace(/~/g,':');if(s[1]=='!'){ra=ra||[];ra.push(s[2]);}if(s[1]=='-'){for(i=0;i<at.length;i++){if(at[i].name==s[2]){at.splice(i,1);return;}}}switch(s[3]){case'=':ar.defaultVal=s[4]||'';break;case':':ar.forcedVal=s[4];break;case'<':ar.validVals=s[4].split('?');break;}if(/[*.?]/.test(s[2])){wat=wat||[];ar.nameRE=new RegExp('^'+wildcardToRE(s[2])+'$');wat.push(ar);}else{ar.name=s[2];at.push(ar);}va.push(s[2]);});}each(tn,function(s,i){var pr=s.charAt(0),x=1,ru={};if(dr){if(dr.noEmpty)ru.noEmpty=dr.noEmpty;if(dr.fullEnd)ru.fullEnd=dr.fullEnd;if(dr.padd)ru.padd=dr.padd;}switch(pr){case'-':ru.noEmpty=true;break;case'+':ru.fullEnd=true;break;case'#':ru.padd=true;break;default:x=0;}tn[i]=s=s.substring(x);t.validElements[s]=1;if(/[*.?]/.test(tn[0])){ru.nameRE=new RegExp('^'+wildcardToRE(tn[0])+'$');t.wildRules=t.wildRules||{};t.wildRules.push(ru);}else{ru.name=tn[0];if(tn[0]=='@')dr=ru;t.rules[s]=ru;}ru.attribs=at;if(ra)ru.requiredAttribs=ra;if(wat){s='';each(va,function(v){if(s)s+='|';s+='('+wildcardToRE(v)+')';});ru.validAttribsRE=new RegExp('^'+s.toLowerCase()+'$');ru.wildAttribs=wat;}});});s='';each(t.validElements,function(v,k){if(s)s+='|';if(k!='@')s+=k;});t.validElementsRE=new RegExp('^('+wildcardToRE(s.toLowerCase())+')$');},findRule:function(n){var t=this,rl=t.rules,i,r;t._setup();r=rl[n];if(r)return r;rl=t.wildRules;for(i=0;i<rl.length;i++){if(rl[i].nameRE.test(n))return rl[i];}return null;},findAttribRule:function(ru,n){var i,wa=ru.wildAttribs;for(i=0;i<wa.length;i++){if(wa[i].nameRE.test(n))return wa[i];}return null;},serialize:function(n,o){var h,t=this;t._setup();o=o||{};o.format=o.format||'html';t.processObj=o;n=n.cloneNode(true);t.key=''+(parseInt(t.key)+1);if(!o.no_events){o.node=n;t.onPreProcess.dispatch(t,o);}t.writer.reset();t._serializeNode(n,o.getInner);o.content=t.writer.getContent();if(!o.no_events)t.onPostProcess.dispatch(t,o);t._postProcess(o);o.node=null;return tinymce.trim(o.content);},_postProcess:function(o){var t=this,s=t.settings,h=o.content,sc=[],p;if(o.format=='html'){p=t._protect({content:h,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1}]});h=p.content;if(s.entity_encoding!=='raw')h=t._encode(h);if(!o.set){h=h.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,s.entity_encoding=='numeric'?'<p$1> </p>':'<p$1> </p>');if(s.remove_linebreaks){h=h.replace(/\r?\n|\r/g,' ');h=h.replace(/(<[^>]+>)\s+/g,'$1 ');h=h.replace(/\s+(<\/[^>]+>)/g,' $1');h=h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,'<$1 $2>');h=h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,'<$1>');h=h.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,'</$1>');}if(s.apply_source_formatting&&s.indent_mode=='simple'){h=h.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,'\n<$1$2$3>\n');h=h.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,'\n<$1$2>');h=h.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,'</$1>\n');h=h.replace(/\n\n/g,'\n');}}h=t._unprotect(h,p);if(s.entity_encoding=='raw')h=h.replace(/<p> <\/p>|<p([^>]+)> <\/p>/g,'<p$1>\u00a0</p>');}o.content=h;},_serializeNode:function(n,inn){var t=this,s=t.settings,w=t.writer,hc,el,cn,i,l,a,at,no,v,nn,ru,ar,iv;if(!s.node_filter||s.node_filter(n)){switch(n.nodeType){case 1:if(n.hasAttribute?n.hasAttribute('mce_bogus'):n.getAttribute('mce_bogus'))return;iv=false;hc=n.hasChildNodes();nn=n.getAttribute('mce_name')||n.nodeName.toLowerCase();if(isIE){if(n.scopeName!=='HTML'&&n.scopeName!=='html')nn=n.scopeName+':'+nn;}if(nn.indexOf('mce:')===0)nn=nn.substring(4);if(!t.validElementsRE.test(nn)||(t.invalidElementsRE&&t.invalidElementsRE.test(nn))||inn){iv=true;break;}if(isIE){if(s.fix_content_duplication){if(n.mce_serialized==t.key)return;n.mce_serialized=t.key;}if(nn.charAt(0)=='/')nn=nn.substring(1);}else if(isGecko){if(n.nodeName==='BR'&&n.getAttribute('type')=='_moz')return;}if(t.childRules){if(t.parentElementsRE.test(t.elementName)){if(!t.childRules[t.elementName].test(nn)){iv=true;break;}}t.elementName=nn;}ru=t.findRule(nn);nn=ru.name||nn;if((!hc&&ru.noEmpty)||(isIE&&!nn)){iv=true;break;}if(ru.requiredAttribs){a=ru.requiredAttribs;for(i=a.length-1;i>=0;i--){if(this.dom.getAttrib(n,a[i])!=='')break;}if(i==-1){iv=true;break;}}w.writeStartElement(nn);if(ru.attribs){for(i=0,at=ru.attribs,l=at.length;i<l;i++){a=at[i];v=t._getAttrib(n,a);if(v!==null)w.writeAttribute(a.name,v);}}if(ru.validAttribsRE){at=isIE?getIEAtts(n):n.attributes;for(i=at.length-1;i>-1;i--){no=at[i];if(no.specified){a=no.nodeName.toLowerCase();if(s.invalid_attrs.test(a)||!ru.validAttribsRE.test(a))continue;ar=t.findAttribRule(ru,a);v=t._getAttrib(n,ar,a);if(v!==null)w.writeAttribute(a,v);}}}if(!hc&&ru.padd)w.writeText('\u00a0');break;case 3:if(t.childRules&&t.parentElementsRE.test(t.elementName)){if(!t.childRules[t.elementName].test(n.nodeName))return;}return w.writeText(n.nodeValue);case 4:return w.writeCDATA(n.nodeValue);case 8:return w.writeComment(n.nodeValue);}}else if(n.nodeType==1)hc=n.hasChildNodes();if(hc){cn=n.firstChild;while(cn){t._serializeNode(cn);t.elementName=nn;cn=cn.nextSibling;}}if(!iv){if(hc||!s.closed.test(nn))w.writeFullEndElement();else w.writeEndElement();}},_protect:function(o){var t=this;o.items=o.items||[];function enc(s){return s.replace(/[\r\n\\]/g,function(c){if(c==='\n')return'\\n';else if(c==='\\')return'\\\\';return'\\r';});};function dec(s){return s.replace(/\\[\\rn]/g,function(c){if(c==='\\n')return'\n';else if(c==='\\\\')return'\\';return'\r';});};each(o.patterns,function(p){o.content=dec(enc(o.content).replace(p.pattern,function(x,a,b,c){b=dec(b);if(p.encode)b=t._encode(b);o.items.push(b);return a+'<!--mce:'+(o.items.length-1)+'-->'+c;}));});return o;},_unprotect:function(h,o){h=h.replace(/\<!--mce:([0-9]+)--\>/g,function(a,b){return o.items[parseInt(b)];});o.items=[];return h;},_encode:function(h){var t=this,s=t.settings,l;if(s.entity_encoding!=='raw'){if(s.entity_encoding.indexOf('named')!=-1){t.setEntities(s.entities);l=t.entityLookup;h=h.replace(t.entitiesRE,function(a){var v;if(v=l[a])a='&'+v+';';return a;});}if(s.entity_encoding.indexOf('numeric')!=-1){h=h.replace(/[\u007E-\uFFFF]/g,function(a){return'&#'+a.charCodeAt(0)+';';});}}return h;},_setup:function(){var t=this,s=this.settings;if(t.done)return;t.done=1;t.setRules(s.valid_elements);t.addRules(s.extended_valid_elements);t.addValidChildRules(s.valid_child_elements);if(s.invalid_elements)t.invalidElementsRE=new RegExp('^('+wildcardToRE(s.invalid_elements.replace(/,/g,'|').toLowerCase())+')$');if(s.attrib_value_filter)t.attribValueFilter=s.attribValueFilter;},_getAttrib:function(n,a,na){var i,v;na=na||a.name;if(a.forcedVal&&(v=a.forcedVal)){if(v==='{$uid}')return this.dom.uniqueId();return v;}v=this.dom.getAttrib(n,na);switch(na){case'rowspan':case'colspan':if(v=='1')v='';break;}if(this.attribValueFilter)v=this.attribValueFilter(na,v,n);if(a.validVals){for(i=a.validVals.length-1;i>=0;i--){if(v==a.validVals[i])break;}if(i==-1)return null;}if(v===''&&typeof(a.defaultVal)!='undefined'){v=a.defaultVal;if(v==='{$uid}')return this.dom.uniqueId();return v;}else{if(na=='class'&&this.processObj.get)v=v.replace(/\s?mceItem\w+\s?/g,'');}if(v==='')return null;return v;}});})();(function(){var each=tinymce.each;tinymce.create('tinymce.dom.ScriptLoader',{ScriptLoader:function(s){this.settings=s||{};this.queue=[];this.lookup={};},isDone:function(u){return this.lookup[u]?this.lookup[u].state==2:0;},markDone:function(u){this.lookup[u]={state:2,url:u};},add:function(u,cb,s,pr){var t=this,lo=t.lookup,o;if(o=lo[u]){if(cb&&o.state==2)cb.call(s||this);return o;}o={state:0,url:u,func:cb,scope:s||this};if(pr)t.queue.unshift(o);else t.queue.push(o);lo[u]=o;return o;},load:function(u,cb,s){var t=this,o;if(o=t.lookup[u]){if(cb&&o.state==2)cb.call(s||t);return o;}function loadScript(u){if(tinymce.dom.Event.domLoaded||t.settings.strict_mode){tinymce.util.XHR.send({url:tinymce._addVer(u),error:t.settings.error,async:false,success:function(co){t.eval(co);}});}else document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"></script>');};if(!tinymce.is(u,'string')){each(u,function(u){loadScript(u);});if(cb)cb.call(s||t);}else{loadScript(u);if(cb)cb.call(s||t);}},loadQueue:function(cb,s){var t=this;if(!t.queueLoading){t.queueLoading=1;t.queueCallbacks=[];t.loadScripts(t.queue,function(){t.queueLoading=0;if(cb)cb.call(s||t);each(t.queueCallbacks,function(o){o.func.call(o.scope);});});}else if(cb)t.queueCallbacks.push({func:cb,scope:s||t});},eval:function(co){var w=window;if(!w.execScript){try{eval.call(w,co);}catch(ex){eval(co,w);}}else w.execScript(co);},loadScripts:function(sc,cb,s){var t=this,lo=t.lookup;function done(o){o.state=2;if(o.func)o.func.call(o.scope||t);};function allDone(){var l;l=sc.length;each(sc,function(o){o=lo[o.url];if(o.state===2){done(o);l--;}else load(o);});if(l===0&&cb){cb.call(s||t);cb=0;}};function load(o){if(o.state>0)return;o.state=1;tinymce.util.XHR.send({url:o.url,error:t.settings.error,success:function(co){t.eval(co);done(o);allDone();}});};each(sc,function(o){var u=o.url;if(!lo[u]){lo[u]=o;t.queue.push(o);}else o=lo[u];if(o.state>0)return;if(!tinymce.dom.Event.domLoaded&&!t.settings.strict_mode){var ix,ol='';if(cb||o.func){o.state=1;ix=tinymce.dom.ScriptLoader._addOnLoad(function(){done(o);allDone();});if(tinymce.isIE)ol=' onreadystatechange="';else ol=' onload="';ol+='tinymce.dom.ScriptLoader._onLoad(this,\''+u+'\','+ix+');"';}document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"'+ol+'></script>');if(!o.func)done(o);}else load(o);});allDone();},'static':{_addOnLoad:function(f){var t=this;t._funcs=t._funcs||[];t._funcs.push(f);return t._funcs.length-1;},_onLoad:function(e,u,ix){if(!tinymce.isIE||e.readyState=='complete')this._funcs[ix].call(this);}}});tinymce.ScriptLoader=new tinymce.dom.ScriptLoader();})();(function(){var DOM=tinymce.DOM,is=tinymce.is;tinymce.create('tinymce.ui.Control',{Control:function(id,s){this.id=id;this.settings=s=s||{};this.rendered=false;this.onRender=new tinymce.util.Dispatcher(this);this.classPrefix='';this.scope=s.scope||this;this.disabled=0;this.active=0;},setDisabled:function(s){var e;if(s!=this.disabled){e=DOM.get(this.id);if(e&&this.settings.unavailable_prefix){if(s){this.prevTitle=e.title;e.title=this.settings.unavailable_prefix+": "+e.title;}else e.title=this.prevTitle;}this.setState('Disabled',s);this.setState('Enabled',!s);this.disabled=s;}},isDisabled:function(){return this.disabled;},setActive:function(s){if(s!=this.active){this.setState('Active',s);this.active=s;}},isActive:function(){return this.active;},setState:function(c,s){var n=DOM.get(this.id);c=this.classPrefix+c;if(s)DOM.addClass(n,c);else DOM.removeClass(n,c);},isRendered:function(){return this.rendered;},renderHTML:function(){},renderTo:function(n){DOM.setHTML(n,this.renderHTML());},postRender:function(){var t=this,b;if(is(t.disabled)){b=t.disabled;t.disabled=-1;t.setDisabled(b);}if(is(t.active)){b=t.active;t.active=-1;t.setActive(b);}},remove:function(){DOM.remove(this.id);this.destroy();},destroy:function(){tinymce.dom.Event.clear(this.id);}});})();tinymce.create('tinymce.ui.Container:tinymce.ui.Control',{Container:function(id,s){this.parent(id,s);this.controls=[];this.lookup={};},add:function(c){this.lookup[c.id]=c;this.controls.push(c);return c;},get:function(n){return this.lookup[n];}});tinymce.create('tinymce.ui.Separator:tinymce.ui.Control',{Separator:function(id,s){this.parent(id,s);this.classPrefix='mceSeparator';},renderHTML:function(){return tinymce.DOM.createHTML('span',{'class':this.classPrefix});}});(function(){var is=tinymce.is,DOM=tinymce.DOM,each=tinymce.each,walk=tinymce.walk;tinymce.create('tinymce.ui.MenuItem:tinymce.ui.Control',{MenuItem:function(id,s){this.parent(id,s);this.classPrefix='mceMenuItem';},setSelected:function(s){this.setState('Selected',s);this.selected=s;},isSelected:function(){return this.selected;},postRender:function(){var t=this;t.parent();if(is(t.selected))t.setSelected(t.selected);}});})();(function(){var is=tinymce.is,DOM=tinymce.DOM,each=tinymce.each,walk=tinymce.walk;tinymce.create('tinymce.ui.Menu:tinymce.ui.MenuItem',{Menu:function(id,s){var t=this;t.parent(id,s);t.items={};t.collapsed=false;t.menuCount=0;t.onAddItem=new tinymce.util.Dispatcher(this);},expand:function(d){var t=this;if(d){walk(t,function(o){if(o.expand)o.expand();},'items',t);}t.collapsed=false;},collapse:function(d){var t=this;if(d){walk(t,function(o){if(o.collapse)o.collapse();},'items',t);}t.collapsed=true;},isCollapsed:function(){return this.collapsed;},add:function(o){if(!o.settings)o=new tinymce.ui.MenuItem(o.id||DOM.uniqueId(),o);this.onAddItem.dispatch(this,o);return this.items[o.id]=o;},addSeparator:function(){return this.add({separator:true});},addMenu:function(o){if(!o.collapse)o=this.createMenu(o);this.menuCount++;return this.add(o);},hasMenus:function(){return this.menuCount!==0;},remove:function(o){delete this.items[o.id];},removeAll:function(){var t=this;walk(t,function(o){if(o.removeAll)o.removeAll();else o.remove();o.destroy();},'items',t);t.items={};},createMenu:function(o){var m=new tinymce.ui.Menu(o.id||DOM.uniqueId(),o);m.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return m;}});})();(function(){var is=tinymce.is,DOM=tinymce.DOM,each=tinymce.each,Event=tinymce.dom.Event,Element=tinymce.dom.Element;tinymce.create('tinymce.ui.DropMenu:tinymce.ui.Menu',{DropMenu:function(id,s){s=s||{};s.container=s.container||DOM.doc.body;s.offset_x=s.offset_x||0;s.offset_y=s.offset_y||0;s.vp_offset_x=s.vp_offset_x||0;s.vp_offset_y=s.vp_offset_y||0;if(is(s.icons)&&!s.icons)s['class']+=' mceNoIcons';this.parent(id,s);this.onShowMenu=new tinymce.util.Dispatcher(this);this.onHideMenu=new tinymce.util.Dispatcher(this);this.classPrefix='mceMenu';},createMenu:function(s){var t=this,cs=t.settings,m;s.container=s.container||cs.container;s.parent=t;s.constrain=s.constrain||cs.constrain;s['class']=s['class']||cs['class'];s.vp_offset_x=s.vp_offset_x||cs.vp_offset_x;s.vp_offset_y=s.vp_offset_y||cs.vp_offset_y;m=new tinymce.ui.DropMenu(s.id||DOM.uniqueId(),s);m.onAddItem.add(t.onAddItem.dispatch,t.onAddItem);return m;},update:function(){var t=this,s=t.settings,tb=DOM.get('menu_'+t.id+'_tbl'),co=DOM.get('menu_'+t.id+'_co'),tw,th;tw=s.max_width?Math.min(tb.clientWidth,s.max_width):tb.clientWidth;th=s.max_height?Math.min(tb.clientHeight,s.max_height):tb.clientHeight;if(!DOM.boxModel)t.element.setStyles({width:tw+2,height:th+2});else t.element.setStyles({width:tw,height:th});if(s.max_width)DOM.setStyle(co,'width',tw);if(s.max_height){DOM.setStyle(co,'height',th);if(tb.clientHeight<s.max_height)DOM.setStyle(co,'overflow','hidden');}},showMenu:function(x,y,px){var t=this,s=t.settings,co,vp=DOM.getViewPort(),w,h,mx,my,ot=2,dm,tb,cp=t.classPrefix;t.collapse(1);if(t.isMenuVisible)return;if(!t.rendered){co=DOM.add(t.settings.container,t.renderNode());each(t.items,function(o){o.postRender();});t.element=new Element('menu_'+t.id,{blocker:1,container:s.container});}else co=DOM.get('menu_'+t.id);if(!tinymce.isOpera)DOM.setStyles(co,{left:-0xFFFF,top:-0xFFFF});DOM.show(co);t.update();x+=s.offset_x||0;y+=s.offset_y||0;vp.w-=4;vp.h-=4;if(s.constrain){w=co.clientWidth-ot;h=co.clientHeight-ot;mx=vp.x+vp.w;my=vp.y+vp.h;if((x+s.vp_offset_x+w)>mx)x=px?px-w:Math.max(0,(mx-s.vp_offset_x)-w);if((y+s.vp_offset_y+h)>my)y=Math.max(0,(my-s.vp_offset_y)-h);}DOM.setStyles(co,{left:x,top:y});t.element.update();t.isMenuVisible=1;t.mouseClickFunc=Event.add(co,'click',function(e){var m;e=e.target;if(e&&(e=DOM.getParent(e,'TR'))&&!DOM.hasClass(e,cp+'ItemSub')){m=t.items[e.id];if(m.isDisabled())return;dm=t;while(dm){if(dm.hideMenu)dm.hideMenu();dm=dm.settings.parent;}if(m.settings.onclick)m.settings.onclick(e);return Event.cancel(e);}});if(t.hasMenus()){t.mouseOverFunc=Event.add(co,'mouseover',function(e){var m,r,mi;e=e.target;if(e&&(e=DOM.getParent(e,'TR'))){m=t.items[e.id];if(t.lastMenu)t.lastMenu.collapse(1);if(m.isDisabled())return;if(e&&DOM.hasClass(e,cp+'ItemSub')){r=DOM.getRect(e);m.showMenu((r.x+r.w-ot),r.y-ot,r.x);t.lastMenu=m;DOM.addClass(DOM.get(m.id).firstChild,cp+'ItemActive');}}});}t.onShowMenu.dispatch(t);if(s.keyboard_focus){Event.add(co,'keydown',t._keyHandler,t);DOM.select('a','menu_'+t.id)[0].focus();t._focusIdx=0;}},hideMenu:function(c){var t=this,co=DOM.get('menu_'+t.id),e;if(!t.isMenuVisible)return;Event.remove(co,'mouseover',t.mouseOverFunc);Event.remove(co,'click',t.mouseClickFunc);Event.remove(co,'keydown',t._keyHandler);DOM.hide(co);t.isMenuVisible=0;if(!c)t.collapse(1);if(t.element)t.element.hide();if(e=DOM.get(t.id))DOM.removeClass(e.firstChild,t.classPrefix+'ItemActive');t.onHideMenu.dispatch(t);},add:function(o){var t=this,co;o=t.parent(o);if(t.isRendered&&(co=DOM.get('menu_'+t.id)))t._add(DOM.select('tbody',co)[0],o);return o;},collapse:function(d){this.parent(d);this.hideMenu(1);},remove:function(o){DOM.remove(o.id);this.destroy();return this.parent(o);},destroy:function(){var t=this,co=DOM.get('menu_'+t.id);Event.remove(co,'mouseover',t.mouseOverFunc);Event.remove(co,'click',t.mouseClickFunc);if(t.element)t.element.remove();DOM.remove(co);},renderNode:function(){var t=this,s=t.settings,n,tb,co,w;w=DOM.create('div',{id:'menu_'+t.id,'class':s['class'],'style':'position:absolute;left:0;top:0;z-index:200000'});co=DOM.add(w,'div',{id:'menu_'+t.id+'_co','class':t.classPrefix+(s['class']?' '+s['class']:'')});t.element=new Element('menu_'+t.id,{blocker:1,container:s.container});if(s.menu_line)DOM.add(co,'span',{'class':t.classPrefix+'Line'});n=DOM.add(co,'table',{id:'menu_'+t.id+'_tbl',border:0,cellPadding:0,cellSpacing:0});tb=DOM.add(n,'tbody');each(t.items,function(o){t._add(tb,o);});t.rendered=true;return w;},_keyHandler:function(e){var t=this,kc=e.keyCode;function focus(d){var i=t._focusIdx+d,e=DOM.select('a','menu_'+t.id)[i];if(e){t._focusIdx=i;e.focus();}};switch(kc){case 38:focus(-1);return;case 40:focus(1);return;case 13:return;case 27:return this.hideMenu();}},_add:function(tb,o){var n,s=o.settings,a,ro,it,cp=this.classPrefix;if(s.separator){ro=DOM.add(tb,'tr',{id:o.id,'class':cp+'ItemSeparator'});DOM.add(ro,'td',{'class':cp+'ItemSeparator'});if(n=ro.previousSibling)DOM.addClass(n,'mceLast');return;}n=ro=DOM.add(tb,'tr',{id:o.id,'class':cp+'Item '+cp+'ItemEnabled'});n=it=DOM.add(n,'td');n=a=DOM.add(n,'a',{href:'javascript:;',onclick:"return false;",onmousedown:'return false;'});DOM.addClass(it,s['class']);DOM.add(n,'span',{'class':'mceIcon'+(s.icon?' mce_'+s.icon:'')});n=DOM.add(n,s.element||'span',{'class':'mceText',title:o.settings.title},o.settings.title);if(o.settings.style)DOM.setAttrib(n,'style',o.settings.style);if(tb.childNodes.length==1)DOM.addClass(ro,'mceFirst');if((n=ro.previousSibling)&&DOM.hasClass(n,cp+'ItemSeparator'))DOM.addClass(ro,'mceFirst');if(o.collapse)DOM.addClass(ro,cp+'ItemSub');if(n=ro.previousSibling)DOM.removeClass(n,'mceLast');DOM.addClass(ro,'mceLast');}});})();(function(){var DOM=tinymce.DOM;tinymce.create('tinymce.ui.Button:tinymce.ui.Control',{Button:function(id,s){this.parent(id,s);this.classPrefix='mceButton';},renderHTML:function(){var cp=this.classPrefix,s=this.settings,h,l;l=DOM.encode(s.label||'');h='<a id="'+this.id+'" href="javascript:;" class="'+cp+' '+cp+'Enabled '+s['class']+(l?' '+cp+'Labeled':'')+'" onmousedown="return false;" onclick="return false;" title="'+DOM.encode(s.title)+'">';if(s.image)h+='<img class="mceIcon" src="'+s.image+'" />'+l+'</a>';else h+='<span class="mceIcon '+s['class']+'"></span>'+(l?'<span class="'+cp+'Label">'+l+'</span>':'')+'</a>';return h;},postRender:function(){var t=this,s=t.settings;tinymce.dom.Event.add(t.id,'click',function(e){if(!t.isDisabled())return s.onclick.call(s.scope,e);});}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,Dispatcher=tinymce.util.Dispatcher;tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control',{ListBox:function(id,s){var t=this;t.parent(id,s);t.items=[];t.onChange=new Dispatcher(t);t.onPostRender=new Dispatcher(t);t.onAdd=new Dispatcher(t);t.onRenderMenu=new tinymce.util.Dispatcher(this);t.classPrefix='mceListBox';},select:function(v){var t=this,e,fv;if(v!=t.selectedValue){e=DOM.get(t.id+'_text');t.selectedValue=v;each(t.items,function(o){if(o.value==v){DOM.setHTML(e,DOM.encode(o.title));fv=1;return false;}});if(!fv){DOM.setHTML(e,DOM.encode(t.settings.title));DOM.addClass(e,'mceTitle');e=0;return;}else DOM.removeClass(e,'mceTitle');}e=0;},add:function(n,v,o){var t=this;o=o||{};o=tinymce.extend(o,{title:n,value:v});t.items.push(o);t.onAdd.dispatch(t,o);},getLength:function(){return this.items.length;},renderHTML:function(){var h='',t=this,s=t.settings,cp=t.classPrefix;h='<table id="'+t.id+'" cellpadding="0" cellspacing="0" class="'+cp+' '+cp+'Enabled'+(s['class']?(' '+s['class']):'')+'"><tbody><tr>';h+='<td>'+DOM.createHTML('a',{id:t.id+'_text',href:'javascript:;','class':'mceText',onclick:"return false;",onmousedown:'return false;'},DOM.encode(t.settings.title))+'</td>';h+='<td>'+DOM.createHTML('a',{id:t.id+'_open',tabindex:-1,href:'javascript:;','class':'mceOpen',onclick:"return false;",onmousedown:'return false;'},'<span></span>')+'</td>';h+='</tr></tbody></table>';return h;},showMenu:function(){var t=this,p1,p2,e=DOM.get(this.id),m;if(t.isDisabled()||t.items.length==0)return;if(t.menu&&t.menu.isMenuVisible)return t.hideMenu();if(!t.isMenuRendered){t.renderMenu();t.isMenuRendered=true;}p1=DOM.getPos(this.settings.menu_container);p2=DOM.getPos(e);m=t.menu;m.settings.offset_x=p2.x;m.settings.offset_y=p2.y;m.settings.keyboard_focus=!tinymce.isOpera;if(t.oldID)m.items[t.oldID].setSelected(0);each(t.items,function(o){if(o.value===t.selectedValue){m.items[o.id].setSelected(1);t.oldID=o.id;}});m.showMenu(0,e.clientHeight);Event.add(DOM.doc,'mousedown',t.hideMenu,t);DOM.addClass(t.id,t.classPrefix+'Selected');},hideMenu:function(e){var t=this;if(e&&e.type=="mousedown"&&(e.target.id==t.id+'_text'||e.target.id==t.id+'_open'))return;if(!e||!DOM.getParent(e.target,function(n){return DOM.hasClass(n,'mceMenu');})){DOM.removeClass(t.id,t.classPrefix+'Selected');Event.remove(DOM.doc,'mousedown',t.hideMenu,t);if(t.menu)t.menu.hideMenu();}},renderMenu:function(){var t=this,m;m=t.settings.control_manager.createDropMenu(t.id+'_menu',{menu_line:1,'class':t.classPrefix+'Menu mceNoIcons',max_width:150,max_height:150});m.onHideMenu.add(t.hideMenu,t);m.add({title:t.settings.title,'class':'mceMenuItemTitle',onclick:function(){if(t.settings.onselect('')!==false)t.select('');}});each(t.items,function(o){o.id=DOM.uniqueId();o.onclick=function(){if(t.settings.onselect(o.value)!==false)t.select(o.value);};m.add(o);});t.onRenderMenu.dispatch(t,m);t.menu=m;},postRender:function(){var t=this,cp=t.classPrefix;Event.add(t.id,'click',t.showMenu,t);Event.add(t.id+'_text','focus',function(e){if(!t._focused){t.keyDownHandler=Event.add(t.id+'_text','keydown',function(e){var idx=-1,v,kc=e.keyCode;each(t.items,function(v,i){if(t.selectedValue==v.value)idx=i;});if(kc==38)v=t.items[idx-1];else if(kc==40)v=t.items[idx+1];else if(kc==13){v=t.selectedValue;t.selectedValue=null;t.settings.onselect(v);return Event.cancel(e);}if(v){t.hideMenu();t.select(v.value);}});}t._focused=1;});Event.add(t.id+'_text','blur',function(){Event.remove(t.id+'_text','keydown',t.keyDownHandler);t._focused=0;});if(tinymce.isIE6||!DOM.boxModel){Event.add(t.id,'mouseover',function(){if(!DOM.hasClass(t.id,cp+'Disabled'))DOM.addClass(t.id,cp+'Hover');});Event.add(t.id,'mouseout',function(){if(!DOM.hasClass(t.id,cp+'Disabled'))DOM.removeClass(t.id,cp+'Hover');});}t.onPostRender.dispatch(t,DOM.get(t.id));},destroy:function(){this.parent();Event.clear(this.id+'_text');}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,Dispatcher=tinymce.util.Dispatcher;tinymce.create('tinymce.ui.NativeListBox:tinymce.ui.ListBox',{NativeListBox:function(id,s){this.parent(id,s);this.classPrefix='mceNativeListBox';},setDisabled:function(s){DOM.get(this.id).disabled=s;},isDisabled:function(){return DOM.get(this.id).disabled;},select:function(v){var e=DOM.get(this.id),ol=e.options;v=''+(v||'');e.selectedIndex=0;each(ol,function(o,i){if(o.value==v){e.selectedIndex=i;return false;}});},add:function(n,v,a){var o,t=this;a=a||{};a.value=v;if(t.isRendered())DOM.add(DOM.get(this.id),'option',a,n);o={title:n,value:v,attribs:a};t.items.push(o);t.onAdd.dispatch(t,o);},getLength:function(){return DOM.get(this.id).options.length-1;},renderHTML:function(){var h,t=this;h=DOM.createHTML('option',{value:''},'-- '+t.settings.title+' --');each(t.items,function(it){h+=DOM.createHTML('option',{value:it.value},it.title);});h=DOM.createHTML('select',{id:t.id,'class':'mceNativeListBox'},h);return h;},postRender:function(){var t=this,ch;t.rendered=true;function onChange(e){var v=e.target.options[e.target.selectedIndex].value;t.onChange.dispatch(t,v);if(t.settings.onselect)t.settings.onselect(v);};Event.add(t.id,'change',onChange);Event.add(t.id,'keydown',function(e){var bf;Event.remove(t.id,'change',ch);bf=Event.add(t.id,'blur',function(){Event.add(t.id,'change',onChange);Event.remove(t.id,'blur',bf);});if(e.keyCode==13||e.keyCode==32){onChange(e);return Event.cancel(e);}});t.onPostRender.dispatch(t,DOM.get(t.id));}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each;tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button',{MenuButton:function(id,s){this.parent(id,s);this.onRenderMenu=new tinymce.util.Dispatcher(this);s.menu_container=s.menu_container||DOM.doc.body;},showMenu:function(){var t=this,p1,p2,e=DOM.get(t.id),m;if(t.isDisabled())return;if(!t.isMenuRendered){t.renderMenu();t.isMenuRendered=true;}if(t.isMenuVisible)return t.hideMenu();p1=DOM.getPos(t.settings.menu_container);p2=DOM.getPos(e);m=t.menu;m.settings.offset_x=p2.x;m.settings.offset_y=p2.y;m.settings.vp_offset_x=p2.x;m.settings.vp_offset_y=p2.y;m.settings.keyboard_focus=t._focused;m.showMenu(0,e.clientHeight);Event.add(DOM.doc,'mousedown',t.hideMenu,t);t.setState('Selected',1);t.isMenuVisible=1;},renderMenu:function(){var t=this,m;m=t.settings.control_manager.createDropMenu(t.id+'_menu',{menu_line:1,'class':this.classPrefix+'Menu',icons:t.settings.icons});m.onHideMenu.add(t.hideMenu,t);t.onRenderMenu.dispatch(t,m);t.menu=m;},hideMenu:function(e){var t=this;if(e&&e.type=="mousedown"&&DOM.getParent(e.target,function(e){return e.id===t.id||e.id===t.id+'_open';}))return;if(!e||!DOM.getParent(e.target,function(n){return DOM.hasClass(n,'mceMenu');})){t.setState('Selected',0);Event.remove(DOM.doc,'mousedown',t.hideMenu,t);if(t.menu)t.menu.hideMenu();}t.isMenuVisible=0;},postRender:function(){var t=this,s=t.settings;Event.add(t.id,'click',function(){if(!t.isDisabled()){if(s.onclick)s.onclick(t.value);t.showMenu();}});}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each;tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton',{SplitButton:function(id,s){this.parent(id,s);this.classPrefix='mceSplitButton';},renderHTML:function(){var h,t=this,s=t.settings,h1;h='<tbody><tr>';if(s.image)h1=DOM.createHTML('img ',{src:s.image,'class':'mceAction '+s['class']});else h1=DOM.createHTML('span',{'class':'mceAction '+s['class']},'');h+='<td>'+DOM.createHTML('a',{id:t.id+'_action',href:'javascript:;','class':'mceAction '+s['class'],onclick:"return false;",onmousedown:'return false;',title:s.title},h1)+'</td>';h1=DOM.createHTML('span',{'class':'mceOpen '+s['class']});h+='<td>'+DOM.createHTML('a',{id:t.id+'_open',href:'javascript:;','class':'mceOpen '+s['class'],onclick:"return false;",onmousedown:'return false;',title:s.title},h1)+'</td>';h+='</tr></tbody>';return DOM.createHTML('table',{id:t.id,'class':'mceSplitButton mceSplitButtonEnabled '+s['class'],cellpadding:'0',cellspacing:'0',onmousedown:'return false;',title:s.title},h);},postRender:function(){var t=this,s=t.settings;if(s.onclick){Event.add(t.id+'_action','click',function(){if(!t.isDisabled())s.onclick(t.value);});}Event.add(t.id+'_open','click',t.showMenu,t);Event.add(t.id+'_open','focus',function(){t._focused=1;});Event.add(t.id+'_open','blur',function(){t._focused=0;});if(tinymce.isIE6||!DOM.boxModel){Event.add(t.id,'mouseover',function(){if(!DOM.hasClass(t.id,'mceSplitButtonDisabled'))DOM.addClass(t.id,'mceSplitButtonHover');});Event.add(t.id,'mouseout',function(){if(!DOM.hasClass(t.id,'mceSplitButtonDisabled'))DOM.removeClass(t.id,'mceSplitButtonHover');});}},destroy:function(){this.parent();Event.clear(this.id+'_action');Event.clear(this.id+'_open');}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,is=tinymce.is,each=tinymce.each;tinymce.create('tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton',{ColorSplitButton:function(id,s){var t=this;t.parent(id,s);t.settings=s=tinymce.extend({colors:'000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF',grid_width:8,default_color:'#888888'},t.settings);t.onShowMenu=new tinymce.util.Dispatcher(t);t.onHideMenu=new tinymce.util.Dispatcher(t);t.value=s.default_color;},showMenu:function(){var t=this,r,p,e,p2;if(t.isDisabled())return;if(!t.isMenuRendered){t.renderMenu();t.isMenuRendered=true;}if(t.isMenuVisible)return t.hideMenu();e=DOM.get(t.id);DOM.show(t.id+'_menu');DOM.addClass(e,'mceSplitButtonSelected');p2=DOM.getPos(e);DOM.setStyles(t.id+'_menu',{left:p2.x,top:p2.y+e.clientHeight,zIndex:200000});e=0;Event.add(DOM.doc,'mousedown',t.hideMenu,t);if(t._focused){t._keyHandler=Event.add(t.id+'_menu','keydown',function(e){if(e.keyCode==27)t.hideMenu();});DOM.select('a',t.id+'_menu')[0].focus();}t.onShowMenu.dispatch(t);t.isMenuVisible=1;},hideMenu:function(e){var t=this;if(e&&e.type=="mousedown"&&DOM.getParent(e.target,function(e){return e.id===t.id+'_open';}))return;if(!e||!DOM.getParent(e.target,function(n){return DOM.hasClass(n,'mceSplitButtonMenu');})){DOM.removeClass(t.id,'mceSplitButtonSelected');Event.remove(DOM.doc,'mousedown',t.hideMenu,t);Event.remove(t.id+'_menu','keydown',t._keyHandler);DOM.hide(t.id+'_menu');}t.onHideMenu.dispatch(t);t.isMenuVisible=0;},renderMenu:function(){var t=this,m,i=0,s=t.settings,n,tb,tr,w;w=DOM.add(s.menu_container,'div',{id:t.id+'_menu','class':s['menu_class']+' '+s['class'],style:'position:absolute;left:0;top:-1000px;'});m=DOM.add(w,'div',{'class':s['class']+' mceSplitButtonMenu'});DOM.add(m,'span',{'class':'mceMenuLine'});n=DOM.add(m,'table',{'class':'mceColorSplitMenu'});tb=DOM.add(n,'tbody');i=0;each(is(s.colors,'array')?s.colors:s.colors.split(','),function(c){c=c.replace(/^#/,'');if(!i--){tr=DOM.add(tb,'tr');i=s.grid_width-1;}n=DOM.add(tr,'td');n=DOM.add(n,'a',{href:'javascript:;',style:{backgroundColor:'#'+c},mce_color:'#'+c});});if(s.more_colors_func){n=DOM.add(tb,'tr');n=DOM.add(n,'td',{colspan:s.grid_width,'class':'mceMoreColors'});n=DOM.add(n,'a',{id:t.id+'_more',href:'javascript:;',onclick:'return false;','class':'mceMoreColors'},s.more_colors_title);Event.add(n,'click',function(e){s.more_colors_func.call(s.more_colors_scope||this);return Event.cancel(e);});}DOM.addClass(m,'mceColorSplitMenu');Event.add(t.id+'_menu','click',function(e){var c;e=e.target;if(e.nodeName=='A'&&(c=e.getAttribute('mce_color')))t.setColor(c);return Event.cancel(e);});return w;},setColor:function(c){var t=this;DOM.setStyle(t.id+'_preview','backgroundColor',c);t.value=c;t.hideMenu();t.settings.onselect(c);},postRender:function(){var t=this,id=t.id;t.parent();DOM.add(id+'_action','div',{id:id+'_preview','class':'mceColorPreview'});},destroy:function(){this.parent();Event.clear(this.id+'_menu');Event.clear(this.id+'_more');DOM.remove(this.id+'_menu');}});})();tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container',{renderHTML:function(){var t=this,h='',c,co,dom=tinymce.DOM,s=t.settings,i,pr,nx,cl;cl=t.controls;for(i=0;i<cl.length;i++){co=cl[i];pr=cl[i-1];nx=cl[i+1];if(i===0){c='mceToolbarStart';if(co.Button)c+=' mceToolbarStartButton';else if(co.SplitButton)c+=' mceToolbarStartSplitButton';else if(co.ListBox)c+=' mceToolbarStartListBox';h+=dom.createHTML('td',{'class':c},dom.createHTML('span',null,'<!-- IE -->'));}if(pr&&co.ListBox){if(pr.Button||pr.SplitButton)h+=dom.createHTML('td',{'class':'mceToolbarEnd'},dom.createHTML('span',null,'<!-- IE -->'));}if(dom.stdMode)h+='<td style="position: relative">'+co.renderHTML()+'</td>';else h+='<td>'+co.renderHTML()+'</td>';if(nx&&co.ListBox){if(nx.Button||nx.SplitButton)h+=dom.createHTML('td',{'class':'mceToolbarStart'},dom.createHTML('span',null,'<!-- IE -->'));}}c='mceToolbarEnd';if(co.Button)c+=' mceToolbarEndButton';else if(co.SplitButton)c+=' mceToolbarEndSplitButton';else if(co.ListBox)c+=' mceToolbarEndListBox';h+=dom.createHTML('td',{'class':c},dom.createHTML('span',null,'<!-- IE -->'));return dom.createHTML('table',{id:t.id,'class':'mceToolbar'+(s['class']?' '+s['class']:''),cellpadding:'0',cellspacing:'0',align:t.settings.align||''},'<tbody><tr>'+h+'</tr></tbody>');}});(function(){var Dispatcher=tinymce.util.Dispatcher,each=tinymce.each;tinymce.create('tinymce.AddOnManager',{items:[],urls:{},lookup:{},onAdd:new Dispatcher(this),get:function(n){return this.lookup[n];},requireLangPack:function(n){var u,s;if(tinymce.EditorManager.settings){u=this.urls[n]+'/langs/'+tinymce.EditorManager.settings.language+'.js';s=tinymce.EditorManager.settings;if(s){if(!tinymce.dom.Event.domLoaded&&!s.strict_mode)tinymce.ScriptLoader.load(u);else tinymce.ScriptLoader.add(u);}}},add:function(id,o){this.items.push(o);this.lookup[id]=o;this.onAdd.dispatch(this,id,o);return o;},load:function(n,u,cb,s){var t=this;if(t.urls[n])return;if(u.indexOf('/')!=0&&u.indexOf('://')==-1)u=tinymce.baseURL+'/'+u;t.urls[n]=u.substring(0,u.lastIndexOf('/'));tinymce.ScriptLoader.add(u,cb,s);}});tinymce.PluginManager=new tinymce.AddOnManager();tinymce.ThemeManager=new tinymce.AddOnManager();}());(function(){var each=tinymce.each,extend=tinymce.extend,DOM=tinymce.DOM,Event=tinymce.dom.Event,ThemeManager=tinymce.ThemeManager,PluginManager=tinymce.PluginManager,explode=tinymce.explode;tinymce.create('static tinymce.EditorManager',{editors:{},i18n:{},activeEditor:null,preInit:function(){var t=this,lo=window.location;tinymce.documentBaseURL=lo.href.replace(/[\?#].*$/,'').replace(/[\/\\][^\/]+$/,'');if(!/[\/\\]$/.test(tinymce.documentBaseURL))tinymce.documentBaseURL+='/';tinymce.baseURL=new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL);tinymce.EditorManager.baseURI=new tinymce.util.URI(tinymce.baseURL);if(tinymce.EditorManager.baseURI.host!=lo.hostname&&lo.hostname)document.domain=tinymce.relaxedDomain=lo.hostname.replace(/.*\.(.+\..+)$/,'$1');t.onBeforeUnload=new tinymce.util.Dispatcher(t);Event.add(window,'beforeunload',function(e){t.onBeforeUnload.dispatch(t,e);});},init:function(s){var t=this,pl,sl=tinymce.ScriptLoader,c,e;function execCallback(se,n,s){var f=se[n];if(!f)return;if(tinymce.is(f,'string')){s=f.replace(/\.\w+$/,'');s=s?tinymce.resolve(s):0;f=tinymce.resolve(f);}return f.apply(s||this,Array.prototype.slice.call(arguments,2));};s=extend({theme:"simple",language:"en",strict_loading_mode:document.contentType=='application/xhtml+xml'},s);t.settings=s;if(!Event.domLoaded&&!s.strict_loading_mode){if(s.language)sl.add(tinymce.baseURL+'/langs/'+s.language+'.js');if(s.theme&&s.theme.charAt(0)!='-'&&!ThemeManager.urls[s.theme])ThemeManager.load(s.theme,'themes/'+s.theme+'/editor_template'+tinymce.suffix+'.js');if(s.plugins){pl=explode(s.plugins);if(tinymce.inArray(pl,'compat2x')!=-1)PluginManager.load('compat2x','plugins/compat2x/editor_plugin'+tinymce.suffix+'.js');each(pl,function(v){if(v&&v.charAt(0)!='-'&&!PluginManager.urls[v]){if(!tinymce.isWebKit&&v=='safari')return;PluginManager.load(v,'plugins/'+v+'/editor_plugin'+tinymce.suffix+'.js');}});}sl.loadQueue();}Event.add(document,'init',function(){var l,co;execCallback(s,'onpageload');if(s.browsers){l=false;each(explode(s.browsers),function(v){switch(v){case'ie':case'msie':if(tinymce.isIE)l=true;break;case'gecko':if(tinymce.isGecko)l=true;break;case'safari':case'webkit':if(tinymce.isWebKit)l=true;break;case'opera':if(tinymce.isOpera)l=true;break;}});if(!l)return;}switch(s.mode){case"exact":l=s.elements||'';if(l.length>0){each(explode(l),function(v){if(DOM.get(v))new tinymce.Editor(v,s).render(1);else{c=0;each(document.forms,function(f){each(f.elements,function(e){if(e.name===v){v='mce_editor_'+c;DOM.setAttrib(e,'id',v);new tinymce.Editor(v,s).render(1);}});});}});}break;case"textareas":case"specific_textareas":function hasClass(n,c){return c.constructor===RegExp?c.test(n.className):DOM.hasClass(n,c);};each(DOM.select('textarea'),function(v){if(s.editor_deselector&&hasClass(v,s.editor_deselector))return;if(!s.editor_selector||hasClass(v,s.editor_selector)){e=DOM.get(v.name);if(!v.id&&!e)v.id=v.name;if(!v.id||t.get(v.id))v.id=DOM.uniqueId();new tinymce.Editor(v.id,s).render(1);}});break;}if(s.oninit){l=co=0;each(t.editors,function(ed){co++;if(!ed.initialized){ed.onInit.add(function(){l++;if(l==co)execCallback(s,'oninit');});}else l++;if(l==co)execCallback(s,'oninit');});}});},get:function(id){return this.editors[id];},getInstanceById:function(id){return this.get(id);},add:function(e){this.editors[e.id]=e;this._setActive(e);return e;},remove:function(e){var t=this;if(!t.editors[e.id])return null;delete t.editors[e.id];if(t.activeEditor==e){each(t.editors,function(e){t._setActive(e);return false;});}e.destroy();return e;},execCommand:function(c,u,v){var t=this,ed=t.get(v),w;switch(c){case"mceFocus":ed.focus();return true;case"mceAddEditor":case"mceAddControl":if(!t.get(v))new tinymce.Editor(v,t.settings).render();return true;case"mceAddFrameControl":w=v.window;w.tinyMCE=tinyMCE;w.tinymce=tinymce;tinymce.DOM.doc=w.document;tinymce.DOM.win=w;ed=new tinymce.Editor(v.element_id,v);ed.render();if(tinymce.isIE){function clr(){ed.destroy();w.detachEvent('onunload',clr);w=w.tinyMCE=w.tinymce=null;};w.attachEvent('onunload',clr);}v.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":ed.remove();return true;case'mceToggleEditor':if(!ed){t.execCommand('mceAddControl',0,v);return true;}if(ed.isHidden())ed.show();else ed.hide();return true;}if(t.activeEditor)return t.activeEditor.execCommand(c,u,v);return false;},execInstanceCommand:function(id,c,u,v){var ed=this.get(id);if(ed)return ed.execCommand(c,u,v);return false;},triggerSave:function(){each(this.editors,function(e){e.save();});},addI18n:function(p,o){var lo,i18n=this.i18n;if(!tinymce.is(p,'string')){each(p,function(o,lc){each(o,function(o,g){each(o,function(o,k){if(g==='common')i18n[lc+'.'+k]=o;else i18n[lc+'.'+g+'.'+k]=o;});});});}else{each(o,function(o,k){i18n[p+'.'+k]=o;});}},_setActive:function(e){this.selectedInstance=this.activeEditor=e;}});tinymce.EditorManager.preInit();})();var tinyMCE=window.tinyMCE=tinymce.EditorManager;(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,extend=tinymce.extend,Dispatcher=tinymce.util.Dispatcher;var each=tinymce.each,isGecko=tinymce.isGecko,isIE=tinymce.isIE,isWebKit=tinymce.isWebKit;var is=tinymce.is,ThemeManager=tinymce.ThemeManager,PluginManager=tinymce.PluginManager,EditorManager=tinymce.EditorManager;var inArray=tinymce.inArray,grep=tinymce.grep,explode=tinymce.explode;tinymce.create('tinymce.Editor',{Editor:function(id,s){var t=this;t.id=t.editorId=id;t.execCommands={};t.queryStateCommands={};t.queryValueCommands={};t.plugins={};each(['onPreInit','onBeforeRenderUI','onPostRender','onInit','onRemove','onActivate','onDeactivate','onClick','onEvent','onMouseUp','onMouseDown','onDblClick','onKeyDown','onKeyUp','onKeyPress','onContextMenu','onSubmit','onReset','onPaste','onPreProcess','onPostProcess','onBeforeSetContent','onBeforeGetContent','onSetContent','onGetContent','onLoadContent','onSaveContent','onNodeChange','onChange','onBeforeExecCommand','onExecCommand','onUndo','onRedo','onVisualAid','onSetProgressState'],function(e){t[e]=new Dispatcher(t);});t.settings=s=extend({id:id,language:'en',docs_language:'en',theme:'simple',skin:'default',delta_width:0,delta_height:0,popup_css:'',plugins:'',document_base_url:tinymce.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',visual_table_class:'mceItemTable',visual:1,inline_styles:true,convert_fonts_to_spans:true,font_size_style_values:'xx-small,x-small,small,medium,large,x-large,xx-large',apply_source_formatting:1,directionality:'ltr',forced_root_block:'p',valid_elements:'@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p[align],-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big',hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:'30px'},s);t.documentBaseURI=new tinymce.util.URI(s.document_base_url||tinymce.documentBaseURL,{base_uri:tinyMCE.baseURI});t.baseURI=EditorManager.baseURI;t.execCallback('setup',t);},render:function(nst){var t=this,s=t.settings,id=t.id,sl=tinymce.ScriptLoader;if(!Event.domLoaded){Event.add(document,'init',function(){t.render();});return;}if(!nst){s.strict_loading_mode=1;tinyMCE.settings=s;}if(!t.getElement())return;if(s.strict_loading_mode){sl.settings.strict_mode=s.strict_loading_mode;tinymce.DOM.settings.strict=1;}if(!/TEXTAREA|INPUT/i.test(t.getElement().nodeName)&&s.hidden_input&&DOM.getParent(id,'form'))DOM.insertAfter(DOM.create('input',{type:'hidden',name:id}),id);t.windowManager=new tinymce.WindowManager(t);if(s.encoding=='xml'){t.onGetContent.add(function(ed,o){if(o.save)o.content=DOM.encode(o.content);});}if(s.add_form_submit_trigger){t.onSubmit.addToTop(function(){if(t.initialized){t.save();t.isNotDirty=1;}});}if(s.add_unload_trigger&&!s.ask){t._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(t.initialized&&!t.destroyed&&!t.isHidden())t.save({format:'raw',no_events:true});});}tinymce.addUnload(t.destroy,t);if(s.submit_patch){t.onBeforeRenderUI.add(function(){var n=t.getElement().form;if(!n)return;if(n._mceOldSubmit)return;if(!n.submit.nodeType&&!n.submit.length){t.formElement=n;n._mceOldSubmit=n.submit;n.submit=function(){EditorManager.triggerSave();t.isNotDirty=1;return this._mceOldSubmit(this);};}n=null;});}function loadScripts(){if(s.language)sl.add(tinymce.baseURL+'/langs/'+s.language+'.js');if(s.theme.charAt(0)!='-'&&!ThemeManager.urls[s.theme])ThemeManager.load(s.theme,'themes/'+s.theme+'/editor_template'+tinymce.suffix+'.js');each(explode(s.plugins),function(p){if(p&&p.charAt(0)!='-'&&!PluginManager.urls[p]){if(!isWebKit&&p=='safari')return;PluginManager.load(p,'plugins/'+p+'/editor_plugin'+tinymce.suffix+'.js');}});sl.loadQueue(function(){if(s.ask){function ask(){window.setTimeout(function(){Event.remove(t.id,'focus',ask);t.windowManager.confirm(t.getLang('edit_confirm'),function(s){if(s)t.init();});},0);};Event.add(t.id,'focus',ask);return;}if(!t.removed)t.init();});};if(s.plugins.indexOf('compat2x')!=-1){PluginManager.load('compat2x','plugins/compat2x/editor_plugin'+tinymce.suffix+'.js');sl.loadQueue(loadScripts);}else loadScripts();},init:function(){var n,t=this,s=t.settings,w,h,e=t.getElement(),o,ti,u,bi,bc,re;EditorManager.add(t);s.theme=s.theme.replace(/-/,'');o=ThemeManager.get(s.theme);t.theme=new o();if(t.theme.init&&s.init_theme)t.theme.init(t,ThemeManager.urls[s.theme]||tinymce.documentBaseURL.replace(/\/$/,''));each(explode(s.plugins.replace(/\-/g,'')),function(p){var c=PluginManager.get(p),u=PluginManager.urls[p]||tinymce.documentBaseURL.replace(/\/$/,''),po;if(c){po=new c(t,u);t.plugins[p]=po;if(po.init)po.init(t,u);}});if(s.popup_css)s.popup_css=t.documentBaseURI.toAbsolute(s.popup_css);else s.popup_css=t.baseURI.toAbsolute("themes/"+s.theme+"/skins/"+s.skin+"/dialog.css");if(s.popup_css_add)s.popup_css+=','+t.documentBaseURI.toAbsolute(s.popup_css_add);t.controlManager=new tinymce.ControlManager(t);t.undoManager=new tinymce.UndoManager(t);t.undoManager.onAdd.add(function(um,l){if(!l.initial)return t.onChange.dispatch(t,l,um);});t.undoManager.onUndo.add(function(um,l){return t.onUndo.dispatch(t,l,um);});t.undoManager.onRedo.add(function(um,l){return t.onRedo.dispatch(t,l,um);});if(s.custom_undo_redo){t.onExecCommand.add(function(ed,cmd,ui,val,a){if(cmd!='Undo'&&cmd!='Redo'&&cmd!='mceRepaint'&&(!a||!a.skip_undo))t.undoManager.add();});}t.onExecCommand.add(function(ed,c){if(!/^(FontName|FontSize)$/.test(c))t.nodeChanged();});if(isGecko){function repaint(a,o){if(!o||!o.initial)t.execCommand('mceRepaint');};t.onUndo.add(repaint);t.onRedo.add(repaint);t.onSetContent.add(repaint);}t.onBeforeRenderUI.dispatch(t,t.controlManager);if(s.render_ui){w=s.width||e.style.width||e.offsetWidth;h=s.height||e.style.height||e.offsetHeight;t.orgDisplay=e.style.display;re=/^[0-9\.]+(|px)$/i;if(re.test(''+w))w=Math.max(parseInt(w)+(o.deltaWidth||0),100);if(re.test(''+h))h=Math.max(parseInt(h)+(o.deltaHeight||0),100);o=t.theme.renderUI({targetNode:e,width:w,height:h,deltaWidth:s.delta_width,deltaHeight:s.delta_height});t.editorContainer=o.editorContainer;}DOM.setStyles(o.sizeContainer||o.editorContainer,{width:w,height:h});h=(o.iframeHeight||h)+((h+'').indexOf('%')==-1?(o.deltaHeight||0):'');if(h<100)h=100;t.iframeHTML=s.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="'+t.documentBaseURI.getURI()+'" />';t.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(tinymce.relaxedDomain)t.iframeHTML+='<script type="text/javascript">document.domain = "'+tinymce.relaxedDomain+'";</script>';bi=s.body_id||'tinymce';if(bi.indexOf('=')!=-1){bi=t.getParam('body_id','','hash');bi=bi[t.id]||bi;}bc=s.body_class||'';if(bc.indexOf('=')!=-1){bc=t.getParam('body_class','','hash');bc=bc[t.id]||'';}t.iframeHTML+='</head><body id="'+bi+'" class="mceContentBody '+bc+'"></body></html>';if(tinymce.relaxedDomain){if(isIE||(tinymce.isOpera&&parseFloat(opera.version())>=9.5))u='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()';else if(tinymce.isOpera)u='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()';}n=DOM.add(o.iframeContainer,'iframe',{id:t.id+"_ifr",src:u||'javascript:""',frameBorder:'0',style:{width:'100%',height:h}});t.contentAreaContainer=o.iframeContainer;DOM.get(o.editorContainer).style.display=t.orgDisplay;DOM.get(t.id).style.display='none';if(tinymce.isOldWebKit){Event.add(n,'load',t.setupIframe,t);n.src=tinymce.baseURL+'/plugins/safari/blank.htm';}else{if(!isIE||!tinymce.relaxedDomain)t.setupIframe();e=n=o=null;}},setupIframe:function(){var t=this,s=t.settings,e=DOM.get(t.id),d=t.getDoc(),h,b;if(!isIE||!tinymce.relaxedDomain){d.open();d.write(t.iframeHTML);d.close();}if(!isIE){try{d.designMode='On';}catch(ex){}}if(isIE){b=t.getBody();DOM.hide(b);b.contentEditable=true;DOM.show(b);}t.dom=new tinymce.DOM.DOMUtils(t.getDoc(),{keep_values:true,url_converter:t.convertURL,url_converter_scope:t,hex_colors:s.force_hex_style_colors,class_filter:s.class_filter,update_styles:1,fix_ie_paragraphs:1});t.serializer=new tinymce.dom.Serializer({entity_encoding:s.entity_encoding,entities:s.entities,valid_elements:s.verify_html===false?'*[*]':s.valid_elements,extended_valid_elements:s.extended_valid_elements,valid_child_elements:s.valid_child_elements,invalid_elements:s.invalid_elements,fix_table_elements:s.fix_table_elements,fix_list_elements:s.fix_list_elements,fix_content_duplication:s.fix_content_duplication,convert_fonts_to_spans:s.convert_fonts_to_spans,font_size_classes:s.font_size_classes,font_size_style_values:s.font_size_style_values,apply_source_formatting:s.apply_source_formatting,remove_linebreaks:s.remove_linebreaks,dom:t.dom});t.selection=new tinymce.dom.Selection(t.dom,t.getWin(),t.serializer);t.forceBlocks=new tinymce.ForceBlocks(t,{forced_root_block:s.forced_root_block});t.editorCommands=new tinymce.EditorCommands(t);t.serializer.onPreProcess.add(function(se,o){return t.onPreProcess.dispatch(t,o,se);});t.serializer.onPostProcess.add(function(se,o){return t.onPostProcess.dispatch(t,o,se);});t.onPreInit.dispatch(t);if(!s.gecko_spellcheck)t.getBody().spellcheck=0;t._addEvents();t.controlManager.onPostRender.dispatch(t,t.controlManager);t.onPostRender.dispatch(t);if(s.directionality)t.getBody().dir=s.directionality;if(s.nowrap)t.getBody().style.whiteSpace="nowrap";if(s.auto_resize)t.onNodeChange.add(t.resizeToContent,t);if(s.custom_elements){function handleCustom(ed,o){each(explode(s.custom_elements),function(v){var n;if(v.indexOf('~')===0){v=v.substring(1);n='span';}else n='div';o.content=o.content.replace(new RegExp('<('+v+')([^>]*)>','g'),'<'+n+' mce_name="$1"$2>');o.content=o.content.replace(new RegExp('</('+v+')>','g'),'</'+n+'>');});};t.onBeforeSetContent.add(handleCustom);t.onPostProcess.add(function(ed,o){if(o.set)handleCustom(ed,o)});}if(s.handle_node_change_callback){t.onNodeChange.add(function(ed,cm,n){t.execCallback('handle_node_change_callback',t.id,n,-1,-1,true,t.selection.isCollapsed());});}if(s.save_callback){t.onSaveContent.add(function(ed,o){var h=t.execCallback('save_callback',t.id,o.content,t.getBody());if(h)o.content=h;});}if(s.onchange_callback){t.onChange.add(function(ed,l){t.execCallback('onchange_callback',t,l);});}if(s.convert_newlines_to_brs){t.onBeforeSetContent.add(function(ed,o){if(o.initial)o.content=o.content.replace(/\r?\n/g,'<br />');});}if(s.fix_nesting&&isIE){t.onBeforeSetContent.add(function(ed,o){o.content=t._fixNesting(o.content);});}if(s.preformatted){t.onPostProcess.add(function(ed,o){o.content=o.content.replace(/^\s*<pre.*?>/,'');o.content=o.content.replace(/<\/pre>\s*$/,'');if(o.set)o.content='<pre class="mceItemHidden">'+o.content+'</pre>';});}if(s.verify_css_classes){t.serializer.attribValueFilter=function(n,v){var s,cl;if(n=='class'){if(!t.classesRE){cl=t.dom.getClasses();if(cl.length>0){s='';each(cl,function(o){s+=(s?'|':'')+o['class'];});t.classesRE=new RegExp('('+s+')','gi');}}return!t.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v)||t.classesRE.test(v)?v:'';}return v;};}if(s.convert_fonts_to_spans)t._convertFonts();if(s.inline_styles)t._convertInlineElements();if(s.cleanup_callback){t.onBeforeSetContent.add(function(ed,o){o.content=t.execCallback('cleanup_callback','insert_to_editor',o.content,o);});t.onPreProcess.add(function(ed,o){if(o.set)t.execCallback('cleanup_callback','insert_to_editor_dom',o.node,o);if(o.get)t.execCallback('cleanup_callback','get_from_editor_dom',o.node,o);});t.onPostProcess.add(function(ed,o){if(o.set)o.content=t.execCallback('cleanup_callback','insert_to_editor',o.content,o);if(o.get)o.content=t.execCallback('cleanup_callback','get_from_editor',o.content,o);});}if(s.save_callback){t.onGetContent.add(function(ed,o){if(o.save)o.content=t.execCallback('save_callback',t.id,o.content,t.getBody());});}if(s.handle_event_callback){t.onEvent.add(function(ed,e,o){if(t.execCallback('handle_event_callback',e,ed,o)===false)Event.cancel(e);});}t.onSetContent.add(function(){t.addVisual(t.getBody());});if(s.padd_empty_editor){t.onPostProcess.add(function(ed,o){o.content=o.content.replace(/^(<p>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,'');});}if(isGecko){try{d.designMode='Off';d.designMode='On';}catch(ex){}}setTimeout(function(){if(t.removed)return;t.load({initial:true,format:(s.cleanup_on_startup?'html':'raw')});t.startContent=t.getContent({format:'raw'});t.undoManager.add({initial:true});t.initialized=true;t.onInit.dispatch(t);t.execCallback('setupcontent_callback',t.id,t.getBody(),t.getDoc());t.execCallback('init_instance_callback',t);t.focus(true);t.nodeChanged({initial:1});if(s.content_css){tinymce.each(explode(s.content_css),function(u){t.dom.loadCSS(t.documentBaseURI.toAbsolute(u));});}if(s.auto_focus){setTimeout(function(){var ed=EditorManager.get(s.auto_focus);ed.selection.select(ed.getBody(),1);ed.selection.collapse(1);ed.getWin().focus();},100);}},1);e=null;},focus:function(sf){var oed,t=this,ce=t.settings.content_editable;if(!sf){if(!ce&&(!isIE||t.selection.getNode().ownerDocument!=t.getDoc()))t.getWin().focus();}if(EditorManager.activeEditor!=t){if((oed=EditorManager.activeEditor)!=null)oed.onDeactivate.dispatch(oed,t);t.onActivate.dispatch(t,oed);}EditorManager._setActive(t);},execCallback:function(n){var t=this,f=t.settings[n],s;if(!f)return;if(t.callbackLookup&&(s=t.callbackLookup[n])){f=s.func;s=s.scope;}if(is(f,'string')){s=f.replace(/\.\w+$/,'');s=s?tinymce.resolve(s):0;f=tinymce.resolve(f);t.callbackLookup=t.callbackLookup||{};t.callbackLookup[n]={func:f,scope:s};}return f.apply(s||t,Array.prototype.slice.call(arguments,1));},translate:function(s){var c=this.settings.language,i18n=EditorManager.i18n;if(!s)return'';return i18n[c+'.'+s]||s.replace(/{\#([^}]+)\}/g,function(a,b){return i18n[c+'.'+b]||'{#'+b+'}';});},getLang:function(n,dv){return EditorManager.i18n[this.settings.language+'.'+n]||(is(dv)?dv:'{#'+n+'}');},getParam:function(n,dv,ty){var tr=tinymce.trim,v=is(this.settings[n])?this.settings[n]:dv,o;if(ty==='hash'){o={};if(is(v,'string')){each(v.indexOf('=')>0?v.split(/[;,](?![^=;,]*(?:[;,]|$))/):v.split(','),function(v){v=v.split('=');if(v.length>1)o[tr(v[0])]=tr(v[1]);else o[tr(v[0])]=tr(v);});}else o=v;return o;}return v;},nodeChanged:function(o){var t=this,s=t.selection,n=s.getNode()||t.getBody();if(t.initialized){t.onNodeChange.dispatch(t,o?o.controlManager||t.controlManager:t.controlManager,isIE&&n.ownerDocument!=t.getDoc()?t.getBody():n,s.isCollapsed(),o);}},addButton:function(n,s){var t=this;t.buttons=t.buttons||{};t.buttons[n]=s;},addCommand:function(n,f,s){this.execCommands[n]={func:f,scope:s||this};},addQueryStateHandler:function(n,f,s){this.queryStateCommands[n]={func:f,scope:s||this};},addQueryValueHandler:function(n,f,s){this.queryValueCommands[n]={func:f,scope:s||this};},addShortcut:function(pa,desc,cmd_func,sc){var t=this,c;if(!t.settings.custom_shortcuts)return false;t.shortcuts=t.shortcuts||{};if(is(cmd_func,'string')){c=cmd_func;cmd_func=function(){t.execCommand(c,false,null);};}if(is(cmd_func,'object')){c=cmd_func;cmd_func=function(){t.execCommand(c[0],c[1],c[2]);};}each(explode(pa),function(pa){var o={func:cmd_func,scope:sc||this,desc:desc,alt:false,ctrl:false,shift:false};each(explode(pa,'+'),function(v){switch(v){case'alt':case'ctrl':case'shift':o[v]=true;break;default:o.charCode=v.charCodeAt(0);o.keyCode=v.toUpperCase().charCodeAt(0);}});t.shortcuts[(o.ctrl?'ctrl':'')+','+(o.alt?'alt':'')+','+(o.shift?'shift':'')+','+o.keyCode]=o;});return true;},execCommand:function(cmd,ui,val,a){var t=this,s=0,o,st;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd)&&(!a||!a.skip_focus))t.focus();o={};t.onBeforeExecCommand.dispatch(t,cmd,ui,val,o);if(o.terminate)return false;if(t.execCallback('execcommand_callback',t.id,t.selection.getNode(),cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);return true;}if(o=t.execCommands[cmd]){st=o.func.call(o.scope,ui,val);if(st!==true){t.onExecCommand.dispatch(t,cmd,ui,val,a);return st;}}each(t.plugins,function(p){if(p.execCommand&&p.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);s=1;return false;}});if(s)return true;if(t.theme.execCommand&&t.theme.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);return true;}if(t.editorCommands.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);return true;}t.getDoc().execCommand(cmd,ui,val);t.onExecCommand.dispatch(t,cmd,ui,val,a);},queryCommandState:function(c){var t=this,o,s;if(t._isHidden())return;if(o=t.queryStateCommands[c]){s=o.func.call(o.scope);if(s!==true)return s;}o=t.editorCommands.queryCommandState(c);if(o!==-1)return o;try{return this.getDoc().queryCommandState(c);}catch(ex){}},queryCommandValue:function(c){var t=this,o,s;if(t._isHidden())return;if(o=t.queryValueCommands[c]){s=o.func.call(o.scope);if(s!==true)return s;}o=t.editorCommands.queryCommandValue(c);if(is(o))return o;try{return this.getDoc().queryCommandValue(c);}catch(ex){}},show:function(){var t=this;DOM.show(t.getContainer());DOM.hide(t.id);t.load();},hide:function(){var t=this,d=t.getDoc();if(isIE&&d)d.execCommand('SelectAll');t.save();DOM.hide(t.getContainer());DOM.setStyle(t.id,'display',t.orgDisplay);},isHidden:function(){return!DOM.isHidden(this.id);},setProgressState:function(b,ti,o){this.onSetProgressState.dispatch(this,b,ti,o);return b;},resizeToContent:function(){var t=this;DOM.setStyle(t.id+"_ifr",'height',t.getBody().scrollHeight);},load:function(o){var t=this,e=t.getElement(),h;o=o||{};o.load=true;h=t.setContent(is(e.value)?e.value:e.innerHTML,o);o.element=e;if(!o.no_events)t.onLoadContent.dispatch(t,o);o.element=e=null;return h;},save:function(o){var t=this,e=t.getElement(),h,f;if(!t.initialized)return;o=o||{};o.save=true;if(!o.no_events){t.undoManager.typing=0;t.undoManager.add();}o.element=e;h=o.content=t.getContent(o);if(!o.no_events)t.onSaveContent.dispatch(t,o);h=o.content;if(!/TEXTAREA|INPUT/i.test(e.nodeName)){e.innerHTML=h;if(f=DOM.getParent(t.id,'form')){each(f.elements,function(e){if(e.name==t.id){e.value=h;return false;}});}}else e.value=h;o.element=e=null;return h;},setContent:function(h,o){var t=this;o=o||{};o.format=o.format||'html';o.set=true;o.content=h;if(!o.no_events)t.onBeforeSetContent.dispatch(t,o);if(!tinymce.isIE&&(h.length===0||/^\s+$/.test(h))){o.content=t.dom.setHTML(t.getBody(),'<br mce_bogus="1" />');o.format='raw';}o.content=t.dom.setHTML(t.getBody(),tinymce.trim(o.content));if(o.format!='raw'&&t.settings.cleanup){o.getInner=true;o.content=t.dom.setHTML(t.getBody(),t.serializer.serialize(t.getBody(),o));}if(!o.no_events)t.onSetContent.dispatch(t,o);return o.content;},getContent:function(o){var t=this,h;o=o||{};o.format=o.format||'html';o.get=true;if(!o.no_events)t.onBeforeGetContent.dispatch(t,o);if(o.format!='raw'&&t.settings.cleanup){o.getInner=true;h=t.serializer.serialize(t.getBody(),o);}else h=t.getBody().innerHTML;h=h.replace(/^\s*|\s*$/g,'');o.content=h;if(!o.no_events)t.onGetContent.dispatch(t,o);return o.content;},isDirty:function(){var t=this;return tinymce.trim(t.startContent)!=tinymce.trim(t.getContent({format:'raw',no_events:1}))&&!t.isNotDirty;},getContainer:function(){var t=this;if(!t.container)t.container=DOM.get(t.editorContainer||t.id+'_parent');return t.container;},getContentAreaContainer:function(){return this.contentAreaContainer;},getElement:function(){return DOM.get(this.settings.content_element||this.id);},getWin:function(){var t=this,e;if(!t.contentWindow){e=DOM.get(t.id+"_ifr");if(e)t.contentWindow=e.contentWindow;}return t.contentWindow;},getDoc:function(){var t=this,w;if(!t.contentDocument){w=t.getWin();if(w)t.contentDocument=w.document;}return t.contentDocument;},getBody:function(){return this.bodyElement||this.getDoc().body;},convertURL:function(u,n,e){var t=this,s=t.settings;if(s.urlconverter_callback)return t.execCallback('urlconverter_callback',u,e,true,n);if(!s.convert_urls||(e&&e.nodeName=='LINK')||u.indexOf('file:')===0)return u;if(s.relative_urls)return t.documentBaseURI.toRelative(u);u=t.documentBaseURI.toAbsolute(u,s.remove_script_host);return u;},addVisual:function(e){var t=this,s=t.settings;e=e||t.getBody();if(!is(t.hasVisual))t.hasVisual=s.visual;each(t.dom.select('table,a',e),function(e){var v;switch(e.nodeName){case'TABLE':v=t.dom.getAttrib(e,'border');if(!v||v=='0'){if(t.hasVisual)t.dom.addClass(e,s.visual_table_class);else t.dom.removeClass(e,s.visual_table_class);}return;case'A':v=t.dom.getAttrib(e,'name');if(v){if(t.hasVisual)t.dom.addClass(e,'mceItemAnchor');else t.dom.removeClass(e,'mceItemAnchor');}return;}});t.onVisualAid.dispatch(t,e,t.hasVisual);},remove:function(){var t=this,e=t.getContainer();t.removed=1;t.hide();t.execCallback('remove_instance_callback',t);t.onRemove.dispatch(t);t.onExecCommand.listeners=[];EditorManager.remove(t);DOM.remove(e);},destroy:function(s){var t=this;if(t.destroyed)return;if(!s){tinymce.removeUnload(t.destroy);tinyMCE.onBeforeUnload.remove(t._beforeUnload);if(t.theme.destroy)t.theme.destroy();t.controlManager.destroy();t.selection.destroy();t.dom.destroy();if(!t.settings.content_editable){Event.clear(t.getWin());Event.clear(t.getDoc());}Event.clear(t.getBody());Event.clear(t.formElement);}if(t.formElement){t.formElement.submit=t.formElement._mceOldSubmit;t.formElement._mceOldSubmit=null;}t.contentAreaContainer=t.formElement=t.container=t.settings.content_element=t.bodyElement=t.contentDocument=t.contentWindow=null;if(t.selection)t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null;t.destroyed=1;},_addEvents:function(){var t=this,i,s=t.settings,lo={mouseup:'onMouseUp',mousedown:'onMouseDown',click:'onClick',keyup:'onKeyUp',keydown:'onKeyDown',keypress:'onKeyPress',submit:'onSubmit',reset:'onReset',contextmenu:'onContextMenu',dblclick:'onDblClick',paste:'onPaste'};function eventHandler(e,o){var ty=e.type;if(t.removed)return;if(t.onEvent.dispatch(t,e,o)!==false){t[lo[e.fakeType||e.type]].dispatch(t,e,o);}};each(lo,function(v,k){switch(k){case'contextmenu':if(tinymce.isOpera){Event.add(t.getBody(),'mousedown',function(e){if(e.ctrlKey){e.fakeType='contextmenu';eventHandler(e);}});}else Event.add(t.getBody(),k,eventHandler);break;case'paste':Event.add(t.getBody(),k,function(e){var tx,h,el,r;if(e.clipboardData)tx=e.clipboardData.getData('text/plain');else if(tinymce.isIE)tx=t.getWin().clipboardData.getData('Text');eventHandler(e,{text:tx,html:h});});break;case'submit':case'reset':Event.add(t.getElement().form||DOM.getParent(t.id,'form'),k,eventHandler);break;default:Event.add(s.content_editable?t.getBody():t.getDoc(),k,eventHandler);}});Event.add(s.content_editable?t.getBody():(isGecko?t.getDoc():t.getWin()),'focus',function(e){t.focus(true);});if(tinymce.isGecko){Event.add(t.getDoc(),'DOMNodeInserted',function(e){var v;e=e.target;if(e.nodeType===1&&e.nodeName==='IMG'&&(v=e.getAttribute('mce_src')))e.src=t.documentBaseURI.toAbsolute(v);});}if(isGecko){function setOpts(){var t=this,d=t.getDoc(),s=t.settings;if(isGecko){if(t._isHidden()){try{if(!s.content_editable)d.designMode='On';}catch(ex){}}try{d.execCommand("styleWithCSS",0,false);}catch(ex){if(!t._isHidden())try{d.execCommand("useCSS",0,true);}catch(ex){}}if(!s.table_inline_editing)try{d.execCommand('enableInlineTableEditing',false,false);}catch(ex){}if(!s.object_resizing)try{d.execCommand('enableObjectResizing',false,false);}catch(ex){}}};t.onBeforeExecCommand.add(setOpts);t.onMouseDown.add(setOpts);}t.onMouseUp.add(t.nodeChanged);t.onClick.add(t.nodeChanged);t.onKeyUp.add(function(ed,e){if((e.keyCode>=33&&e.keyCode<=36)||(e.keyCode>=37&&e.keyCode<=40)||e.keyCode==13||e.keyCode==45||e.keyCode==46||e.keyCode==8||e.ctrlKey)t.nodeChanged();});t.onReset.add(function(){t.setContent(t.startContent,{format:'raw'});});if(t.getParam('tab_focus')){function tabCancel(ed,e){if(e.keyCode===9)return Event.cancel(e);};function tabHandler(ed,e){var x,i,f,el,v;function find(d){f=DOM.getParent(ed.id,'form');el=f.elements;if(f){each(el,function(e,i){if(e.id==ed.id){x=i;return false;}});if(d>0){for(i=x+1;i<el.length;i++){if(el[i].type!='hidden')return el[i];}}else{for(i=x-1;i>=0;i--){if(el[i].type!='hidden')return el[i];}}}return null;};if(e.keyCode===9){v=explode(ed.getParam('tab_focus'));if(v.length==1){v[1]=v[0];v[0]=':prev';}if(e.shiftKey){if(v[0]==':prev')el=find(-1);else el=DOM.get(v[0]);}else{if(v[1]==':next')el=find(1);else el=DOM.get(v[1]);}if(el){if(ed=EditorManager.get(el.id||el.name))ed.focus();else window.setTimeout(function(){window.focus();el.focus();},10);return Event.cancel(e);}}};t.onKeyUp.add(tabCancel);if(isGecko){t.onKeyPress.add(tabHandler);t.onKeyDown.add(tabCancel);}else t.onKeyDown.add(tabHandler);}if(s.custom_shortcuts){if(s.custom_undo_redo_keyboard_shortcuts){t.addShortcut('ctrl+z',t.getLang('undo_desc'),'Undo');t.addShortcut('ctrl+y',t.getLang('redo_desc'),'Redo');}if(isGecko){t.addShortcut('ctrl+b',t.getLang('bold_desc'),'Bold');t.addShortcut('ctrl+i',t.getLang('italic_desc'),'Italic');t.addShortcut('ctrl+u',t.getLang('underline_desc'),'Underline');}for(i=1;i<=6;i++)t.addShortcut('ctrl+'+i,'',['FormatBlock',false,'<h'+i+'>']);t.addShortcut('ctrl+7','',['FormatBlock',false,'<p>']);t.addShortcut('ctrl+8','',['FormatBlock',false,'<div>']);t.addShortcut('ctrl+9','',['FormatBlock',false,'<address>']);function find(e){var v=null;if(!e.altKey&&!e.ctrlKey&&!e.metaKey)return v;each(t.shortcuts,function(o){if(o.ctrl!=e.ctrlKey&&(!tinymce.isMac||o.ctrl==e.metaKey))return;if(o.alt!=e.altKey)return;if(o.shift!=e.shiftKey)return;if(e.keyCode==o.keyCode||(e.charCode&&e.charCode==o.charCode)){v=o;return false;}});return v;};t.onKeyUp.add(function(ed,e){var o=find(e);if(o)return Event.cancel(e);});t.onKeyPress.add(function(ed,e){var o=find(e);if(o)return Event.cancel(e);});t.onKeyDown.add(function(ed,e){var o=find(e);if(o){o.func.call(o.scope);return Event.cancel(e);}});}if(tinymce.isIE){Event.add(t.getDoc(),'controlselect',function(e){var re=t.resizeInfo,cb;e=e.target;if(e.nodeName!=='IMG')return;if(re)Event.remove(re.node,re.ev,re.cb);if(!t.dom.hasClass(e,'mceItemNoResize')){ev='resizeend';cb=Event.add(e,ev,function(e){var v;e=e.target;if(v=t.dom.getStyle(e,'width')){t.dom.setAttrib(e,'width',v.replace(/[^0-9%]+/g,''));t.dom.setStyle(e,'width','');}if(v=t.dom.getStyle(e,'height')){t.dom.setAttrib(e,'height',v.replace(/[^0-9%]+/g,''));t.dom.setStyle(e,'height','');}});}else{ev='resizestart';cb=Event.add(e,'resizestart',Event.cancel,Event);}re=t.resizeInfo={node:e,ev:ev,cb:cb};});t.onKeyDown.add(function(ed,e){switch(e.keyCode){case 8:if(t.selection.getRng().item){t.selection.getRng().item(0).removeNode();return Event.cancel(e);}}});}if(tinymce.isOpera){t.onClick.add(function(ed,e){Event.prevent(e);});}if(s.custom_undo_redo){function addUndo(){t.undoManager.typing=0;t.undoManager.add();};if(tinymce.isIE){Event.add(t.getWin(),'blur',function(e){var n;if(t.selection){n=t.selection.getNode();if(!t.removed&&n.ownerDocument&&n.ownerDocument!=t.getDoc())addUndo();}});}else{Event.add(t.getDoc(),'blur',function(){if(t.selection&&!t.removed)addUndo();});}t.onMouseDown.add(addUndo);t.onKeyUp.add(function(ed,e){if((e.keyCode>=33&&e.keyCode<=36)||(e.keyCode>=37&&e.keyCode<=40)||e.keyCode==13||e.keyCode==45||e.ctrlKey){t.undoManager.typing=0;t.undoManager.add();}});t.onKeyDown.add(function(ed,e){if((e.keyCode>=33&&e.keyCode<=36)||(e.keyCode>=37&&e.keyCode<=40)||e.keyCode==13||e.keyCode==45){if(t.undoManager.typing){t.undoManager.add();t.undoManager.typing=0;}return;}if(!t.undoManager.typing){t.undoManager.add();t.undoManager.typing=1;}});}},_convertInlineElements:function(){var t=this,s=t.settings,dom=t.dom,v,e,na,st,sp;function convert(ed,o){if(!s.inline_styles)return;if(o.get){each(t.dom.select('table,u,strike',o.node),function(n){switch(n.nodeName){case'TABLE':if(v=dom.getAttrib(n,'height')){dom.setStyle(n,'height',v);dom.setAttrib(n,'height','');}break;case'U':case'STRIKE':n.style.textDecoration=n.nodeName=='U'?'underline':'line-through';dom.setAttrib(n,'mce_style','');dom.setAttrib(n,'mce_name','span');break;}});}else if(o.set){each(t.dom.select('table,span',o.node).reverse(),function(n){if(n.nodeName=='TABLE'){if(v=dom.getStyle(n,'height'))dom.setAttrib(n,'height',v.replace(/[^0-9%]+/g,''));}else{if(n.style.textDecoration=='underline')na='u';else if(n.style.textDecoration=='line-through')na='strike';else na='';if(na){n.style.textDecoration='';dom.setAttrib(n,'mce_style','');e=dom.create(na,{style:dom.getAttrib(n,'style')});dom.replace(e,n,1);}}});}};t.onPreProcess.add(convert);if(!s.cleanup_on_startup){t.onSetContent.add(function(ed,o){if(o.initial)convert(t,{node:t.getBody(),set:1});});}},_convertFonts:function(){var t=this,s=t.settings,dom=t.dom,fz,fzn,sl,cl;if(!s.inline_styles)return;fz=[8,10,12,14,18,24,36];fzn=['xx-small','x-small','small','medium','large','x-large','xx-large'];if(sl=s.font_size_style_values)sl=explode(sl);if(cl=s.font_size_classes)cl=explode(cl);function convertToFonts(no){var n,f,nl,x,i,v,st;if(tinymce.isWebKit||!s.inline_styles)return;nl=t.dom.select('span',no);for(x=nl.length-1;x>=0;x--){n=nl[x];f=dom.create('font',{color:dom.toHex(dom.getStyle(n,'color')),face:dom.getStyle(n,'fontFamily'),style:dom.getAttrib(n,'style'),'class':dom.getAttrib(n,'class')});st=f.style;if(st.color||st.fontFamily){st.color=st.fontFamily='';dom.setAttrib(f,'mce_style','');}if(sl){i=inArray(sl,dom.getStyle(n,'fontSize'));if(i!=-1){dom.setAttrib(f,'size',''+(i+1||1));}}else if(cl){i=inArray(cl,dom.getAttrib(n,'class'));v=dom.getStyle(n,'fontSize');if(i==-1&&v.indexOf('pt')>0)i=inArray(fz,parseInt(v));if(i==-1)i=inArray(fzn,v);if(i!=-1){dom.setAttrib(f,'size',''+(i+1||1));f.style.fontSize='';}}if(f.color||f.face||f.size){f.style.fontFamily='';dom.setAttrib(f,'mce_style','');dom.replace(f,n,1);}f=n=null;}};t.onSetContent.add(function(ed,o){convertToFonts(ed.getBody());});t.onPreProcess.add(function(ed,o){var n,sp,nl,x;if(!s.inline_styles)return;if(o.get){nl=t.dom.select('font',o.node);for(x=nl.length-1;x>=0;x--){n=nl[x];sp=dom.create('span',{style:dom.getAttrib(n,'style'),'class':dom.getAttrib(n,'class')});dom.setStyles(sp,{fontFamily:dom.getAttrib(n,'face'),color:dom.getAttrib(n,'color'),backgroundColor:n.style.backgroundColor});if(n.size){if(sl)dom.setStyle(sp,'fontSize',sl[parseInt(n.size)-1]);else dom.setAttrib(sp,'class',cl[parseInt(n.size)-1]);}dom.setAttrib(sp,'mce_style','');dom.replace(sp,n,1);}}});},_isHidden:function(){var s;if(!isGecko)return 0;s=this.selection.getSel();return(!s||!s.rangeCount||s.rangeCount==0);},_fixNesting:function(s){var d=[],i;s=s.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(a,b,c){var e;if(b==='/'){if(!d.length)return'';if(c!==d[d.length-1].tag){for(i=d.length-1;i>=0;i--){if(d[i].tag===c){d[i].close=1;break;}}return'';}else{d.pop();if(d.length&&d[d.length-1].close){a=a+'</'+d[d.length-1].tag+'>';d.pop();}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(c))return a;if(/\/>$/.test(a))return a;d.push({tag:c});}return a;});for(i=d.length-1;i>=0;i--)s+='</'+d[i].tag+'>';return s;}});})();(function(){var each=tinymce.each,isIE=tinymce.isIE,isGecko=tinymce.isGecko,isOpera=tinymce.isOpera,isWebKit=tinymce.isWebKit;tinymce.create('tinymce.EditorCommands',{EditorCommands:function(ed){this.editor=ed;},execCommand:function(cmd,ui,val){var t=this,ed=t.editor,f;switch(cmd){case'Cut':case'Copy':case'Paste':try{ed.getDoc().execCommand(cmd,ui,val);}catch(ex){if(isGecko){ed.windowManager.confirm(ed.getLang('clipboard_msg'),function(s){if(s)window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html','mceExternal');});}else ed.windowManager.alert(ed.getLang('clipboard_no_support'));}return true;case'mceResetDesignMode':case'mceBeginUndoLevel':return true;case'unlink':t.UnLink();return true;case'JustifyLeft':case'JustifyCenter':case'JustifyRight':case'JustifyFull':t.mceJustify(cmd,cmd.substring(7).toLowerCase());return true;case'mceEndUndoLevel':case'mceAddUndoLevel':ed.undoManager.add();return true;default:f=this[cmd];if(f){f.call(this,ui,val);return true;}}return false;},Indent:function(){var ed=this.editor,d=ed.dom,s=ed.selection,e,iv,iu;iv=ed.settings.indentation;iu=/[a-z%]+$/i.exec(iv);iv=parseInt(iv);if(ed.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){each(this._getSelectedBlocks(),function(e){d.setStyle(e,'paddingLeft',(parseInt(e.style.paddingLeft||0)+iv)+iu);});return;}ed.getDoc().execCommand('Indent',false,null);if(isIE){d.getParent(s.getNode(),function(n){if(n.nodeName=='BLOCKQUOTE'){n.dir=n.style.cssText='';}});}},Outdent:function(){var ed=this.editor,d=ed.dom,s=ed.selection,e,v,iv,iu;iv=ed.settings.indentation;iu=/[a-z%]+$/i.exec(iv);iv=parseInt(iv);if(ed.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){each(this._getSelectedBlocks(),function(e){v=Math.max(0,parseInt(e.style.paddingLeft||0)-iv);d.setStyle(e,'paddingLeft',v?v+iu:'');});return;}ed.getDoc().execCommand('Outdent',false,null);},mceSetAttribute:function(u,v){var ed=this.editor,d=ed.dom,e;if(e=d.getParent(ed.selection.getNode(),d.isBlock))d.setAttrib(e,v.name,v.value);},mceSetContent:function(u,v){this.editor.setContent(v);},mceToggleVisualAid:function(){var ed=this.editor;ed.hasVisual=!ed.hasVisual;ed.addVisual();},mceReplaceContent:function(u,v){var s=this.editor.selection;s.setContent(v.replace(/\{\$selection\}/g,s.getContent({format:'text'})));},mceInsertLink:function(u,v){var ed=this.editor,s=ed.selection,e=ed.dom.getParent(s.getNode(),'A');if(tinymce.is(v,'string'))v={href:v};function set(e){each(v,function(v,k){ed.dom.setAttrib(e,k,v);});};if(!e){ed.execCommand('CreateLink',false,'javascript:mctmp(0);');each(ed.dom.select('a'),function(e){if(e.href=='javascript:mctmp(0);')set(e);});}else{if(v.href)set(e);else ed.dom.remove(e,1);}},UnLink:function(){var ed=this.editor,s=ed.selection;if(s.isCollapsed())s.select(s.getNode());ed.getDoc().execCommand('unlink',false,null);s.collapse(0);},FontName:function(u,v){var t=this,ed=t.editor,s=ed.selection,e;if(!v){if(s.isCollapsed())s.select(s.getNode());t.RemoveFormat();}else ed.getDoc().execCommand('FontName',false,v);},FontSize:function(u,v){var ed=this.editor,s=ed.settings,fz=tinymce.explode(s.font_size_style_values),fzc=tinymce.explode(s.font_size_classes),h,bm;each(ed.dom.select('font'),function(e){e.style.fontSize='';});ed.getDoc().execCommand('FontSize',false,v);if(s.inline_styles){each(ed.dom.select('font'),function(e){if(e.parentNode.nodeName=='FONT'&&e.size==e.parentNode.size){if(!bm)bm=ed.selection.getBookmark();ed.dom.remove(e,1);return;}if(v=e.size){if(fzc&&fzc.length>0)ed.dom.setAttrib(e,'class',fzc[parseInt(v)-1]);else ed.dom.setStyle(e,'fontSize',fz[parseInt(v)-1]);}});}ed.selection.moveToBookmark(bm);},queryCommandValue:function(c){var f=this['queryValue'+c];if(f)return f.call(this,c);return false;},queryCommandState:function(cmd){var f;switch(cmd){case'JustifyLeft':case'JustifyCenter':case'JustifyRight':case'JustifyFull':return this.queryStateJustify(cmd,cmd.substring(7).toLowerCase());default:if(f=this['queryState'+cmd])return f.call(this,cmd);}return-1;},_queryState:function(c){try{return this.editor.getDoc().queryCommandState(c);}catch(ex){}},_queryVal:function(c){try{return this.editor.getDoc().queryCommandValue(c);}catch(ex){}},queryValueFontSize:function(){var ed=this.editor,v=0,p;if(isOpera||isWebKit){if(p=ed.dom.getParent(ed.selection.getNode(),'FONT'))v=p.size;return v;}return this._queryVal('FontSize');},queryValueFontName:function(){var ed=this.editor,v=0,p;if(p=ed.dom.getParent(ed.selection.getNode(),'FONT'))v=p.face;if(!v)v=this._queryVal('FontName');return v;},mceJustify:function(c,v){var ed=this.editor,se=ed.selection,n=se.getNode(),nn=n.nodeName,bl,nb,dom=ed.dom,rm;if(ed.settings.inline_styles&&this.queryStateJustify(c,v))rm=1;bl=dom.getParent(n,ed.dom.isBlock);if(nn=='IMG'){if(v=='full')return;if(rm){if(v=='center')dom.setStyle(bl||n.parentNode,'textAlign','');dom.setStyle(n,'float','');this.mceRepaint();return;}if(v=='center'){if(bl&&/^(TD|TH)$/.test(bl.nodeName))bl=0;if(!bl||bl.childNodes.length>1){nb=dom.create('p');nb.appendChild(n.cloneNode(false));if(bl)dom.insertAfter(nb,bl);else dom.insertAfter(nb,n);dom.remove(n);n=nb.firstChild;bl=nb;}dom.setStyle(bl,'textAlign',v);dom.setStyle(n,'float','');}else{dom.setStyle(n,'float',v);dom.setStyle(bl||n.parentNode,'textAlign','');}this.mceRepaint();return;}if(ed.settings.inline_styles&&ed.settings.forced_root_block){if(rm)v='';each(this._getSelectedBlocks(dom.getParent(se.getStart(),dom.isBlock),dom.getParent(se.getEnd(),dom.isBlock)),function(e){dom.setAttrib(e,'align','');dom.setStyle(e,'textAlign',v=='full'?'justify':v);});return;}else if(!rm)ed.getDoc().execCommand(c,false,null);if(ed.settings.inline_styles){if(rm){dom.getParent(ed.selection.getNode(),function(n){if(n.style&&n.style.textAlign)dom.setStyle(n,'textAlign','');});return;}each(dom.select('*'),function(n){var v=n.align;if(v){if(v=='full')v='justify';dom.setStyle(n,'textAlign',v);dom.setAttrib(n,'align','');}});}},mceSetCSSClass:function(u,v){this.mceSetStyleInfo(0,{command:'setattrib',name:'class',value:v});},getSelectedElement:function(){var t=this,ed=t.editor,dom=ed.dom,se=ed.selection,r=se.getRng(),r1,r2,sc,ec,so,eo,e,sp,ep,re;if(se.isCollapsed()||r.item)return se.getNode();re=ed.settings.merge_styles_invalid_parents;if(tinymce.is(re,'string'))re=new RegExp(re,'i');if(isIE){r1=r.duplicate();r1.collapse(true);sc=r1.parentElement();r2=r.duplicate();r2.collapse(false);ec=r2.parentElement();if(sc!=ec){r1.move('character',1);sc=r1.parentElement();}if(sc==ec){r1=r.duplicate();r1.moveToElementText(sc);if(r1.compareEndPoints('StartToStart',r)==0&&r1.compareEndPoints('EndToEnd',r)==0)return re&&re.test(sc.nodeName)?null:sc;}}else{function getParent(n){return dom.getParent(n,function(n){return n.nodeType==1;});};sc=r.startContainer;ec=r.endContainer;so=r.startOffset;eo=r.endOffset;if(!r.collapsed){if(sc==ec){if(so-eo<2){if(sc.hasChildNodes()){sp=sc.childNodes[so];return re&&re.test(sp.nodeName)?null:sp;}}}}if(sc.nodeType!=3||ec.nodeType!=3)return null;if(so==0){sp=getParent(sc);if(sp&&sp.firstChild!=sc)sp=null;}if(so==sc.nodeValue.length){e=sc.nextSibling;if(e&&e.nodeType==1)sp=sc.nextSibling;}if(eo==0){e=ec.previousSibling;if(e&&e.nodeType==1)ep=e;}if(eo==ec.nodeValue.length){ep=getParent(ec);if(ep&&ep.lastChild!=ec)ep=null;}if(sp==ep)return re&&sp&&re.test(sp.nodeName)?null:sp;}return null;},InsertHorizontalRule:function(){if(isGecko||isIE)this.editor.selection.setContent('<hr />');else this.editor.getDoc().execCommand('InsertHorizontalRule',false,'');},RemoveFormat:function(){var t=this,ed=t.editor,s=ed.selection,b;if(isWebKit)s.setContent(s.getContent({format:'raw'}).replace(/(<(span|b|i|strong|em|strike) [^>]+>|<(span|b|i|strong|em|strike)>|<\/(span|b|i|strong|em|strike)>|)/g,''),{format:'raw'});else ed.getDoc().execCommand('RemoveFormat',false,null);t.mceSetStyleInfo(0,{command:'removeformat'});ed.addVisual();},mceSetStyleInfo:function(u,v){var t=this,ed=t.editor,d=ed.getDoc(),dom=ed.dom,e,b,s=ed.selection,nn=v.wrapper||'span',b=s.getBookmark(),re;function set(n,e){if(n.nodeType==1){switch(v.command){case'setattrib':return dom.setAttrib(n,v.name,v.value);case'setstyle':return dom.setStyle(n,v.name,v.value);case'removeformat':return dom.setAttrib(n,'class','');}}};re=ed.settings.merge_styles_invalid_parents;if(tinymce.is(re,'string'))re=new RegExp(re,'i');if(e=t.getSelectedElement())set(e,1);else{d.execCommand('FontName',false,'__');each(isWebKit?dom.select('span'):dom.select('font'),function(n){var sp,e;if(dom.getAttrib(n,'face')=='__'||n.style.fontFamily==='__'){sp=dom.create(nn,{mce_new:'1'});set(sp);each(n.childNodes,function(n){sp.appendChild(n.cloneNode(true));});dom.replace(sp,n);}});}each(dom.select(nn).reverse(),function(n){var p=n.parentNode;if(!dom.getAttrib(n,'mce_new')){p=dom.getParent(n,function(n){return n.nodeType==1&&dom.getAttrib(n,'mce_new');});if(p)dom.remove(n,1);}});each(dom.select(nn).reverse(),function(n){var p=n.parentNode;if(!p||!dom.getAttrib(n,'mce_new'))return;if(p.nodeName==nn.toUpperCase()&&p.childNodes.length==1)return dom.remove(p,1);if(n.nodeType==1&&(!re||!re.test(p.nodeName))&&p.childNodes.length==1){set(p);dom.setAttrib(n,'class','');}});each(dom.select(nn).reverse(),function(n){if(dom.getAttrib(n,'mce_new')||(dom.getAttribs(n).length<=1&&n.className==='')){if(!dom.getAttrib(n,'class')&&!dom.getAttrib(n,'style'))return dom.remove(n,1);dom.setAttrib(n,'mce_new','');}});s.moveToBookmark(b);},queryStateJustify:function(c,v){var ed=this.editor,n=ed.selection.getNode(),dom=ed.dom;if(n&&n.nodeName=='IMG'){if(dom.getStyle(n,'float')==v)return 1;return n.parentNode.style.textAlign==v;}n=dom.getParent(ed.selection.getStart(),function(n){return n.nodeType==1&&n.style.textAlign;});if(v=='full')v='justify';if(ed.settings.inline_styles)return(n&&n.style.textAlign==v);return this._queryState(c);},HiliteColor:function(ui,val){var t=this,ed=t.editor,d=ed.getDoc();function set(s){if(!isGecko)return;try{d.execCommand("styleWithCSS",0,s);}catch(ex){d.execCommand("useCSS",0,!s);}};if(isGecko||isOpera){set(true);d.execCommand('hilitecolor',false,val);set(false);}else d.execCommand('BackColor',false,val);},Undo:function(){var ed=this.editor;if(ed.settings.custom_undo_redo){ed.undoManager.undo();ed.nodeChanged();}else ed.getDoc().execCommand('Undo',false,null);},Redo:function(){var ed=this.editor;if(ed.settings.custom_undo_redo){ed.undoManager.redo();ed.nodeChanged();}else ed.getDoc().execCommand('Redo',false,null);},FormatBlock:function(ui,val){var t=this,ed=t.editor,s=ed.selection,dom=ed.dom,bl,nb,b;function isBlock(n){return/^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(n.nodeName);};bl=dom.getParent(s.getNode(),function(n){return isBlock(n);});if(bl){if((isIE&&isBlock(bl.parentNode))||bl.nodeName=='DIV'){nb=ed.dom.create(val);each(dom.getAttribs(bl),function(v){dom.setAttrib(nb,v.nodeName,dom.getAttrib(bl,v.nodeName));});b=s.getBookmark();dom.replace(nb,bl,1);s.moveToBookmark(b);ed.nodeChanged();return;}}val=ed.settings.forced_root_block?(val||'<p>'):val;if(val.indexOf('<')==-1)val='<'+val+'>';if(tinymce.isGecko)val=val.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi,'$1');ed.getDoc().execCommand('FormatBlock',false,val);},mceCleanup:function(){var ed=this.editor,s=ed.selection,b=s.getBookmark();ed.setContent(ed.getContent());s.moveToBookmark(b);},mceRemoveNode:function(ui,val){var ed=this.editor,s=ed.selection,b,n=val||s.getNode();if(n==ed.getBody())return;b=s.getBookmark();ed.dom.remove(n,1);s.moveToBookmark(b);ed.nodeChanged();},mceSelectNodeDepth:function(ui,val){var ed=this.editor,s=ed.selection,c=0;ed.dom.getParent(s.getNode(),function(n){if(n.nodeType==1&&c++==val){s.select(n);ed.nodeChanged();return false;}},ed.getBody());},mceSelectNode:function(u,v){this.editor.selection.select(v);},mceInsertContent:function(ui,val){this.editor.selection.setContent(val);},mceInsertRawHTML:function(ui,val){var ed=this.editor;ed.selection.setContent('tiny_mce_marker');ed.setContent(ed.getContent().replace(/tiny_mce_marker/g,val));},mceRepaint:function(){var s,b,e=this.editor;if(tinymce.isGecko){try{s=e.selection;b=s.getBookmark(true);if(s.getSel())s.getSel().selectAllChildren(e.getBody());s.collapse(true);s.moveToBookmark(b);}catch(ex){}}},queryStateUnderline:function(){var ed=this.editor,n=ed.selection.getNode();if(n&&n.nodeName=='A')return false;return this._queryState('Underline');},queryStateOutdent:function(){var ed=this.editor,n;if(ed.settings.inline_styles){if((n=ed.dom.getParent(ed.selection.getStart(),ed.dom.isBlock))&&parseInt(n.style.paddingLeft)>0)return true;if((n=ed.dom.getParent(ed.selection.getEnd(),ed.dom.isBlock))&&parseInt(n.style.paddingLeft)>0)return true;}else return!!ed.dom.getParent(ed.selection.getNode(),'BLOCKQUOTE');return this.queryStateInsertUnorderedList()||this.queryStateInsertOrderedList();},queryStateInsertUnorderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),'UL');},queryStateInsertOrderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),'OL');},queryStatemceBlockQuote:function(){return!!this.editor.dom.getParent(this.editor.selection.getStart(),function(n){return n.nodeName==='BLOCKQUOTE';});},mceBlockQuote:function(){var t=this,ed=t.editor,s=ed.selection,dom=ed.dom,sb,eb,n,bm,bq,r,bq2,i,nl;function getBQ(e){return dom.getParent(e,function(n){return n.nodeName==='BLOCKQUOTE';});};sb=dom.getParent(s.getStart(),dom.isBlock);eb=dom.getParent(s.getEnd(),dom.isBlock);if(bq=getBQ(sb)){if(sb!=eb||sb.childNodes.length>1||(sb.childNodes.length==1&&sb.firstChild.nodeName!='BR'))bm=s.getBookmark();if(getBQ(eb)){bq2=bq.cloneNode(false);while(n=eb.nextSibling)bq2.appendChild(n.parentNode.removeChild(n));}if(bq2)dom.insertAfter(bq2,bq);nl=t._getSelectedBlocks(sb,eb);for(i=nl.length-1;i>=0;i--){dom.insertAfter(nl[i],bq);}if(/^\s*$/.test(bq.innerHTML))dom.remove(bq,1);if(bq2&&/^\s*$/.test(bq2.innerHTML))dom.remove(bq2,1);if(!bm){if(!isIE){r=ed.getDoc().createRange();r.setStart(sb,0);r.setEnd(sb,0);s.setRng(r);}else{s.select(sb);s.collapse(0);if(dom.getParent(s.getStart(),dom.isBlock)!=sb){r=s.getRng();r.move('character',-1);r.select();}}}else t.editor.selection.moveToBookmark(bm);return;}if(isIE&&!sb&&!eb){t.editor.getDoc().execCommand('Indent');n=getBQ(s.getNode());n.style.margin=n.dir='';return;}if(!sb||!eb)return;if(sb!=eb||sb.childNodes.length>1||(sb.childNodes.length==1&&sb.firstChild.nodeName!='BR'))bm=s.getBookmark();each(t._getSelectedBlocks(getBQ(s.getStart()),getBQ(s.getEnd())),function(e){if(e.nodeName=='BLOCKQUOTE'&&!bq){bq=e;return;}if(!bq){bq=dom.create('blockquote');e.parentNode.insertBefore(bq,e);}if(e.nodeName=='BLOCKQUOTE'&&bq){n=e.firstChild;while(n){bq.appendChild(n.cloneNode(true));n=n.nextSibling;}dom.remove(e);return;}bq.appendChild(dom.remove(e));});if(!bm){if(!isIE){r=ed.getDoc().createRange();r.setStart(sb,0);r.setEnd(sb,0);s.setRng(r);}else{s.select(sb);s.collapse(1);}}else s.moveToBookmark(bm);},_getSelectedBlocks:function(st,en){var ed=this.editor,dom=ed.dom,s=ed.selection,sb,eb,n,bl=[];sb=dom.getParent(st||s.getStart(),dom.isBlock);eb=dom.getParent(en||s.getEnd(),dom.isBlock);if(sb)bl.push(sb);if(sb&&eb&&sb!=eb){n=sb;while((n=n.nextSibling)&&n!=eb){if(dom.isBlock(n))bl.push(n);}}if(eb&&sb!=eb)bl.push(eb);return bl;}});})();tinymce.create('tinymce.UndoManager',{index:0,data:null,typing:0,UndoManager:function(ed){var t=this,Dispatcher=tinymce.util.Dispatcher;t.editor=ed;t.data=[];t.onAdd=new Dispatcher(this);t.onUndo=new Dispatcher(this);t.onRedo=new Dispatcher(this);},add:function(l){var t=this,i,ed=t.editor,b,s=ed.settings,la;l=l||{};l.content=l.content||ed.getContent({format:'raw',no_events:1});l.content=l.content.replace(/^\s*|\s*$/g,'');la=t.data[t.index>0&&(t.index==0||t.index==t.data.length)?t.index-1:t.index];if(!l.initial&&la&&l.content==la.content)return null;if(s.custom_undo_redo_levels){if(t.data.length>s.custom_undo_redo_levels){for(i=0;i<t.data.length-1;i++)t.data[i]=t.data[i+1];t.data.length--;t.index=t.data.length;}}if(s.custom_undo_redo_restore_selection&&!l.initial)l.bookmark=b=l.bookmark||ed.selection.getBookmark();if(t.index<t.data.length)t.index++;if(t.data.length===0&&!l.initial)return null;t.data.length=t.index+1;t.data[t.index++]=l;if(l.initial)t.index=0;if(t.data.length==2&&t.data[0].initial)t.data[0].bookmark=b;t.onAdd.dispatch(t,l);ed.isNotDirty=0;return l;},undo:function(){var t=this,ed=t.editor,l=l,i;if(t.typing){t.add();t.typing=0;}if(t.index>0){if(t.index==t.data.length&&t.index>1){i=t.index;t.typing=0;if(!t.add())t.index=i;--t.index;}l=t.data[--t.index];ed.setContent(l.content,{format:'raw'});ed.selection.moveToBookmark(l.bookmark);t.onUndo.dispatch(t,l);}return l;},redo:function(){var t=this,ed=t.editor,l=null;if(t.index<t.data.length-1){l=t.data[++t.index];ed.setContent(l.content,{format:'raw'});ed.selection.moveToBookmark(l.bookmark);t.onRedo.dispatch(t,l);}return l;},clear:function(){var t=this;t.data=[];t.index=0;t.typing=0;t.add({initial:true});},hasUndo:function(){return this.index!=0||this.typing;},hasRedo:function(){return this.index<this.data.length-1;}});(function(){var Event,isIE,isGecko,isOpera,each,extend;Event=tinymce.dom.Event;isIE=tinymce.isIE;isGecko=tinymce.isGecko;isOpera=tinymce.isOpera;each=tinymce.each;extend=tinymce.extend;tinymce.create('tinymce.ForceBlocks',{ForceBlocks:function(ed){var t=this,s=ed.settings,elm;t.editor=ed;t.dom=ed.dom;elm=(s.forced_root_block||'p').toLowerCase();s.element=elm.toUpperCase();ed.onPreInit.add(t.setup,t);t.reOpera=new RegExp('(\\u00a0| | )<\/'+elm+'>','gi');t.rePadd=new RegExp('<p( )([^>]+)><\\\/p>|<p( )([^>]+)\\\/>|<p( )([^>]+)>\\s+<\\\/p>|<p><\\\/p>|<p\\\/>|<p>\\s+<\\\/p>'.replace(/p/g,elm),'gi');t.reNbsp2BR1=new RegExp('<p( )([^>]+)>[\\s\\u00a0]+<\\\/p>|<p>[\\s\\u00a0]+<\\\/p>'.replace(/p/g,elm),'gi');t.reNbsp2BR2=new RegExp('<p( )([^>]+)>( | )<\\\/p>|<p>( | )<\\\/p>'.replace(/p/g,elm),'gi');t.reBR2Nbsp=new RegExp('<p( )([^>]+)>\\s*<br \\\/>\\s*<\\\/p>|<p>\\s*<br \\\/>\\s*<\\\/p>'.replace(/p/g,elm),'gi');t.reTrailBr=new RegExp('\\s*<br \\/>\\s*<\\\/p>'.replace(/p/g,elm),'gi');function padd(ed,o){if(isOpera)o.content=o.content.replace(t.reOpera,'</'+elm+'>');o.content=o.content.replace(t.rePadd,'<'+elm+'$1$2$3$4$5$6>\u00a0</'+elm+'>');if(!isIE&&!isOpera&&o.set){o.content=o.content.replace(t.reNbsp2BR1,'<'+elm+'$1$2><br /></'+elm+'>');o.content=o.content.replace(t.reNbsp2BR2,'<'+elm+'$1$2><br /></'+elm+'>');}else{o.content=o.content.replace(t.reBR2Nbsp,'<'+elm+'$1$2>\u00a0</'+elm+'>');o.content=o.content.replace(t.reTrailBr,'</'+elm+'>');}};ed.onBeforeSetContent.add(padd);ed.onPostProcess.add(padd);if(s.forced_root_block){ed.onInit.add(t.forceRoots,t);ed.onSetContent.add(t.forceRoots,t);ed.onBeforeGetContent.add(t.forceRoots,t);}},setup:function(){var t=this,ed=t.editor,s=ed.settings;if(s.forced_root_block){ed.onKeyUp.add(t.forceRoots,t);ed.onPreProcess.add(t.forceRoots,t);}if(s.force_br_newlines){if(isIE){ed.onKeyPress.add(function(ed,e){var n,s=ed.selection;if(e.keyCode==13&&s.getNode().nodeName!='LI'){s.setContent('<br id="__" /> ',{format:'raw'});n=ed.dom.get('__');n.removeAttribute('id');s.select(n);s.collapse();return Event.cancel(e);}});}return;}if(!isIE&&s.force_p_newlines){ed.onKeyPress.add(function(ed,e){if(e.keyCode==13&&!e.shiftKey){if(!t.insertPara(e))Event.cancel(e);}});if(isGecko){ed.onKeyDown.add(function(ed,e){if((e.keyCode==8||e.keyCode==46)&&!e.shiftKey)t.backspaceDelete(e,e.keyCode==8);});}}function ren(rn,na){var ne=ed.dom.create(na);each(rn.attributes,function(a){if(a.specified&&a.nodeValue)ne.setAttribute(a.nodeName.toLowerCase(),a.nodeValue);});each(rn.childNodes,function(n){ne.appendChild(n.cloneNode(true));});rn.parentNode.replaceChild(ne,rn);return ne;};if(isIE&&s.element!='P'){ed.onKeyPress.add(function(ed,e){t.lastElm=ed.selection.getNode().nodeName;});ed.onKeyUp.add(function(ed,e){var bl,sel=ed.selection,n=sel.getNode(),b=ed.getBody();if(b.childNodes.length===1&&n.nodeName=='P'){n=ren(n,s.element);sel.select(n);sel.collapse();ed.nodeChanged();}else if(e.keyCode==13&&!e.shiftKey&&t.lastElm!='P'){bl=ed.dom.getParent(n,'P');if(bl){ren(bl,s.element);ed.nodeChanged();}}});}},find:function(n,t,s){var ed=this.editor,w=ed.getDoc().createTreeWalker(n,4,null,false),c=-1;while(n=w.nextNode()){c++;if(t==0&&n==s)return c;if(t==1&&c==s)return n;}return-1;},forceRoots:function(ed,e){var t=this,ed=t.editor,b=ed.getBody(),d=ed.getDoc(),se=ed.selection,s=se.getSel(),r=se.getRng(),si=-2,ei,so,eo,tr,c=-0xFFFFFF;var nx,bl,bp,sp,le,nl=b.childNodes,i;if(e&&e.keyCode==13)return true;for(i=nl.length-1;i>=0;i--){nx=nl[i];if(nx.nodeType==3||(!t.dom.isBlock(nx)&&nx.nodeType!=8)){if(!bl){if(nx.nodeType!=3||/[^\s]/g.test(nx.nodeValue)){if(si==-2&&r){if(!isIE){if(ed.dom.getParent(r.startContainer,function(e){return e===b;})){so=r.startOffset;eo=r.endOffset;si=t.find(b,0,r.startContainer);ei=t.find(b,0,r.endContainer);}}else{tr=d.body.createTextRange();tr.moveToElementText(b);tr.collapse(1);bp=tr.move('character',c)*-1;tr=r.duplicate();tr.collapse(1);sp=tr.move('character',c)*-1;tr=r.duplicate();tr.collapse(0);le=(tr.move('character',c)*-1)-sp;si=sp-bp;ei=le;}}bl=ed.dom.create(ed.settings.forced_root_block);bl.appendChild(nx.cloneNode(1));nx.parentNode.replaceChild(bl,nx);}}else{if(bl.hasChildNodes())bl.insertBefore(nx,bl.firstChild);else bl.appendChild(nx);}}else bl=null;}if(si!=-2){if(!isIE){bl=b.getElementsByTagName(ed.settings.element)[0];r=d.createRange();if(si!=-1)r.setStart(t.find(b,1,si),so);else r.setStart(bl,0);if(ei!=-1)r.setEnd(t.find(b,1,ei),eo);else r.setEnd(bl,0);if(s){s.removeAllRanges();s.addRange(r);}}else{try{r=s.createRange();r.moveToElementText(b);r.collapse(1);r.moveStart('character',si);r.moveEnd('character',ei);r.select();}catch(ex){}}}},getParentBlock:function(n){var d=this.dom;return d.getParent(n,d.isBlock);},insertPara:function(e){var t=this,ed=t.editor,dom=ed.dom,d=ed.getDoc(),se=ed.settings,s=ed.selection.getSel(),r=s.getRangeAt(0),b=d.body;var rb,ra,dir,sn,so,en,eo,sb,eb,bn,bef,aft,sc,ec,n,vp=dom.getViewPort(ed.getWin()),y,ch;function isEmpty(n){n=n.innerHTML;n=n.replace(/<(img|hr|table)/gi,'-');n=n.replace(/<[^>]+>/g,'');return n.replace(/[ \t\r\n]+/g,'')=='';};rb=d.createRange();rb.setStart(s.anchorNode,s.anchorOffset);rb.collapse(true);ra=d.createRange();ra.setStart(s.focusNode,s.focusOffset);ra.collapse(true);dir=rb.compareBoundaryPoints(rb.START_TO_END,ra)<0;sn=dir?s.anchorNode:s.focusNode;so=dir?s.anchorOffset:s.focusOffset;en=dir?s.focusNode:s.anchorNode;eo=dir?s.focusOffset:s.anchorOffset;if(sn===en&&/^(TD|TH)$/.test(sn.nodeName)){dom.remove(sn.firstChild);ed.dom.add(sn,se.element,null,'<br />');aft=ed.dom.add(sn,se.element,null,'<br />');r=d.createRange();r.selectNodeContents(aft);r.collapse(1);ed.selection.setRng(r);return false;}if(sn==b&&en==b&&b.firstChild&&ed.dom.isBlock(b.firstChild)){sn=en=sn.firstChild;so=eo=0;rb=d.createRange();rb.setStart(sn,0);ra=d.createRange();ra.setStart(en,0);}sn=sn.nodeName=="HTML"?d.body:sn;sn=sn.nodeName=="BODY"?sn.firstChild:sn;en=en.nodeName=="HTML"?d.body:en;en=en.nodeName=="BODY"?en.firstChild:en;sb=t.getParentBlock(sn);eb=t.getParentBlock(en);bn=sb?sb.nodeName:se.element;if(t.dom.getParent(sb,function(n){return/OL|UL|PRE/.test(n.nodeName);}))return true;if(sb&&(sb.nodeName=='CAPTION'||/absolute|relative|static/gi.test(sb.style.position))){bn=se.element;sb=null;}if(eb&&(eb.nodeName=='CAPTION'||/absolute|relative|static/gi.test(eb.style.position))){bn=se.element;eb=null;}if(/(TD|TABLE|TH|CAPTION)/.test(bn)||(sb&&bn=="DIV"&&/left|right/gi.test(sb.style.cssFloat))){bn=se.element;sb=eb=null;}bef=(sb&&sb.nodeName==bn)?sb.cloneNode(0):ed.dom.create(bn);aft=(eb&&eb.nodeName==bn)?eb.cloneNode(0):ed.dom.create(bn);aft.removeAttribute('id');if(/^(H[1-6])$/.test(bn)&&sn.nodeValue&&so==sn.nodeValue.length)aft=ed.dom.create(se.element);n=sc=sn;do{if(n==b||n.nodeType==9||t.dom.isBlock(n)||/(TD|TABLE|TH|CAPTION)/.test(n.nodeName))break;sc=n;}while((n=n.previousSibling?n.previousSibling:n.parentNode));n=ec=en;do{if(n==b||n.nodeType==9||t.dom.isBlock(n)||/(TD|TABLE|TH|CAPTION)/.test(n.nodeName))break;ec=n;}while((n=n.nextSibling?n.nextSibling:n.parentNode));if(sc.nodeName==bn)rb.setStart(sc,0);else rb.setStartBefore(sc);rb.setEnd(sn,so);bef.appendChild(rb.cloneContents()||d.createTextNode(''));try{ra.setEndAfter(ec);}catch(ex){}ra.setStart(en,eo);aft.appendChild(ra.cloneContents()||d.createTextNode(''));r=d.createRange();if(!sc.previousSibling&&sc.parentNode.nodeName==bn){r.setStartBefore(sc.parentNode);}else{if(rb.startContainer.nodeName==bn&&rb.startOffset==0)r.setStartBefore(rb.startContainer);else r.setStart(rb.startContainer,rb.startOffset);}if(!ec.nextSibling&&ec.parentNode.nodeName==bn)r.setEndAfter(ec.parentNode);else r.setEnd(ra.endContainer,ra.endOffset);r.deleteContents();if(isOpera)ed.getWin().scrollTo(0,vp.y);if(bef.firstChild&&bef.firstChild.nodeName==bn)bef.innerHTML=bef.firstChild.innerHTML;if(aft.firstChild&&aft.firstChild.nodeName==bn)aft.innerHTML=aft.firstChild.innerHTML;if(isEmpty(bef))bef.innerHTML='<br />';if(isEmpty(aft))aft.innerHTML=isOpera?' ':'<br />';if(isOpera&&parseFloat(opera.version())<9.5){r.insertNode(bef);r.insertNode(aft);}else{r.insertNode(aft);r.insertNode(bef);}aft.normalize();bef.normalize();function first(n){return d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false).nextNode()||n;};r=d.createRange();r.selectNodeContents(isGecko?first(aft):aft);r.collapse(1);s.removeAllRanges();s.addRange(r);y=ed.dom.getPos(aft).y;ch=aft.clientHeight;if(y<vp.y||y+ch>vp.y+vp.h){ed.getWin().scrollTo(0,y<vp.y?y:y-vp.h+ch);}return false;},backspaceDelete:function(e,bs){var t=this,ed=t.editor,b=ed.getBody(),n,se=ed.selection,r=se.getRng(),sc=r.startContainer,n,w,tn;if(sc&&ed.dom.isBlock(sc)&&!/^(TD|TH)$/.test(sc.nodeName)&&bs){if(sc.childNodes.length==0||(sc.childNodes.length==1&&sc.firstChild.nodeName=='BR')){n=sc;while((n=n.previousSibling)&&!ed.dom.isBlock(n));if(n){if(sc!=b.firstChild){w=ed.dom.doc.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false);while(tn=w.nextNode())n=tn;r=ed.getDoc().createRange();r.setStart(n,n.nodeValue?n.nodeValue.length:0);r.setEnd(n,n.nodeValue?n.nodeValue.length:0);se.setRng(r);ed.dom.remove(sc);}return Event.cancel(e);}}}function handler(e){e=e.target;if(e&&e.parentNode&&e.nodeName=='BR'&&(n=t.getParentBlock(e))){Event.remove(b,'DOMNodeInserted',handler);if(e.previousSibling||e.nextSibling)ed.dom.remove(e);}};Event._add(b,'DOMNodeInserted',handler);window.setTimeout(function(){Event._remove(b,'DOMNodeInserted',handler);},1);}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,extend=tinymce.extend;tinymce.create('tinymce.ControlManager',{ControlManager:function(ed,s){var t=this,i;s=s||{};t.editor=ed;t.controls={};t.onAdd=new tinymce.util.Dispatcher(t);t.onPostRender=new tinymce.util.Dispatcher(t);t.prefix=s.prefix||ed.id+'_';t._cls={};t.onPostRender.add(function(){each(t.controls,function(c){c.postRender();});});},get:function(id){return this.controls[this.prefix+id]||this.controls[id];},setActive:function(id,s){var c=null;if(c=this.get(id))c.setActive(s);return c;},setDisabled:function(id,s){var c=null;if(c=this.get(id))c.setDisabled(s);return c;},add:function(c){var t=this;if(c){t.controls[c.id]=c;t.onAdd.dispatch(c,t);}return c;},createControl:function(n){var c,t=this,ed=t.editor;each(ed.plugins,function(p){if(p.createControl){c=p.createControl(n,t);if(c)return false;}});switch(n){case"|":case"separator":return t.createSeparator();}if(!c&&ed.buttons&&(c=ed.buttons[n]))return t.createButton(n,c);return t.add(c);},createDropMenu:function(id,s,cc){var t=this,ed=t.editor,c,bm,v,cls;s=extend({'class':'mceDropDown',constrain:ed.settings.constrain_menus},s);s['class']=s['class']+' '+ed.getParam('skin')+'Skin';if(v=ed.getParam('skin_variant'))s['class']+=' '+ed.getParam('skin')+'Skin'+v.substring(0,1).toUpperCase()+v.substring(1);id=t.prefix+id;cls=cc||t._cls.dropmenu||tinymce.ui.DropMenu;c=t.controls[id]=new cls(id,s);c.onAddItem.add(function(c,o){var s=o.settings;s.title=ed.getLang(s.title,s.title);if(!s.onclick){s.onclick=function(v){ed.execCommand(s.cmd,s.ui||false,s.value);};}});ed.onRemove.add(function(){c.destroy();});if(tinymce.isIE){c.onShowMenu.add(function(){bm=ed.selection.getBookmark(1);});c.onHideMenu.add(function(){if(bm)ed.selection.moveToBookmark(bm);});}return t.add(c);},createListBox:function(id,s,cc){var t=this,ed=t.editor,cmd,c,cls;if(t.get(id))return null;s.title=ed.translate(s.title);s.scope=s.scope||ed;if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}s=extend({title:s.title,'class':'mce_'+id,scope:s.scope,control_manager:t},s);id=t.prefix+id;if(ed.settings.use_native_selects)c=new tinymce.ui.NativeListBox(id,s);else{cls=cc||t._cls.listbox||tinymce.ui.ListBox;c=new cls(id,s);}t.controls[id]=c;if(tinymce.isWebKit){c.onPostRender.add(function(c,n){Event.add(n,'mousedown',function(){ed.bookmark=ed.selection.getBookmark('simple');});Event.add(n,'focus',function(){ed.selection.moveToBookmark(ed.bookmark);ed.bookmark=null;});});}if(c.hideMenu)ed.onMouseDown.add(c.hideMenu,c);return t.add(c);},createButton:function(id,s,cc){var t=this,ed=t.editor,o,c,cls;if(t.get(id))return null;s.title=ed.translate(s.title);s.label=ed.translate(s.label);s.scope=s.scope||ed;if(!s.onclick&&!s.menu_button){s.onclick=function(){ed.execCommand(s.cmd,s.ui||false,s.value);};}s=extend({title:s.title,'class':'mce_'+id,unavailable_prefix:ed.getLang('unavailable',''),scope:s.scope,control_manager:t},s);id=t.prefix+id;if(s.menu_button){cls=cc||t._cls.menubutton||tinymce.ui.MenuButton;c=new cls(id,s);ed.onMouseDown.add(c.hideMenu,c);}else{cls=t._cls.button||tinymce.ui.Button;c=new cls(id,s);}return t.add(c);},createMenuButton:function(id,s){s=s||{};s.menu_button=1;return this.createButton(id,s);},createSplitButton:function(id,s,cc){var t=this,ed=t.editor,cmd,c,cls;if(t.get(id))return null;s.title=ed.translate(s.title);s.scope=s.scope||ed;if(!s.onclick){s.onclick=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}s=extend({title:s.title,'class':'mce_'+id,scope:s.scope,control_manager:t},s);id=t.prefix+id;cls=cc||t._cls.splitbutton||tinymce.ui.SplitButton;c=t.add(new cls(id,s));ed.onMouseDown.add(c.hideMenu,c);return c;},createColorSplitButton:function(id,s,cc){var t=this,ed=t.editor,cmd,c,cls,bm;if(t.get(id))return null;s.title=ed.translate(s.title);s.scope=s.scope||ed;if(!s.onclick){s.onclick=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}s=extend({title:s.title,'class':'mce_'+id,'menu_class':ed.getParam('skin')+'Skin',scope:s.scope,more_colors_title:ed.getLang('more_colors')},s);id=t.prefix+id;cls=cc||t._cls.colorsplitbutton||tinymce.ui.ColorSplitButton;c=new cls(id,s);ed.onMouseDown.add(c.hideMenu,c);ed.onRemove.add(function(){c.destroy();});if(tinymce.isIE){c.onShowMenu.add(function(){bm=ed.selection.getBookmark(1);});c.onHideMenu.add(function(){if(bm){ed.selection.moveToBookmark(bm);bm=0;}});}return t.add(c);},createToolbar:function(id,s,cc){var c,t=this,cls;id=t.prefix+id;cls=cc||t._cls.toolbar||tinymce.ui.Toolbar;c=new cls(id,s);if(t.get(id))return null;return t.add(c);},createSeparator:function(cc){var cls=cc||this._cls.separator||tinymce.ui.Separator;return new cls();},setControlType:function(n,c){return this._cls[n.toLowerCase()]=c;},destroy:function(){each(this.controls,function(c){c.destroy();});this.controls=null;}});})();(function(){var Dispatcher=tinymce.util.Dispatcher,each=tinymce.each,isIE=tinymce.isIE,isOpera=tinymce.isOpera;tinymce.create('tinymce.WindowManager',{WindowManager:function(ed){var t=this;t.editor=ed;t.onOpen=new Dispatcher(t);t.onClose=new Dispatcher(t);t.params={};t.features={};},open:function(s,p){var t=this,f='',x,y,mo=t.editor.settings.dialog_type=='modal',w,sw,sh,vp=tinymce.DOM.getViewPort(),u;s=s||{};p=p||{};sw=isOpera?vp.w:screen.width;sh=isOpera?vp.h:screen.height;s.name=s.name||'mc_'+new Date().getTime();s.width=parseInt(s.width||320);s.height=parseInt(s.height||240);s.resizable=true;s.left=s.left||parseInt(sw/ 2.0) - (s.width /2.0);s.top=s.top||parseInt(sh/ 2.0) - (s.height /2.0);p.inline=false;p.mce_width=s.width;p.mce_height=s.height;p.mce_auto_focus=s.auto_focus;if(mo){if(isIE){s.center=true;s.help=false;s.dialogWidth=s.width+'px';s.dialogHeight=s.height+'px';s.scroll=s.scrollbars||false;}}each(s,function(v,k){if(tinymce.is(v,'boolean'))v=v?'yes':'no';if(!/^(name|url)$/.test(k)){if(isIE&&mo)f+=(f?';':'')+k+':'+v;else f+=(f?',':'')+k+'='+v;}});t.features=s;t.params=p;t.onOpen.dispatch(t,s,p);u=s.url||s.file;if(tinymce.relaxedDomain)u+=(u.indexOf('?')==-1?'?':'&')+'mce_rdomain='+tinymce.relaxedDomain;u=tinymce._addVer(u);try{if(isIE&&mo){w=1;window.showModalDialog(u,window,f);}else w=window.open(u,s.name,f);}catch(ex){}if(!w)alert(t.editor.getLang('popup_blocked'));},close:function(w){w.close();this.onClose.dispatch(this);},createInstance:function(cl,a,b,c,d,e){var f=tinymce.resolve(cl);return new f(a,b,c,d,e);},confirm:function(t,cb,s){cb.call(s||this,confirm(this._decode(this.editor.getLang(t,t))));},alert:function(tx,cb,s){var t=this;alert(t._decode(t.editor.getLang(tx,tx)));if(cb)cb.call(s||t);},_decode:function(s){return tinymce.DOM.decode(s).replace(/\\n/g,'\n');}});}());����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/tinymce/plugins/��������������������������������������������������������������0000755�0001066�0001066�00000000000�11051167752�015206� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/tinymce/plugins/safari/�������������������������������������������������������0000755�0001066�0001066�00000000000�11051167752�016453� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/tinymce/plugins/safari/editor_plugin.js���������������������������������������0000644�0001066�0001066�00000016716�11031210647�021656� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(function(){var Event=tinymce.dom.Event,grep=tinymce.grep,each=tinymce.each,inArray=tinymce.inArray,isOldWebKit=tinymce.isOldWebKit;tinymce.create('tinymce.plugins.Safari',{init:function(ed){var t=this,dom;if(!tinymce.isWebKit)return;t.editor=ed;t.webKitFontSizes=['x-small','small','medium','large','x-large','xx-large','-webkit-xxx-large'];t.namedFontSizes=['xx-small','x-small','small','medium','large','x-large','xx-large'];ed.addCommand('CreateLink',function(u,v){var n=ed.selection.getNode(),dom=ed.dom,a;if(n&&(/^(left|right)$/i.test(dom.getStyle(n,'float',1))||/^(left|right)$/i.test(dom.getAttrib(n,'align')))){a=dom.create('a',{href:v},n.cloneNode());n.parentNode.replaceChild(a,n);ed.selection.select(a);}else ed.getDoc().execCommand("CreateLink",false,v);});ed.onPaste.add(function(ed,e){function removeStyles(e){e=e.target;if(e.nodeType==1){e.style.cssText='';each(ed.dom.select('*',e),function(e){e.style.cssText='';});}};Event.add(ed.getDoc(),'DOMNodeInserted',removeStyles);window.setTimeout(function(){Event.remove(ed.getDoc(),'DOMNodeInserted',removeStyles);},0);});ed.onKeyUp.add(function(ed,e){var h,b;if(e.keyCode==46||e.keyCode==8){b=ed.getBody();h=b.innerHTML;if(b.childNodes.length==1&&!/<(img|hr)/.test(h)&&tinymce.trim(h.replace(/<[^>]+>/g,'')).length==0)ed.setContent('',{format:'raw'});}});ed.addCommand('FormatBlock',function(u,v){var dom=ed.dom,e=dom.getParent(ed.selection.getNode(),dom.isBlock);if(e)dom.replace(dom.create(v),e,1);else ed.getDoc().execCommand("FormatBlock",false,v);});ed.addCommand('mceInsertContent',function(u,v){ed.getDoc().execCommand("InsertText",false,'mce_marker');ed.getBody().innerHTML=ed.getBody().innerHTML.replace(/mce_marker/g,v+'<span id="_mce_tmp">XX</span>');ed.selection.select(ed.dom.get('_mce_tmp'));ed.getDoc().execCommand("Delete",false,' ');});ed.onKeyPress.add(function(ed,e){if(e.keyCode==13&&(e.shiftKey||ed.settings.force_br_newlines&&ed.selection.getNode().nodeName!='LI')){t._insertBR(ed);Event.cancel(e);}});ed.addQueryValueHandler('FontSize',function(u,v){var e,v;if((e=ed.dom.getParent(ed.selection.getStart(),'span'))&&(v=e.style.fontSize))return tinymce.inArray(t.namedFontSizes,v)+1;if((e=ed.dom.getParent(ed.selection.getEnd(),'span'))&&(v=e.style.fontSize))return tinymce.inArray(t.namedFontSizes,v)+1;return ed.getDoc().queryCommandValue('FontSize');});ed.addQueryValueHandler('FontName',function(u,v){var e,v;if((e=ed.dom.getParent(ed.selection.getStart(),'span'))&&(v=e.style.fontFamily))return v.replace(/, /g,',');if((e=ed.dom.getParent(ed.selection.getEnd(),'span'))&&(v=e.style.fontFamily))return v.replace(/, /g,',');return ed.getDoc().queryCommandValue('FontName');});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName=='IMG'){t.selElm=e;ed.selection.select(e);}else t.selElm=null;});ed.onInit.add(function(){t._fixWebKitSpans();if(isOldWebKit)t._patchSafari2x(ed);});ed.onSetContent.add(function(){dom=ed.dom;each(['strong','b','em','u','strike','sub','sup','a'],function(v){each(grep(dom.select(v)).reverse(),function(n){var nn=n.nodeName.toLowerCase(),st;if(nn=='a'){if(n.name)dom.replace(dom.create('img',{mce_name:'a',name:n.name,'class':'mceItemAnchor'}),n);return;}switch(nn){case'b':case'strong':if(nn=='b')nn='strong';st='font-weight: bold;';break;case'em':st='font-style: italic;';break;case'u':st='text-decoration: underline;';break;case'sub':st='vertical-align: sub;';break;case'sup':st='vertical-align: super;';break;case'strike':st='text-decoration: line-through;';break;}dom.replace(dom.create('span',{mce_name:nn,style:st,'class':'Apple-style-span'}),n,1);});});});ed.onPreProcess.add(function(ed,o){dom=ed.dom;each(grep(o.node.getElementsByTagName('span')).reverse(),function(n){var v,bg;if(o.get){if(dom.hasClass(n,'Apple-style-span')){bg=n.style.backgroundColor;switch(dom.getAttrib(n,'mce_name')){case'font':if(!ed.settings.convert_fonts_to_spans)dom.setAttrib(n,'style','');break;case'strong':case'em':case'sub':case'sup':dom.setAttrib(n,'style','');break;case'strike':case'u':if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');else dom.setAttrib(n,'mce_name','');break;default:if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');}if(bg)n.style.backgroundColor=bg;}}if(dom.hasClass(n,'mceItemRemoved'))dom.remove(n,1);});});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/<br \/><\/(h[1-6]|div|p|address|pre)>/g,'</$1>');o.content=o.content.replace(/ id=\"undefined\"/g,'');});},getInfo:function(){return{longname:'Safari compatibility',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_fixWebKitSpans:function(){var t=this,ed=t.editor;if(!isOldWebKit){Event.add(ed.getDoc(),'DOMNodeInserted',function(e){e=e.target;if(e&&e.nodeType==1)t._fixAppleSpan(e);});}else{ed.onExecCommand.add(function(){each(ed.dom.select('span'),function(n){t._fixAppleSpan(n);});ed.nodeChanged();});}},_fixAppleSpan:function(e){var ed=this.editor,dom=ed.dom,fz=this.webKitFontSizes,fzn=this.namedFontSizes,s=ed.settings,st,p;if(dom.getAttrib(e,'mce_fixed'))return;if(e.nodeName=='SPAN'&&e.className=='Apple-style-span'){st=e.style;if(!s.convert_fonts_to_spans){if(st.fontSize){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'size',inArray(fz,st.fontSize)+1);}if(st.fontFamily){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'face',st.fontFamily);}if(st.color){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'color',dom.toHex(st.color));}if(st.backgroundColor){dom.setAttrib(e,'mce_name','font');dom.setStyle(e,'background-color',st.backgroundColor);}}else{if(st.fontSize)dom.setStyle(e,'fontSize',fzn[inArray(fz,st.fontSize)]);}if(st.fontWeight=='bold')dom.setAttrib(e,'mce_name','strong');if(st.fontStyle=='italic')dom.setAttrib(e,'mce_name','em');if(st.textDecoration=='underline')dom.setAttrib(e,'mce_name','u');if(st.textDecoration=='line-through')dom.setAttrib(e,'mce_name','strike');if(st.verticalAlign=='super')dom.setAttrib(e,'mce_name','sup');if(st.verticalAlign=='sub')dom.setAttrib(e,'mce_name','sub');dom.setAttrib(e,'mce_fixed','1');}},_patchSafari2x:function(ed){var t=this,setContent,getNode,dom=ed.dom,lr;if(ed.windowManager.onBeforeOpen){ed.windowManager.onBeforeOpen.add(function(){r=ed.selection.getRng();});}ed.selection.select=function(n){this.getSel().setBaseAndExtent(n,0,n,1);};getNode=ed.selection.getNode;ed.selection.getNode=function(){return t.selElm||getNode.call(this);};ed.selection.getRng=function(){var t=this,s=t.getSel(),d=ed.getDoc(),r,rb,ra,di;if(s.anchorNode){r=d.createRange();try{rb=d.createRange();rb.setStart(s.anchorNode,s.anchorOffset);rb.collapse(1);ra=d.createRange();ra.setStart(s.focusNode,s.focusOffset);ra.collapse(1);di=rb.compareBoundaryPoints(rb.START_TO_END,ra)<0;r.setStart(di?s.anchorNode:s.focusNode,di?s.anchorOffset:s.focusOffset);r.setEnd(di?s.focusNode:s.anchorNode,di?s.focusOffset:s.anchorOffset);lr=r;}catch(ex){}}return r||lr;};setContent=ed.selection.setContent;ed.selection.setContent=function(h,s){var r=this.getRng(),b;try{setContent.call(this,h,s);}catch(ex){b=dom.create('body');b.innerHTML=h;each(b.childNodes,function(n){r.insertNode(n.cloneNode(true));});}};},_insertBR:function(ed){var dom=ed.dom,s=ed.selection,r=s.getRng(),br;r.insertNode(br=dom.create('br'));r.setStartAfter(br);r.setEndAfter(br);s.setRng(r);if(s.getSel().focusNode==br.previousSibling){s.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'),br));s.collapse(1);}ed.getWin().scrollTo(0,dom.getPos(s.getRng().startContainer).y);}});tinymce.PluginManager.add('safari',tinymce.plugins.Safari);})();��������������������������������������������������wp/dev/wp-includes/js/tinymce/plugins/safari/blank.htm����������������������������������������������0000644�0001066�0001066�00000000017�10743673705�020261� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!-- WebKit -->�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/tinymce/plugins/autosave/�����������������������������������������������������0000755�0001066�0001066�00000000000�11051167752�017035� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js�������������������������������������0000644�0001066�0001066�00000001331�10750407446�022237� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(function(){tinymce.create('tinymce.plugins.AutoSavePlugin',{init:function(ed,url){var t=this;t.editor=ed;window.onbeforeunload=tinymce.plugins.AutoSavePlugin._beforeUnloadHandler;},getInfo:function(){return{longname:'Auto save',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',version:tinymce.majorVersion+"."+tinymce.minorVersion};},'static':{_beforeUnloadHandler:function(){var msg;tinymce.each(tinyMCE.editors,function(ed){if(ed.getParam("fullscreen_is_enabled"))return;if(ed.isDirty()){msg=ed.getLang("autosave.unload_msg");return false;}});return msg;}}});tinymce.PluginManager.add('autosave',tinymce.plugins.AutoSavePlugin);})();�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/tinymce/plugins/autosave/readme.txt�������������������������������������������0000644�0001066�0001066�00000000075�10762616541�021040� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Check the TinyMCE documentation for details on this plugin. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/tinymce/plugins/media/��������������������������������������������������������0000755�0001066�0001066�00000000000�11051167751�016264� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������wp/dev/wp-includes/js/tinymce/plugins/media/media.htm�����������������������������������������������0000644�0001066�0001066�00000076623�11031210647�020062� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>{#media_dlg.title}

    {#media_dlg.general}
     
     
    x   
    {#media_dlg.preview}
    {#media_dlg.advanced}
     
    {#media_dlg.flash_options}
    {#media_dlg.flv_options}
    {#media_dlg.qt_options}
     
     
    {#media_dlg.wmp_options}
    {#media_dlg.rmp_options}
     
    {#media_dlg.shockwave_options}
    wp/dev/wp-includes/js/tinymce/plugins/media/img/0000755000106600010660000000000011051167751017040 5ustar wp/dev/wp-includes/js/tinymce/plugins/media/img/shockwave.gif0000644000106600010660000000060310743673705021530 0ustar GIF89a2-Ŝ՟lfwh|Ŝӽ;Ģ̵Yf$$33..77ll~~꟟!+,*H#!H:FI] i2ՠH:Ωkd:DE`:&i^E $#(G)o #& %F)#x$*#Go #&"H**#)#{**&*+)E!*!O*))CH)TN*A;wp/dev/wp-includes/js/tinymce/plugins/media/img/flv_player.swf0000644000106600010660000002662410743673705021746 0ustar CWSax| \S$pr/EO΀ ѐEUEzZj[jjjkov?xowfvvfvf`KsBj)@=%hjjJe 6( UH |F5PT! (5y$DxLB[ 4SH e>aJPBIB.&䫴>$)sIC=؇ޓ!g}o^ӣzT G)!;tQTPPƏ-Z>C=>A×迨֡ 幻GJ?쑱"Ӫھ{SVes¶ŋe^cKqy? 5~E^LhQD5޿ˬ<+O߅i8jοMN6,?D~#5d([T;nJ = DAqfy9 ^)jrp@/o ɰ&6ٸT+Tɠj؎A:;0)Yp<\<0B k*ۥO2FD G0cۥB_HXޕA!A$B,D`(it Z[J~ЬَW+ EH.,225S*H+*QZTi (_֠RBoư(EYԐZf0贤h07JQPBcե< dXQkU(L"J02JP΀M WҖ 22>>U0BS~ 4H]{>Coұ~PeH`P R0#,ẠP~O(ӱ¥X4'ҫ*%'vI)zbҨ |:6K>K'iU*" oPFQjЁ:S(eĚ_4egVm}3L+Yc@Q1`|e%^b{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ÿt96緝㤮>YY`ەR]^Qk_^w*tUmO q{ޥ?nzXz9s5p5c*8"p8b-XFGe sAVŚ}s-]Zw ֿtKtǠeuukJg-|KϽ { oJLslcw:(,oh=Od'O'ްU믟ͨ>#n;uvb0˫٩Q_1~1[fV#!T5~Y~]xڔ'φ|t蓛n虻}fV Nh$^_hg}ͱ7&]<)Go-Yjʸ#~#cW h?>gT;?z>om/ԍܔrxm 燷%hy[k|MgVnT%2ڧႺ=WMיV_?8Wr^|/jt*kv׆fhԜGʏv4vFh$_b$tt&3xk=  rX3!iAkQ4N ՁiA+|k% "! 1o/-W֋1\z2+VŁʙr8$-Ä`Wxr/;e[@GOS־~=ۓ{4z9,]lPrYl7y}n a+Uf:LW2dAHΤHOwP.ш"ey׶V:|Vݩaƭ욲dk[W]F5`\t5`GtwqL1DbtC{xvi\E14xdLtafˠxBL]˴B+"#*˼Žh5H}<Dz#I=շ %7gvN1|ϻGnyB <4)~[\|gӓTWW7/'է}}}c*ޞ57Bn%N{pvo}ĉr̷:ooZ{r\I8l}㌇n]sĂG?,G }dMЍ\W[/ F\1Ž$%pC2V?3|K"#$7ؒD{;(~SQ{[1(^UA@5u@G|P̠FSh^H@^_mtf_Y\gz)0" $.r/qDЧv-DzD{H.Bw2p>ڵkESSq\ze%e 9g xnBCL:ݹA],FϹk# DkVB8mb#iLD8ntYuD#ux z"  #7S ,V ". ;*?5;" <_ ,\" !;wp/dev/wp-includes/js/tinymce/plugins/media/img/windowsmedia.gif0000644000106600010660000000063710743673705022237 0ustar GIF89a?uS-ѩaY0@G愅p+fҎG,LWKqxwwV&^qKNCiiimKx+tnV^K~3fp!BWuWr(a;vTHo9!?," %lhhD 4],G:jͤ\fఄTs5 !*$/  ;-!&1/<'9;=7+; :78(3.2 "+%?>))'=., ? ., B 2%3cB(  ~;wp/dev/wp-includes/js/tinymce/plugins/media/img/trans.gif0000644000106600010660000000005310743673705020664 0ustar GIF89a!,D;wp/dev/wp-includes/js/tinymce/plugins/media/css/0000755000106600010660000000000011051167751017054 5ustar wp/dev/wp-includes/js/tinymce/plugins/media/css/media.css0000644000106600010660000000234711021532502020636 0ustar #id, #name, #hspace, #vspace, #class_name, #align { width: 100px } #hspace, #vspace { width: 50px } #flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } #flash_base, #flash_flashvars { width: 240px } #width, #height { width: 40px } #src, #media_type { width: 250px } #class { width: 120px } #prev { margin: 0; border: 1px solid black; width: 380px; height: 230px; overflow: auto } .panel_wrapper div.current { height: 390px; overflow: auto } #flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } .mceAddSelectValue { background-color: #DDDDDD } #qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px } #wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } #rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } #shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } #qt_qtsrc { width: 200px } wp/dev/wp-includes/js/tinymce/plugins/media/css/content.css0000644000106600010660000000101410743673705021244 0ustar .mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc;} .mceItemShockWave {background-image: url(../img/shockwave.gif);} .mceItemFlash {background-image:url(../img/flash.gif);} .mceItemQuickTime {background-image:url(../img/quicktime.gif);} .mceItemWindowsMedia {background-image:url(../img/windowsmedia.gif);} .mceItemRealMedia {background-image:url(../img/realmedia.gif);} wp/dev/wp-includes/js/tinymce/plugins/media/editor_plugin.js0000644000106600010660000001704411031210647021463 0ustar (function(){var each=tinymce.each;tinymce.create('tinymce.plugins.MediaPlugin',{init:function(ed,url){var t=this;t.editor=ed;t.url=url;function isMediaElm(n){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className);};ed.onPreInit.add(function(){ed.serializer.addRules('param[name|value|_value]');});ed.addCommand('mceMedia',function(){ed.windowManager.open({file:url+'/media.htm',width:430+parseInt(ed.getLang('media.delta_width',0)),height:470+parseInt(ed.getLang('media.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('media',{title:'media.desc',cmd:'mceMedia'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('media',n.nodeName=='IMG'&&isMediaElm(n));});ed.onInit.add(function(){var lo={mceItemFlash:'flash',mceItemShockWave:'shockwave',mceItemWindowsMedia:'windowsmedia',mceItemQuickTime:'quicktime',mceItemRealMedia:'realmedia'};if(ed.settings.content_css!==false)ed.dom.loadCSS(url+"/css/content.css");if(ed.theme.onResolveName){ed.theme.onResolveName.add(function(th,o){if(o.name=='img'){each(lo,function(v,k){if(ed.dom.hasClass(o.node,k)){o.name=v;o.title=ed.dom.getAttrib(o.node,'title');return false;}});}});}if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){if(e.nodeName=='IMG'&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(e.className)){m.add({title:'media.edit',icon:'media',cmd:'mceMedia'});}});}});ed.onBeforeSetContent.add(function(ed,o){var h=o.content;h=h.replace(/]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,function(a,b,c){var o=t._parse(c);return''});h=h.replace(/]*)>/gi,'');h=h.replace(/]*)\/?>/gi,'');h=h.replace(/]*)>/gi,'');h=h.replace(/<\/(object)([^>]*)>/gi,'');h=h.replace(/<\/embed>/gi,'');h=h.replace(/]*)>/gi,function(a,b){return''});h=h.replace(/\/ class=\"mceItemParam\"><\/span>/gi,'class="mceItemParam">');o.content=h;});ed.onSetContent.add(function(){t._spansToImgs(ed.getBody());});ed.onPreProcess.add(function(ed,o){var dom=ed.dom;if(o.set){t._spansToImgs(o.node);each(dom.select('IMG',o.node),function(n){var p;if(isMediaElm(n)){p=t._parse(n.title);dom.setAttrib(n,'width',dom.getAttrib(n,'width',p.width||100));dom.setAttrib(n,'height',dom.getAttrib(n,'height',p.height||100));}});}if(o.get){each(dom.select('IMG',o.node),function(n){var ci,cb,mt;if(ed.getParam('media_use_script')){if(isMediaElm(n))n.className=n.className.replace(/mceItem/g,'mceTemp');return;}switch(n.className){case'mceItemFlash':ci='d27cdb6e-ae6d-11cf-96b8-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='application/x-shockwave-flash';break;case'mceItemShockWave':ci='166b1bca-3f9c-11cf-8075-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';mt='application/x-director';break;case'mceItemWindowsMedia':ci=ed.getParam('media_wmp6_compatible')?'05589fa1-c356-11ce-bf01-00aa0055595a':'6bf52a52-394a-11d3-b153-00c04f79faa6';cb='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';mt='application/x-mplayer2';break;case'mceItemQuickTime':ci='02bf25d5-8c17-4b23-bc80-d3488abddc6b';cb='http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';mt='video/quicktime';break;case'mceItemRealMedia':ci='cfcdaa03-8be4-11cf-b84b-0020afbbccfa';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='audio/x-pn-realaudio-plugin';break;}if(ci){dom.replace(t._buildObj({classid:ci,codebase:cb,type:mt},n),n);}});}});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/_value=/g,'value=');});if(ed.getParam('media_use_script')){function getAttr(s,n){n=new RegExp(n+'=\"([^\"]+)\"','g').exec(s);return n?ed.dom.decode(n[1]):'';};ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/]+>/g,function(im){var cl=getAttr(im,'class');if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(cl)){at=t._parse(getAttr(im,'title'));at.width=getAttr(im,'width');at.height=getAttr(im,'height');im='';}return im;});});}},getInfo:function(){return{longname:'Media',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_buildObj:function(o,n){var ob,ed=this.editor,dom=ed.dom,p=this._parse(n.title);p.width=o.width=dom.getAttrib(n,'width')||100;p.height=o.height=dom.getAttrib(n,'height')||100;ob=dom.create('span',{mce_name:'object',classid:"clsid:"+o.classid,codebase:o.codebase,width:o.width,height:o.height});if(p.src)p.src=ed.convertURL(p.src,'src',n);each(p,function(v,k){if(!/^(width|height|codebase|classid)$/.test(k)){if(o.type=='application/x-mplayer2'&&k=='src')k='url';dom.add(ob,'span',{mce_name:'param',name:k,'_value':v});}});dom.add(ob,'span',tinymce.extend({mce_name:'embed',type:o.type},p));return ob;},_spansToImgs:function(p){var t=this,dom=t.editor.dom,im,ci;each(dom.select('span',p),function(n){if(dom.getAttrib(n,'class')=='mceItemObject'){ci=dom.getAttrib(n,"classid").toLowerCase().replace(/\s+/g,'');switch(ci){case'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':dom.replace(t._createImg('mceItemFlash',n),n);break;case'clsid:166b1bca-3f9c-11cf-8075-444553540000':dom.replace(t._createImg('mceItemShockWave',n),n);break;case'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':case'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':case'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':dom.replace(t._createImg('mceItemWindowsMedia',n),n);break;case'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':dom.replace(t._createImg('mceItemQuickTime',n),n);break;case'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':dom.replace(t._createImg('mceItemRealMedia',n),n);break;default:dom.replace(t._createImg('mceItemFlash',n),n);}return;}if(dom.getAttrib(n,'class')=='mceItemEmbed'){switch(dom.getAttrib(n,'type')){case'application/x-shockwave-flash':dom.replace(t._createImg('mceItemFlash',n),n);break;case'application/x-director':dom.replace(t._createImg('mceItemShockWave',n),n);break;case'application/x-mplayer2':dom.replace(t._createImg('mceItemWindowsMedia',n),n);break;case'video/quicktime':dom.replace(t._createImg('mceItemQuickTime',n),n);break;case'audio/x-pn-realaudio-plugin':dom.replace(t._createImg('mceItemRealMedia',n),n);break;default:dom.replace(t._createImg('mceItemFlash',n),n);}}});},_createImg:function(cl,n){var im,dom=this.editor.dom,pa={},ti='';im=dom.create('img',{src:this.url+'/img/trans.gif',width:dom.getAttrib(n,'width')||100,height:dom.getAttrib(n,'height')||100,'class':cl});each(['id','name','width','height','bgcolor','align','flashvars','src','wmode'],function(na){var v=dom.getAttrib(n,na);if(v)pa[na]=v;});each(dom.select('span',n),function(n){if(dom.hasClass(n,'mceItemParam'))pa[dom.getAttrib(n,'name')]=dom.getAttrib(n,'_value');});if(pa.movie){pa.src=pa.movie;delete pa.movie;}delete pa.width;delete pa.height;im.title=this._serialize(pa);return im;},_parse:function(s){return tinymce.util.JSON.parse('{'+s+'}');},_serialize:function(o){return tinymce.util.JSON.serialize(o).replace(/[{}]/g,'');}});tinymce.PluginManager.add('media',tinymce.plugins.MediaPlugin);})();wp/dev/wp-includes/js/tinymce/plugins/media/js/0000755000106600010660000000000011051167751016700 5ustar wp/dev/wp-includes/js/tinymce/plugins/media/js/media.js0000644000106600010660000004275711021532502020317 0ustar tinyMCEPopup.requireLangPack(); var oldWidth, oldHeight, ed, url; if (url = tinyMCEPopup.getParam("media_external_list_url")) document.write(''); function init() { var pl = "", f, val; var type = "flash", fe, i; ed = tinyMCEPopup.editor; tinyMCEPopup.resizeToInnerSize(); f = document.forms[0] fe = ed.selection.getNode(); if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) { pl = fe.title; switch (ed.dom.getAttrib(fe, 'class')) { case 'mceItemFlash': type = 'flash'; break; case 'mceItemFlashVideo': type = 'flv'; break; case 'mceItemShockWave': type = 'shockwave'; break; case 'mceItemWindowsMedia': type = 'wmp'; break; case 'mceItemQuickTime': type = 'qt'; break; case 'mceItemRealMedia': type = 'rmp'; break; } document.forms[0].insert.value = ed.getLang('update', 'Insert', true); } document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); document.getElementById('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','qt_qtsrc','media','media'); document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); var html = getMediaListHTML('medialist','src','media','media'); if (html == "") document.getElementById("linklistrow").style.display = 'none'; else document.getElementById("linklistcontainer").innerHTML = html; // Resize some elements if (isVisible('filebrowser')) document.getElementById('src').style.width = '230px'; // Setup form if (pl != "") { pl = tinyMCEPopup.editor.plugins.media._parse(pl); switch (type) { case "flash": setBool(pl, 'flash', 'play'); setBool(pl, 'flash', 'loop'); setBool(pl, 'flash', 'menu'); setBool(pl, 'flash', 'swliveconnect'); setStr(pl, 'flash', 'quality'); setStr(pl, 'flash', 'scale'); setStr(pl, 'flash', 'salign'); setStr(pl, 'flash', 'wmode'); setStr(pl, 'flash', 'base'); setStr(pl, 'flash', 'flashvars'); break; case "qt": setBool(pl, 'qt', 'loop'); setBool(pl, 'qt', 'autoplay'); setBool(pl, 'qt', 'cache'); setBool(pl, 'qt', 'controller'); setBool(pl, 'qt', 'correction'); setBool(pl, 'qt', 'enablejavascript'); setBool(pl, 'qt', 'kioskmode'); setBool(pl, 'qt', 'autohref'); setBool(pl, 'qt', 'playeveryframe'); setBool(pl, 'qt', 'tarsetcache'); setStr(pl, 'qt', 'scale'); setStr(pl, 'qt', 'starttime'); setStr(pl, 'qt', 'endtime'); setStr(pl, 'qt', 'tarset'); setStr(pl, 'qt', 'qtsrcchokespeed'); setStr(pl, 'qt', 'volume'); setStr(pl, 'qt', 'qtsrc'); break; case "shockwave": setBool(pl, 'shockwave', 'sound'); setBool(pl, 'shockwave', 'progress'); setBool(pl, 'shockwave', 'autostart'); setBool(pl, 'shockwave', 'swliveconnect'); setStr(pl, 'shockwave', 'swvolume'); setStr(pl, 'shockwave', 'swstretchstyle'); setStr(pl, 'shockwave', 'swstretchhalign'); setStr(pl, 'shockwave', 'swstretchvalign'); break; case "wmp": setBool(pl, 'wmp', 'autostart'); setBool(pl, 'wmp', 'enabled'); setBool(pl, 'wmp', 'enablecontextmenu'); setBool(pl, 'wmp', 'fullscreen'); setBool(pl, 'wmp', 'invokeurls'); setBool(pl, 'wmp', 'mute'); setBool(pl, 'wmp', 'stretchtofit'); setBool(pl, 'wmp', 'windowlessvideo'); setStr(pl, 'wmp', 'balance'); setStr(pl, 'wmp', 'baseurl'); setStr(pl, 'wmp', 'captioningid'); setStr(pl, 'wmp', 'currentmarker'); setStr(pl, 'wmp', 'currentposition'); setStr(pl, 'wmp', 'defaultframe'); setStr(pl, 'wmp', 'playcount'); setStr(pl, 'wmp', 'rate'); setStr(pl, 'wmp', 'uimode'); setStr(pl, 'wmp', 'volume'); break; case "rmp": setBool(pl, 'rmp', 'autostart'); setBool(pl, 'rmp', 'loop'); setBool(pl, 'rmp', 'autogotourl'); setBool(pl, 'rmp', 'center'); setBool(pl, 'rmp', 'imagestatus'); setBool(pl, 'rmp', 'maintainaspect'); setBool(pl, 'rmp', 'nojava'); setBool(pl, 'rmp', 'prefetch'); setBool(pl, 'rmp', 'shuffle'); setStr(pl, 'rmp', 'console'); setStr(pl, 'rmp', 'controls'); setStr(pl, 'rmp', 'numloop'); setStr(pl, 'rmp', 'scriptcallbacks'); break; } setStr(pl, null, 'src'); setStr(pl, null, 'id'); setStr(pl, null, 'name'); setStr(pl, null, 'vspace'); setStr(pl, null, 'hspace'); setStr(pl, null, 'bgcolor'); setStr(pl, null, 'align'); setStr(pl, null, 'width'); setStr(pl, null, 'height'); if ((val = ed.dom.getAttrib(fe, "width")) != "") pl.width = f.width.value = val; if ((val = ed.dom.getAttrib(fe, "height")) != "") pl.height = f.height.value = val; oldWidth = pl.width ? parseInt(pl.width) : 0; oldHeight = pl.height ? parseInt(pl.height) : 0; } else oldWidth = oldHeight = 0; selectByValue(f, 'media_type', type); changedType(type); updateColor('bgcolor_pick', 'bgcolor'); TinyMCE_EditableSelects.init(); generatePreview(); } function insertMedia() { var fe, f = document.forms[0], h; tinyMCEPopup.restoreSelection(); if (!AutoValidator.validate(f)) { alert(ed.getLang('invalid_data')); return false; } f.width.value = f.width.value == "" ? 100 : f.width.value; f.height.value = f.height.value == "" ? 100 : f.height.value; fe = ed.selection.getNode(); if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) { switch (f.media_type.options[f.media_type.selectedIndex].value) { case "flash": fe.className = "mceItemFlash"; break; case "flv": fe.className = "mceItemFlashVideo"; break; case "shockwave": fe.className = "mceItemShockWave"; break; case "qt": fe.className = "mceItemQuickTime"; break; case "wmp": fe.className = "mceItemWindowsMedia"; break; case "rmp": fe.className = "mceItemRealMedia"; break; } if (fe.width != f.width.value || fe.height != f.height.height) ed.execCommand('mceRepaint'); fe.title = serializeParameters(); fe.width = f.width.value; fe.height = f.height.value; fe.style.width = f.width.value + (f.width.value.indexOf('%') == -1 ? 'px' : ''); fe.style.height = f.height.value + (f.height.value.indexOf('%') == -1 ? 'px' : ''); fe.align = f.align.options[f.align.selectedIndex].value; } else { h = ' 0) { var html = ""; html += ''; return html; } return ""; } function getType(v) { var fo, i, c, el, x, f = document.forms[0]; fo = ed.getParam("media_types", "flash=swf;flv=flv;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';'); // YouTube if (v.match(/watch\?v=(.+)(.*)/)) { f.width.value = '425'; f.height.value = '350'; f.src.value = 'http://www.youtube.com/v/' + v.match(/v=(.*)(.*)/)[0].split('=')[1]; return 'flash'; } // Google video if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) { f.width.value = '425'; f.height.value = '326'; f.src.value = 'http://video.google.com/googleplayer.swf?docId=' + v.substring('http://video.google.com/videoplay?docid='.length) + '&hl=en'; return 'flash'; } for (i=0; i 0 ? s.substring(0, s.length - 1) : s; return s; } function setBool(pl, p, n) { if (typeof(pl[n]) == "undefined") return; document.forms[0].elements[p + "_" + n].checked = pl[n]; } function setStr(pl, p, n) { var f = document.forms[0], e = f.elements[(p != null ? p + "_" : '') + n]; if (typeof(pl[n]) == "undefined") return; if (e.type == "text") e.value = pl[n]; else selectByValue(f, (p != null ? p + "_" : '') + n, pl[n]); } function getBool(p, n, d, tv, fv) { var v = document.forms[0].elements[p + "_" + n].checked; tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'"; fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'"; return (v == d) ? '' : n + (v ? ':' + tv + ',' : ':' + fv + ','); } function getStr(p, n, d) { var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; if (n == 'src') v = tinyMCEPopup.editor.convertURL(v, 'src', null); return ((n == d || v == '') ? '' : n + ":'" + jsEncode(v) + "',"); } function getInt(p, n, d) { var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ","); } function jsEncode(s) { s = s.replace(new RegExp('\\\\', 'g'), '\\\\'); s = s.replace(new RegExp('"', 'g'), '\\"'); s = s.replace(new RegExp("'", 'g'), "\\'"); return s; } function generatePreview(c) { var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh; p.innerHTML = ''; nw = parseInt(f.width.value); nh = parseInt(f.height.value); if (f.width.value != "" && f.height.value != "") { if (f.constrain.checked) { if (c == 'width' && oldWidth != 0) { wp = nw / oldWidth; nh = Math.round(wp * nh); f.height.value = nh; } else if (c == 'height' && oldHeight != 0) { hp = nh / oldHeight; nw = Math.round(hp * nw); f.width.value = nw; } } } if (f.width.value != "") oldWidth = nw; if (f.height.value != "") oldHeight = nh; // After constrain pl = serializeParameters(); switch (f.media_type.options[f.media_type.selectedIndex].value) { case "flash": cls = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'; codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; type = 'application/x-shockwave-flash'; break; case "shockwave": cls = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000'; codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0'; type = 'application/x-director'; break; case "qt": cls = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'; codebase = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'; type = 'video/quicktime'; break; case "wmp": cls = ed.getParam('media_wmp6_compatible') ? 'clsid:05589FA1-C356-11CE-BF01-00AA0055595A' : 'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6'; codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; type = 'application/x-mplayer2'; break; case "rmp": cls = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'; codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; type = 'audio/x-pn-realaudio-plugin'; break; } if (pl == '') { p.innerHTML = ''; return; } pl = tinyMCEPopup.editor.plugins.media._parse(pl); if (!pl.src) { p.innerHTML = ''; return; } pl.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(pl.src); pl.width = !pl.width ? 100 : pl.width; pl.height = !pl.height ? 100 : pl.height; pl.id = !pl.id ? 'obj' : pl.id; pl.name = !pl.name ? 'eobj' : pl.name; pl.align = !pl.align ? '' : pl.align; // Avoid annoying warning about insecure items if (!tinymce.isIE || document.location.protocol != 'https:') { h += ''; for (n in pl) { h += ''; // Add extra url parameter if it's an absolute URL if (n == 'src' && pl[n].indexOf('://') != -1) h += ''; } } h += ''; h += '
    wp/dev/wp-includes/js/tinymce/plugins/spellchecker/0000755000106600010660000000000011051167751017651 5ustar wp/dev/wp-includes/js/tinymce/plugins/spellchecker/img/0000755000106600010660000000000011051167751020425 5ustar wp/dev/wp-includes/js/tinymce/plugins/spellchecker/img/wline.gif0000644000106600010660000000005610743673705022243 0ustar GIF89a**!,Df;wp/dev/wp-includes/js/tinymce/plugins/spellchecker/config.php0000644000106600010660000000117510743673705021643 0ustar wp/dev/wp-includes/js/tinymce/plugins/spellchecker/includes/0000755000106600010660000000000011051167751021457 5ustar wp/dev/wp-includes/js/tinymce/plugins/spellchecker/includes/general.php0000644000106600010660000000421410743673705023616 0ustar $value) $newarray[formatParam($name, $sanitize)] = formatParam($value, $sanitize); return $newarray; } return formatParam($_REQUEST[$name], $sanitize); } function &getLogger() { global $mcLogger, $man; if (isset($man)) $mcLogger = $man->getLogger(); if (!$mcLogger) { $mcLogger = new Moxiecode_Logger(); // Set logger options $mcLogger->setPath(dirname(__FILE__) . "/../logs"); $mcLogger->setMaxSize("100kb"); $mcLogger->setMaxFiles("10"); $mcLogger->setFormat("{time} - {message}"); } return $mcLogger; } function debug($msg) { $args = func_get_args(); $log = getLogger(); $log->debug(implode(', ', $args)); } function info($msg) { $args = func_get_args(); $log = getLogger(); $log->info(implode(', ', $args)); } function error($msg) { $args = func_get_args(); $log = getLogger(); $log->error(implode(', ', $args)); } function warn($msg) { $args = func_get_args(); $log = getLogger(); $log->warn(implode(', ', $args)); } function fatal($msg) { $args = func_get_args(); $log = getLogger(); $log->fatal(implode(', ', $args)); } ?>wp/dev/wp-includes/js/tinymce/plugins/spellchecker/css/0000755000106600010660000000000011051167751020441 5ustar wp/dev/wp-includes/js/tinymce/plugins/spellchecker/css/content.css0000644000106600010660000000014110743673705022631 0ustar .mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;} wp/dev/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js0000644000106600010660000002027510767664151023072 0ustar /** * $Id: editor_plugin_src.js 425 2007-11-21 15:17:39Z spocke $ * * @author Moxiecode * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. */ (function() { var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM; tinymce.create('tinymce.plugins.SpellcheckerPlugin', { getInfo : function() { return { longname : 'Spellchecker', author : 'Moxiecode Systems AB', authorurl : 'http://tinymce.moxiecode.com', infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker', version : tinymce.majorVersion + "." + tinymce.minorVersion }; }, init : function(ed, url) { var t = this, cm; t.url = url; t.editor = ed; // Register commands ed.addCommand('mceSpellCheck', function() { if (!t.active) { ed.setProgressState(1); t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) { if (r.length > 0) { t.active = 1; t._markWords(r); ed.setProgressState(0); ed.nodeChanged(); } else { ed.setProgressState(0); ed.windowManager.alert('spellchecker.no_mpell'); } }); } else t._done(); }); ed.onInit.add(function() { if (ed.settings.content_css !== false) ed.dom.loadCSS(url + '/css/content.css'); }); ed.onClick.add(t._showMenu, t); ed.onContextMenu.add(t._showMenu, t); ed.onBeforeGetContent.add(function() { if (t.active) t._removeWords(); }); ed.onNodeChange.add(function(ed, cm) { cm.setActive('spellchecker', t.active); }); ed.onSetContent.add(function() { t._done(); }); ed.onBeforeGetContent.add(function() { t._done(); }); ed.onBeforeExecCommand.add(function(ed, cmd) { if (cmd == 'mceFullScreen') t._done(); }); // Find selected language t.languages = {}; each(ed.getParam('spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv', 'hash'), function(v, k) { if (k.indexOf('+') === 0) { k = k.substring(1); t.selectedLang = v; } t.languages[k] = v; }); }, createControl : function(n, cm) { var t = this, c, ed = t.editor; if (n == 'spellchecker') { c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); c.onRenderMenu.add(function(c, m) { m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1); each(t.languages, function(v, k) { var o = {icon : 1}, mi; o.onclick = function() { mi.setSelected(1); t.selectedItem.setSelected(0); t.selectedItem = mi; t.selectedLang = v; }; o.title = k; mi = m.add(o); mi.setSelected(v == t.selectedLang); if (v == t.selectedLang) t.selectedItem = mi; }) }); return c; } }, // Internal functions _walk : function(n, f) { var d = this.editor.getDoc(), w; if (d.createTreeWalker) { w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); while ((n = w.nextNode()) != null) f.call(this, n); } else tinymce.walk(n, f, 'childNodes'); }, _getSeparators : function() { var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}\u201d\u201c'); // Build word separator regexp for (i=0; i$1$2'); v = v.replace(r3, '$1$2'); dom.replace(dom.create('span', {'class' : 'mceItemHidden'}, v), n); } } }); se.moveToBookmark(b); }, _showMenu : function(ed, e) { var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()); if (!m) { p1 = DOM.getPos(ed.getContentAreaContainer()); //p2 = DOM.getPos(ed.getContainer()); m = ed.controlManager.createDropMenu('spellcheckermenu', { offset_x : p1.x, offset_y : p1.y, 'class' : 'mceNoIcons' }); t._menu = m; } if (dom.hasClass(e.target, 'mceItemHiddenSpellWord')) { m.removeAll(); m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1); t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(e.target.innerHTML)], function(r) { m.removeAll(); if (r.length > 0) { m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); each(r, function(v) { m.add({title : v, onclick : function() { dom.replace(ed.getDoc().createTextNode(v), e.target); t._checkDone(); }}); }); m.addSeparator(); } else m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); m.add({ title : 'spellchecker.ignore_word', onclick : function() { dom.remove(e.target, 1); t._checkDone(); } }); m.add({ title : 'spellchecker.ignore_words', onclick : function() { t._removeWords(dom.decode(e.target.innerHTML)); t._checkDone(); } }); m.update(); }); ed.selection.select(e.target); p1 = dom.getPos(e.target); m.showMenu(p1.x, p1.y + e.target.offsetHeight - vp.y); return tinymce.dom.Event.cancel(e); } else m.hideMenu(); }, _checkDone : function() { var t = this, ed = t.editor, dom = ed.dom, o; each(dom.select('span'), function(n) { if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) { o = true; return false; } }); if (!o) t._done(); }, _done : function() { var t = this, la = t.active; if (t.active) { t.active = 0; t._removeWords(); if (t._menu) t._menu.hideMenu(); if (la) t.editor.nodeChanged(); } }, _sendRPC : function(m, p, cb) { var t = this, url = t.editor.getParam("spellchecker_rpc_url", this.url+"/rpc.php"); if (url == '{backend}') { t.editor.setProgressState(0); alert('Please specify: spellchecker_rpc_url'); return; } JSONRequest.sendRPC({ url : url, method : m, params : p, success : cb, error : function(e, x) { t.editor.setProgressState(0); t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText)); } }); } }); // Register plugin tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin); })();wp/dev/wp-includes/js/tinymce/plugins/spellchecker/classes/0000755000106600010660000000000011051167751021306 5ustar wp/dev/wp-includes/js/tinymce/plugins/spellchecker/classes/SpellChecker.php0000644000106600010660000000271610752003177024367 0ustar _config = $config; } /** * Simple loopback function everything that gets in will be send back. * * @param $args.. Arguments. * @return {Array} Array of all input arguments. */ function &loopback(/* args.. */) { return func_get_args(); } /** * Spellchecks an array of words. * * @param {String} $lang Language code like sv or en. * @param {Array} $words Array of words to spellcheck. * @return {Array} Array of misspelled words. */ function &checkWords($lang, $words) { return $words; } /** * Returns suggestions of for a specific word. * * @param {String} $lang Language code like sv or en. * @param {String} $word Specific word to get suggestions for. * @return {Array} Array of suggestions for the specified word. */ function &getSuggestions($lang, $word) { return array(); } /** * Throws an error message back to the user. This will stop all execution. * * @param {String} $str Message to send back to user. */ function throwError($str) { die('{"result":null,"id":null,"error":{"errstr":"' . addslashes($str) . '","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}'); } } ?> wp/dev/wp-includes/js/tinymce/plugins/spellchecker/classes/PSpellShell.php0000644000106600010660000000537210743673705024225 0ustar _getCMD($lang); if ($fh = fopen($this->_tmpfile, "w")) { fwrite($fh, "!\n"); foreach($words as $key => $value) fwrite($fh, "^" . $value . "\n"); fclose($fh); } else $this->throwError("PSpell support was not found."); $data = shell_exec($cmd); @unlink($this->_tmpfile); $returnData = array(); $dataArr = preg_split("/[\r\n]/", $data, -1, PREG_SPLIT_NO_EMPTY); foreach ($dataArr as $dstr) { $matches = array(); // Skip this line. if (strpos($dstr, "@") === 0) continue; preg_match("/\& ([^ ]+) .*/i", $dstr, $matches); if (!empty($matches[1])) $returnData[] = utf8_encode(trim($matches[1])); } return $returnData; } /** * Returns suggestions of for a specific word. * * @param {String} $lang Language code like sv or en. * @param {String} $word Specific word to get suggestions for. * @return {Array} Array of suggestions for the specified word. */ function &getSuggestions($lang, $word) { $cmd = $this->_getCMD($lang); if (function_exists("mb_convert_encoding")) $word = mb_convert_encoding($word, "ISO-8859-1", mb_detect_encoding($word, "UTF-8")); else $word = utf8_encode($word); if ($fh = fopen($this->_tmpfile, "w")) { fwrite($fh, "!\n"); fwrite($fh, "^$word\n"); fclose($fh); } else $this->throwError("Error opening tmp file."); $data = shell_exec($cmd); @unlink($this->_tmpfile); $returnData = array(); $dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY); foreach($dataArr as $dstr) { $matches = array(); // Skip this line. if (strpos($dstr, "@") === 0) continue; preg_match("/\&[^:]+:(.*)/i", $dstr, $matches); if (!empty($matches[1])) { $words = array_slice(explode(',', $matches[1]), 0, 10); for ($i=0; $i_tmpfile = tempnam($this->_config['PSpellShell.tmp'], "tinyspell"); if(preg_match("#win#i", php_uname())) return $this->_config['PSpellShell.aspell'] . " -a --lang=". $lang . " --encoding=utf-8 -H < " . $this->_tmpfile . " 2>&1"; return "cat ". $this->_tmpfile ." | " . $this->_config['PSpellShell.aspell'] . " -a --encoding=utf-8 -H --lang=". $lang; } } ?> wp/dev/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/0000755000106600010660000000000011051167751022446 5ustar wp/dev/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/JSON.php0000644000106600010660000002714510743673705023751 0ustar _data = $data; $this->_len = strlen($data); $this->_pos = -1; $this->_location = JSON_IN_BETWEEN; $this->_lastLocations = array(); $this->_needProp = false; } function getToken() { return $this->_token; } function getLocation() { return $this->_location; } function getTokenName() { switch ($this->_token) { case JSON_BOOL: return 'JSON_BOOL'; case JSON_INT: return 'JSON_INT'; case JSON_STR: return 'JSON_STR'; case JSON_FLOAT: return 'JSON_FLOAT'; case JSON_NULL: return 'JSON_NULL'; case JSON_START_OBJ: return 'JSON_START_OBJ'; case JSON_END_OBJ: return 'JSON_END_OBJ'; case JSON_START_ARRAY: return 'JSON_START_ARRAY'; case JSON_END_ARRAY: return 'JSON_END_ARRAY'; case JSON_KEY: return 'JSON_KEY'; } return 'UNKNOWN'; } function getValue() { return $this->_value; } function readToken() { $chr = $this->read(); if ($chr != null) { switch ($chr) { case '[': $this->_lastLocation[] = $this->_location; $this->_location = JSON_IN_ARRAY; $this->_token = JSON_START_ARRAY; $this->_value = null; $this->readAway(); return true; case ']': $this->_location = array_pop($this->_lastLocation); $this->_token = JSON_END_ARRAY; $this->_value = null; $this->readAway(); if ($this->_location == JSON_IN_OBJECT) $this->_needProp = true; return true; case '{': $this->_lastLocation[] = $this->_location; $this->_location = JSON_IN_OBJECT; $this->_needProp = true; $this->_token = JSON_START_OBJ; $this->_value = null; $this->readAway(); return true; case '}': $this->_location = array_pop($this->_lastLocation); $this->_token = JSON_END_OBJ; $this->_value = null; $this->readAway(); if ($this->_location == JSON_IN_OBJECT) $this->_needProp = true; return true; // String case '"': case '\'': return $this->_readString($chr); // Null case 'n': return $this->_readNull(); // Bool case 't': case 'f': return $this->_readBool($chr); default: // Is number if (is_numeric($chr) || $chr == '-' || $chr == '.') return $this->_readNumber($chr); return true; } } return false; } function _readBool($chr) { $this->_token = JSON_BOOL; $this->_value = $chr == 't'; if ($chr == 't') $this->skip(3); // rue else $this->skip(4); // alse $this->readAway(); if ($this->_location == JSON_IN_OBJECT && !$this->_needProp) $this->_needProp = true; return true; } function _readNull() { $this->_token = JSON_NULL; $this->_value = null; $this->skip(3); // ull $this->readAway(); if ($this->_location == JSON_IN_OBJECT && !$this->_needProp) $this->_needProp = true; return true; } function _readString($quote) { $output = ""; $this->_token = JSON_STR; $endString = false; while (($chr = $this->peek()) != -1) { switch ($chr) { case '\\': // Read away slash $this->read(); // Read escape code $chr = $this->read(); switch ($chr) { case 't': $output .= "\t"; break; case 'b': $output .= "\b"; break; case 'f': $output .= "\f"; break; case 'r': $output .= "\r"; break; case 'n': $output .= "\n"; break; case 'u': $output .= $this->_int2utf8(hexdec($this->read(4))); break; default: $output .= $chr; break; } break; case '\'': case '"': if ($chr == $quote) $endString = true; $chr = $this->read(); if ($chr != -1 && $chr != $quote) $output .= $chr; break; default: $output .= $this->read(); } // String terminated if ($endString) break; } $this->readAway(); $this->_value = $output; // Needed a property if ($this->_needProp) { $this->_token = JSON_KEY; $this->_needProp = false; return true; } if ($this->_location == JSON_IN_OBJECT && !$this->_needProp) $this->_needProp = true; return true; } function _int2utf8($int) { $int = intval($int); switch ($int) { case 0: return chr(0); case ($int & 0x7F): return chr($int); case ($int & 0x7FF): return chr(0xC0 | (($int >> 6) & 0x1F)) . chr(0x80 | ($int & 0x3F)); case ($int & 0xFFFF): return chr(0xE0 | (($int >> 12) & 0x0F)) . chr(0x80 | (($int >> 6) & 0x3F)) . chr (0x80 | ($int & 0x3F)); case ($int & 0x1FFFFF): return chr(0xF0 | ($int >> 18)) . chr(0x80 | (($int >> 12) & 0x3F)) . chr(0x80 | (($int >> 6) & 0x3F)) . chr(0x80 | ($int & 0x3F)); } } function _readNumber($start) { $value = ""; $isFloat = false; $this->_token = JSON_INT; $value .= $start; while (($chr = $this->peek()) != -1) { if (is_numeric($chr) || $chr == '-' || $chr == '.') { if ($chr == '.') $isFloat = true; $value .= $this->read(); } else break; } $this->readAway(); if ($isFloat) { $this->_token = JSON_FLOAT; $this->_value = floatval($value); } else $this->_value = intval($value); if ($this->_location == JSON_IN_OBJECT && !$this->_needProp) $this->_needProp = true; return true; } function readAway() { while (($chr = $this->peek()) != null) { if ($chr != ':' && $chr != ',' && $chr != ' ') return; $this->read(); } } function read($len = 1) { if ($this->_pos < $this->_len) { if ($len > 1) { $str = substr($this->_data, $this->_pos + 1, $len); $this->_pos += $len; return $str; } else return $this->_data[++$this->_pos]; } return null; } function skip($len) { $this->_pos += $len; } function peek() { if ($this->_pos < $this->_len) return $this->_data[$this->_pos + 1]; return null; } } /** * This class handles JSON stuff. * * @package MCManager.utils */ class Moxiecode_JSON { function Moxiecode_JSON() { } function decode($input) { $reader = new Moxiecode_JSONReader($input); return $this->readValue($reader); } function readValue(&$reader) { $this->data = array(); $this->parents = array(); $this->cur =& $this->data; $key = null; $loc = JSON_IN_ARRAY; while ($reader->readToken()) { switch ($reader->getToken()) { case JSON_STR: case JSON_INT: case JSON_BOOL: case JSON_FLOAT: case JSON_NULL: switch ($reader->getLocation()) { case JSON_IN_OBJECT: $this->cur[$key] = $reader->getValue(); break; case JSON_IN_ARRAY: $this->cur[] = $reader->getValue(); break; default: return $reader->getValue(); } break; case JSON_KEY: $key = $reader->getValue(); break; case JSON_START_OBJ: case JSON_START_ARRAY: if ($loc == JSON_IN_OBJECT) $this->addArray($key); else $this->addArray(null); $cur =& $obj; $loc = $reader->getLocation(); break; case JSON_END_OBJ: case JSON_END_ARRAY: $loc = $reader->getLocation(); if (count($this->parents) > 0) { $this->cur =& $this->parents[count($this->parents) - 1]; array_pop($this->parents); } break; } } return $this->data[0]; } // This method was needed since PHP is crapy and doesn't have pointers/references function addArray($key) { $this->parents[] =& $this->cur; $ar = array(); if ($key) $this->cur[$key] =& $ar; else $this->cur[] =& $ar; $this->cur =& $ar; } function getDelim($index, &$reader) { switch ($reader->getLocation()) { case JSON_IN_ARRAY: case JSON_IN_OBJECT: if ($index > 0) return ","; break; } return ""; } function encode($input) { switch (gettype($input)) { case 'boolean': return $input ? 'true' : 'false'; case 'integer': return (int) $input; case 'float': case 'double': return (float) $input; case 'NULL': return 'null'; case 'string': return $this->encodeString($input); case 'array': return $this->_encodeArray($input); case 'object': return $this->_encodeArray(get_object_vars($input)); } return ''; } function encodeString($input) { // Needs to be escaped if (preg_match('/[^a-zA-Z0-9]/', $input)) { $output = ''; for ($i=0; $i_utf82utf16($char))); } if (($byte & 0xF0) == 0xE0) { $char = pack('C*', $byte, ord($input[$i + 1]), ord($input[$i + 2])); $i += 2; $output .= sprintf('\u%04s', bin2hex($this->_utf82utf16($char))); } if (($byte & 0xF8) == 0xF0) { $char = pack('C*', $byte, ord($input[$i + 1]), ord($input[$i + 2], ord($input[$i + 3]))); $i += 3; $output .= sprintf('\u%04s', bin2hex($this->_utf82utf16($char))); } if (($byte & 0xFC) == 0xF8) { $char = pack('C*', $byte, ord($input[$i + 1]), ord($input[$i + 2], ord($input[$i + 3]), ord($input[$i + 4]))); $i += 4; $output .= sprintf('\u%04s', bin2hex($this->_utf82utf16($char))); } if (($byte & 0xFE) == 0xFC) { $char = pack('C*', $byte, ord($input[$i + 1]), ord($input[$i + 2], ord($input[$i + 3]), ord($input[$i + 4]), ord($input[$i + 5]))); $i += 5; $output .= sprintf('\u%04s', bin2hex($this->_utf82utf16($char))); } else if ($byte < 128) $output .= $input[$i]; } } return '"' . $output . '"'; } return '"' . $input . '"'; } function _utf82utf16($utf8) { if (function_exists('mb_convert_encoding')) return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8'); switch (strlen($utf8)) { case 1: return $utf8; case 2: return chr(0x07 & (ord($utf8[0]) >> 2)) . chr((0xC0 & (ord($utf8[0]) << 6)) | (0x3F & ord($utf8[1]))); case 3: return chr((0xF0 & (ord($utf8[0]) << 4)) | (0x0F & (ord($utf8[1]) >> 2))) . chr((0xC0 & (ord($utf8[1]) << 6)) | (0x7F & ord($utf8[2]))); } return ''; } function _encodeArray($input) { $output = ''; $isIndexed = true; $keys = array_keys($input); for ($i=0; $iencodeString($keys[$i]) . ':' . $this->encode($input[$keys[$i]]); $isIndexed = false; } else $output .= $this->encode($input[$keys[$i]]); if ($i != count($keys) - 1) $output .= ','; } return $isIndexed ? '[' . $output . ']' : '{' . $output . '}'; } } ?> wp/dev/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/Logger.php0000644000106600010660000001253110743673705024410 0ustar _path = ""; $this->_filename = "{level}.log"; $this->setMaxSize("100k"); $this->_maxFiles = 10; $this->_level = MC_LOGGER_DEBUG; $this->_format = "[{time}] [{level}] {message}"; } /** * Sets the current log level, use the MC_LOGGER constants. * * @param int $level Log level instance for example MC_LOGGER_DEBUG. */ function setLevel($level) { if (is_string($level)) { switch (strtolower($level)) { case "debug": $level = MC_LOGGER_DEBUG; break; case "info": $level = MC_LOGGER_INFO; break; case "warn": case "warning": $level = MC_LOGGER_WARN; break; case "error": $level = MC_LOGGER_ERROR; break; case "fatal": $level = MC_LOGGER_FATAL; break; default: $level = MC_LOGGER_FATAL; } } $this->_level = $level; } /** * Returns the current log level for example MC_LOGGER_DEBUG. * * @return int Current log level for example MC_LOGGER_DEBUG. */ function getLevel() { return $this->_level; } function setPath($path) { $this->_path = $path; } function getPath() { return $this->_path; } function setFileName($file_name) { $this->_filename = $file_name; } function getFileName() { return $this->_filename; } function setFormat($format) { $this->_format = $format; } function getFormat() { return $this->_format; } function setMaxSize($size) { // Fix log max size $logMaxSizeBytes = intval(preg_replace("/[^0-9]/", "", $size)); // Is KB if (strpos((strtolower($size)), "k") > 0) $logMaxSizeBytes *= 1024; // Is MB if (strpos((strtolower($size)), "m") > 0) $logMaxSizeBytes *= (1024 * 1024); $this->_maxSizeBytes = $logMaxSizeBytes; $this->_maxSize = $size; } function getMaxSize() { return $this->_maxSize; } function setMaxFiles($max_files) { $this->_maxFiles = $max_files; } function getMaxFiles() { return $this->_maxFiles; } function debug($msg) { $args = func_get_args(); $this->_logMsg(MC_LOGGER_DEBUG, implode(', ', $args)); } function info($msg) { $args = func_get_args(); $this->_logMsg(MC_LOGGER_INFO, implode(', ', $args)); } function warn($msg) { $args = func_get_args(); $this->_logMsg(MC_LOGGER_WARN, implode(', ', $args)); } function error($msg) { $args = func_get_args(); $this->_logMsg(MC_LOGGER_ERROR, implode(', ', $args)); } function fatal($msg) { $args = func_get_args(); $this->_logMsg(MC_LOGGER_FATAL, implode(', ', $args)); } function isDebugEnabled() { return $this->_level >= MC_LOGGER_DEBUG; } function isInfoEnabled() { return $this->_level >= MC_LOGGER_INFO; } function isWarnEnabled() { return $this->_level >= MC_LOGGER_WARN; } function isErrorEnabled() { return $this->_level >= MC_LOGGER_ERROR; } function isFatalEnabled() { return $this->_level >= MC_LOGGER_FATAL; } function _logMsg($level, $message) { $roll = false; if ($level < $this->_level) return; $logFile = $this->toOSPath($this->_path . "/" . $this->_filename); switch ($level) { case MC_LOGGER_DEBUG: $levelName = "DEBUG"; break; case MC_LOGGER_INFO: $levelName = "INFO"; break; case MC_LOGGER_WARN: $levelName = "WARN"; break; case MC_LOGGER_ERROR: $levelName = "ERROR"; break; case MC_LOGGER_FATAL: $levelName = "FATAL"; break; } $logFile = str_replace('{level}', strtolower($levelName), $logFile); $text = $this->_format; $text = str_replace('{time}', date("Y-m-d H:i:s"), $text); $text = str_replace('{level}', strtolower($levelName), $text); $text = str_replace('{message}', $message, $text); $message = $text . "\r\n"; // Check filesize if (file_exists($logFile)) { $size = @filesize($logFile); if ($size + strlen($message) > $this->_maxSizeBytes) $roll = true; } // Roll if the size is right if ($roll) { for ($i=$this->_maxFiles-1; $i>=1; $i--) { $rfile = $this->toOSPath($logFile . "." . $i); $nfile = $this->toOSPath($logFile . "." . ($i+1)); if (@file_exists($rfile)) @rename($rfile, $nfile); } @rename($logFile, $this->toOSPath($logFile . ".1")); // Delete last logfile $delfile = $this->toOSPath($logFile . "." . ($this->_maxFiles + 1)); if (@file_exists($delfile)) @unlink($delfile); } // Append log line if (($fp = @fopen($logFile, "a")) != null) { @fputs($fp, $message); @fflush($fp); @fclose($fp); } } /** * Converts a Unix path to OS specific path. * * @param String $path Unix path to convert. */ function toOSPath($path) { return str_replace("/", DIRECTORY_SEPARATOR, $path); } } ?>wp/dev/wp-includes/js/tinymce/plugins/spellchecker/classes/PSpell.php0000644000106600010660000000355410743673705023235 0ustar _getPLink($lang); $outWords = array(); foreach ($words as $word) { if (!pspell_check($plink, trim($word))) $outWords[] = utf8_encode($word); } return $outWords; } /** * Returns suggestions of for a specific word. * * @param {String} $lang Language code like sv or en. * @param {String} $word Specific word to get suggestions for. * @return {Array} Array of suggestions for the specified word. */ function &getSuggestions($lang, $word) { $words = pspell_suggest($this->_getPLink($lang), $word); for ($i=0; $ithrowError("PSpell support not found in PHP installation."); // Setup PSpell link $plink = pspell_new( $lang, $this->_config['PSpell.spelling'], $this->_config['PSpell.jargon'], $this->_config['PSpell.encoding'], $this->_config['PSpell.mode'] ); // Setup PSpell link /* if (!$plink) { $pspellConfig = pspell_config_create( $lang, $this->_config['PSpell.spelling'], $this->_config['PSpell.jargon'], $this->_config['PSpell.encoding'] ); $plink = pspell_new_config($pspell_config); }*/ if (!$plink) $this->throwError("No PSpell link found opened."); return $plink; } } ?> wp/dev/wp-includes/js/tinymce/plugins/spellchecker/classes/GoogleSpell.php0000644000106600010660000001000310763111301024212 0ustar _getMatches($lang, $wordstr); $words = array(); for ($i=0; $i_unhtmlentities(mb_substr($wordstr, $matches[$i][1], $matches[$i][2], "UTF-8")); return $words; } /** * Returns suggestions of for a specific word. * * @param {String} $lang Language code like sv or en. * @param {String} $word Specific word to get suggestions for. * @return {Array} Array of suggestions for the specified word. */ function &getSuggestions($lang, $word) { $sug = array(); $osug = array(); $matches = $this->_getMatches($lang, $word); if (count($matches) > 0) $sug = explode("\t", utf8_encode($this->_unhtmlentities($matches[0][4]))); // Remove empty foreach ($sug as $item) { if ($item) $osug[] = $item; } return $osug; } function &_getMatches($lang, $str) { $server = "www.google.com"; $port = 443; $path = "/tbproxy/spell?lang=" . $lang . "&hl=en"; $host = "www.google.com"; $url = "https://" . $server; // Setup XML request $xml = '' . $str . ''; $header = "POST ".$path." HTTP/1.0 \r\n"; $header .= "MIME-Version: 1.0 \r\n"; $header .= "Content-type: application/PTI26 \r\n"; $header .= "Content-length: ".strlen($xml)." \r\n"; $header .= "Content-transfer-encoding: text \r\n"; $header .= "Request-number: 1 \r\n"; $header .= "Document-type: Request \r\n"; $header .= "Interface-Version: Test 1.4 \r\n"; $header .= "Connection: close \r\n\r\n"; $header .= $xml; // Use curl if it exists if (function_exists('curl_init')) { // Use curl $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $xml = curl_exec($ch); curl_close($ch); } else { // Use raw sockets $fp = fsockopen("ssl://" . $server, $port, $errno, $errstr, 30); if ($fp) { // Send request fwrite($fp, $header); // Read response $xml = ""; while (!feof($fp)) $xml .= fgets($fp, 128); fclose($fp); } else echo "Could not open SSL connection to google."; } // Grab and parse content $matches = array(); preg_match_all('/([^<]*)<\/c>/', $xml, $matches, PREG_SET_ORDER); return $matches; } function _unhtmlentities($string) { $string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string); $string = preg_replace('~&#([0-9]+);~e', 'chr(\\1)', $string); $trans_tbl = get_html_translation_table(HTML_ENTITIES); $trans_tbl = array_flip($trans_tbl); return strtr($string, $trans_tbl); } } // Patch in multibyte support if (!function_exists('mb_substr')) { function mb_substr($str, $start, $len = '', $encoding="UTF-8"){ $limit = strlen($str); for ($s = 0; $start > 0;--$start) {// found the real start if ($s >= $limit) break; if ($str[$s] <= "\x7F") ++$s; else { ++$s; // skip length while ($str[$s] >= "\x80" && $str[$s] <= "\xBF") ++$s; } } if ($len == '') return substr($str, $s); else for ($e = $s; $len > 0; --$len) {//found the real end if ($e >= $limit) break; if ($str[$e] <= "\x7F") ++$e; else { ++$e;//skip length while ($str[$e] >= "\x80" && $str[$e] <= "\xBF" && $e < $limit) ++$e; } } return substr($str, $s, $e - $s); } } ?>wp/dev/wp-includes/js/tinymce/plugins/spellchecker/rpc.php0000644000106600010660000000372410743673705021164 0ustar decode($raw); // Execute RPC if (isset($config['general.engine'])) { $spellchecker = new $config['general.engine']($config); $result = call_user_func_array(array($spellchecker, $input['method']), $input['params']); } else die('{"result":null,"id":null,"error":{"errstr":"You must choose an spellchecker engine in the config.php file.","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}'); // Request and response id should always be the same $output = array( "id" => $input->id, "result" => $result, "error" => null ); // Return JSON encoded string echo $json->encode($output); ?>wp/dev/wp-includes/js/tinymce/plugins/wordpress/0000755000106600010660000000000011051167752017236 5ustar wp/dev/wp-includes/js/tinymce/plugins/wordpress/img/0000755000106600010660000000000011051167752020012 5ustar wp/dev/wp-includes/js/tinymce/plugins/wordpress/img/help.gif0000644000106600010660000000044710750407446021440 0ustar GIF89aO^u"Zr9ZBzrýP5nSVMp_ܑ̰"X"g!,'dihHY_fUNTFfD"TX$b1pLJ%px$G“a It%qH d8&bmz^~%u & & ' }( Q* 44!;wp/dev/wp-includes/js/tinymce/plugins/wordpress/img/video.gif0000644000106600010660000000014311033173201021567 0ustar GIF89a!,4ajqׅb҉~Hc-'m;u]%L*;wp/dev/wp-includes/js/tinymce/plugins/wordpress/img/toolbars.gif0000644000106600010660000000040410750407446022326 0ustar GIF89a6|iIUXjxm,.79zBER79Dfj~JM[̙c:vzaޢrLr*nS%@BOPqyR[@I~ck!,'dih٬lbtm3M@X Iq90"N`$ Gq0Gvr C Rx z`HJVXzo]q  > C:  :61+eli%!;wp/dev/wp-includes/js/tinymce/plugins/wordpress/img/more_bug.gif0000644000106600010660000000022210750407446022276 0ustar GIF89a !, cڋB"U@`n։ $z] ؂ALz~V*nʪ5>8d'' Z.ns}R;wp/dev/wp-includes/js/tinymce/plugins/wordpress/img/media.gif0000644000106600010660000000022511033173201021541 0ustar GIF89aܣ跻! ,BPI87 D1Ñ0pl |E oop!P*Vy%;wp/dev/wp-includes/js/tinymce/plugins/wordpress/img/page.gif0000644000106600010660000000015410750407446021417 0ustar GIF89afff!,=`L*R=xiʶ ǂ0smp tYH% d"R@R$FQL;wp/dev/wp-includes/js/tinymce/plugins/wordpress/img/page_bug.gif0000644000106600010660000000026410750407446022256 0ustar GIF89a !, -ڋHY['rLfk< 5̭Jndiêx1EL܎={,ª'0l=ŧbvHȨri @Yiy) *P;wp/dev/wp-includes/js/tinymce/plugins/wordpress/img/audio.gif0000644000106600010660000000022211033173201021560 0ustar GIF89aշʙ! ,?pI85Ir(zƶk~J@ s&bKta, Bkgz;wp/dev/wp-includes/js/tinymce/plugins/wordpress/img/image.gif0000644000106600010660000000014511033173201021545 0ustar GIF89a!,6V\܅'y㙍*ےH̦zڳZ@f(&;wp/dev/wp-includes/js/tinymce/plugins/wordpress/img/more.gif0000644000106600010660000000015410750407446021445 0ustar GIF89afff!,={塸Wmp2cW7Enċ 4m9~rMV!9"C@TFS;wp/dev/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif0000644000106600010660000000005310750407446021630 0ustar GIF89a!,D;wp/dev/wp-includes/js/tinymce/plugins/wordpress/css/0000755000106600010660000000000011051167752020026 5ustar wp/dev/wp-includes/js/tinymce/plugins/wordpress/css/content.css0000644000106600010660000000047210750407446022217 0ustar .mceWPnextpage, .mceWPmore { border: 0px; border-top: 1px dotted #cccccc; display: block; width: 100%; height: 12px; margin-top: 15px; } .mceWPmore { background: #ffffff url(../img/more_bug.gif) no-repeat right top; } .mceWPnextpage { background: #ffffff url(../img/page_bug.gif) no-repeat right top; }wp/dev/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js0000644000106600010660000002361511034172415022440 0ustar /** * WordPress plugin. */ (function() { var DOM = tinymce.DOM; // Load plugin specific language pack tinymce.PluginManager.requireLangPack('wordpress'); tinymce.create('tinymce.plugins.WordPress', { init : function(ed, url) { var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'); var moreHTML = ''; var nextpageHTML = ''; if ( tinymce.util.Cookie.get('kitchenSink') == '1' ) ed.settings.wordpress_adv_hidden = 0; // Hides the specified toolbar and resizes the iframe ed.onPostRender.add(function() { if ( ed.getParam('wordpress_adv_hidden', 1) ) { DOM.hide(ed.controlManager.get(tbId).id); t._resizeIframe(ed, tbId, 28); } }); // Register commands ed.addCommand('WP_More', function() { ed.execCommand('mceInsertContent', 0, moreHTML); }); ed.addCommand('WP_Page', function() { ed.execCommand('mceInsertContent', 0, nextpageHTML); }); ed.addCommand('WP_Help', function() { ed.windowManager.open({ url : tinymce.baseURL + '/wp-mce-help.php', width : 450, height : 420, inline : 1 }); }); ed.addCommand('WP_Adv', function() { var id = ed.controlManager.get(tbId).id, cm = ed.controlManager, cook = tinymce.util.Cookie, date; date = new Date(); date.setTime(date.getTime()+(10*365*24*60*60*1000)); if (DOM.isHidden(id)) { cm.setActive('wp_adv', 1); DOM.show(id); t._resizeIframe(ed, tbId, -28); ed.settings.wordpress_adv_hidden = 0; cook.set('kitchenSink', '1', date); } else { cm.setActive('wp_adv', 0); DOM.hide(id); t._resizeIframe(ed, tbId, 28); ed.settings.wordpress_adv_hidden = 1; cook.set('kitchenSink', '0', date); } }); // Register buttons ed.addButton('wp_more', { title : 'wordpress.wp_more_desc', image : url + '/img/more.gif', cmd : 'WP_More' }); ed.addButton('wp_page', { title : 'wordpress.wp_page_desc', image : url + '/img/page.gif', cmd : 'WP_Page' }); ed.addButton('wp_help', { title : 'wordpress.wp_help_desc', image : url + '/img/help.gif', cmd : 'WP_Help' }); ed.addButton('wp_adv', { title : 'wordpress.wp_adv_desc', image : url + '/img/toolbars.gif', cmd : 'WP_Adv' }); // Add Media buttons ed.addButton('add_media', { title : 'wordpress.add_media', image : url + '/img/media.gif', onclick : function() { tb_show('', tinymce.DOM.get('add_media').href); tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); } }); ed.addButton('add_image', { title : 'wordpress.add_image', image : url + '/img/image.gif', onclick : function() { tb_show('', tinymce.DOM.get('add_image').href); tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); } }); ed.addButton('add_video', { title : 'wordpress.add_video', image : url + '/img/video.gif', onclick : function() { tb_show('', tinymce.DOM.get('add_video').href); tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); } }); ed.addButton('add_audio', { title : 'wordpress.add_audio', image : url + '/img/audio.gif', onclick : function() { tb_show('', tinymce.DOM.get('add_audio').href); tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); } }); // Add Media buttons to fullscreen ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) { if ( 'mceFullScreen' != cmd ) return; if ( 'mce_fullscreen' != ed.id ) ed.settings.theme_advanced_buttons1 += ',|,add_image,add_video,add_audio,add_media'; }); // Add class "alignleft", "alignright" and "aligncenter" when selecting align for images. ed.addCommand('JustifyLeft', function() { var n = ed.selection.getNode(); if ( n.nodeName != 'IMG' ) ed.editorCommands.mceJustify('JustifyLeft', 'left'); else ed.plugins.wordpress.do_align(n, 'alignleft'); }); ed.addCommand('JustifyRight', function() { var n = ed.selection.getNode(); if ( n.nodeName != 'IMG' ) ed.editorCommands.mceJustify('JustifyRight', 'right'); else ed.plugins.wordpress.do_align(n, 'alignright'); }); ed.addCommand('JustifyCenter', function() { var n = ed.selection.getNode(), P = ed.dom.getParent(n, 'p'), DL = ed.dom.getParent(n, 'dl'); if ( n.nodeName == 'IMG' && ( P || DL ) ) ed.plugins.wordpress.do_align(n, 'aligncenter'); else ed.editorCommands.mceJustify('JustifyCenter', 'center'); }); // Word count if script is loaded if ( 'undefined' != typeof wpWordCount ) { var last = 0; ed.onKeyUp.add(function(ed, e) { if ( e.keyCode == last ) return; if ( 13 == e.keyCode || 8 == last || 46 == last ) wpWordCount.wc( ed.getContent({format : 'raw'}) ); last = e.keyCode; }); }; // Add listeners to handle more break t._handleMoreBreak(ed, url); // Add custom shortcuts ed.addShortcut('alt+shift+c', ed.getLang('justifycenter_desc'), 'JustifyCenter'); ed.addShortcut('alt+shift+r', ed.getLang('justifyright_desc'), 'JustifyRight'); ed.addShortcut('alt+shift+l', ed.getLang('justifyleft_desc'), 'JustifyLeft'); ed.addShortcut('alt+shift+j', ed.getLang('justifyfull_desc'), 'JustifyFull'); ed.addShortcut('alt+shift+q', ed.getLang('blockquote_desc'), 'mceBlockQuote'); ed.addShortcut('alt+shift+u', ed.getLang('bullist_desc'), 'InsertUnorderedList'); ed.addShortcut('alt+shift+o', ed.getLang('numlist_desc'), 'InsertOrderedList'); ed.addShortcut('alt+shift+d', ed.getLang('striketrough_desc'), 'Strikethrough'); ed.addShortcut('alt+shift+n', ed.getLang('spellchecker.desc'), 'mceSpellCheck'); ed.addShortcut('alt+shift+a', ed.getLang('link_desc'), 'mceLink'); ed.addShortcut('alt+shift+s', ed.getLang('unlink_desc'), 'unlink'); ed.addShortcut('alt+shift+m', ed.getLang('image_desc'), 'mceImage'); ed.addShortcut('alt+shift+g', ed.getLang('fullscreen.desc'), 'mceFullScreen'); ed.addShortcut('alt+shift+z', ed.getLang('wp_adv_desc'), 'WP_Adv'); ed.addShortcut('alt+shift+h', ed.getLang('help_desc'), 'WP_Help'); ed.addShortcut('alt+shift+t', ed.getLang('wp_more_desc'), 'WP_More'); ed.addShortcut('alt+shift+p', ed.getLang('wp_page_desc'), 'WP_Page'); if ( tinymce.isWebKit ) { ed.addShortcut('alt+shift+b', ed.getLang('bold_desc'), 'Bold'); ed.addShortcut('alt+shift+i', ed.getLang('italic_desc'), 'Italic'); } }, getInfo : function() { return { longname : 'WordPress Plugin', author : 'WordPress', // add Moxiecode? authorurl : 'http://wordpress.org', infourl : 'http://wordpress.org', version : '3.0' }; }, // Internal functions do_align : function(n, a) { var P, DL, DIV, cls, c, ed = tinyMCE.activeEditor; P = ed.dom.getParent(n, 'p'); DL = ed.dom.getParent(n, 'dl'); DIV = ed.dom.getParent(n, 'div'); if ( DL && DIV ) { cls = ed.dom.hasClass(DL, a) ? 'alignnone' : a; DL.className = DL.className.replace(/align[^ '"]+\s?/g, ''); ed.dom.addClass(DL, cls); c = (cls == 'aligncenter') ? ed.dom.addClass(DIV, 'mceIEcenter') : ed.dom.removeClass(DIV, 'mceIEcenter'); } else if ( P ) { cls = ed.dom.hasClass(n, a) ? 'alignnone' : a; n.className = n.className.replace(/align[^ '"]+\s?/g, ''); ed.dom.addClass(n, cls); if ( cls == 'aligncenter' ) ed.dom.setStyle(P, 'textAlign', 'center'); else if (P.style && P.style.textAlign == 'center') ed.dom.setStyle(P, 'textAlign', ''); } ed.execCommand('mceRepaint'); }, // Resizes the iframe by a relative height value _resizeIframe : function(ed, tb_id, dy) { var ifr = ed.getContentAreaContainer().firstChild; DOM.setStyle(ifr, 'height', ifr.clientHeight + dy); // Resize iframe ed.theme.deltaHeight += dy; // For resize cookie }, _handleMoreBreak : function(ed, url) { var moreHTML = '$1'; var nextpageHTML = ''; // Load plugin specific CSS into editor ed.onInit.add(function() { ed.dom.loadCSS(url + '/css/content.css'); }); // Display morebreak instead if img in element path ed.onPostRender.add(function() { if (ed.theme.onResolveName) { ed.theme.onResolveName.add(function(th, o) { if (o.node.nodeName == 'IMG') { if ( ed.dom.hasClass(o.node, 'mceWPmore') ) o.name = 'wpmore'; if ( ed.dom.hasClass(o.node, 'mceWPnextpage') ) o.name = 'wppage'; } }); } }); // Replace morebreak with images ed.onBeforeSetContent.add(function(ed, o) { o.content = o.content.replace(//g, moreHTML); o.content = o.content.replace(//g, nextpageHTML); }); // Replace images with morebreak ed.onPostProcess.add(function(ed, o) { if (o.get) o.content = o.content.replace(/]+>/g, function(im) { if (im.indexOf('class="mceWPmore') !== -1) { var m, moretext = (m = im.match(/alt="(.*?)"/)) ? m[1] : ''; im = ''; } if (im.indexOf('class="mceWPnextpage') !== -1) im = ''; return im; }); }); // Set active buttons if user selected pagebreak or more break ed.onNodeChange.add(function(ed, cm, n) { cm.setActive('wp_page', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mceWPnextpage')); cm.setActive('wp_more', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mceWPmore')); }); } }); // Register plugin tinymce.PluginManager.add('wordpress', tinymce.plugins.WordPress); })(); wp/dev/wp-includes/js/tinymce/plugins/wordpress/js/0000755000106600010660000000000011051167752017652 5ustar wp/dev/wp-includes/js/tinymce/plugins/paste/0000755000106600010660000000000011051167752016322 5ustar wp/dev/wp-includes/js/tinymce/plugins/paste/pastetext.htm0000644000106600010660000000251411031210647021045 0ustar {#paste.paste_text_desc}
    {#paste.paste_text_desc}

    {#paste_dlg.text_title}
    wp/dev/wp-includes/js/tinymce/plugins/paste/pasteword.htm0000644000106600010660000000201211031210647021025 0ustar {#paste.paste_word_desc}
    {#paste.paste_word_desc}
    {#paste_dlg.word_title}
    wp/dev/wp-includes/js/tinymce/plugins/paste/css/0000755000106600010660000000000011051167752017112 5ustar wp/dev/wp-includes/js/tinymce/plugins/paste/css/pasteword.css0000644000106600010660000000005610743673705021644 0ustar .sourceIframe { border: 1px solid #808080; } wp/dev/wp-includes/js/tinymce/plugins/paste/css/blank.css0000644000106600010660000000061310743673705020722 0ustar html, body {height:98%} body { background-color: #FFFFFF; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; scrollbar-3dlight-color: #F0F0EE; scrollbar-arrow-color: #676662; scrollbar-base-color: #F0F0EE; scrollbar-darkshadow-color: #DDDDDD; scrollbar-face-color: #E0E0DD; scrollbar-highlight-color: #F0F0EE; scrollbar-shadow-color: #F0F0EE; scrollbar-track-color: #F5F5F5; } wp/dev/wp-includes/js/tinymce/plugins/paste/editor_plugin.js0000644000106600010660000002054311021532502021512 0ustar (function(){var Event=tinymce.dom.Event;tinymce.create('tinymce.plugins.PastePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mcePasteText',function(ui,v){if(ui){if((ed.getParam('paste_use_dialog',true))||(!tinymce.isIE)){ed.windowManager.open({file:url+'/pastetext.htm',width:450,height:400,inline:1},{plugin_url:url});}else t._insertText(clipboardData.getData("Text"),true);}else t._insertText(v.html,v.linebreaks);});ed.addCommand('mcePasteWord',function(ui,v){if(ui){if((ed.getParam('paste_use_dialog',true))||(!tinymce.isIE)){ed.windowManager.open({file:url+'/pasteword.htm',width:450,height:400,inline:1},{plugin_url:url});}else t._insertText(t._clipboardHTML());}else t._insertWordContent(v);});ed.addCommand('mceSelectAll',function(){ed.execCommand('selectall');});ed.addButton('pastetext',{title:'paste.paste_text_desc',cmd:'mcePasteText',ui:true});ed.addButton('pasteword',{title:'paste.paste_word_desc',cmd:'mcePasteWord',ui:true});ed.addButton('selectall',{title:'paste.selectall_desc',cmd:'mceSelectAll'});if(ed.getParam("paste_auto_cleanup_on_paste",false)){ed.onPaste.add(function(ed,e){return t._handlePasteEvent(e)});}if(!tinymce.isIE&&ed.getParam("paste_auto_cleanup_on_paste",false)){ed.onKeyDown.add(function(ed,e){if(e.ctrlKey&&e.keyCode==86){window.setTimeout(function(){ed.execCommand("mcePasteText",true);},1);Event.cancel(e);}});}},getInfo:function(){return{longname:'Paste text/word',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_handlePasteEvent:function(e){var html=this._clipboardHTML(),ed=this.editor,sel=ed.selection,r;if(ed&&(r=sel.getRng())&&r.text.length>0)ed.execCommand('delete');if(html&&html.length>0)ed.execCommand('mcePasteWord',false,html);return Event.cancel(e);},_insertText:function(content,bLinebreaks){content=this.editor.dom.encode(content);if(content&&content.length>0){if(bLinebreaks){if(this.editor.getParam("paste_create_paragraphs",true)){var rl=this.editor.getParam("paste_replace_list",'\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i

    ');content=content.replace(/\r\r/g,'

    ');content=content.replace(/\n\n/g,'

    ');if((pos=content.indexOf('

    '))!=-1){this.editor.execCommand("Delete");var node=this.editor.selection.getNode();var breakElms=[];do{if(node.nodeType==1){if(node.nodeName=="TD"||node.nodeName=="BODY")break;breakElms[breakElms.length]=node;}}while(node=node.parentNode);var before="",after="

    ";before+=content.substring(0,pos);for(var i=0;i";after+="<"+breakElms[(breakElms.length-1)-i].nodeName+">";}before+="

    ";content=before+content.substring(pos+7)+after;}}if(this.editor.getParam("paste_create_linebreaks",true)){content=content.replace(/\r\n/g,'
    ');content=content.replace(/\r/g,'
    ');content=content.replace(/\n/g,'
    ');}}this.editor.execCommand("mceInsertRawHTML",false,content);}},_insertWordContent:function(content){var t=this,ed=t.editor;if(content&&content.length>0){var bull=String.fromCharCode(8226);var middot=String.fromCharCode(183);if(ed.getParam('paste_insert_word_content_callback'))content=ed.execCallback('paste_insert_word_content_callback','before',content);var rl=ed.getParam("paste_replace_list",'\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i(.*?)<\/p>','gi'),'

    $1

    ');}content=content.replace(new RegExp('tab-stops: list [0-9]+.0pt">','gi'),'">'+"--list--");content=content.replace(new RegExp(bull+"(.*?)
    ","gi"),"

    "+middot+"$1

    ");content=content.replace(new RegExp('','gi'),""+bull);content=content.replace(/<\/o:p>/gi,"");content=content.replace(new RegExp('
    ]*>/gi,"");if(this.editor.getParam("paste_remove_styles",true))content=content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)','gi'),"<$1$3");content=content.replace(/<\/?font[^>]*>/gi,"");switch(this.editor.getParam("paste_strip_class_attributes","all")){case"all":content=content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");break;case"mso":content=content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)','gi'),"<$1$3");break;}content=content.replace(new RegExp('href="?'+this._reEscape(""+document.location)+'','gi'),'href="'+this.editor.documentBaseURI.getURI());content=content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");content=content.replace(/<\\?\?xml[^>]*>/gi,"");content=content.replace(/<\/?\w+:[^>]*>/gi,"");content=content.replace(/-- page break --\s*

     <\/p>/gi,"");content=content.replace(/-- page break --/gi,"");if(!this.editor.getParam('force_p_newlines')){content=content.replace('','','gi');content=content.replace('

    ','

    ','gi');}if(!tinymce.isIE&&!this.editor.getParam('force_p_newlines')){content=content.replace(/<\/?p[^>]*>/gi,"");}content=content.replace(/<\/?div[^>]*>/gi,"");if(this.editor.getParam("paste_convert_middot_lists",true)){var div=ed.dom.create("div",null,content);var className=this.editor.getParam("paste_unindented_list_class","unIndentedList");while(this._convertMiddots(div,"--list--"));while(this._convertMiddots(div,middot,className));while(this._convertMiddots(div,bull));content=div.innerHTML;}if(this.editor.getParam("paste_convert_headers_to_strong",false)){content=content.replace(/ <\/h[1-6]>/gi,'

      

    ');content=content.replace(//gi,'

    ');content=content.replace(/<\/h[1-6]>/gi,'

    ');content=content.replace(/ <\/b>/gi,'  ');content=content.replace(/^( )*/gi,'');}content=content.replace(/--list--/gi,"");if(ed.getParam('paste_insert_word_content_callback'))content=ed.execCallback('paste_insert_word_content_callback','after',content);this.editor.execCommand("mceInsertContent",false,content);if(this.editor.getParam('paste_force_cleanup_wordpaste',true)){var ed=this.editor;window.setTimeout(function(){ed.execCommand("mceCleanup");},1);}}},_reEscape:function(s){var l="?.\\*[](){}+^$:";var o="";for(var i=0;i blank_page wp/dev/wp-includes/js/tinymce/plugins/paste/js/0000755000106600010660000000000011051167752016736 5ustar wp/dev/wp-includes/js/tinymce/plugins/paste/js/pastetext.js0000644000106600010660000000172010743673705021324 0ustar tinyMCEPopup.requireLangPack(); function saveContent() { if (document.forms[0].htmlSource.value == '') { tinyMCEPopup.close(); return false; } tinyMCEPopup.execCommand('mcePasteText', false, { html : document.forms[0].htmlSource.value, linebreaks : document.forms[0].linebreaks.checked }); tinyMCEPopup.close(); } function onLoadInit() { tinyMCEPopup.resizeToInnerSize(); // Remove Gecko spellchecking if (tinymce.isGecko) document.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck"); resizeInputs(); } var wHeight=0, wWidth=0, owHeight=0, owWidth=0; function resizeInputs() { if (!tinymce.isIE) { wHeight = self.innerHeight-80; wWidth = self.innerWidth-17; } else { wHeight = document.body.clientHeight-80; wWidth = document.body.clientWidth-17; } document.forms[0].htmlSource.style.height = Math.abs(wHeight) + 'px'; document.forms[0].htmlSource.style.width = Math.abs(wWidth) + 'px'; } tinyMCEPopup.onInit.add(onLoadInit);wp/dev/wp-includes/js/tinymce/plugins/paste/js/pasteword.js0000644000106600010660000000260710761173352021311 0ustar tinyMCEPopup.requireLangPack(); function saveContent() { var html = document.getElementById("frmData").contentWindow.document.body.innerHTML; if (html == ''){ tinyMCEPopup.close(); return false; } tinyMCEPopup.execCommand('mcePasteWord', false, html); tinyMCEPopup.close(); } function onLoadInit() { tinyMCEPopup.resizeToInnerSize(); // Fix for endless reloading in FF window.setTimeout(createIFrame, 10); } function createIFrame() { document.getElementById('iframecontainer').innerHTML = ''; } var wHeight=0, wWidth=0, owHeight=0, owWidth=0; function initIframe(doc) { var dir = tinyMCEPopup.editor.settings.directionality; doc.body.dir = dir; // Remove Gecko spellchecking if (tinymce.isGecko) doc.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck"); resizeInputs(); } function resizeInputs() { if (!tinymce.isIE) { wHeight = self.innerHeight - 80; wWidth = self.innerWidth - 18; } else { wHeight = document.body.clientHeight - 80; wWidth = document.body.clientWidth - 18; } var elm = document.getElementById('frmData'); if (elm) { elm.style.height = Math.abs(wHeight) + 'px'; elm.style.width = Math.abs(wWidth) + 'px'; } } tinyMCEPopup.onInit.add(onLoadInit); wp/dev/wp-includes/js/tinymce/plugins/inlinepopups/0000755000106600010660000000000011051167751017732 5ustar wp/dev/wp-includes/js/tinymce/plugins/inlinepopups/skins/0000755000106600010660000000000011051167752021062 5ustar wp/dev/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/0000755000106600010660000000000011051167752023302 5ustar wp/dev/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/0000755000106600010660000000000011051167752024056 5ustar wp/dev/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif0000644000106600010660000000161710743673705026234 0ustar GIF89a'I=:8 }݂~ދ釚uù볧η̴%+ҭٴ!I,'II))#&&I++&&(ůG'(I'G4%گC$%4$CҎԬ#>6>6T@`>(P (B:  !dn0!F_rhةf$@xj2]/p8X  P)0u#@T ;j@ C+Rx.. 5`{ pav720ҡr5hV`k%ج6H -`~͂61$(b ]2+ "AH7]q >]{?4޼u҉Z @&-`=߀qH 2tA @\qd2 ""XJAٸH ;wp/dev/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif0000644000106600010660000000146210743673705025666 0ustar GIF89a wvnn \\ܣ<<66CCJJ888CCdd--QQ33yyWWiivvkj<<llbb$$uuEE׎ڴMLpp++$$eeKKRRÌͳ==AAdd::))::JJjjWWPP((;;ħɣп%%%ƪ00ccIIϺ̱֘~ȟ^]עUU,,ڌssyy||٭QPNNđƘBB__??mm 㺺߀bb!, o2u20v7$r1U{))F1+55=;p!}%Y!8d>x`~~ M\j_}]hE(M2x&sBW( '~7 ?Wf.cKRs&(#>88܅Dpj"@: )Fn$ 0&saxS-*B"-Ȅ }l9hǬ[8q ! 0HhACzfCˀ.a˻xtfbŃ|򗶱 xXB B(CӨH倠6v A;!,rMܰ !üЛPf@(ν@h $ӧg@;wp/dev/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/drag.gif0000644000106600010660000000007110750407446025462 0ustar GIF89afff!, 'k;wp/dev/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif0000644000106600010660000000140110743673705026741 0ustar GIF89a-P$%'êu}~鳧ùȿǵ=:8!.,-PpH,$el:ШtJVSجvzxL.hznhN% !$"HNXȰÇ#J\@ŋ3jܨǏ CI2ɓ(S\ɲ%0cʜI8sɳ JѣH (]ʴӧPJJիXjׯ`Ê۠ٳhӪ]˶۷o!ȝKݻx˗ LÈ'vǐ#KL˘3kyϠCMӨQ3Xͺװc@۸s޽ Nȓ+_μУK>݄سkν;ËOӫ_Ͼ_˟Ͽ(h& 6 „Vhfyv!x.($h(,0(.;wp/dev/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif0000644000106600010660000000013410743673705026363 0ustar GIF89a !, !(AK( 8vu)~*F ;wp/dev/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/button.gif0000644000106600010660000000043010743673705026064 0ustar GIF89aPccc!,PPC8;dihjLm,tJxpHDH1ɜ-P@ZجvvoްxL΂贚z^6|>~vz"w7ħ/! ;wp/dev/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif0000644000106600010660000000162310743673705026213 0ustar GIF89a *T xg(Z[3ʜ[ūu=ѻnKc+؈,Meх+9CRڃL5\D~zȼ3~ %zn)E"<jT,-E΂-wIܕ@T8»aʡ_Ȯ}I:TµІ2aû{_}a݊#?׳^]ݏ1ƘPőU{79P|y7!,  Q Q _J]#i#]J_Kai~aK #LG# HY̯H œɽOO V ?S SRi~8 * mAm R85|,eп$Fhp #A}?` b=Pis$ `AQmph):ANQ͈T@ P-NU>E2`^ X5rgowxd> WqC:(SMu"C@k,U&aIB8]1!xh $q$mZ\e8>aGXXKT$AO>DŽew#X@F ys=@…&Ƃܽr É}Wx-P\"FčI;wp/dev/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif0000644000106600010660000000173510750407446026253 0ustar GIF89at0궹RTT;=h !,t0Čdi$l;nr-&@|'#oH2/l(R+1q/X'c4XhIc2=Dn9x;}uqwC~CjX9lt|=vm#~ oİȿIJӸֶoЩƳnھ7!Tp}8H,bLq#) 4jĀ!Rɒ.Nd˗0cʔr͛.k S'O,`ˡ %!Ds `jTDVj+f lh&1aZ"dMdnڶpAo^v߮;!q +Ŭۺ}}7  y᳝Cp9<:jL~ݺ봯Y9wۨ#N{ٝwq{6..ekn;4ZϠ:ϻ'yy?>z`.iM-ZraO?Mn8SƤ$h(8b,H.h"28 9V#:$TX$Q$D)$8%HY%;HZ&ae%f|]*afhn9&nkQgMfD)'j9ƝY)=Il'( 餒)@bVJhv:**ʥnꞰ jꤿfګZ*mjhjv,JeZ>;,z,j-fr[-vnnžoK-cwzp˜.;Xc4Nbq'N;wp/dev/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css0000644000106600010660000001563411000754130025316 0ustar /* Clearlooks 2 */ /* Reset */ .clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block;} /* General */ .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block;} .clearlooks2 {position:absolute;} .clearlooks2 .mceWrapper {position:static} .mceEventBlocker {position:absolute; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%;} .clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; filter:alpha(opacity=50);} .clearlooks2_modalBlocker {position:absolute; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; filter:alpha(opacity=60); display:none} /* Top */ .clearlooks2 .mceTop, .clearlooks2 .mceTop div { top:0; width:100%; height:23px } .clearlooks2 .mceTop .mceLeft { width:55%; background-image: none; border-style: solid none none solid; border-width: 1px; } .clearlooks2 .mceTop .mceCenter { } .clearlooks2 .mceTop .mceRight { right:0; width:55%; height:23px; background-image: none; border-style: solid solid none none; border-width: 1px; } .clearlooks2 .mceTop span { width:100%; font: 12px/20px bold "Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold; } .clearlooks2 .mceFocus .mceTop .mceLeft { background-image: none; border-style: solid none none solid; border-width: 1px; } .clearlooks2 .mceFocus .mceTop .mceCenter { } .clearlooks2 .mceFocus .mceTop .mceRight { background-image: none; border-style: solid solid none none; border-width: 1px; } .clearlooks2 .mceFocus .mceTop span { color:#FFF } /* Middle */ .clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0} .clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)} .clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:#E4F2FD;border-left:1px solid #c6d9e9} .clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF} .clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:#E4F2FD;border-right:1px solid #c6d9e9} /* Bottom */ .clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px} .clearlooks2 .mceBottom {left:0; bottom:0; width:100%;background:#E4F2FD;border-bottom:1px solid #c6d9e9} .clearlooks2 .mceBottom div {top:0} .clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:#E4F2FD ;border-left:1px solid #c6d9e9} .clearlooks2 .mceBottom .mceCenter {left:5px; width:100%} .clearlooks2 .mceBottom .mceRight {right:0; width:6px; background:#E4F2FD url(img/drag.gif) no-repeat;border-right:1px solid #c6d9e9} .clearlooks2 .mceBottom span {display:none} .clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px} .clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0} .clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px} .clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0} .clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px} /* Actions */ .clearlooks2 a {width:29px; height:16px; top:3px} .clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0} .clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0} .clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0} .clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0} .clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px} .clearlooks2 .mceMovable .mceMove {display:block} .clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px} .clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px} .clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px} .clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px} .clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} .clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} .clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px} .clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px} .clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px} /* Resize */ .clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px} .clearlooks2 .mceResizable .mceResize {display:block} .clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none} .clearlooks2 .mceMinimizable .mceMin {display:block} .clearlooks2 .mceMaximizable .mceMax {display:block} .clearlooks2 .mceMaximized .mceMed {display:block} .clearlooks2 .mceMaximized .mceMax {display:none} .clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize} .clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize} .clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize} .clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize} .clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize} .clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize} .clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize} .clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize} /* Alert/Confirm */ .clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0} .clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px} .clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal} .clearlooks2 a:hover {font-weight:bold} .clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#E4F2FD} .clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px} .clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)} .clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px} .clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto} .clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)} wp/dev/wp-includes/js/tinymce/plugins/inlinepopups/template.htm0000644000106600010660000003032311031210647022247 0ustar Template for dialogs
    Blured
    Content
    Statusbar text.
    Focused
    Content
    Statusbar text.
    Statusbar
    Content
    Statusbar text.
    Statusbar, Resizable
    Content
    Statusbar text.
    Resizable, Maximizable
    Content
    Statusbar text.
    Blurred, Maximizable, Statusbar, Resizable
    Content
    Statusbar text.
    Maximized, Maximizable, Minimizable
    Content
    Statusbar text.
    Blured
    Content
    Statusbar text.
    Alert
    This is a very long error message. This is a very long error message. This is a very long error message. This is a very long error message. This is a very long error message. This is a very long error message. This is a very long error message. This is a very long error message. This is a very long error message. This is a very long error message. This is a very long error message. This is a very long error message.
    Ok
    Confirm
    This is a very long error message. This is a very long error message. This is a very long error message. This is a very long error message. This is a very long error message. This is a very long error message. This is a very long error message. This is a very long error message. This is a very long error message. This is a very long error message. This is a very long error message. This is a very long error message.
    Ok Cancel
    wp/dev/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js0000644000106600010660000002603311031210647023127 0ustar (function(){var DOM=tinymce.DOM,Element=tinymce.dom.Element,Event=tinymce.dom.Event,each=tinymce.each,is=tinymce.is;tinymce.create('tinymce.plugins.InlinePopups',{init:function(ed,url){ed.onBeforeRenderUI.add(function(){ed.windowManager=new tinymce.InlineWindowManager(ed);DOM.loadCSS(url+'/skins/'+(ed.settings.inlinepopups_skin||'clearlooks2')+"/window.css");});},getInfo:function(){return{longname:'InlinePopups',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager',{InlineWindowManager:function(ed){var t=this;t.parent(ed);t.zIndex=300000;t.count=0;},open:function(f,p){var t=this,id,opt='',ed=t.editor,dw=0,dh=0,vp,po,mdf,clf,we,w,u;f=f||{};p=p||{};if(!f.inline)return t.parent(f,p);if(!f.type)t.bookmark=ed.selection.getBookmark('simple');id=DOM.uniqueId();vp=DOM.getViewPort();f.width=parseInt(f.width||320);f.height=parseInt(f.height||240)+(tinymce.isIE?8:0);f.min_width=parseInt(f.min_width||150);f.min_height=parseInt(f.min_height||100);f.max_width=parseInt(f.max_width||2000);f.max_height=parseInt(f.max_height||2000);f.left=f.left||Math.round(Math.max(vp.x,vp.x+(vp.w/ 2.0) - (f.width /2.0)));f.top=f.top||Math.round(Math.max(vp.y,vp.y+(vp.h/ 2.0) - (f.height /2.0)));f.movable=f.resizable=true;p.mce_width=f.width;p.mce_height=f.height;p.mce_inline=true;p.mce_window_id=id;p.mce_auto_focus=f.auto_focus;t.features=f;t.params=p;t.onOpen.dispatch(t,f,p);if(f.type){opt+=' mceModal';if(f.type)opt+=' mce'+f.type.substring(0,1).toUpperCase()+f.type.substring(1);f.resizable=false;}if(f.statusbar)opt+=' mceStatusbar';if(f.resizable)opt+=' mceResizable';if(f.minimizable)opt+=' mceMinimizable';if(f.maximizable)opt+=' mceMaximizable';if(f.movable)opt+=' mceMovable';t._addAll(DOM.doc.body,['div',{id:id,'class':ed.settings.inlinepopups_skin||'clearlooks2',style:'width:100px;height:100px'},['div',{id:id+'_wrapper','class':'mceWrapper'+opt},['div',{id:id+'_top','class':'mceTop'},['div',{'class':'mceLeft'}],['div',{'class':'mceCenter'}],['div',{'class':'mceRight'}],['span',{id:id+'_title'},f.title||'']],['div',{id:id+'_middle','class':'mceMiddle'},['div',{id:id+'_left','class':'mceLeft'}],['span',{id:id+'_content'}],['div',{id:id+'_right','class':'mceRight'}]],['div',{id:id+'_bottom','class':'mceBottom'},['div',{'class':'mceLeft'}],['div',{'class':'mceCenter'}],['div',{'class':'mceRight'}],['span',{id:id+'_status'},'Content']],['a',{'class':'mceMove',tabindex:'-1',href:'javascript:;'}],['a',{'class':'mceMin',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceMax',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceMed',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceClose',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{id:id+'_resize_n','class':'mceResize mceResizeN',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_s','class':'mceResize mceResizeS',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_w','class':'mceResize mceResizeW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_e','class':'mceResize mceResizeE',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_nw','class':'mceResize mceResizeNW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_ne','class':'mceResize mceResizeNE',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_sw','class':'mceResize mceResizeSW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_se','class':'mceResize mceResizeSE',tabindex:'-1',href:'javascript:;'}]]]);DOM.setStyles(id,{top:-10000,left:-10000});if(tinymce.isGecko)DOM.setStyle(id,'overflow','auto');if(!f.type){dw+=DOM.get(id+'_left').clientWidth;dw+=DOM.get(id+'_right').clientWidth;dh+=DOM.get(id+'_top').clientHeight;dh+=DOM.get(id+'_bottom').clientHeight;}DOM.setStyles(id,{top:f.top,left:f.left,width:f.width+dw,height:f.height+dh});u=f.url||f.file;if(u){if(tinymce.relaxedDomain)u+=(u.indexOf('?')==-1?'?':'&')+'mce_rdomain='+tinymce.relaxedDomain;u=tinymce._addVer(u);}if(!f.type){DOM.add(id+'_content','iframe',{id:id+'_ifr',src:'javascript:""',frameBorder:0,style:'border:0;width:10px;height:10px'});DOM.setStyles(id+'_ifr',{width:f.width,height:f.height});DOM.setAttrib(id+'_ifr','src',u);}else{DOM.add(id+'_wrapper','a',{id:id+'_ok','class':'mceButton mceOk',href:'javascript:;',onmousedown:'return false;'},'Ok');if(f.type=='confirm')DOM.add(id+'_wrapper','a',{'class':'mceButton mceCancel',href:'javascript:;',onmousedown:'return false;'},'Cancel');DOM.add(id+'_middle','div',{'class':'mceIcon'});DOM.setHTML(id+'_content',f.content.replace('\n','
    '));}mdf=Event.add(id,'mousedown',function(e){var n=e.target,w,vp;w=t.windows[id];t.focus(id);if(n.nodeName=='A'||n.nodeName=='a'){if(n.className=='mceMax'){w.oldPos=w.element.getXY();w.oldSize=w.element.getSize();vp=DOM.getViewPort();vp.w-=2;vp.h-=2;w.element.moveTo(vp.x,vp.y);w.element.resizeTo(vp.w,vp.h);DOM.setStyles(id+'_ifr',{width:vp.w-w.deltaWidth,height:vp.h-w.deltaHeight});DOM.addClass(id+'_wrapper','mceMaximized');}else if(n.className=='mceMed'){w.element.moveTo(w.oldPos.x,w.oldPos.y);w.element.resizeTo(w.oldSize.w,w.oldSize.h);w.iframeElement.resizeTo(w.oldSize.w-w.deltaWidth,w.oldSize.h-w.deltaHeight);DOM.removeClass(id+'_wrapper','mceMaximized');}else if(n.className=='mceMove')return t._startDrag(id,e,n.className);else if(DOM.hasClass(n,'mceResize'))return t._startDrag(id,e,n.className.substring(13));}});clf=Event.add(id,'click',function(e){var n=e.target;t.focus(id);if(n.nodeName=='A'||n.nodeName=='a'){switch(n.className){case'mceClose':t.close(null,id);return Event.cancel(e);case'mceButton mceOk':case'mceButton mceCancel':f.button_func(n.className=='mceButton mceOk');return Event.cancel(e);}}});t.windows=t.windows||{};w=t.windows[id]={id:id,mousedown_func:mdf,click_func:clf,element:new Element(id,{blocker:1,container:ed.getContainer()}),iframeElement:new Element(id+'_ifr'),features:f,deltaWidth:dw,deltaHeight:dh};w.iframeElement.on('focus',function(){t.focus(id);});if(t.count==0&&t.editor.getParam('dialog_type')=='modal'){DOM.add(DOM.doc.body,'div',{id:'mceModalBlocker','class':(t.editor.settings.inlinepopups_skin||'clearlooks2')+'_modalBlocker',style:{left:vp.x,top:vp.y,zIndex:t.zIndex-1}});DOM.show('mceModalBlocker');}else DOM.setStyle('mceModalBlocker','z-index',t.zIndex-1);if(tinymce.isIE6||(tinymce.isIE&&!DOM.boxModel))DOM.setStyles('mceModalBlocker',{position:'absolute',width:vp.w-2,height:vp.h-2});t.focus(id);t._fixIELayout(id,1);if(DOM.get(id+'_ok'))DOM.get(id+'_ok').focus();t.count++;return w;},focus:function(id){var t=this,w=t.windows[id];w.zIndex=this.zIndex++;w.element.setStyle('zIndex',w.zIndex);w.element.update();id=id+'_wrapper';DOM.removeClass(t.lastId,'mceFocus');DOM.addClass(id,'mceFocus');t.lastId=id;},_addAll:function(te,ne){var i,n,t=this,dom=tinymce.DOM;if(is(ne,'string'))te.appendChild(dom.doc.createTextNode(ne));else if(ne.length){te=te.appendChild(dom.create(ne[0],ne[1]));for(i=2;iix){fw=w;ix=w.zIndex;}});if(fw)t.focus(fw.id);}},setTitle:function(w,ti){var e;w=this._findId(w);if(e=DOM.get(w+'_title'))e.innerHTML=DOM.encode(ti);},alert:function(txt,cb,s){var t=this,w;w=t.open({title:t,type:'alert',button_func:function(s){if(cb)cb.call(s||t,s);t.close(null,w.id);},content:DOM.encode(t.editor.getLang(txt,txt)),inline:1,width:400,height:130});},confirm:function(txt,cb,s){var t=this,w;w=t.open({title:t,type:'confirm',button_func:function(s){if(cb)cb.call(s||t,s);t.close(null,w.id);},content:DOM.encode(t.editor.getLang(txt,txt)),inline:1,width:400,height:130});},_findId:function(w){var t=this;if(typeof(w)=='string')return w;each(t.windows,function(wo){var ifr=DOM.get(wo.id+'_ifr');if(ifr&&w==ifr.contentWindow){w=wo.id;return false;}});return w;},_fixIELayout:function(id,s){var w,img;if(!tinymce.isIE6)return;each(['n','s','w','e','nw','ne','sw','se'],function(v){var e=DOM.get(id+'_resize_'+v);DOM.setStyles(e,{width:s?e.clientWidth:'',height:s?e.clientHeight:'',cursor:DOM.getStyle(e,'cursor',1)});DOM.setStyle(id+"_bottom",'bottom','-1px');e=0;});if(w=this.windows[id]){w.element.hide();w.element.show();each(DOM.select('div,a',id),function(e,i){if(e.currentStyle.backgroundImage!='none'){img=new Image();img.src=e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,'$1');}});DOM.get(id).style.filter='';}}});tinymce.PluginManager.add('inlinepopups',tinymce.plugins.InlinePopups);})();wp/dev/wp-includes/js/tinymce/plugins/directionality/0000755000106600010660000000000011051167751020230 5ustar wp/dev/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js0000644000106600010660000000255210750407446023441 0ustar (function(){tinymce.create('tinymce.plugins.Directionality',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceDirectionLTR',function(){var e=ed.dom.getParent(ed.selection.getNode(),ed.dom.isBlock);if(e){if(ed.dom.getAttrib(e,"dir")!="ltr")ed.dom.setAttrib(e,"dir","ltr");else ed.dom.setAttrib(e,"dir","");}ed.nodeChanged();});ed.addCommand('mceDirectionRTL',function(){var e=ed.dom.getParent(ed.selection.getNode(),ed.dom.isBlock);if(e){if(ed.dom.getAttrib(e,"dir")!="rtl")ed.dom.setAttrib(e,"dir","rtl");else ed.dom.setAttrib(e,"dir","");}ed.nodeChanged();});ed.addButton('ltr',{title:'directionality.ltr_desc',cmd:'mceDirectionLTR'});ed.addButton('rtl',{title:'directionality.rtl_desc',cmd:'mceDirectionRTL'});ed.onNodeChange.add(t._nodeChange,t);},getInfo:function(){return{longname:'Directionality',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_nodeChange:function(ed,cm,n){var dom=ed.dom,dir;n=dom.getParent(n,dom.isBlock);if(!n){cm.setDisabled('ltr',1);cm.setDisabled('rtl',1);return;}dir=dom.getAttrib(n,'dir');cm.setActive('ltr',dir=="ltr");cm.setDisabled('ltr',0);cm.setActive('rtl',dir=="rtl");cm.setDisabled('rtl',0);}});tinymce.PluginManager.add('directionality',tinymce.plugins.Directionality);})();wp/dev/wp-includes/js/tinymce/plugins/wpeditimage/0000755000106600010660000000000011051167751017504 5ustar wp/dev/wp-includes/js/tinymce/plugins/wpeditimage/img/0000755000106600010660000000000011051167751020260 5ustar wp/dev/wp-includes/js/tinymce/plugins/wpeditimage/img/image.png0000644000106600010660000000716511023402665022054 0ustar PNG  IHDRw= pHYs   OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳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wp/dev/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html0000644000106600010660000002757511047641230022334 0ustar
    {#wpeditimage.size}
    {#wpeditimage.s130}
    {#wpeditimage.s120}
    {#wpeditimage.s110}
    {#wpeditimage.s100}
    {#wpeditimage.s90}
    {#wpeditimage.s80}
    {#wpeditimage.s70}
    {#wpeditimage.s60}
    Lorem ipsum dolor sit amet consectetuer velit pretium euismod ipsum enim. Mi cursus at a mollis senectus id arcu gravida quis urna. Sed et felis id tempus Morbi mauris tincidunt enim In mauris. Pede eu risus velit libero natoque enim lorem adipiscing ipsum consequat. In malesuada et sociis tincidunt tempus pellentesque cursus convallis ipsum Suspendisse. Risus In ac quis ut Nunc convallis laoreet ante Suspendisse Nam. Amet amet urna condimentum Vestibulum sem at Curabitur lorem et cursus. Sodales tortor fermentum leo dui habitant Nunc Sed Vestibulum. Ut lorem In penatibus libero id ipsum sagittis nec elit Sed. Condimentum eget Vivamus vel consectetuer lorem molestie turpis amet tellus id. Condimentum vel ridiculus Fusce sed pede Nam nunc sodales eros tempor. Sit lacus magna dictumst Curabitur fringilla auctor id vitae wisi facilisi. Fermentum eget turpis felis velit leo Nunc Proin orci molestie Praesent. Curabitur tellus scelerisque suscipit ut sem amet cursus mi Morbi eu. Donec libero Vestibulum augue et mollis accumsan ornare condimentum In enim. Leo eget ac consectetuer quis condimentum malesuada. Condimentum commodo et Lorem fringilla malesuada libero volutpat sem tellus enim. Tincidunt sed at Aenean nec nonummy porttitor Nam Sed Nulla ut. Auctor leo In aliquet Curabitur eros et velit Quisque justo morbi. Et vel mauris sit nulla semper vitae et quis at dui. Id at elit laoreet justo eu mauris Quisque et interdum pharetra. Nullam accumsan interdum Maecenas condimentum quis quis Fusce a sollicitudin Sed. Non Quisque Vivamus congue porttitor non semper ipsum porttitor quis vel. Donec eros lacus volutpat et tincidunt sem convallis id venenatis sit. Consectetuer odio. Semper faucibus Morbi nulla convallis orci Aliquam Sed porttitor et Pellentesque. Venenatis laoreet lorem id a a Morbi augue turpis id semper. Arcu volutpat ac mauris Vestibulum fringilla Aenean condimentum nibh sed id. Sagittis eu lacus orci urna tellus tellus pretium Curabitur dui nunc. Et nibh eu eu nibh adipiscing at lorem Vestibulum adipiscing augue. Magna convallis Phasellus dolor malesuada Curabitur ornare adipiscing tellus Aliquam tempus. Id Aliquam Integer augue Nulla consectetuer ac Donec Curabitur tincidunt et. Id vel Nunc amet lacus dui magna ridiculus penatibus laoreet Duis. Enim sagittis nibh quis Nulla nec laoreet vel Maecenas mattis vel.

    {#wpeditimage.link_help}

    wp/dev/wp-includes/js/tinymce/plugins/wpeditimage/css/0000755000106600010660000000000011051167751020274 5ustar wp/dev/wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css0000644000106600010660000000710611034775215022743 0ustar html, body { background-color: #fff; margin: 0; padding: 0; } .submit input, .button { font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; padding: 3px 5px; font-size: 12px; line-height: 1.5em; border-width: 1px; border-style: solid; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; cursor: pointer; text-decoration: none; } textarea, input, select { font: 13px Verdana, Arial, Helvetica, sans-serif; margin: 1px; padding: 3px; } body, td { font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; } abbr.required { color: #FF0000; text-align: left; } img.alignright, .alignright { float: right; } img.alignleft, .alignleft { float: left; } img.aligncenter { display: block; margin-left: auto; margin-right: auto; } label { cursor: pointer; } th.label { width: 107px; } #media-upload #basic th.label { padding: 5px 5px 5px 0; } .show-align { height: 200px; width: 480px; float: right; background-color: #f1f1f1; cursor: default; -moz-user-select: none; user-select: none; overflow: hidden; } #media-upload #img-edit { border: 1px solid #c0c0c0; width: 623px; margin: 15px auto; } #media-upload .media-upload-form table.describe { border-top-style: none; border-top-width: 0; } #img_demo_txt { font-size: 6px; line-height: 10px; font-family: "Courier New",Courier,monotype; color: #ccc; background-color: #ccc; } #img_demo { padding: 0; } #saveeditimg { padding: 10px 0 0 5px; border-top: 1px solid #ccc; } #sidemenu, #sidemenu li { list-style: none; } #sidemenu li { display: inline; } #sidemenu a { border-bottom-style: solid; border-bottom-width: 1px; border-top-style: solid; border-top-width: 1px; display: block; float: left; line-height: 28px; text-decoration: none; text-align: center; white-space: nowrap; margin: 0; padding: 0pt 7px; } #sidemenu a.current { -moz-border-radius-topleft: 4px; -khtml-border-top-left-radius: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -khtml-border-top-right-radius: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; border-style:solid; border-width:1px; font-weight:normal; } #adv_settings .field label { padding: 0 5px 5px; } #media-upload h3 { clear: both; padding: 0pt 0pt 3px; border-bottom-style: solid; border-bottom-width: 1px; font-family: Georgia,"Times New Roman",Times,serif; font-size: 20px; font-weight: normal; line-height: normal; margin: 0 0 10px -4px; padding: 15px 0 3px; border-bottom-color: #DADADA; color: #5A5A5A; } #img_dim #width, #img_dim #height, #img_prop #border, #img_prop #vspace, #img_prop #hspace { width: 36px; } #img_dim abbr { padding: 0 4px; } #show_align_sp { width: 115px; } #img_dim input, #img_prop input { margin-right: 10px; } #basic .align .field label { padding: 0 0 0 24px; } #basic { padding-top: 2px; } td { padding: 2px 0; } #img_size { float: right; text-align: center; cursor: pointer; background-color: #f1f1f1; padding: 5px 0; width: 45px; } #img_size div { font-size: 10px; padding: 2px; border: 1px solid #f1f1f1; line-height: 15px; height: 15px; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; color: #07273E; } #img_size div#s100 { border-color: #A3A3A3; background-color: #E5E5E5; } #img_size_div { width: 100px; float: left; cursor: default; } #img_size_title { margin: 0 7px 5px; text-align: right; font-weight: bold; } #img_align_td { padding: 2px 0 8px; } wp/dev/wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css0000644000106600010660000000161211027740213023526 0ustar body#media-upload ul#sidemenu { left: auto; right: 0; } #basic .align .field label { display: block; float: right; padding: 0 24px 0 0; margin: 5px 3px 5px 5px; } .align .field input { display: block; float: right; margin: 5px 15px 5px 0; } tr.image-size label { margin: 0; } tr.image-size input { margin: 3px 15px 0 5px; } .image-align-none-label, .image-align-left-label, .image-align-center-label, .image-align-right-label { background-position: center right; } #media-upload .describe th.label { text-align: right; } .show-align, .alignright, #img_size { float: left; } tr.image-size label, tr.image-size input, #img_dim label, #img_dim input, #img_prop label, #img_prop input, #img_size_div, .alignleft { float: right; } #img_dim label, #img_prop label { margin: 5px 0pt; } #img_dim input, #img_prop input { margin: 0 5px 0 10px; } #img_size_title { text-align: left; } wp/dev/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js0000644000106600010660000001477111047641230022712 0ustar (function() { tinymce.create('tinymce.plugins.wpEditImage', { init : function(ed, url) { var t = this; t.url = url; t._createButtons(); // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('...'); ed.addCommand('WP_EditImage', function() { var el = ed.selection.getNode(); if ( ed.dom.getAttrib(el, 'class').indexOf('mceItem') != -1 || el.nodeName != 'IMG' ) return; tb_show('', url + '/editimage.html?ver=311g&TB_iframe=true'); tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); }); ed.onInit.add(function(ed) { tinymce.dom.Event.add(ed.getWin(), 'scroll', function(e) { ed.plugins.wpeditimage.hideButtons(); }); }); ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) { ed.plugins.wpeditimage.hideButtons(); }); ed.onSaveContent.add(function(ed, o) { ed.plugins.wpeditimage.hideButtons(); }); ed.onMouseUp.add(function(ed, e) { if ( tinymce.isOpera ) { if ( e.target.nodeName == 'IMG' ) ed.plugins.wpeditimage.showButtons(e.target); } else if ( ! tinymce.isWebKit ) { var n = ed.selection.getNode(), DL; if ( n.nodeName == 'IMG' && (DL = ed.dom.getParent(n, 'DL')) ) { window.setTimeout(function(){ var ed = tinyMCE.activeEditor, n = ed.selection.getNode(), DL = ed.dom.getParent(n, 'DL'); if ( n.width != (parseInt(ed.dom.getStyle(DL, 'width')) - 10) ) { ed.dom.setStyle(DL, 'width', parseInt(n.width)+10); ed.execCommand('mceRepaint'); } }, 100); } } }); ed.onMouseDown.add(function(ed, e) { if ( tinymce.isOpera || e.target.nodeName != 'IMG' ) { t.hideButtons(); return; } ed.plugins.wpeditimage.showButtons(e.target); }); ed.onKeyPress.add(function(ed, e) { var DL, DIV; if ( e.keyCode == 13 && (DL = ed.dom.getParent(ed.selection.getNode(), 'DL')) ) { var P = ed.dom.create('p', {}, ' '); if ( (DIV = DL.parentNode) && DIV.nodeName == 'DIV' ) ed.dom.insertAfter( P, DIV ); else ed.dom.insertAfter( P, DL ); tinymce.dom.Event.cancel(e); ed.selection.select(P); return false; } }); ed.onBeforeSetContent.add(function(ed, o) { o.content = t._do_shcode(o.content); }); ed.onPostProcess.add(function(ed, o) { if (o.get) o.content = t._get_shcode(o.content); }); }, _do_shcode : function(co) { return co.replace(/\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\][\s\u00a0]*/g, function(a,b,c){ b = b.replace(/\\'|\\'|\\'/g, ''').replace(/\\"|\\"/g, '"'); c = c.replace(/\\'|\\'/g, ''').replace(/\\"/g, '"'); var id = b.match(/id=['"]([^'"]+)/i), cls = b.match(/align=['"]([^'"]+)/i); var w = b.match(/width=['"]([0-9]+)/), cap = b.match(/caption=['"]([^'"]+)/i); id = ( id && id[1] ) ? id[1] : ''; cls = ( cls && cls[1] ) ? cls[1] : 'alignnone'; w = ( w && w[1] ) ? w[1] : ''; cap = ( cap && cap[1] ) ? cap[1] : ''; if ( ! w || ! cap ) return c; var div_cls = (cls == 'aligncenter') ? 'mceTemp mceIEcenter' : 'mceTemp'; return '
    '+c+'
    '+cap+'
    '; }); }, _get_shcode : function(co) { return co.replace(/
    \s*]+)>\s*]+>([\s\S]+?)<\/dt>\s*]+>(.+?)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi, function(a,b,c,cap){ var id = b.match(/id=['"]([^'"]+)/i), cls = b.match(/class=['"]([^'"]+)/i); var w = c.match(/width=['"]([0-9]+)/); id = ( id && id[1] ) ? id[1] : ''; cls = ( cls && cls[1] ) ? cls[1] : 'alignnone'; w = ( w && w[1] ) ? w[1] : ''; if ( ! w || ! cap ) return c; cls = cls.match(/align[^ '"]+/) || 'alignnone'; cap = cap.replace(/<\S[^<>]*>/gi, '').replace(/'/g, ''').replace(/"/g, '"'); return '[caption id="'+id+'" align="'+cls+'" width="'+w+'" caption="'+cap+'"]'+c+'[/caption]'; }); }, showButtons : function(n) { var t = this, ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y; if (ed.dom.getAttrib(n, 'class').indexOf('mceItem') != -1) return; vp = ed.dom.getViewPort(ed.getWin()); p1 = DOM.getPos(ed.getContentAreaContainer()); p2 = ed.dom.getPos(n); X = Math.max(p2.x - vp.x, 0) + p1.x; Y = Math.max(p2.y - vp.y, 0) + p1.y; DOM.setStyles('wp_editbtns', { 'top' : Y+5+'px', 'left' : X+5+'px', 'display' : 'block' }); t.btnsTout = window.setTimeout( function(){ed.plugins.wpeditimage.hideButtons();}, 5000 ); }, hideButtons : function() { if ( tinymce.DOM.isHidden('wp_editbtns') ) return; tinymce.DOM.hide('wp_editbtns'); window.clearTimeout(this.btnsTout); }, _createButtons : function() { var t = this, ed = tinyMCE.activeEditor, DOM = tinymce.DOM; DOM.remove('wp_editbtns'); var wp_editbtns = DOM.add(document.body, 'div', { id : 'wp_editbtns', style : 'display:none;' }); var wp_editimgbtn = DOM.add('wp_editbtns', 'img', { src : t.url+'/img/image.png', id : 'wp_editimgbtn', width : '24', height : '24', title : ed.getLang('wpeditimage.edit_img') }); wp_editimgbtn.onmousedown = function(e) { var ed = tinyMCE.activeEditor; ed.windowManager.bookmark = ed.selection.getBookmark('simple'); ed.execCommand("WP_EditImage"); this.parentNode.style.display = 'none'; }; var wp_delimgbtn = DOM.add('wp_editbtns', 'img', { src : t.url+'/img/delete.png', id : 'wp_delimgbtn', width : '24', height : '24', title : ed.getLang('wpeditimage.del_img') }); wp_delimgbtn.onmousedown = function(e) { var ed = tinyMCE.activeEditor, el = ed.selection.getNode(), p; if ( el.nodeName == 'IMG' && ed.dom.getAttrib(el, 'class').indexOf('mceItem') == -1 ) { if ( (p = ed.dom.getParent(el, 'div')) && ed.dom.hasClass(p, 'mceTemp') ) ed.dom.remove(p); else if ( (p = ed.dom.getParent(el, 'A')) && p.childNodes.length == 1 ) ed.dom.remove(p); else ed.dom.remove(el); this.parentNode.style.display = 'none'; ed.execCommand('mceRepaint'); return false; } }; }, getInfo : function() { return { longname : 'Edit Image', author : 'WordPress', authorurl : 'http://wordpress.org', infourl : '', version : "1.0" }; } }); tinymce.PluginManager.add('wpeditimage', tinymce.plugins.wpEditImage); })(); wp/dev/wp-includes/js/tinymce/plugins/wpeditimage/js/0000755000106600010660000000000011051167751020120 5ustar wp/dev/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js0000644000106600010660000004063211047641230022405 0ustar var tinymce = null, tinyMCEPopup, tinyMCE; tinyMCEPopup = { init: function() { var t = this, w, ti, li, q, i, it; li = ('' + document.location.search).replace(/^\?/, '').split('&'); q = {}; for (i=0; i' ); } }, I : function(e) { return document.getElementById(e); }, current : '', link : '', link_rel : '', target_value : '', current_size_sel : 's100', width : '', height : '', align : '', img_alt : '', setTabs : function(tab) { var t = this; if ( 'current' == tab.className ) return false; t.I('div_advanced').style.display = ( 'tab_advanced' == tab.id ) ? 'block' : 'none'; t.I('div_basic').style.display = ( 'tab_basic' == tab.id ) ? 'block' : 'none'; t.I('tab_basic').className = t.I('tab_advanced').className = ''; tab.className = 'current'; return false; }, img_seturl : function(u) { var t = this, rel = t.I('link_rel').value; if ( 'current' == u ) { t.I('link_href').value = t.current; t.I('link_rel').value = t.link_rel; } else { t.I('link_href').value = t.link; if ( rel ) { rel = rel.replace( /attachment|wp-att-[0-9]+/gi, '' ); t.I('link_rel').value = tinymce.trim(rel); } } }, imgAlignCls : function(v) { var t = this, cls = t.I('img_classes').value; t.I('img_demo').className = t.align = v; cls = cls.replace( /align[^ "']+/gi, '' ); cls += (' ' + v); cls = cls.replace( /\s+/g, ' ' ).replace( /^\s/, '' ); if ( 'aligncenter' == v ) { t.I('hspace').value = ''; t.updateStyle('hspace'); } t.I('img_classes').value = cls; }, showSize : function(el) { var t = this, demo = t.I('img_demo'), w = t.width, h = t.height, id = el.id || 's100', size; size = parseInt(id.substring(1)) / 200; demo.width = Math.round(w * size); demo.height = Math.round(h * size); t.showSizeClear(); el.style.borderColor = '#A3A3A3'; el.style.backgroundColor = '#E5E5E5'; }, showSizeSet : function() { var t = this; if ( (t.width * 1.3) > parseInt(t.preloadImg.width) ) { var s130 = t.I('s130'), s120 = t.I('s120'), s110 = t.I('s110'); s130.onclick = s120.onclick = s110.onclick = null; s130.onmouseover = s120.onmouseover = s110.onmouseover = null; s130.style.color = s120.style.color = s110.style.color = '#aaa'; } }, showSizeRem : function() { var t = this, demo = t.I('img_demo'), f = document.forms[0]; demo.width = Math.round(f.width.value * 0.5); demo.height = Math.round(f.height.value * 0.5); t.showSizeClear(); t.I(t.current_size_sel).style.borderColor = '#A3A3A3'; t.I(t.current_size_sel).style.backgroundColor = '#E5E5E5'; return false; }, showSizeClear : function() { var divs = this.I('img_size').getElementsByTagName('div'); for ( i = 0; i < divs.length; i++ ) { divs[i].style.borderColor = '#f1f1f1'; divs[i].style.backgroundColor = '#f1f1f1'; } }, imgEditSize : function(el) { var t = this, f = document.forms[0]; if ( ! t.preloadImg || ! t.preloadImg.width || ! t.preloadImg.height ) return; var W = parseInt(t.preloadImg.width), H = parseInt(t.preloadImg.height), w = t.width || W, h = t.height || H, id = el.id || 's100'; size = parseInt(id.substring(1)) / 100; w = Math.round(w * size); h = Math.round(h * size); f.width.value = Math.min(W, w); f.height.value = Math.min(H, h); t.current_size_sel = id; t.demoSetSize(); }, demoSetSize : function(img) { var demo = this.I('img_demo'), f = document.forms[0]; demo.width = f.width.value ? Math.round(f.width.value * 0.5) : ''; demo.height = f.height.value ? Math.round(f.height.value * 0.5) : ''; }, demoSetStyle : function() { var f = document.forms[0], demo = this.I('img_demo'), dom = tinyMCEPopup.editor.dom; if (demo) { dom.setAttrib(demo, 'style', f.img_style.value); dom.setStyle(demo, 'width', ''); dom.setStyle(demo, 'height', ''); } }, origSize : function() { var t = this, f = document.forms[0], el = t.I('s100'); f.width.value = t.width = t.preloadImg.width; f.height.value = t.height = t.preloadImg.height; t.showSizeSet(); t.demoSetSize(); t.showSize(el); }, init : function() { var ed = tinyMCEPopup.editor, h; h = document.body.innerHTML; // Replace a=x with a="x" in IE if (tinymce.isIE) h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"') document.body.innerHTML = ed.translate(h); window.setTimeout( function(){wpImage.setup();}, 100 ); }, setup : function() { var t = this, h, c, el, id, link, fname, f = document.forms[0], ed = tinyMCEPopup.editor, d = t.I('img_demo'), dom = tinyMCEPopup.dom, DL, caption = ''; document.dir = tinyMCEPopup.editor.getParam('directionality',''); if ( tinyMCEPopup.editor.getParam('wpeditimage_disable_captions', false) ) t.I('cap_field').style.display = 'none'; tinyMCEPopup.restoreSelection(); el = ed.selection.getNode(); if (el.nodeName != 'IMG') return; f.img_src.value = d.src = link = ed.dom.getAttrib(el, 'src'); ed.dom.setStyle(el, 'float', ''); t.getImageData(); c = ed.dom.getAttrib(el, 'class'); if ( DL = dom.getParent(el, 'dl') ) { var dlc = ed.dom.getAttrib(DL, 'class'); dlc = dlc.match(/align[^ "']+/i); if ( dlc && ! dom.hasClass(el, dlc) ) { c += ' '+dlc; tinymce.trim(c); } tinymce.each(DL.childNodes, function(e) { if ( e.nodeName == 'DD' && dom.hasClass(e, 'wp-caption-dd') ) { caption = e.innerHTML; return; } }); } f.img_cap.value = caption; f.img_title.value = ed.dom.getAttrib(el, 'title'); f.img_alt.value = ed.dom.getAttrib(el, 'alt'); f.border.value = ed.dom.getAttrib(el, 'border'); f.vspace.value = ed.dom.getAttrib(el, 'vspace'); f.hspace.value = ed.dom.getAttrib(el, 'hspace'); f.align.value = ed.dom.getAttrib(el, 'align'); f.width.value = t.width = ed.dom.getAttrib(el, 'width'); f.height.value = t.height = ed.dom.getAttrib(el, 'height'); f.img_classes.value = c; f.img_style.value = ed.dom.getAttrib(el, 'style'); // Move attribs to styles if (dom.getAttrib(el, 'hspace')) t.updateStyle('hspace'); if (dom.getAttrib(el, 'border')) t.updateStyle('border'); if (dom.getAttrib(el, 'vspace')) t.updateStyle('vspace'); if (pa = ed.dom.getParent(el, 'A')) { f.link_href.value = t.current = ed.dom.getAttrib(pa, 'href'); f.link_title.value = ed.dom.getAttrib(pa, 'title'); f.link_rel.value = t.link_rel = ed.dom.getAttrib(pa, 'rel'); f.link_style.value = ed.dom.getAttrib(pa, 'style'); t.target_value = ed.dom.getAttrib(pa, 'target'); f.link_classes.value = ed.dom.getAttrib(pa, 'class'); } f.link_target.checked = ( t.target_value && t.target_value == '_blank' ) ? 'checked' : ''; fname = link.substring( link.lastIndexOf('/') ); fname = fname.replace(/-[0-9]{2,4}x[0-9]{2,4}/, '' ); t.link = link.substring( 0, link.lastIndexOf('/') ) + fname; if ( c.indexOf('alignleft') != -1 ) { t.I('alignleft').checked = "checked"; d.className = t.align = "alignleft"; } else if ( c.indexOf('aligncenter') != -1 ) { t.I('aligncenter').checked = "checked"; d.className = t.align = "aligncenter"; } else if ( c.indexOf('alignright') != -1 ) { t.I('alignright').checked = "checked"; d.className = t.align = "alignright"; } else if ( c.indexOf('alignnone') != -1 ) { t.I('alignnone').checked = "checked"; d.className = t.align = "alignnone"; } if ( t.width && t.preloadImg.width ) t.showSizeSet(); document.body.style.display = ''; }, remove : function() { var ed = tinyMCEPopup.editor, p, el; tinyMCEPopup.restoreSelection(); el = ed.selection.getNode(); if (el.nodeName != 'IMG') return; if ( (p = ed.dom.getParent(el, 'div')) && ed.dom.hasClass(p, 'mceTemp') ) ed.dom.remove(p); else if ( (p = ed.dom.getParent(el, 'A')) && p.childNodes.length == 1 ) ed.dom.remove(p); else ed.dom.remove(el); ed.execCommand('mceRepaint'); tinyMCEPopup.close(); return; }, update : function() { var t = this, f = document.forms[0], ed = tinyMCEPopup.editor, el, b, fixSafari = null, DL, P, A, DIV, do_caption = null, img_class = f.img_classes.value, html; tinyMCEPopup.restoreSelection(); el = ed.selection.getNode(); if (el.nodeName != 'IMG') return; if (f.img_src.value === '') { t.remove(); return; } if ( f.img_cap.value != '' && f.width.value != '' ) { do_caption = 1; img_class = img_class.replace( /align[^ "']+\s?/gi, '' ); } A = ed.dom.getParent(el, 'a'); P = ed.dom.getParent(el, 'p'); DL = ed.dom.getParent(el, 'dl'); DIV = ed.dom.getParent(el, 'div'); tinyMCEPopup.execCommand("mceBeginUndoLevel"); ed.dom.setAttribs(el, { src : f.img_src.value, title : f.img_title.value, alt : f.img_alt.value, width : f.width.value, height : f.height.value, style : f.img_style.value, 'class' : img_class }); if ( f.link_href.value ) { // Create new anchor elements if ( A == null ) { if ( ! f.link_href.value.match(/https?:\/\//i) ) f.link_href.value = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.link_href.value); if ( tinymce.isWebKit && ed.dom.hasClass(el, 'aligncenter') ) { ed.dom.removeClass(el, 'aligncenter'); fixSafari = 1; } tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); if ( fixSafari ) ed.dom.addClass(el, 'aligncenter'); tinymce.each(ed.dom.select("a"), function(n) { if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { ed.dom.setAttribs(n, { href : f.link_href.value, title : f.link_title.value, rel : f.link_rel.value, target : (f.link_target.checked == true) ? '_blank' : '', 'class' : f.link_classes.value, style : f.link_style.value }); } }); } else { ed.dom.setAttribs(A, { href : f.link_href.value, title : f.link_title.value, rel : f.link_rel.value, target : (f.link_target.checked == true) ? '_blank' : '', 'class' : f.link_classes.value, style : f.link_style.value }); } } if ( do_caption ) { var id, cap_id = '', cap, DT, DD, cap_width = 10 + parseInt(f.width.value), align = t.align.substring(5), div_cls = (t.align == 'aligncenter') ? 'mceTemp mceIEcenter' : 'mceTemp'; if ( DL ) { ed.dom.setAttribs(DL, { 'class' : 'wp-caption '+t.align, style : 'width: '+cap_width+'px;' }); if ( DIV ) ed.dom.setAttrib(DIV, 'class', div_cls); if ( (DT = ed.dom.getParent(el, 'dt')) && (DD = DT.nextSibling) && ed.dom.hasClass(DD, 'wp-caption-dd') ) ed.dom.setHTML(DD, f.img_cap.value); } else { var lnk = '', pa; if ( (id = f.img_classes.value.match( /wp-image-([0-9]{1,6})/ )) && id[1] ) cap_id = 'attachment_'+id[1]; if ( f.link_href.value && (lnk = ed.dom.getParent(el, 'a')) ) { if ( lnk.childNodes.length == 1 ) html = ed.dom.getOuterHTML(lnk); else { html = ed.dom.getOuterHTML(lnk); html = html.match(/]+>/i); html = html+ed.dom.getOuterHTML(el)+''; } } else html = ed.dom.getOuterHTML(el); html = '
    '+html+'
    '+f.img_cap.value+'
    '; cap = ed.dom.create('div', {'class': div_cls}, html); if ( P ) { P.parentNode.insertBefore(cap, P); if ( P.childNodes.length == 1 ) ed.dom.remove(P); else if ( lnk && lnk.childNodes.length == 1 ) ed.dom.remove(lnk); else ed.dom.remove(el); } else if ( pa = ed.dom.getParent(el, 'TD,TH,LI') ) { pa.appendChild(cap); if ( lnk && lnk.childNodes.length == 1 ) ed.dom.remove(lnk); else ed.dom.remove(el); } } } else { if ( DL && DIV ) { var aa; if ( f.link_href.value && (aa = ed.dom.getParent(el, 'a')) ) html = ed.dom.getOuterHTML(aa); else html = ed.dom.getOuterHTML(el); P = ed.dom.create('p', {}, html); DIV.parentNode.insertBefore(P, DIV); ed.dom.remove(DIV); } } if ( f.img_classes.value.indexOf('aligncenter') != -1 ) { if ( P && ( ! P.style || P.style.textAlign != 'center' ) ) ed.dom.setStyle(P, 'textAlign', 'center'); } else { if ( P && P.style && P.style.textAlign == 'center' ) ed.dom.setStyle(P, 'textAlign', ''); } if ( ! f.link_href.value && A ) { b = ed.selection.getBookmark(); ed.dom.remove(A, 1); ed.selection.moveToBookmark(b); } tinyMCEPopup.execCommand("mceEndUndoLevel"); ed.execCommand('mceRepaint'); tinyMCEPopup.close(); }, updateStyle : function(ty) { var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : f.img_style.value}); if (tinyMCEPopup.editor.settings.inline_styles) { // Handle align if (ty == 'align') { dom.setStyle(img, 'float', ''); dom.setStyle(img, 'vertical-align', ''); v = f.align.value; if (v) { if (v == 'left' || v == 'right') dom.setStyle(img, 'float', v); else img.style.verticalAlign = v; } } // Handle border if (ty == 'border') { dom.setStyle(img, 'border', ''); v = f.border.value; if (v || v == '0') { if (v == '0') img.style.border = '0'; else img.style.border = v + 'px solid black'; } } // Handle hspace if (ty == 'hspace') { dom.setStyle(img, 'marginLeft', ''); dom.setStyle(img, 'marginRight', ''); v = f.hspace.value; if (v) { img.style.marginLeft = v + 'px'; img.style.marginRight = v + 'px'; } } // Handle vspace if (ty == 'vspace') { dom.setStyle(img, 'marginTop', ''); dom.setStyle(img, 'marginBottom', ''); v = f.vspace.value; if (v) { img.style.marginTop = v + 'px'; img.style.marginBottom = v + 'px'; } } // Merge f.img_style.value = dom.serializeStyle(dom.parseStyle(img.style.cssText)); this.demoSetStyle(); } }, checkVal : function(f) { if ( f.value == '' ) { // if ( f.id == 'width' ) f.value = this.width || this.preloadImg.width; // if ( f.id == 'height' ) f.value = this.height || this.preloadImg.height; if ( f.id == 'img_src' ) f.value = this.I('img_demo').src || this.preloadImg.src; } }, resetImageData : function() { var f = document.forms[0]; f.width.value = f.height.value = ''; }, updateImageData : function() { var f = document.forms[0], t = wpImage; if ( f.width.value == '' || f.height.value == '' ) { f.width.value = t.width = t.preloadImg.width; f.height.value = t.height = t.preloadImg.height; } t.showSizeSet(); t.demoSetSize(); if ( f.img_style.value ) t.demoSetStyle(); }, getImageData : function() { var t = wpImage, f = document.forms[0]; t.preloadImg = new Image(); t.preloadImg.onload = t.updateImageData; t.preloadImg.onerror = t.resetImageData; t.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.img_src.value); } }; window.onload = function(){wpImage.init();} wpImage.preInit(); wp/dev/wp-includes/js/tinymce/wp-mce-help.php0000644000106600010660000003042611031210647016347 0ustar > <?php _e('Rich Editor Help') ?> text_direction) ) : ?>

    Rich editing, also called WYSIWYG for What You See Is What You Get, means your text is formatted as you type. The rich editor creates HTML code behind the scenes while you concentrate on writing. Font styles, links and images all appear approximately as they will on the internet.') ?>

    wp/dev/wp-includes/js/tinymce/wordpress.css0000644000106600010660000000231711047735541016274 0ustar /* This file contains the CSS data for the editable area(iframe) of TinyMCE */ .aligncenter, dl.aligncenter { display: block; margin-left: auto; margin-right: auto; } .alignleft { float: left; } .alignright { float: right; } .wp-caption { border: 1px solid #ddd; text-align: center; background-color: #f3f3f3; padding-top: 4px; margin: 10px; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } .wp-caption img { margin: 0; padding: 0; border: 0 none; } .wp-caption-dd { font-size: 11px; line-height: 17px; padding: 0 4px 5px; margin: 0; } body.mceContentBody { background: #fff; color: #000; font: 13px/19px "Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif; padding: 0.6em; margin: 0; } body.mceForceColors { background:#fff; color:#000; } h1 {font-size: 2em} h2 {font-size: 1.5em} h3 {font-size: 1.17em} h4 {font-size: 1em} h5 {font-size: .83em} h6 {font-size: .75em} .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid { border: 1px dashed #BBB; } img { border:0; } td { font-size: 10px; } pre { font: 12px/18px "Courier New", monospace; } .mceIEcenter { text-align: center; } wp/dev/wp-includes/js/tinymce/blank.htm0000644000106600010660000000031410740224325015316 0ustar blank_page wp/dev/wp-includes/js/tinymce/license.txt0000644000106600010660000006446310762616541015730 0ustar GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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. Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! wp/dev/wp-includes/js/tinymce/themes/0000755000106600010660000000000011051167752015012 5ustar wp/dev/wp-includes/js/tinymce/themes/advanced/0000755000106600010660000000000011051167752016557 5ustar wp/dev/wp-includes/js/tinymce/themes/advanced/skins/0000755000106600010660000000000011051167752017706 5ustar wp/dev/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/0000755000106600010660000000000011051167752021516 5ustar wp/dev/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/0000755000106600010660000000000011051167752022272 5ustar wp/dev/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/separator.gif0000644000106600010660000000007110750407446024761 0ustar GIF89a!, b ;wp/dev/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/down_arrow.gif0000644000106600010660000000007410750407446025145 0ustar GIF89a !, je9L;wp/dev/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/butt2.png0000644000106600010660000000104110750407446024036 0ustar PNG  IHDRW?PLTE UIDATx^NQ {sw]pw%\pdw;)8NH%y%xqP*(J=9~Q_sRyr C CPs&*ڹ C{hرkım6h,gƘX n,KK["`64L$1?HzzO"""Y>tyMf9vmmnݪjZzG)uX:xxz H3Q5 B.@ $pd!s#~<<+"x M0B\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BvʛPu9+& 2x& k& U] vo opraT&!,{ 'e7\l-)S7@&4+`yTSL\:=Jk:;eĈ8cA8Oj@b/+:{ tyt#|- mN qK!,lI+8b̠y h*Zp=3`C`B"pX 9bPB`Z= 8>u,St"ΦOT\um|; 8~*!,xIA]GeAPb)"!s BI М V 5q((X2=,I n#&AVq5t sny\)_g|r5!,gD+8[{`&y_hI)(L "+gN8l5"LA .%@%O@8NgL+Ƀpus/ jȩjVj c7 I!,\0t p hQm6Tqmx( 6'sa@`]-lz0 _g ir!` !,s ءXP\|)pWʄQ稊G.}!*1p v;Tݩ2 X )|f%9`}0PFd~ezGw);wp/dev/wp-includes/js/tinymce/themes/advanced/skins/default/img/menu_arrow.gif0000644000106600010660000000010410743673705024755 0ustar GIF89a!, zq(׉*;wp/dev/wp-includes/js/tinymce/themes/advanced/skins/default/img/menu_check.gif0000644000106600010660000000010610743673705024702 0ustar GIF89a!,;i#~ʶ{;wp/dev/wp-includes/js/tinymce/themes/advanced/skins/default/img/buttons.png0000644000106600010660000000631210743673705024323 0ustar PNG  IHDR^NQgAMA7tEXtSoftwareAdobe ImageReadyqe<OPLTE! 𴳲[[[^žu\ apī' xxxlllHHH»***kkkܻĽǿ޾444JJJ׷ĻٹyyyzzzKKK߿]]]ȿvvvü^0}#999UUUBBB111KYYYᑢ9```nnnDY>>>rrrMMMӿtttgggċ%%%bq慅쑐1M IDATxڴ_WG2ɄPTf" YI$ %W.UZRWE@^m]["ؾ眙ɤ৿o>999sTQQZkhA`_޾i#;GV+_C3D\#s;D܂Wzrᔋ;@F' 񆄂 4JHӍ2 M8?R-ׇ}wfS_UX\Jk sC<"rWdX\eͺrjԅ$`6=}Ezz,YLR-=E_(TxG\{Ywuz \GVXhqtzуzwb"5”}Hu/ww*.NstvZU!@:$*=J뫫`Z߁씽ۭUjH WIIҞ,Mx¢U Abi {^ {d^L8jҦ>Kwy QР+uj9ǃd }{4a< au:Odgs\a<{r7豪I DG+ p<7 ^"%к& ʸbWW ރu< 0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feI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3-gAMA|Q cHRMz%u0`:o_FPLTEΙ߃ÃÄĄÛ࠼䕯ՠ▯ԸV}⟻ᠼ⠻ܟޠޟݴIMMNNV`defjvߍux|܁܃كڄڄߋߍyyxzلutvu_`hji·͆ψUVWW`Ԙبڪʴɴ٩۶ڵʴɳӵӵڵ8DtRNSS%IDATxڔ\g-BZ}X]IumXn3Ar\_cozY $27J`2(du")@l\<+y^w}Cߪu\}>[r+++>⍽*+ҒqR[)(im aP)ķr*++dC$_5ZoȩɀRpqM}M}="@s*q #$ $$ {ꔎ0܄ y$IDHAHAHP,9GqoJA 8HD AX)2෥z}NuzEŲSAL+unpwvg"O靟J~aeavQ;57_~x<^iga<7a/=n9~ni{K bؕSRSi h =ק w:Apo0H( `( C!qn\3P( 5 B2ԩ4r76666v^\KUIohOzzY/eY/zgXT[C3,^/˲ : ==4HVּW*8 44 +)ǞIX=1114xfffg?1, _ u) \:<?qV 3I>;S)xyqq 2/~ f#H4DHDpQ $Wex.7t|?@>__uBpߨ9q9wntttT~R+W`䞃Fq"=*}Y޴[j'4GD^2|00M$I$H$O/$ /gJ+zF~]P[Rd'Nhׯm\۸M1mJSߒԆVV*~X]][[U;A]mxy~*/sm8 U΁OjKKKKK@[YVbbJ,SMҀiWyyq]\y*U4444D Hq <7-s_Ԩ6D#sHdv6DhT}ᑴĉ7??iÁ? |}?_OaWhu\.lu8]V6.?kNr9.p\NTqRᛀNr9.Gt:T᧓}tbBdWwWɮ'T$u6LDI ADo4G/gJ+6r>wIENDB`wp/dev/wp-includes/js/tinymce/themes/advanced/skins/o2k7/ui.css0000644000106600010660000003456511000754130021616 0ustar /* Reset */ .o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} .o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} .o2k7Skin table td {vertical-align:middle} /* Containers */ .o2k7Skin table {background:#E5EFFD} .o2k7Skin iframe {display:block; background:#FFF} .o2k7Skin .mceToolbar {height:26px} /* External */ .o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none} .o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;} .o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} /* Layout */ .o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD} .o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD} .o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} .o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} .o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} .o2k7Skin .mceStatusbar {display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} .o2k7Skin .mceStatusbar div {float:left; padding:2px} .o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize} .o2k7Skin .mceStatusbar a:hover {text-decoration:underline} .o2k7Skin table.mceToolbar {margin-left:3px} .o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;} .o2k7Skin .mceToolbar td.mceFirst span {margin:0} .o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} .o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none} .o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px} .o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} .o2k7Skin td.mceCenter {text-align:center;} .o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;} .o2k7Skin td.mceRight table {margin:0 0 0 auto;} /* Button */ .o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} .o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px} .o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px} .o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} .o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px} .o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; filter:alpha(opacity=30)} .o2k7Skin .mceButtonLabeled {width:auto} .o2k7Skin .mceButtonLabeled span.mceIcon {float:left} .o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} .o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888} /* Separator */ .o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} /* ListBox */ .o2k7Skin .mceListBox {margin-left:3px} .o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} .o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} .o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} .o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} .o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} .o2k7Skin .mceListBoxDisabled .mceText {color:gray} .o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden} .o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} .o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} /* SplitButton */ .o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px} .o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} .o2k7Skin .mceSplitButton a.mceAction {width:22px} .o2k7Skin .mceSplitButton span.mceAction {width:22px; background:url(../../img/icons.gif) 20px 20px} .o2k7Skin .mceSplitButton a.mceOpen {width:10px} .o2k7Skin .mceSplitButton span.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0} .o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px} .o2k7Skin table.mceSplitButtonEnabled:hover span.mceOpen, .o2k7Skin .mceSplitButtonHover span.mceOpen, .o2k7Skin .mceSplitButtonSelected span.mceOpen {background-position:-44px -44px} .o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; filter:alpha(opacity=30)} .o2k7Skin .mceSplitButtonActive {background-position:0 -44px} /* ColorSplitButton */ .o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} .o2k7Skin .mceColorSplitMenu td {padding:2px} .o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} .o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} .o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} .o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} .o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A} .o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden} .o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden} /* Menu */ .o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD} .o2k7Skin .mceNoIcons span.mceIcon {width:0;} .o2k7Skin .mceNoIcons a .mceText {padding-left:10px} .o2k7Skin .mceMenu table {background:#FFF} .o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block} .o2k7Skin .mceMenu td {height:20px} .o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0} .o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} .o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px} .o2k7Skin .mceMenu pre.mceText {font-family:Monospace} .o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} .o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3} .o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px} .o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD} .o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} .o2k7Skin .mceMenuItemDisabled .mceText {color:#888} .o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)} .o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} .o2k7Skin .mceMenu span.mceMenuLine {display:none} .o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} /* Progress,Resize */ .o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; filter:alpha(opacity=50); background:#FFF} .o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} .o2k7Skin .mcePlaceHolder {border:1px dotted gray} /* Formats */ .o2k7Skin .mce_formatPreview a {font-size:10px} .o2k7Skin .mce_p span.mceText {} .o2k7Skin .mce_address span.mceText {font-style:italic} .o2k7Skin .mce_pre span.mceText {font-family:monospace} .o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} .o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} .o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} .o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} .o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} .o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} /* Theme */ .o2k7Skin span.mce_bold {background-position:0 0} .o2k7Skin span.mce_italic {background-position:-60px 0} .o2k7Skin span.mce_underline {background-position:-140px 0} .o2k7Skin span.mce_strikethrough {background-position:-120px 0} .o2k7Skin span.mce_undo {background-position:-160px 0} .o2k7Skin span.mce_redo {background-position:-100px 0} .o2k7Skin span.mce_cleanup {background-position:-40px 0} .o2k7Skin span.mce_bullist {background-position:-20px 0} .o2k7Skin span.mce_numlist {background-position:-80px 0} .o2k7Skin span.mce_justifyleft {background-position:-460px 0} .o2k7Skin span.mce_justifyright {background-position:-480px 0} .o2k7Skin span.mce_justifycenter {background-position:-420px 0} .o2k7Skin span.mce_justifyfull {background-position:-440px 0} .o2k7Skin span.mce_anchor {background-position:-200px 0} .o2k7Skin span.mce_indent {background-position:-400px 0} .o2k7Skin span.mce_outdent {background-position:-540px 0} .o2k7Skin span.mce_link {background-position:-500px 0} .o2k7Skin span.mce_unlink {background-position:-640px 0} .o2k7Skin span.mce_sub {background-position:-600px 0} .o2k7Skin span.mce_sup {background-position:-620px 0} .o2k7Skin span.mce_removeformat {background-position:-580px 0} .o2k7Skin span.mce_newdocument {background-position:-520px 0} .o2k7Skin span.mce_image {background-position:-380px 0} .o2k7Skin span.mce_help {background-position:-340px 0} .o2k7Skin span.mce_code {background-position:-260px 0} .o2k7Skin span.mce_hr {background-position:-360px 0} .o2k7Skin span.mce_visualaid {background-position:-660px 0} .o2k7Skin span.mce_charmap {background-position:-240px 0} .o2k7Skin span.mce_paste {background-position:-560px 0} .o2k7Skin span.mce_copy {background-position:-700px 0} .o2k7Skin span.mce_cut {background-position:-680px 0} .o2k7Skin span.mce_blockquote {background-position:-220px 0} .o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0} .o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0} .o2k7Skin span.mce_forecolorpicker {background-position:-720px 0} .o2k7Skin span.mce_backcolorpicker {background-position:-760px 0} /* Plugins */ .o2k7Skin span.mce_advhr {background-position:-0px -20px} .o2k7Skin span.mce_ltr {background-position:-20px -20px} .o2k7Skin span.mce_rtl {background-position:-40px -20px} .o2k7Skin span.mce_emotions {background-position:-60px -20px} .o2k7Skin span.mce_fullpage {background-position:-80px -20px} .o2k7Skin span.mce_fullscreen {background-position:-100px -20px} .o2k7Skin span.mce_iespell {background-position:-120px -20px} .o2k7Skin span.mce_insertdate {background-position:-140px -20px} .o2k7Skin span.mce_inserttime {background-position:-160px -20px} .o2k7Skin span.mce_absolute {background-position:-180px -20px} .o2k7Skin span.mce_backward {background-position:-200px -20px} .o2k7Skin span.mce_forward {background-position:-220px -20px} .o2k7Skin span.mce_insert_layer {background-position:-240px -20px} .o2k7Skin span.mce_insertlayer {background-position:-260px -20px} .o2k7Skin span.mce_movebackward {background-position:-280px -20px} .o2k7Skin span.mce_moveforward {background-position:-300px -20px} .o2k7Skin span.mce_media {background-position:-320px -20px} .o2k7Skin span.mce_nonbreaking {background-position:-340px -20px} .o2k7Skin span.mce_pastetext {background-position:-360px -20px} .o2k7Skin span.mce_pasteword {background-position:-380px -20px} .o2k7Skin span.mce_selectall {background-position:-400px -20px} .o2k7Skin span.mce_preview {background-position:-420px -20px} .o2k7Skin span.mce_print {background-position:-440px -20px} .o2k7Skin span.mce_cancel {background-position:-460px -20px} .o2k7Skin span.mce_save {background-position:-480px -20px} .o2k7Skin span.mce_replace {background-position:-500px -20px} .o2k7Skin span.mce_search {background-position:-520px -20px} .o2k7Skin span.mce_styleprops {background-position:-560px -20px} .o2k7Skin span.mce_table {background-position:-580px -20px} .o2k7Skin span.mce_cell_props {background-position:-600px -20px} .o2k7Skin span.mce_delete_table {background-position:-620px -20px} .o2k7Skin span.mce_delete_col {background-position:-640px -20px} .o2k7Skin span.mce_delete_row {background-position:-660px -20px} .o2k7Skin span.mce_col_after {background-position:-680px -20px} .o2k7Skin span.mce_col_before {background-position:-700px -20px} .o2k7Skin span.mce_row_after {background-position:-720px -20px} .o2k7Skin span.mce_row_before {background-position:-740px -20px} .o2k7Skin span.mce_merge_cells {background-position:-760px -20px} .o2k7Skin span.mce_table_props {background-position:-980px -20px} .o2k7Skin span.mce_row_props {background-position:-780px -20px} .o2k7Skin span.mce_split_cells {background-position:-800px -20px} .o2k7Skin span.mce_template {background-position:-820px -20px} .o2k7Skin span.mce_visualchars {background-position:-840px -20px} .o2k7Skin span.mce_abbr {background-position:-860px -20px} .o2k7Skin span.mce_acronym {background-position:-880px -20px} .o2k7Skin span.mce_attribs {background-position:-900px -20px} .o2k7Skin span.mce_cite {background-position:-920px -20px} .o2k7Skin span.mce_del {background-position:-940px -20px} .o2k7Skin span.mce_ins {background-position:-960px -20px} .o2k7Skin span.mce_pagebreak {background-position:0 -40px} .o2k7Skin .mce_spellchecker span.mceAction {background-position:-540px -20px} wp/dev/wp-includes/js/tinymce/themes/advanced/skins/o2k7/content.css0000644000106600010660000000242111021532502022635 0ustar body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} body {background:#FFF;} body.mceForceColors {background:#FFF; color:#000;} h1 {font-size: 2em} h2 {font-size: 1.5em} h3 {font-size: 1.17em} h4 {font-size: 1em} h5 {font-size: .83em} h6 {font-size: .75em} .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(../default/img/items.gif) no-repeat bottom left;} img.mceItemAnchor {width:12px; height:12px; background:url(../default/img/items.gif) no-repeat;} img {border:0;} table {cursor:default} table td, table th {cursor:text} ins {border-bottom:1px solid green; text-decoration: none; color:green} del {color:red; text-decoration:line-through} cite {border-bottom:1px dashed blue} acronym {border-bottom:1px dotted #CCC; cursor:help} abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help} /* IE */ * html body { scrollbar-3dlight-color:#F0F0EE; scrollbar-arrow-color:#676662; scrollbar-base-color:#F0F0EE; scrollbar-darkshadow-color:#DDD; scrollbar-face-color:#E0E0DD; scrollbar-highlight-color:#F0F0EE; scrollbar-shadow-color:#F0F0EE; scrollbar-track-color:#F5F5F5; } wp/dev/wp-includes/js/tinymce/themes/advanced/skins/o2k7/dialog.css0000644000106600010660000001250710757367711022457 0ustar /* Generic */ body { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; scrollbar-3dlight-color:#F0F0EE; scrollbar-arrow-color:#676662; scrollbar-base-color:#F0F0EE; scrollbar-darkshadow-color:#DDDDDD; scrollbar-face-color:#E0E0DD; scrollbar-highlight-color:#F0F0EE; scrollbar-shadow-color:#F0F0EE; scrollbar-track-color:#F5F5F5; background:#F0F0EE; padding:0; margin:8px 8px 0 8px; } html {background:#F0F0EE;} td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} textarea {resize:none;outline:none;} a:link, a:visited {color:black;} a:hover {color:#2B6FB6;} /* Forms */ fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} legend {color:#2B6FB6; font-weight:bold;} label.msg {display:none;} label.invalid {color:#EE0000; display:inline;} input.invalid {border:1px solid #EE0000;} input {background:#FFF; border:1px solid #CCC;} input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} input, select, textarea {border:1px solid #808080;} input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} .input_noborder {border:0;} /* Buttons */ #insert, #cancel, input.button, .updateButton { border:0; margin:0; padding:0; font-weight:bold; width:94px; height:26px; background:url(../default/img/buttons.png) 0 -26px; cursor:pointer; padding-bottom:2px; } #insert {background:url(../default/img/buttons.png) 0 -52px;} #cancel {background:url(../default/img/buttons.png) 0 0;} /* Browse */ a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} .mceOldBoxModel a.browse span {width:22px; height:20px;} a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} a.browse span.disabled {border:1px solid white; -moz-opacity:0.3; opacity:0.3; filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);} a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} .mceOldBoxModel a.pickcolor span {width:21px; height:17px;} a.pickcolor:hover span {background-color:#B2BBD0;} a.pickcolor:hover span.disabled {} /* Charmap */ table.charmap {border:1px solid #AAA; text-align:center} td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} #charmap a {display:block; color:#000; text-decoration:none; border:0} #charmap a:hover {background:#CCC;color:#2B6FB6} #charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} #charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} /* Source */ .wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} .mceActionPanel {margin-top:5px;} /* Tabs classes */ .tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;} .tabs ul {margin:0; padding:0; list-style:none;} .tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} .tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} .tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} .tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} .tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} .tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} /* Panels */ .panel_wrapper div.panel {display:none;} .panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} .panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} /* Columns */ .column {float:left;} .properties {width:100%;} .properties .column1 {} .properties .column2 {text-align:left;} /* Titles */ h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} h3 {font-size:14px;} .title {font-size:12px; font-weight:bold; color:#2B6FB6;} /* Dialog specific */ #link .panel_wrapper, #link div.current {height:125px;} #image .panel_wrapper, #image div.current {height:200px;} #plugintable thead {font-weight:bold; background:#DDD;} #plugintable, #about #plugintable td {border:1px solid #919B9C;} #plugintable {width:96%; margin-top:10px;} #pluginscontainer {height:290px; overflow:auto;} #colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} #colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} #colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} #colorpicker #light div {overflow:hidden;} #colorpicker #previewblock {float:right; padding-left:10px; height:20px;} #colorpicker .panel_wrapper div.current {height:175px;} #colorpicker #namedcolors {width:150px;} #colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} #colorpicker #colornamecontainer {margin-top:5px;} wp/dev/wp-includes/js/tinymce/themes/advanced/skins/o2k7/ui_black.css0000644000106600010660000000313110766056557022765 0ustar /* Black */ .o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton span.mceOpen, .o2k7SkinBlack .mceListBox .mceOpen {background-image:url(img/button_bg_black.png)} .o2k7SkinBlack table, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} .o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} .o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} .o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;} .o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)} .o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#FFE7A1}wp/dev/wp-includes/js/tinymce/themes/advanced/skins/o2k7/ui_silver.css0000644000106600010660000000146010761173411023200 0ustar /* Silver */ .o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton span.mceOpen, .o2k7SkinSilver .mceListBox .mceOpen {background-image:url(img/button_bg_silver.png)} .o2k7SkinSilver table, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} .o2k7SkinSilver .mceListBox .mceText {background:#FFF} .o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb} wp/dev/wp-includes/js/tinymce/themes/advanced/about.htm0000644000106600010660000000557711031210647020407 0ustar {#advanced_dlg.about_title}

    {#advanced_dlg.about_title}

    Version: ()

    TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

    Copyright © 2003-2008, Moxiecode Systems AB, All rights reserved.

    For more information about this software visit the TinyMCE website.

    Got Moxie? Hosted By Sourceforge Also on freshmeat

    {#advanced_dlg.about_loaded}

     

    wp/dev/wp-includes/js/tinymce/themes/advanced/img/0000755000106600010660000000000011051167752017333 5ustar wp/dev/wp-includes/js/tinymce/themes/advanced/img/colorpicker.jpg0000644000106600010660000000616510743673705022370 0ustar JFIF>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality C    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222," }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?孇JضY6k[D{nկlzVEjַ=+ȯHٶ=+^ٺV-ZҼ<,C4پAUejZFX@qEyZjĆHk>sҚ)R!@TJ~jrc4u "Bv#cqUTL*f qLXTL*v Qf@£"aL#BLn:Vj̀t8;WZ'^fjշ=+*ߵizWZ'^FZұ=+R^]h-vhEVB(5r Y O!!!@q1+ާ)1~:<*MD <MH B H {c'`xWZ9^ᩙq޲;֤.~ёЉp:UZ󎵗8^ ֠j֠kьâh֭F*֭F+#j1\XT⢌T=ЉF¥4YԦB£aSQ^$LFELE0MTPjτt{W XUiPv(J̇hzWV'ZFi@+*ҴanՁVfoUy[s"sUL xC!Vs]0b"BǚPi(5B:T(4j j@kã'Pj@ji׷2p&9Vz׳E53Y)tґQ8Y8YҙQFL֡j֡ECנ#Zj-e91VPT(* o"xMڢASc-f#5)+3Lab HRL"ZSE2#hCTz˫25 &*D*фք-ҳ!5~& <ʬ[8*j0aֳ(3ԥ2ejQ"bEE-XAYgE *$: ZT☂9hzԧ*B)WY dDSH^EcE2")H⼚R TUȫ<ڳ.EWb5J*:봱0ChBgd}ΓR{kW@Ks@`A8?g..<QkܱS"X^Sp%cWnNX 9Lp𨸸Jvc"Zڎr̦PUg2Rr6[[Z?ː()'Р`!,< H*\ȰÇ#JHŋ3jȱǏ CIɓ(}ԨeC0cʜ)ʛ8sɳϟ@ JѣH;x`iӗJJUͤXjpQ.I((ٳhܥKۋ*6ݻx~vu^~ LÈzM3]u؉\*-z(g 0.ti ? ĺH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S** > ݂Kd7uՊ [@"[M[7X[&lexeǒ@,[`¥%Z XmBf\!H$ uFhe݈odh؃o]G \ph8(@`-ph|LE $(<(qPHMITK=s6C#(uQCՆ`~cm~1iI#>vc~{8&֊_%0p"~.P^Ra"Fj'aQ>#p&K|?#"#Y>: ;p@TTH, J[KpVu}(&Ug [k֊;h XB(F`N{JP ŐNli$ʙv,ߖI ʣ8قׂPB Wn x8g'o,0MGɨ~n7-)SSjZ@ZHThG]<@䂐 Tf_ 8H0(NM|MM&Ԏʖl %Ȋ Pj^Gfqpq^᪶j>EpJ r&Snr[m)Ͻ!x^,r-r2i L Ӟr~m s9s:7٪9ݨs>7js:J}AVHtE_DU/4ɰk| L LPCuR/uS?R/CuVouWuXuYuZu[u\u]u^u_u`vavb/vc?vdOve_vfovgvhvivjvkvlvmvnvo#vs?wtOwu_wvow9Gq?_x;ww{w|w}a^(w~x/x?xOzWxxΉxcw'wxxxr=yOy_yoyyyygYyyyzz/z?zOzOozzzyWgzzxz?{O{lxx{{vxox|({{?t{{|/nAox7|o||ȏ|ɟ|ʯ|˿|;wp/dev/wp-includes/js/tinymce/themes/advanced/img/sflogo.png0000644000106600010660000000072510750407446021340 0ustar PNG  IHDRXTtEXtSoftwareAdobe ImageReadyqe<ZPLTE_jrt~jt{ٔв쪜I*̹¸鞍mVRIDATHn0Dq)'3of!dC ArSp g]{%rR.jjd_gW7T{]Eud0MqX.\v+ۘ^npA9C3ATYY1J% i&bS#Y}R %zZd)Q@ڊ\ÀkZʿgB}:t_ jOH^.<~{LSlFVkj`/?8(8? 'S zIENDB`wp/dev/wp-includes/js/tinymce/themes/advanced/img/gotmoxie.png0000644000106600010660000000172710750407446021705 0ustar PNG  IHDRX :OgAMAOX2tEXtSoftwareAdobe ImageReadyqe<ZPLTEMn+Srʣֺ댡ƁLTSIDATxڴs Qcxͷh4m&,{?$y^j1p6 zo`2Ulq[~+qSZ+߉F}eV9LZiJݶ#%uG *+׭+jb:1nn$޹>ݎ 5)1)u!oYUP76orzM6hyR./V01{7s먫Tp[u?Ul&nj88N|W1{y#] 5Ѿ_p(hpzeerIDd|]8TLU G-c#醒O+b5~nAmE_'y#ϛe؍Olu%wiI+O[Ԥm?:ЉlT:`t NB-麏T.@-bun73Va -}vHy!pUHRW7D`:# ՕJj&?p:y i=W˹%M2Im%Gc|=LߏB6fAVH|8M%2YN?~.o! ^m6/ŨSm4IrS맰rá603 ~rsVlU6 /A--^` Q+ώ/.bgqa%`J?i~eIENDB`wp/dev/wp-includes/js/tinymce/themes/advanced/img/fm.gif0000644000106600010660000000341510750407446020431 0ustar GIF89aXmps:BJ*/3s]bg)))ΓqrsSVYQ_m󃄅exCP\ژ37DpoZK0`'V?~xnbH `Dd{ {#advanced_dlg.code_title}
    {#advanced_dlg.code_title}

    wp/dev/wp-includes/js/tinymce/themes/advanced/editor_template.js0000644000106600010660000005253711021532502022274 0ustar (function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,extend=tinymce.extend,each=tinymce.each,Cookie=tinymce.util.Cookie,lastExtID,explode=tinymce.explode;tinymce.ThemeManager.requireLangPack('advanced');tinymce.create('tinymce.themes.AdvancedTheme',{controls:{bold:['bold_desc','Bold'],italic:['italic_desc','Italic'],underline:['underline_desc','Underline'],strikethrough:['striketrough_desc','Strikethrough'],justifyleft:['justifyleft_desc','JustifyLeft'],justifycenter:['justifycenter_desc','JustifyCenter'],justifyright:['justifyright_desc','JustifyRight'],justifyfull:['justifyfull_desc','JustifyFull'],bullist:['bullist_desc','InsertUnorderedList'],numlist:['numlist_desc','InsertOrderedList'],outdent:['outdent_desc','Outdent'],indent:['indent_desc','Indent'],cut:['cut_desc','Cut'],copy:['copy_desc','Copy'],paste:['paste_desc','Paste'],undo:['undo_desc','Undo'],redo:['redo_desc','Redo'],link:['link_desc','mceLink'],unlink:['unlink_desc','unlink'],image:['image_desc','mceImage'],cleanup:['cleanup_desc','mceCleanup'],help:['help_desc','mceHelp'],code:['code_desc','mceCodeEditor'],hr:['hr_desc','InsertHorizontalRule'],removeformat:['removeformat_desc','RemoveFormat'],sub:['sub_desc','subscript'],sup:['sup_desc','superscript'],forecolor:['forecolor_desc','ForeColor'],forecolorpicker:['forecolor_desc','mceForeColor'],backcolor:['backcolor_desc','HiliteColor'],backcolorpicker:['backcolor_desc','mceBackColor'],charmap:['charmap_desc','mceCharMap'],visualaid:['visualaid_desc','mceToggleVisualAid'],anchor:['anchor_desc','mceInsertAnchor'],newdocument:['newdocument_desc','mceNewDocument'],blockquote:['blockquote_desc','mceBlockQuote']},stateControls:['bold','italic','underline','strikethrough','bullist','numlist','justifyleft','justifycenter','justifyright','justifyfull','sub','sup','blockquote'],init:function(ed,url){var t=this,s,v;t.editor=ed;t.url=url;t.onResolveName=new tinymce.util.Dispatcher(this);t.settings=s=extend({theme_advanced_path:true,theme_advanced_toolbar_location:'bottom',theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1},ed.settings);if((v=s.theme_advanced_path_location)&&v!='none')s.theme_advanced_statusbar_location=s.theme_advanced_path_location;if(s.theme_advanced_statusbar_location=='none')s.theme_advanced_statusbar_location=0;ed.onInit.add(function(){ed.onNodeChange.add(t._nodeChanged,t);if(ed.settings.content_css!==false)ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/"+ed.settings.skin+"/content.css"));});ed.onSetProgressState.add(function(ed,b,ti){var co,id=ed.id,tb;if(b){t.progressTimer=setTimeout(function(){co=ed.getContainer();co=co.insertBefore(DOM.create('DIV',{style:'position:relative'}),co.firstChild);tb=DOM.get(ed.id+'_tbl');DOM.add(co,'div',{id:id+'_blocker','class':'mceBlocker',style:{width:tb.clientWidth+2,height:tb.clientHeight+2}});DOM.add(co,'div',{id:id+'_progress','class':'mceProgress',style:{left:tb.clientWidth/ 2, top : tb.clientHeight /2}});},ti||0);}else{DOM.remove(id+'_blocker');DOM.remove(id+'_progress');clearTimeout(t.progressTimer);}});DOM.loadCSS(ed.baseURI.toAbsolute(s.editor_css||"themes/advanced/skins/"+ed.settings.skin+"/ui.css"));if(s.skin_variant)DOM.loadCSS(ed.baseURI.toAbsolute(s.editor_css||"themes/advanced/skins/"+ed.settings.skin+"/ui_"+s.skin_variant+".css"));},createControl:function(n,cf){var cd,c;if(c=cf.createControl(n))return c;switch(n){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu();}if((cd=this.controls[n]))return cf.createButton(n,{title:"advanced."+cd[0],cmd:cd[1],ui:cd[2],value:cd[3]});},execCommand:function(cmd,ui,val){var f=this['_'+cmd];if(f){f.call(this,ui,val);return true;}return false;},_importClasses:function(e){var ed=this.editor,c=ed.controlManager.get('styleselect');if(c.getLength()==0){each(ed.dom.getClasses(),function(o){c.add(o['class'],o['class']);});}},_createStyleSelect:function(n){var t=this,ed=t.editor,cf=ed.controlManager,c=cf.createListBox('styleselect',{title:'advanced.style_select',onselect:function(v){if(c.selectedValue===v){ed.execCommand('mceSetStyleInfo',0,{command:'removeformat'});c.select();return false;}else ed.execCommand('mceSetCSSClass',0,v);}});if(c){each(ed.getParam('theme_advanced_styles','','hash'),function(v,k){if(v)c.add(t.editor.translate(k),v);});c.onPostRender.add(function(ed,n){Event.add(n.id+'_text','focus',t._importClasses,t);Event.add(n.id+'_text','mousedown',t._importClasses,t);});}return c;},_createFontSelect:function(){var c,t=this,ed=t.editor;c=ed.controlManager.createListBox('fontselect',{title:'advanced.fontdefault',cmd:'FontName'});if(c){each(ed.getParam('theme_advanced_fonts',t.settings.theme_advanced_fonts,'hash'),function(v,k){c.add(ed.translate(k),v,{style:v.indexOf('dings')==-1?'font-family:'+v:''});});}return c;},_createFontSizeSelect:function(){var t=this,ed=t.editor,c,lo=["1 (8 pt)","2 (10 pt)","3 (12 pt)","4 (14 pt)","5 (18 pt)","6 (24 pt)","7 (36 pt)"],fz=[8,10,12,14,18,24,36];c=ed.controlManager.createListBox('fontsizeselect',{title:'advanced.font_size',cmd:'FontSize'});if(c){each(ed.getParam('theme_advanced_font_sizes',t.settings.theme_advanced_font_sizes,'hash'),function(v,k){c.add(k!=v?k:lo[parseInt(v)-1],v,{'style':'font-size:'+fz[v-1]+'pt','class':'mceFontSize'+v});});}return c;},_createBlockFormats:function(){var c,fmts={p:'advanced.paragraph',address:'advanced.address',pre:'advanced.pre',h1:'advanced.h1',h2:'advanced.h2',h3:'advanced.h3',h4:'advanced.h4',h5:'advanced.h5',h6:'advanced.h6',div:'advanced.div',blockquote:'advanced.blockquote',code:'advanced.code',dt:'advanced.dt',dd:'advanced.dd',samp:'advanced.samp'},t=this;c=t.editor.controlManager.createListBox('formatselect',{title:'advanced.block',cmd:'FormatBlock'});if(c){each(t.editor.getParam('theme_advanced_blockformats',t.settings.theme_advanced_blockformats,'hash'),function(v,k){c.add(t.editor.translate(k!=v?k:fmts[v]),v,{'class':'mce_formatPreview mce_'+v});});}return c;},_createForeColorMenu:function(){var c,t=this,s=t.settings,o={},v;if(s.theme_advanced_more_colors){o.more_colors_func=function(){t._mceColorPicker(0,{color:c.value,func:function(co){c.setColor(co);}});};}if(v=s.theme_advanced_text_colors)o.colors=v;o.title='advanced.forecolor_desc';o.cmd='ForeColor';o.scope=this;c=t.editor.controlManager.createColorSplitButton('forecolor',o);return c;},_createBackColorMenu:function(){var c,t=this,s=t.settings,o={},v;if(s.theme_advanced_more_colors){o.more_colors_func=function(){t._mceColorPicker(0,{color:c.value,func:function(co){c.setColor(co);}});};}if(v=s.theme_advanced_background_colors)o.colors=v;o.title='advanced.backcolor_desc';o.cmd='HiliteColor';o.scope=this;c=t.editor.controlManager.createColorSplitButton('backcolor',o);return c;},renderUI:function(o){var n,ic,tb,t=this,ed=t.editor,s=t.settings,sc,p,nl;n=p=DOM.create('span',{id:ed.id+'_parent','class':'mceEditor '+ed.settings.skin+'Skin'+(s.skin_variant?' '+ed.settings.skin+'Skin'+t._ufirst(s.skin_variant):'')});if(!DOM.boxModel)n=DOM.add(n,'div',{'class':'mceOldBoxModel'});n=sc=DOM.add(n,'table',{id:ed.id+'_tbl','class':'mceLayout',cellSpacing:0,cellPadding:0});n=tb=DOM.add(n,'tbody');switch((s.theme_advanced_layout_manager||'').toLowerCase()){case"rowlayout":ic=t._rowLayout(s,tb,o);break;case"customlayout":ic=ed.execCallback("theme_advanced_custom_layout",s,tb,o,p);break;default:ic=t._simpleLayout(s,tb,o,p);}n=o.targetNode;nl=DOM.stdMode?sc.getElementsByTagName('tr'):sc.rows;DOM.addClass(nl[0],'mceFirst');DOM.addClass(nl[nl.length-1],'mceLast');each(DOM.select('tr',tb),function(n){DOM.addClass(n.firstChild,'mceFirst');DOM.addClass(n.childNodes[n.childNodes.length-1],'mceLast');});if(DOM.get(s.theme_advanced_toolbar_container))DOM.get(s.theme_advanced_toolbar_container).appendChild(p);else DOM.insertAfter(p,n);Event.add(ed.id+'_path_row','click',function(e){e=e.target;if(e.nodeName=='A'){t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/,'$1'));return Event.cancel(e);}});if(!ed.getParam('accessibility_focus')||ed.getParam('tab_focus'))Event.add(DOM.add(p,'a',{href:'#'},''),'focus',function(){tinyMCE.get(ed.id).focus();});if(s.theme_advanced_toolbar_location=='external')o.deltaHeight=0;t.deltaHeight=o.deltaHeight;o.targetNode=null;return{iframeContainer:ic,editorContainer:ed.id+'_parent',sizeContainer:sc,deltaHeight:o.deltaHeight};},getInfo:function(){return{longname:'Advanced theme',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',version:tinymce.majorVersion+"."+tinymce.minorVersion}},resizeBy:function(dw,dh){var e=DOM.get(this.editor.id+'_tbl');this.resizeTo(e.clientWidth+dw,e.clientHeight+dh);},resizeTo:function(w,h){var ed=this.editor,s=ed.settings,e=DOM.get(ed.id+'_tbl'),ifr=DOM.get(ed.id+'_ifr'),dh;w=Math.max(s.theme_advanced_resizing_min_width||100,w);h=Math.max(s.theme_advanced_resizing_min_height||100,h);w=Math.min(s.theme_advanced_resizing_max_width||0xFFFF,w);h=Math.min(s.theme_advanced_resizing_max_height||0xFFFF,h);dh=e.clientHeight-ifr.clientHeight;DOM.setStyle(ifr,'height',h-dh);DOM.setStyles(e,{width:w,height:h});},destroy:function(){var id=this.editor.id;Event.clear(id+'_resize');Event.clear(id+'_path_row');Event.clear(id+'_external_close');},_simpleLayout:function(s,tb,o,p){var t=this,ed=t.editor,lo=s.theme_advanced_toolbar_location,sl=s.theme_advanced_statusbar_location,n,ic,etb,c;if(lo=='top')t._addToolbars(tb,o);if(lo=='external'){n=c=DOM.create('div',{style:'position:relative'});n=DOM.add(n,'div',{id:ed.id+'_external','class':'mceExternalToolbar'});DOM.add(n,'a',{id:ed.id+'_external_close',href:'javascript:;','class':'mceExternalClose'});n=DOM.add(n,'table',{id:ed.id+'_tblext',cellSpacing:0,cellPadding:0});etb=DOM.add(n,'tbody');if(p.firstChild.className=='mceOldBoxModel')p.firstChild.appendChild(c);else p.insertBefore(c,p.firstChild);t._addToolbars(etb,o);ed.onMouseUp.add(function(){var e=DOM.get(ed.id+'_external');DOM.show(e);DOM.hide(lastExtID);var f=Event.add(ed.id+'_external_close','click',function(){DOM.hide(ed.id+'_external');Event.remove(ed.id+'_external_close','click',f);});DOM.show(e);DOM.setStyle(e,'top',0-DOM.getRect(ed.id+'_tblext').h-1);DOM.hide(e);DOM.show(e);e.style.filter='';lastExtID=ed.id+'_external';e=null;});}if(sl=='top')t._addStatusBar(tb,o);if(!s.theme_advanced_toolbar_container){n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});}if(lo=='bottom')t._addToolbars(tb,o);if(sl=='bottom')t._addStatusBar(tb,o);return ic;},_rowLayout:function(s,tb,o){var t=this,ed=t.editor,dc,da,cf=ed.controlManager,n,ic,to,a;dc=s.theme_advanced_containers_default_class||'';da=s.theme_advanced_containers_default_align||'center';each(explode(s.theme_advanced_containers||''),function(c,i){var v=s['theme_advanced_container_'+c]||'';switch(v.toLowerCase()){case'mceeditor':n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});break;case'mceelementpath':t._addStatusBar(tb,o);break;default:a=(s['theme_advanced_container_'+c+'_align']||da).toLowerCase();a='mce'+t._ufirst(a);n=DOM.add(DOM.add(tb,'tr'),'td',{'class':'mceToolbar '+(s['theme_advanced_container_'+c+'_class']||dc)+' '+a||da});to=cf.createToolbar("toolbar"+i);t._addControls(v,to);DOM.setHTML(n,to.renderHTML());o.deltaHeight-=s.theme_advanced_row_height;}});return ic;},_addControls:function(v,tb){var t=this,s=t.settings,di,cf=t.editor.controlManager;if(s.theme_advanced_disable&&!t._disabled){di={};each(explode(s.theme_advanced_disable),function(v){di[v]=1;});t._disabled=di;}else di=t._disabled;each(explode(v),function(n){var c;if(di&&di[n])return;if(n=='tablecontrols'){each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(n){n=t.createControl(n,cf);if(n)tb.add(n);});return;}c=t.createControl(n,cf);if(c)tb.add(c);});},_addToolbars:function(c,o){var t=this,i,tb,ed=t.editor,s=t.settings,v,cf=ed.controlManager,di,n,h=[],a;a=s.theme_advanced_toolbar_align.toLowerCase();a='mce'+t._ufirst(a);n=DOM.add(DOM.add(c,'tr'),'td',{'class':'mceToolbar '+a});if(!ed.getParam('accessibility_focus')||ed.getParam('tab_focus'))h.push(DOM.createHTML('a',{href:'#',onfocus:'tinyMCE.get(\''+ed.id+'\').focus();'},''));h.push(DOM.createHTML('a',{href:'#',accesskey:'q',title:ed.getLang("advanced.toolbar_focus")},''));for(i=1;(v=s['theme_advanced_buttons'+i]);i++){tb=cf.createToolbar("toolbar"+i,{'class':'mceToolbarRow'+i});if(s['theme_advanced_buttons'+i+'_add'])v+=','+s['theme_advanced_buttons'+i+'_add'];if(s['theme_advanced_buttons'+i+'_add_before'])v=s['theme_advanced_buttons'+i+'_add_before']+','+v;t._addControls(v,tb);h.push(tb.renderHTML());o.deltaHeight-=s.theme_advanced_row_height;}h.push(DOM.createHTML('a',{href:'#',accesskey:'z',title:ed.getLang("advanced.toolbar_focus"),onfocus:'tinyMCE.getInstanceById(\''+ed.id+'\').focus();'},''));DOM.setHTML(n,h.join(''));},_addStatusBar:function(tb,o){var n,t=this,ed=t.editor,s=t.settings,r,mf,me,td;n=DOM.add(tb,'tr');n=td=DOM.add(n,'td',{'class':'mceStatusbar'});n=DOM.add(n,'div',{id:ed.id+'_path_row'},s.theme_advanced_path?ed.translate('advanced.path')+': ':' ');DOM.add(n,'a',{href:'#',accesskey:'x'});if(s.theme_advanced_resizing&&!tinymce.isOldWebKit){DOM.add(td,'a',{id:ed.id+'_resize',href:'javascript:;',onclick:"return false;",'class':'mceResize'});if(s.theme_advanced_resizing_use_cookie){ed.onPostRender.add(function(){var o=Cookie.getHash("TinyMCE_"+ed.id+"_size"),c=DOM.get(ed.id+'_tbl');if(!o)return;if(s.theme_advanced_resize_horizontal)c.style.width=Math.max(10,o.cw)+'px';c.style.height=Math.max(10,o.ch)+'px';DOM.get(ed.id+'_ifr').style.height=Math.max(10,parseInt(o.ch)+t.deltaHeight)+'px';});}ed.onPostRender.add(function(){Event.add(ed.id+'_resize','mousedown',function(e){var c,p,w,h,n,pa;c=DOM.get(ed.id+'_tbl');w=c.clientWidth;h=c.clientHeight;miw=s.theme_advanced_resizing_min_width||100;mih=s.theme_advanced_resizing_min_height||100;maw=s.theme_advanced_resizing_max_width||0xFFFF;mah=s.theme_advanced_resizing_max_height||0xFFFF;p=DOM.add(DOM.get(ed.id+'_parent'),'div',{'class':'mcePlaceHolder'});DOM.setStyles(p,{width:w,height:h});DOM.hide(c);DOM.show(p);r={x:e.screenX,y:e.screenY,w:w,h:h,dx:null,dy:null};mf=Event.add(DOM.doc,'mousemove',function(e){var w,h;r.dx=e.screenX-r.x;r.dy=e.screenY-r.y;w=Math.max(miw,r.w+r.dx);h=Math.max(mih,r.h+r.dy);w=Math.min(maw,w);h=Math.min(mah,h);if(s.theme_advanced_resize_horizontal)p.style.width=w+'px';p.style.height=h+'px';return Event.cancel(e);});me=Event.add(DOM.doc,'mouseup',function(e){var ifr;Event.remove(DOM.doc,'mousemove',mf);Event.remove(DOM.doc,'mouseup',me);c.style.display='';DOM.remove(p);if(r.dx===null)return;ifr=DOM.get(ed.id+'_ifr');if(s.theme_advanced_resize_horizontal)c.style.width=Math.max(10,r.w+r.dx)+'px';c.style.height=Math.max(10,r.h+r.dy)+'px';ifr.style.height=Math.max(10,ifr.clientHeight+r.dy)+'px';if(s.theme_advanced_resizing_use_cookie){Cookie.setHash("TinyMCE_"+ed.id+"_size",{cw:r.w+r.dx,ch:r.h+r.dy});}});return Event.cancel(e);});});}o.deltaHeight-=21;n=tb=null;},_nodeChanged:function(ed,cm,n,co){var t=this,p,de=0,v,c,s=t.settings;tinymce.each(t.stateControls,function(c){cm.setActive(c,ed.queryCommandState(t.controls[c][1]));});cm.setActive('visualaid',ed.hasVisual);cm.setDisabled('undo',!ed.undoManager.hasUndo()&&!ed.typing);cm.setDisabled('redo',!ed.undoManager.hasRedo());cm.setDisabled('outdent',!ed.queryCommandState('Outdent'));p=DOM.getParent(n,'A');if(c=cm.get('link')){if(!p||!p.name){c.setDisabled(!p&&co);c.setActive(!!p);}}if(c=cm.get('unlink')){c.setDisabled(!p&&co);c.setActive(!!p&&!p.name);}if(c=cm.get('anchor')){c.setActive(!!p&&p.name);if(tinymce.isWebKit){p=DOM.getParent(n,'IMG');c.setActive(!!p&&DOM.getAttrib(p,'mce_name')=='a');}}p=DOM.getParent(n,'IMG');if(c=cm.get('image'))c.setActive(!!p&&n.className.indexOf('mceItem')==-1);if(c=cm.get('styleselect')){if(n.className){t._importClasses();c.select(n.className);}else c.select();}if(c=cm.get('formatselect')){p=DOM.getParent(n,DOM.isBlock);if(p)c.select(p.nodeName.toLowerCase());}if(c=cm.get('fontselect'))c.select(ed.queryCommandValue('FontName'));if(c=cm.get('fontsizeselect'))c.select(''+ed.queryCommandValue('FontSize'));if(s.theme_advanced_path&&s.theme_advanced_statusbar_location){p=DOM.get(ed.id+'_path')||DOM.add(ed.id+'_path_row','span',{id:ed.id+'_path'});DOM.setHTML(p,'');ed.dom.getParent(n,function(n){var na=n.nodeName.toLowerCase(),u,pi,ti='';if(n.nodeType!=1||(DOM.hasClass(n,'mceItemHidden')||DOM.hasClass(n,'mceItemRemoved')))return;if(v=DOM.getAttrib(n,'mce_name'))na=v;if(tinymce.isIE&&n.scopeName!=='HTML')na=n.scopeName+':'+na;na=na.replace(/mce\:/g,'');switch(na){case'b':na='strong';break;case'i':na='em';break;case'img':if(v=DOM.getAttrib(n,'src'))ti+='src: '+v+' ';break;case'a':if(v=DOM.getAttrib(n,'name')){ti+='name: '+v+' ';na+='#'+v;}if(v=DOM.getAttrib(n,'href'))ti+='href: '+v+' ';break;case'font':if(s.convert_fonts_to_spans)na='span';if(v=DOM.getAttrib(n,'face'))ti+='font: '+v+' ';if(v=DOM.getAttrib(n,'size'))ti+='size: '+v+' ';if(v=DOM.getAttrib(n,'color'))ti+='color: '+v+' ';break;case'span':if(v=DOM.getAttrib(n,'style'))ti+='style: '+v+' ';break;}if(v=DOM.getAttrib(n,'id'))ti+='id: '+v+' ';if(v=n.className){v=v.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g,'');if(v&&v.indexOf('mceItem')==-1){ti+='class: '+v+' ';if(DOM.isBlock(n)||na=='img'||na=='span')na+='.'+v;}}na=na.replace(/(html:)/g,'');na={name:na,node:n,title:ti};t.onResolveName.dispatch(t,na);ti=na.title;na=na.name;pi=DOM.create('a',{'href':"javascript:;",onmousedown:"return false;",title:ti,'class':'mcePath_'+(de++)},na);if(p.hasChildNodes()){p.insertBefore(DOM.doc.createTextNode(' \u00bb '),p.firstChild);p.insertBefore(pi,p.firstChild);}else p.appendChild(pi);},ed.getBody());}},_sel:function(v){this.editor.execCommand('mceSelectNodeDepth',false,v);},_mceInsertAnchor:function(ui,v){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/anchor.htm',width:320+parseInt(ed.getLang('advanced.anchor_delta_width',0)),height:90+parseInt(ed.getLang('advanced.anchor_delta_height',0)),inline:true},{theme_url:this.url});},_mceCharMap:function(){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/charmap.htm',width:550+parseInt(ed.getLang('advanced.charmap_delta_width',0)),height:250+parseInt(ed.getLang('advanced.charmap_delta_height',0)),inline:true},{theme_url:this.url});},_mceHelp:function(){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/about.htm',width:480,height:380,inline:true},{theme_url:this.url});},_mceColorPicker:function(u,v){var ed=this.editor;v=v||{};ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/color_picker.htm',width:375+parseInt(ed.getLang('advanced.colorpicker_delta_width',0)),height:250+parseInt(ed.getLang('advanced.colorpicker_delta_height',0)),close_previous:false,inline:true},{input_color:v.color,func:v.func,theme_url:this.url});},_mceCodeEditor:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/source_editor.htm',width:parseInt(ed.getParam("theme_advanced_source_editor_width",720)),height:parseInt(ed.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url});},_mceImage:function(ui,val){var ed=this.editor;if(ed.dom.getAttrib(ed.selection.getNode(),'class').indexOf('mceItem')!=-1)return;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/image.htm',width:355+parseInt(ed.getLang('advanced.image_delta_width',0)),height:275+parseInt(ed.getLang('advanced.image_delta_height',0)),inline:true},{theme_url:this.url});},_mceLink:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/link.htm',width:310+parseInt(ed.getLang('advanced.link_delta_width',0)),height:200+parseInt(ed.getLang('advanced.link_delta_height',0)),inline:true},{theme_url:this.url});},_mceNewDocument:function(){var ed=this.editor;ed.windowManager.confirm('advanced.newdocument',function(s){if(s)ed.execCommand('mceSetContent',false,'');});},_mceForeColor:function(){var t=this;this._mceColorPicker(0,{color:t.fgColor,func:function(co){t.fgColor=co;t.editor.execCommand('ForeColor',false,co);}});},_mceBackColor:function(){var t=this;this._mceColorPicker(0,{color:t.bgColor,func:function(co){t.bgColor=co;t.editor.execCommand('HiliteColor',false,co);}});},_ufirst:function(s){return s.substring(0,1).toUpperCase()+s.substring(1);}});tinymce.ThemeManager.add('advanced',tinymce.themes.AdvancedTheme);}());wp/dev/wp-includes/js/tinymce/themes/advanced/link.htm0000644000106600010660000000514111031210647020215 0ustar {#advanced_dlg.link_title}
     
    wp/dev/wp-includes/js/tinymce/themes/advanced/color_picker.htm0000644000106600010660000000547311031210647021743 0ustar {#advanced_dlg.colorpicker_title}
    {#advanced_dlg.colorpicker_picker_title}

    {#advanced_dlg.colorpicker_palette_title}

    {#advanced_dlg.colorpicker_named_title}

    {#advanced_dlg.colorpicker_name}
    wp/dev/wp-includes/js/tinymce/themes/advanced/charmap.htm0000644000106600010660000000453611031210647020702 0ustar {#advanced_dlg.charmap_title}
    {#advanced_dlg.charmap_title}
     
     
    HTML-Code
     
     
    NUM-Code
     
    wp/dev/wp-includes/js/tinymce/themes/advanced/image.htm0000644000106600010660000001107411031210647020344 0ustar {#advanced_dlg.image_title}
     
    x
    wp/dev/wp-includes/js/tinymce/themes/advanced/js/0000755000106600010660000000000011051167752017173 5ustar wp/dev/wp-includes/js/tinymce/themes/advanced/js/color_picker.js0000644000106600010660000002541111021532502022171 0ustar tinyMCEPopup.requireLangPack(); var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false; var colors = [ "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033", "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099", "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff", "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033", "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399", "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff", "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333", "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399", "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff", "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633", "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699", "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff", "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633", "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999", "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff", "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933", "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999", "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff", "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33", "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99", "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff", "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33", "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99", "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff", "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33", "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99", "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff" ]; var named = { '#F0F8FF':'AliceBlue','#FAEBD7':'AntiqueWhite','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige', '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'BlanchedAlmond','#0000FF':'Blue','#8A2BE2':'BlueViolet','#A52A2A':'Brown', '#DEB887':'BurlyWood','#5F9EA0':'CadetBlue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'CornflowerBlue', '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'DarkBlue','#008B8B':'DarkCyan','#B8860B':'DarkGoldenRod', '#A9A9A9':'DarkGray','#A9A9A9':'DarkGrey','#006400':'DarkGreen','#BDB76B':'DarkKhaki','#8B008B':'DarkMagenta','#556B2F':'DarkOliveGreen', '#FF8C00':'Darkorange','#9932CC':'DarkOrchid','#8B0000':'DarkRed','#E9967A':'DarkSalmon','#8FBC8F':'DarkSeaGreen','#483D8B':'DarkSlateBlue', '#2F4F4F':'DarkSlateGray','#2F4F4F':'DarkSlateGrey','#00CED1':'DarkTurquoise','#9400D3':'DarkViolet','#FF1493':'DeepPink','#00BFFF':'DeepSkyBlue', '#696969':'DimGray','#696969':'DimGrey','#1E90FF':'DodgerBlue','#B22222':'FireBrick','#FFFAF0':'FloralWhite','#228B22':'ForestGreen', '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'GhostWhite','#FFD700':'Gold','#DAA520':'GoldenRod','#808080':'Gray','#808080':'Grey', '#008000':'Green','#ADFF2F':'GreenYellow','#F0FFF0':'HoneyDew','#FF69B4':'HotPink','#CD5C5C':'IndianRed','#4B0082':'Indigo','#FFFFF0':'Ivory', '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'LavenderBlush','#7CFC00':'LawnGreen','#FFFACD':'LemonChiffon','#ADD8E6':'LightBlue', '#F08080':'LightCoral','#E0FFFF':'LightCyan','#FAFAD2':'LightGoldenRodYellow','#D3D3D3':'LightGray','#D3D3D3':'LightGrey','#90EE90':'LightGreen', '#FFB6C1':'LightPink','#FFA07A':'LightSalmon','#20B2AA':'LightSeaGreen','#87CEFA':'LightSkyBlue','#778899':'LightSlateGray','#778899':'LightSlateGrey', '#B0C4DE':'LightSteelBlue','#FFFFE0':'LightYellow','#00FF00':'Lime','#32CD32':'LimeGreen','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon', '#66CDAA':'MediumAquaMarine','#0000CD':'MediumBlue','#BA55D3':'MediumOrchid','#9370D8':'MediumPurple','#3CB371':'MediumSeaGreen','#7B68EE':'MediumSlateBlue', '#00FA9A':'MediumSpringGreen','#48D1CC':'MediumTurquoise','#C71585':'MediumVioletRed','#191970':'MidnightBlue','#F5FFFA':'MintCream','#FFE4E1':'MistyRose','#FFE4B5':'Moccasin', '#FFDEAD':'NavajoWhite','#000080':'Navy','#FDF5E6':'OldLace','#808000':'Olive','#6B8E23':'OliveDrab','#FFA500':'Orange','#FF4500':'OrangeRed','#DA70D6':'Orchid', '#EEE8AA':'PaleGoldenRod','#98FB98':'PaleGreen','#AFEEEE':'PaleTurquoise','#D87093':'PaleVioletRed','#FFEFD5':'PapayaWhip','#FFDAB9':'PeachPuff', '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'PowderBlue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'RosyBrown','#4169E1':'RoyalBlue', '#8B4513':'SaddleBrown','#FA8072':'Salmon','#F4A460':'SandyBrown','#2E8B57':'SeaGreen','#FFF5EE':'SeaShell','#A0522D':'Sienna','#C0C0C0':'Silver', '#87CEEB':'SkyBlue','#6A5ACD':'SlateBlue','#708090':'SlateGray','#708090':'SlateGrey','#FFFAFA':'Snow','#00FF7F':'SpringGreen', '#4682B4':'SteelBlue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet', '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'WhiteSmoke','#FFFF00':'Yellow','#9ACD32':'YellowGreen' }; function init() { var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')); tinyMCEPopup.resizeToInnerSize(); generatePicker(); if (inputColor) { changeFinalColor(inputColor); col = convertHexToRGB(inputColor); if (col) updateLight(col.r, col.g, col.b); } } function insertAction() { var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); tinyMCEPopup.restoreSelection(); if (f) f(color); tinyMCEPopup.close(); } function showColor(color, name) { if (name) document.getElementById("colorname").innerHTML = name; document.getElementById("preview").style.backgroundColor = color; document.getElementById("color").value = color.toLowerCase(); } function convertRGBToHex(col) { var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); if (!col) return col; var rgb = col.replace(re, "$1,$2,$3").split(','); if (rgb.length == 3) { r = parseInt(rgb[0]).toString(16); g = parseInt(rgb[1]).toString(16); b = parseInt(rgb[2]).toString(16); r = r.length == 1 ? '0' + r : r; g = g.length == 1 ? '0' + g : g; b = b.length == 1 ? '0' + b : b; return "#" + r + g + b; } return col; } function convertHexToRGB(col) { if (col.indexOf('#') != -1) { col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); r = parseInt(col.substring(0, 2), 16); g = parseInt(col.substring(2, 4), 16); b = parseInt(col.substring(4, 6), 16); return {r : r, g : g, b : b}; } return null; } function generatePicker() { var el = document.getElementById('light'), h = '', i; for (i = 0; i < detail; i++){ h += '
    '; } el.innerHTML = h; } function generateWebColors() { var el = document.getElementById('webcolors'), h = '', i; if (el.className == 'generated') return; h += '' + ''; for (i=0; i' + '' + ''; if ((i+1) % 18 == 0) h += ''; } h += '
    '; el.innerHTML = h; el.className = 'generated'; } function generateNamedColors() { var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; if (el.className == 'generated') return; for (n in named) { v = named[n]; h += '' } el.innerHTML = h; el.className = 'generated'; } function dechex(n) { return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); } function computeColor(e) { var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB; x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0); y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0); partWidth = document.getElementById('colors').width / 6; partDetail = detail / 2; imHeight = document.getElementById('colors').height; r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255; g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth); b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth); coef = (imHeight - y) / imHeight; r = 128 + (r - 128) * coef; g = 128 + (g - 128) * coef; b = 128 + (b - 128) * coef; changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); updateLight(r, g, b); } function updateLight(r, g, b) { var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; for (i=0; i=0) && (i'; html += '' + ed.getLang('advanced_dlg.about_author') + ''; html += '' + ed.getLang('advanced_dlg.about_version') + ''; html += ''; html += ''; html += ''; tinymce.each(ed.plugins, function(p, n) { var info; if (!p.getInfo) return; html += ''; info = p.getInfo(); if (info.infourl != null && info.infourl != '') html += '' + info.longname + ''; else html += '' + info.longname + ''; if (info.authorurl != null && info.authorurl != '') html += '' + info.author + ''; else html += '' + info.author + ''; html += '' + info.version + ''; html += ''; document.getElementById('plugins_tab').style.display = ''; }); html += ''; html += ''; tcont.innerHTML = html; tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; } function insertHelpIFrame() { var html; if (tinyMCEPopup.getParam('docs_url')) { html = ''; document.getElementById('iframecontainer').innerHTML = html; document.getElementById('help_tab').style.display = 'block'; } } tinyMCEPopup.onInit.add(init); wp/dev/wp-includes/js/tinymce/themes/advanced/js/anchor.js0000644000106600010660000000200510772340615021000 0ustar tinyMCEPopup.requireLangPack(); var AnchorDialog = { init : function(ed) { var action, elm, f = document.forms[0]; this.editor = ed; elm = ed.dom.getParent(ed.selection.getNode(), 'A,IMG'); v = ed.dom.getAttrib(elm, 'name'); if (v) { this.action = 'update'; f.anchorName.value = v; } f.insert.value = ed.getLang(elm ? 'update' : 'insert'); }, update : function() { var ed = this.editor; tinyMCEPopup.restoreSelection(); if (this.action != 'update') ed.selection.collapse(1); // Webkit acts weird if empty inline element is inserted so we need to use a image instead if (tinymce.isWebKit) ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('img', {mce_name : 'a', name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'})); else ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'}, '')); tinyMCEPopup.close(); } }; tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); wp/dev/wp-includes/js/tinymce/themes/advanced/js/link.js0000644000106600010660000001135511000754130020455 0ustar tinyMCEPopup.requireLangPack(); var LinkDialog = { preInit : function() { var url; if (url = tinyMCEPopup.getParam("external_link_list_url")) document.write(''); }, init : function() { var f = document.forms[0], ed = tinyMCEPopup.editor; // Setup browse button document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); if (isVisible('hrefbrowser')) document.getElementById('href').style.width = '180px'; this.fillClassList('class_list'); this.fillFileList('link_list', 'tinyMCELinkList'); this.fillTargetList('target_list'); if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { f.href.value = ed.dom.getAttrib(e, 'href'); f.linktitle.value = ed.dom.getAttrib(e, 'title'); f.insert.value = ed.getLang('update'); selectByValue(f, 'link_list', f.href.value); selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); } }, update : function() { var f = document.forms[0], ed = tinyMCEPopup.editor, e, b; tinyMCEPopup.restoreSelection(); e = ed.dom.getParent(ed.selection.getNode(), 'A'); // Remove element if there is no href if (!f.href.value) { if (e) { tinyMCEPopup.execCommand("mceBeginUndoLevel"); b = ed.selection.getBookmark(); ed.dom.remove(e, 1); ed.selection.moveToBookmark(b); tinyMCEPopup.execCommand("mceEndUndoLevel"); tinyMCEPopup.close(); return; } } tinyMCEPopup.execCommand("mceBeginUndoLevel"); // Create new anchor elements if (e == null) { tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); tinymce.each(ed.dom.select("a"), function(n) { if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { e = n; ed.dom.setAttribs(e, { href : f.href.value, title : f.linktitle.value, target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null, 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null }); } }); } else { ed.dom.setAttribs(e, { href : f.href.value, title : f.linktitle.value, target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null, 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null }); } // Don't move caret if selection was image if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { ed.focus(); ed.selection.select(e); ed.selection.collapse(0); tinyMCEPopup.storeSelection(); } tinyMCEPopup.execCommand("mceEndUndoLevel"); tinyMCEPopup.close(); }, checkPrefix : function(n) { if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) n.value = 'mailto:' + n.value; if (/^\s*www./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) n.value = 'http://' + n.value; }, fillFileList : function(id, l) { var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; l = window[l]; if (l && l.length > 0) { lst.options[lst.options.length] = new Option('', ''); tinymce.each(l, function(o) { lst.options[lst.options.length] = new Option(o[0], o[1]); }); } else dom.remove(dom.getParent(id, 'tr')); }, fillClassList : function(id) { var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { cl = []; tinymce.each(v.split(';'), function(v) { var p = v.split('='); cl.push({'title' : p[0], 'class' : p[1]}); }); } else cl = tinyMCEPopup.editor.dom.getClasses(); if (cl.length > 0) { lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); tinymce.each(cl, function(o) { lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); }); } else dom.remove(dom.getParent(id, 'tr')); }, fillTargetList : function(id) { var dom = tinyMCEPopup.dom, lst = dom.get(id), v; lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { tinymce.each(v.split(','), function(v) { v = v.split('='); lst.options[lst.options.length] = new Option(v[0], v[1]); }); } } }; LinkDialog.preInit(); tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); wp/dev/wp-includes/js/tinymce/themes/advanced/js/image.js0000644000106600010660000001416011021532502020577 0ustar var ImageDialog = { preInit : function() { var url; tinyMCEPopup.requireLangPack(); if (url = tinyMCEPopup.getParam("external_image_list_url")) document.write(''); }, init : function() { var f = document.forms[0], ed = tinyMCEPopup.editor; // Setup browse button document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); if (isVisible('srcbrowser')) document.getElementById('src').style.width = '180px'; e = ed.selection.getNode(); this.fillFileList('image_list', 'tinyMCEImageList'); if (e.nodeName == 'IMG') { f.src.value = ed.dom.getAttrib(e, 'src'); f.alt.value = ed.dom.getAttrib(e, 'alt'); f.border.value = this.getAttrib(e, 'border'); f.vspace.value = this.getAttrib(e, 'vspace'); f.hspace.value = this.getAttrib(e, 'hspace'); f.width.value = ed.dom.getAttrib(e, 'width'); f.height.value = ed.dom.getAttrib(e, 'height'); f.insert.value = ed.getLang('update'); f.class_name.value = ed.dom.getAttrib(e, 'class'); this.styleVal = ed.dom.getAttrib(e, 'style'); selectByValue(f, 'image_list', f.src.value); selectByValue(f, 'align', this.getAttrib(e, 'align')); this.updateStyle(); } }, fillFileList : function(id, l) { var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; l = window[l]; if (l && l.length > 0) { lst.options[lst.options.length] = new Option('', ''); tinymce.each(l, function(o) { lst.options[lst.options.length] = new Option(o[0], o[1]); }); } else dom.remove(dom.getParent(id, 'tr')); }, update : function() { var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; tinyMCEPopup.restoreSelection(); if (f.src.value === '') { if (ed.selection.getNode().nodeName == 'IMG') { ed.dom.remove(ed.selection.getNode()); ed.execCommand('mceRepaint'); } tinyMCEPopup.close(); return; } if (!ed.settings.inline_styles) { args = tinymce.extend(args, { vspace : nl.vspace.value, hspace : nl.hspace.value, border : nl.border.value, align : getSelectValue(f, 'align') }); } else args.style = this.styleVal; tinymce.extend(args, { src : f.src.value, alt : f.alt.value, width : f.width.value, height : f.height.value, 'class' : f.class_name.value }); el = ed.selection.getNode(); if (el && el.nodeName == 'IMG') { ed.dom.setAttribs(el, args); } else { ed.execCommand('mceInsertContent', false, '', {skip_undo : 1}); ed.dom.setAttribs('__mce_tmp', args); ed.dom.setAttrib('__mce_tmp', 'id', ''); ed.undoManager.add(); } tinyMCEPopup.close(); }, updateStyle : function() { var dom = tinyMCEPopup.dom, st, v, cls, oldcls, rep, f = document.forms[0]; if (tinyMCEPopup.editor.settings.inline_styles) { st = tinyMCEPopup.dom.parseStyle(this.styleVal); // Handle align v = getSelectValue(f, 'align'); cls = f.class_name.value || ''; cls = cls ? cls.replace(/alignright\s*|alignleft\s*|aligncenter\s*/g, '') : ''; cls = cls ? cls.replace(/^\s*(.+?)\s*$/, '$1') : ''; if (v) { if (v == 'left' || v == 'right') { st['float'] = v; delete st['vertical-align']; oldcls = cls ? ' '+cls : ''; f.class_name.value = 'align' + v + oldcls; } else { st['vertical-align'] = v; delete st['float']; f.class_name.value = cls; } } else { delete st['float']; delete st['vertical-align']; f.class_name.value = cls; } // Handle border v = f.border.value; if (v || v == '0') { if (v == '0') st['border'] = '0'; else st['border'] = v + 'px solid black'; } else delete st['border']; // Handle hspace v = f.hspace.value; if (v) { delete st['margin']; st['margin-left'] = v + 'px'; st['margin-right'] = v + 'px'; } else { delete st['margin-left']; delete st['margin-right']; } // Handle vspace v = f.vspace.value; if (v) { delete st['margin']; st['margin-top'] = v + 'px'; st['margin-bottom'] = v + 'px'; } else { delete st['margin-top']; delete st['margin-bottom']; } // Merge st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st)); this.styleVal = dom.serializeStyle(st); } }, getAttrib : function(e, at) { var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; if (ed.settings.inline_styles) { switch (at) { case 'align': if (v = dom.getStyle(e, 'float')) return v; if (v = dom.getStyle(e, 'vertical-align')) return v; break; case 'hspace': v = dom.getStyle(e, 'margin-left') v2 = dom.getStyle(e, 'margin-right'); if (v && v == v2) return parseInt(v.replace(/[^0-9]/g, '')); break; case 'vspace': v = dom.getStyle(e, 'margin-top') v2 = dom.getStyle(e, 'margin-bottom'); if (v && v == v2) return parseInt(v.replace(/[^0-9]/g, '')); break; case 'border': v = 0; tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { sv = dom.getStyle(e, 'border-' + sv + '-width'); // False or not the same as prev if (!sv || (sv != v && v !== 0)) { v = 0; return false; } if (sv) v = sv; }); if (v) return parseInt(v.replace(/[^0-9]/g, '')); break; } } if (v = dom.getAttrib(e, at)) return v; return ''; }, resetImageData : function() { var f = document.forms[0]; f.width.value = f.height.value = ""; }, updateImageData : function() { var f = document.forms[0], t = ImageDialog; if (f.width.value == "") f.width.value = t.preloadImg.width; if (f.height.value == "") f.height.value = t.preloadImg.height; }, getImageData : function() { var f = document.forms[0]; this.preloadImg = new Image(); this.preloadImg.onload = this.updateImageData; this.preloadImg.onerror = this.resetImageData; this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); } }; ImageDialog.preInit(); tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); wp/dev/wp-includes/js/tinymce/themes/advanced/js/source_editor.js0000644000106600010660000000257110743673705022413 0ustar tinyMCEPopup.requireLangPack(); tinyMCEPopup.onInit.add(onLoadInit); function saveContent() { tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value); tinyMCEPopup.close(); } function onLoadInit() { tinyMCEPopup.resizeToInnerSize(); // Remove Gecko spellchecking if (tinymce.isGecko) document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent(); if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { setWrap('soft'); document.getElementById('wraped').checked = true; } resizeInputs(); } function setWrap(val) { var v, n, s = document.getElementById('htmlSource'); s.wrap = val; if (!tinymce.isIE) { v = s.value; n = s.cloneNode(false); n.setAttribute("wrap", val); s.parentNode.replaceChild(n, s); n.value = v; } } function toggleWordWrap(elm) { if (elm.checked) setWrap('soft'); else setWrap('off'); } var wHeight=0, wWidth=0, owHeight=0, owWidth=0; function resizeInputs() { var el = document.getElementById('htmlSource'); if (!tinymce.isIE) { wHeight = self.innerHeight - 65; wWidth = self.innerWidth - 16; } else { wHeight = document.body.clientHeight - 70; wWidth = document.body.clientWidth - 16; } el.style.height = Math.abs(wHeight) + 'px'; el.style.width = Math.abs(wWidth) + 'px'; } wp/dev/wp-includes/js/tinymce/themes/advanced/js/charmap.js0000644000106600010660000003426310757367711021165 0ustar tinyMCEPopup.requireLangPack(); var charmap = [ [' ', ' ', true, 'no-break space'], ['&', '&', true, 'ampersand'], ['"', '"', true, 'quotation mark'], // finance ['¢', '¢', true, 'cent sign'], ['€', '€', true, 'euro sign'], ['£', '£', true, 'pound sign'], ['¥', '¥', true, 'yen sign'], // signs ['©', '©', true, 'copyright sign'], ['®', '®', true, 'registered sign'], ['™', '™', true, 'trade mark sign'], ['‰', '‰', true, 'per mille sign'], ['µ', 'µ', true, 'micro sign'], ['·', '·', true, 'middle dot'], ['•', '•', true, 'bullet'], ['…', '…', true, 'three dot leader'], ['′', '′', true, 'minutes / feet'], ['″', '″', true, 'seconds / inches'], ['§', '§', true, 'section sign'], ['¶', '¶', true, 'paragraph sign'], ['ß', 'ß', true, 'sharp s / ess-zed'], // quotations ['‹', '‹', true, 'single left-pointing angle quotation mark'], ['›', '›', true, 'single right-pointing angle quotation mark'], ['«', '«', true, 'left pointing guillemet'], ['»', '»', true, 'right pointing guillemet'], ['‘', '‘', true, 'left single quotation mark'], ['’', '’', true, 'right single quotation mark'], ['“', '“', true, 'left double quotation mark'], ['”', '”', true, 'right double quotation mark'], ['‚', '‚', true, 'single low-9 quotation mark'], ['„', '„', true, 'double low-9 quotation mark'], ['<', '<', true, 'less-than sign'], ['>', '>', true, 'greater-than sign'], ['≤', '≤', true, 'less-than or equal to'], ['≥', '≥', true, 'greater-than or equal to'], ['–', '–', true, 'en dash'], ['—', '—', true, 'em dash'], ['¯', '¯', true, 'macron'], ['‾', '‾', true, 'overline'], ['¤', '¤', true, 'currency sign'], ['¦', '¦', true, 'broken bar'], ['¨', '¨', true, 'diaeresis'], ['¡', '¡', true, 'inverted exclamation mark'], ['¿', '¿', true, 'turned question mark'], ['ˆ', 'ˆ', true, 'circumflex accent'], ['˜', '˜', true, 'small tilde'], ['°', '°', true, 'degree sign'], ['−', '−', true, 'minus sign'], ['±', '±', true, 'plus-minus sign'], ['÷', '÷', true, 'division sign'], ['⁄', '⁄', true, 'fraction slash'], ['×', '×', true, 'multiplication sign'], ['¹', '¹', true, 'superscript one'], ['²', '²', true, 'superscript two'], ['³', '³', true, 'superscript three'], ['¼', '¼', true, 'fraction one quarter'], ['½', '½', true, 'fraction one half'], ['¾', '¾', true, 'fraction three quarters'], // math / logical ['ƒ', 'ƒ', true, 'function / florin'], ['∫', '∫', true, 'integral'], ['∑', '∑', true, 'n-ary sumation'], ['∞', '∞', true, 'infinity'], ['√', '√', true, 'square root'], ['∼', '∼', false,'similar to'], ['≅', '≅', false,'approximately equal to'], ['≈', '≈', true, 'almost equal to'], ['≠', '≠', true, 'not equal to'], ['≡', '≡', true, 'identical to'], ['∈', '∈', false,'element of'], ['∉', '∉', false,'not an element of'], ['∋', '∋', false,'contains as member'], ['∏', '∏', true, 'n-ary product'], ['∧', '∧', false,'logical and'], ['∨', '∨', false,'logical or'], ['¬', '¬', true, 'not sign'], ['∩', '∩', true, 'intersection'], ['∪', '∪', false,'union'], ['∂', '∂', true, 'partial differential'], ['∀', '∀', false,'for all'], ['∃', '∃', false,'there exists'], ['∅', '∅', false,'diameter'], ['∇', '∇', false,'backward difference'], ['∗', '∗', false,'asterisk operator'], ['∝', '∝', false,'proportional to'], ['∠', '∠', false,'angle'], // undefined ['´', '´', true, 'acute accent'], ['¸', '¸', true, 'cedilla'], ['ª', 'ª', true, 'feminine ordinal indicator'], ['º', 'º', true, 'masculine ordinal indicator'], ['†', '†', true, 'dagger'], ['‡', '‡', true, 'double dagger'], // alphabetical special chars ['À', 'À', true, 'A - grave'], ['Á', 'Á', true, 'A - acute'], ['Â', 'Â', true, 'A - circumflex'], ['Ã', 'Ã', true, 'A - tilde'], ['Ä', 'Ä', true, 'A - diaeresis'], ['Å', 'Å', true, 'A - ring above'], ['Æ', 'Æ', true, 'ligature AE'], ['Ç', 'Ç', true, 'C - cedilla'], ['È', 'È', true, 'E - grave'], ['É', 'É', true, 'E - acute'], ['Ê', 'Ê', true, 'E - circumflex'], ['Ë', 'Ë', true, 'E - diaeresis'], ['Ì', 'Ì', true, 'I - grave'], ['Í', 'Í', true, 'I - acute'], ['Î', 'Î', true, 'I - circumflex'], ['Ï', 'Ï', true, 'I - diaeresis'], ['Ð', 'Ð', true, 'ETH'], ['Ñ', 'Ñ', true, 'N - tilde'], ['Ò', 'Ò', true, 'O - grave'], ['Ó', 'Ó', true, 'O - acute'], ['Ô', 'Ô', true, 'O - circumflex'], ['Õ', 'Õ', true, 'O - tilde'], ['Ö', 'Ö', true, 'O - diaeresis'], ['Ø', 'Ø', true, 'O - slash'], ['Œ', 'Œ', true, 'ligature OE'], ['Š', 'Š', true, 'S - caron'], ['Ù', 'Ù', true, 'U - grave'], ['Ú', 'Ú', true, 'U - acute'], ['Û', 'Û', true, 'U - circumflex'], ['Ü', 'Ü', true, 'U - diaeresis'], ['Ý', 'Ý', true, 'Y - acute'], ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], ['Þ', 'Þ', true, 'THORN'], ['à', 'à', true, 'a - grave'], ['á', 'á', true, 'a - acute'], ['â', 'â', true, 'a - circumflex'], ['ã', 'ã', true, 'a - tilde'], ['ä', 'ä', true, 'a - diaeresis'], ['å', 'å', true, 'a - ring above'], ['æ', 'æ', true, 'ligature ae'], ['ç', 'ç', true, 'c - cedilla'], ['è', 'è', true, 'e - grave'], ['é', 'é', true, 'e - acute'], ['ê', 'ê', true, 'e - circumflex'], ['ë', 'ë', true, 'e - diaeresis'], ['ì', 'ì', true, 'i - grave'], ['í', 'í', true, 'i - acute'], ['î', 'î', true, 'i - circumflex'], ['ï', 'ï', true, 'i - diaeresis'], ['ð', 'ð', true, 'eth'], ['ñ', 'ñ', true, 'n - tilde'], ['ò', 'ò', true, 'o - grave'], ['ó', 'ó', true, 'o - acute'], ['ô', 'ô', true, 'o - circumflex'], ['õ', 'õ', true, 'o - tilde'], ['ö', 'ö', true, 'o - diaeresis'], ['ø', 'ø', true, 'o slash'], ['œ', 'œ', true, 'ligature oe'], ['š', 'š', true, 's - caron'], ['ù', 'ù', true, 'u - grave'], ['ú', 'ú', true, 'u - acute'], ['û', 'û', true, 'u - circumflex'], ['ü', 'ü', true, 'u - diaeresis'], ['ý', 'ý', true, 'y - acute'], ['þ', 'þ', true, 'thorn'], ['ÿ', 'ÿ', true, 'y - diaeresis'], ['Α', 'Α', true, 'Alpha'], ['Β', 'Β', true, 'Beta'], ['Γ', 'Γ', true, 'Gamma'], ['Δ', 'Δ', true, 'Delta'], ['Ε', 'Ε', true, 'Epsilon'], ['Ζ', 'Ζ', true, 'Zeta'], ['Η', 'Η', true, 'Eta'], ['Θ', 'Θ', true, 'Theta'], ['Ι', 'Ι', true, 'Iota'], ['Κ', 'Κ', true, 'Kappa'], ['Λ', 'Λ', true, 'Lambda'], ['Μ', 'Μ', true, 'Mu'], ['Ν', 'Ν', true, 'Nu'], ['Ξ', 'Ξ', true, 'Xi'], ['Ο', 'Ο', true, 'Omicron'], ['Π', 'Π', true, 'Pi'], ['Ρ', 'Ρ', true, 'Rho'], ['Σ', 'Σ', true, 'Sigma'], ['Τ', 'Τ', true, 'Tau'], ['Υ', 'Υ', true, 'Upsilon'], ['Φ', 'Φ', true, 'Phi'], ['Χ', 'Χ', true, 'Chi'], ['Ψ', 'Ψ', true, 'Psi'], ['Ω', 'Ω', true, 'Omega'], ['α', 'α', true, 'alpha'], ['β', 'β', true, 'beta'], ['γ', 'γ', true, 'gamma'], ['δ', 'δ', true, 'delta'], ['ε', 'ε', true, 'epsilon'], ['ζ', 'ζ', true, 'zeta'], ['η', 'η', true, 'eta'], ['θ', 'θ', true, 'theta'], ['ι', 'ι', true, 'iota'], ['κ', 'κ', true, 'kappa'], ['λ', 'λ', true, 'lambda'], ['μ', 'μ', true, 'mu'], ['ν', 'ν', true, 'nu'], ['ξ', 'ξ', true, 'xi'], ['ο', 'ο', true, 'omicron'], ['π', 'π', true, 'pi'], ['ρ', 'ρ', true, 'rho'], ['ς', 'ς', true, 'final sigma'], ['σ', 'σ', true, 'sigma'], ['τ', 'τ', true, 'tau'], ['υ', 'υ', true, 'upsilon'], ['φ', 'φ', true, 'phi'], ['χ', 'χ', true, 'chi'], ['ψ', 'ψ', true, 'psi'], ['ω', 'ω', true, 'omega'], // symbols ['ℵ', 'ℵ', false,'alef symbol'], ['ϖ', 'ϖ', false,'pi symbol'], ['ℜ', 'ℜ', false,'real part symbol'], ['ϑ','ϑ', false,'theta symbol'], ['ϒ', 'ϒ', false,'upsilon - hook symbol'], ['℘', '℘', false,'Weierstrass p'], ['ℑ', 'ℑ', false,'imaginary part'], // arrows ['←', '←', true, 'leftwards arrow'], ['↑', '↑', true, 'upwards arrow'], ['→', '→', true, 'rightwards arrow'], ['↓', '↓', true, 'downwards arrow'], ['↔', '↔', true, 'left right arrow'], ['↵', '↵', false,'carriage return'], ['⇐', '⇐', false,'leftwards double arrow'], ['⇑', '⇑', false,'upwards double arrow'], ['⇒', '⇒', false,'rightwards double arrow'], ['⇓', '⇓', false,'downwards double arrow'], ['⇔', '⇔', false,'left right double arrow'], ['∴', '∴', false,'therefore'], ['⊂', '⊂', false,'subset of'], ['⊃', '⊃', false,'superset of'], ['⊄', '⊄', false,'not a subset of'], ['⊆', '⊆', false,'subset of or equal to'], ['⊇', '⊇', false,'superset of or equal to'], ['⊕', '⊕', false,'circled plus'], ['⊗', '⊗', false,'circled times'], ['⊥', '⊥', false,'perpendicular'], ['⋅', '⋅', false,'dot operator'], ['⌈', '⌈', false,'left ceiling'], ['⌉', '⌉', false,'right ceiling'], ['⌊', '⌊', false,'left floor'], ['⌋', '⌋', false,'right floor'], ['⟨', '〈', false,'left-pointing angle bracket'], ['⟩', '〉', false,'right-pointing angle bracket'], ['◊', '◊', true,'lozenge'], ['♠', '♠', false,'black spade suit'], ['♣', '♣', true, 'black club suit'], ['♥', '♥', true, 'black heart suit'], ['♦', '♦', true, 'black diamond suit'], [' ', ' ', false,'en space'], [' ', ' ', false,'em space'], [' ', ' ', false,'thin space'], ['‌', '‌', false,'zero width non-joiner'], ['‍', '‍', false,'zero width joiner'], ['‎', '‎', false,'left-to-right mark'], ['‏', '‏', false,'right-to-left mark'], ['­', '­', false,'soft hyphen'] ]; tinyMCEPopup.onInit.add(function() { tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); }); function renderCharMapHTML() { var charsPerRow = 20, tdWidth=20, tdHeight=20, i; var html = ''; var cols=-1; for (i=0; i' + '' + charmap[i][1] + ''; if ((cols+1) % charsPerRow == 0) html += ''; } } if (cols % charsPerRow > 0) { var padd = charsPerRow - (cols % charsPerRow); for (var i=0; i '; } html += '
    '; return html; } function insertChar(chr) { tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); // Refocus in window if (tinyMCEPopup.isWindow) window.focus(); tinyMCEPopup.editor.focus(); tinyMCEPopup.close(); } function previewChar(codeA, codeB, codeN) { var elmA = document.getElementById('codeA'); var elmB = document.getElementById('codeB'); var elmV = document.getElementById('codeV'); var elmN = document.getElementById('codeN'); if (codeA=='#160;') { elmV.innerHTML = '__'; } else { elmV.innerHTML = '&' + codeA; } elmB.innerHTML = '&' + codeA; elmA.innerHTML = '&' + codeB; elmN.innerHTML = codeN; } wp/dev/wp-includes/js/tinymce/themes/advanced/anchor.htm0000644000106600010660000000214611031210647020534 0ustar {#advanced_dlg.anchor_title}
    {#advanced_dlg.anchor_title}
    {#advanced_dlg.anchor_name}:
    wp/dev/wp-includes/js/tinymce/tiny_mce_config.php0000644000106600010660000002664711047641230017402 0ustar 'url'. It adds the plugin's name to TinyMCE's plugins init and the call to PluginManager to load the plugin. The url should be absolute and should include the js file name to be loaded. Example: array( 'myplugin' => 'http://my-site.com/wp-content/plugins/myfolder/mce_plugin.js' ) If the plugin uses a button, it should be added with one of the "$mce_buttons" filters. */ $mce_external_plugins = apply_filters('mce_external_plugins', array()); $ext_plugins = "\n"; if ( ! empty($mce_external_plugins) ) { /* The following filter loads external language files for TinyMCE plugins. It takes an associative array 'plugin_name' => 'path', where path is the include path to the file. The language file should follow the same format as /tinymce/langs/wp-langs.php and should define a variable $strings that holds all translated strings. Example: $strings = 'tinyMCE.addI18n("' . $mce_locale . '.mypluginname_dlg",{tab_general:"General", ... })'; */ $mce_external_languages = apply_filters('mce_external_languages', array()); $loaded_langs = array(); $strings = ''; if ( ! empty($mce_external_languages) ) { foreach ( $mce_external_languages as $name => $path ) { if ( is_file($path) && is_readable($path) ) { include_once($path); $ext_plugins .= $strings; $loaded_langs[] = $name; } } } foreach ( $mce_external_plugins as $name => $url ) { if ( is_ssl() ) $url = str_replace('http://', 'https://', $url); $plugins[] = '-' . $name; if ( in_array($name, $loaded_langs) ) { $plugurl = dirname($url); $ext_plugins .= 'tinyMCEPreInit.load_ext("' . $plugurl . '", "' . $mce_locale . '");' . "\n"; } $ext_plugins .= 'tinymce.PluginManager.load("' . $name . '", "' . $url . '");' . "\n"; } } $plugins = implode($plugins, ','); $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'wp_more', '|', 'spellchecker', 'fullscreen', 'wp_adv' )); $mce_buttons = implode($mce_buttons, ','); $mce_buttons_2 = apply_filters('mce_buttons_2', array('formatselect', 'underline', 'justifyfull', 'forecolor', '|', 'pastetext', 'pasteword', 'removeformat', '|', 'media', 'charmap', '|', 'outdent', 'indent', '|', 'undo', 'redo', 'wp_help' )); $mce_buttons_2 = implode($mce_buttons_2, ','); $mce_buttons_3 = apply_filters('mce_buttons_3', array()); $mce_buttons_3 = implode($mce_buttons_3, ','); $mce_buttons_4 = apply_filters('mce_buttons_4', array()); $mce_buttons_4 = implode($mce_buttons_4, ','); $no_captions = ( apply_filters( 'disable_captions', '' ) ) ? true : false; // TinyMCE init settings $initArray = array ( 'mode' => 'none', 'onpageload' => 'wpEditorInit', 'width' => '100%', 'theme' => 'advanced', 'skin' => 'wp_theme', 'theme_advanced_buttons1' => "$mce_buttons", 'theme_advanced_buttons2' => "$mce_buttons_2", 'theme_advanced_buttons3' => "$mce_buttons_3", 'theme_advanced_buttons4' => "$mce_buttons_4", 'language' => "$mce_locale", 'spellchecker_languages' => "$mce_spellchecker_languages", 'theme_advanced_toolbar_location' => 'top', 'theme_advanced_toolbar_align' => 'left', 'theme_advanced_statusbar_location' => 'bottom', 'theme_advanced_resizing' => true, 'theme_advanced_resize_horizontal' => false, 'dialog_type' => 'modal', 'relative_urls' => false, 'remove_script_host' => false, 'convert_urls' => false, 'apply_source_formatting' => false, 'remove_linebreaks' => true, 'paste_convert_middot_lists' => true, 'paste_remove_spans' => true, 'paste_remove_styles' => true, 'gecko_spellcheck' => true, 'entities' => '38,amp,60,lt,62,gt', 'accessibility_focus' => false, 'tab_focus' => ':next', 'content_css' => "$mce_css", 'save_callback' => 'switchEditors.saveCallback', 'wpeditimage_disable_captions' => $no_captions, 'plugins' => "$plugins", // pass-through the settings for compression and caching, so they can be changed with "tiny_mce_before_init" 'disk_cache' => true, 'compress' => true, 'old_cache_max' => '1' // number of cache files to keep ); // For people who really REALLY know what they're doing with TinyMCE // You can modify initArray to add, remove, change elements of the config before tinyMCE.init (changed from action to filter) $initArray = apply_filters('tiny_mce_before_init', $initArray); // Setting "valid_elements", "invalid_elements" and "extended_valid_elements" can be done through "tiny_mce_before_init". // Best is to use the default cleanup by not specifying valid_elements, as TinyMCE contains full set of XHTML 1.0. // support for deprecated actions ob_start(); do_action('mce_options'); $mce_deprecated = ob_get_contents(); ob_end_clean(); $mce_deprecated = (string) $mce_deprecated; if ( strlen( $mce_deprecated ) < 10 || ! strpos( $mce_deprecated, ':' ) || ! strpos( $mce_deprecated, ',' ) ) $mce_deprecated = ''; // Settings for the gzip compression and cache $disk_cache = ( ! isset($initArray['disk_cache']) || false == $initArray['disk_cache'] ) ? false : true; $compress = ( ! isset($initArray['compress']) || false == $initArray['compress'] ) ? false : true; $old_cache_max = ( isset($initArray['old_cache_max']) ) ? (int) $initArray['old_cache_max'] : 0; $initArray['disk_cache'] = $initArray['compress'] = $initArray['old_cache_max'] = null; unset( $initArray['disk_cache'], $initArray['compress'], $initArray['old_cache_max'] ); // Anybody still using IE5/5.5? It can't handle gzip compressed js well. if ( $msie = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ) { $ie_ver = (int) substr( $_SERVER['HTTP_USER_AGENT'] , $msie + 5, 3 ); if ( $ie_ver && $ie_ver < 6 ) $compress = false; } // Cache path, this is where the .gz files will be stored $cache_path = WP_CONTENT_DIR . '/uploads/js_cache'; if ( $disk_cache && ! is_dir($cache_path) ) $disk_cache = wp_mkdir_p($cache_path); $cache_ext = '.js'; $plugins = explode( ',', $initArray['plugins'] ); $theme = ( 'simple' == $initArray['theme'] ) ? 'simple' : 'advanced'; $language = ( isset($initArray['language']) && ! empty($initArray['language']) ) ? substr( $initArray['language'], 0, 2 ) : 'en'; $cacheKey = $mce_options = ''; // Check if browser supports gzip if ( $compress && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) { if ( ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') || isset($_SERVER['---------------']) ) && function_exists('gzencode') && ! ini_get('zlib.output_compression') ) { $cache_ext = '.gz'; } } // Setup cache info if ( $disk_cache ) { $cacheKey = apply_filters('tiny_mce_version', '20080810'); foreach ( $initArray as $v ) $cacheKey .= $v; if ( ! empty($mce_external_plugins) ) { foreach ( $mce_external_plugins as $n => $v ) $cacheKey .= $n; } $cacheKey = md5( $cacheKey ); $cache_file = $cache_path . '/tinymce_' . $cacheKey . $cache_ext; } $expiresOffset = 864000; // 10 days header( 'Content-Type: application/x-javascript; charset=UTF-8' ); header( 'Vary: Accept-Encoding' ); // Handle proxies header( 'Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expiresOffset ) . ' GMT' ); // Use cached file if exists if ( $disk_cache && is_file($cache_file) && is_readable($cache_file) ) { $mtime = gmdate("D, d M Y H:i:s", filemtime($cache_file)) . " GMT"; if ( isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $_SERVER['HTTP_IF_MODIFIED_SINCE'] == $mtime ) { header('HTTP/1.1 304 Not Modified'); exit; } header("Last-Modified: " . $mtime); header("Cache-Control: must-revalidate", false); $content = getFileContents( $cache_file ); if ( '.gz' == $cache_ext ) header( 'Content-Encoding: gzip' ); echo $content; exit; } foreach ( $initArray as $k => $v ) $mce_options .= $k . ':"' . $v . '",'; if ( $mce_deprecated ) $mce_options .= $mce_deprecated; $mce_options = rtrim( trim($mce_options), '\n\r,' ); $content = 'var tinyMCEPreInit = { settings : { themes : "' . $theme . '", plugins : "' . $initArray['plugins'] . '", languages : "' . $language . '", debug : false }, base : "' . $baseurl . '", suffix : "", query : "ver=311" };'; // Load patch $content .= getFileContents( 'tiny_mce_ext.js' ); // Add core $content .= getFileContents( 'tiny_mce.js' ); // Patch loading functions $content .= 'tinyMCEPreInit.start();'; // Add all languages (WP) include_once( dirname(__FILE__).'/langs/wp-langs.php' ); $content .= $strings; // Add themes $content .= getFileContents( 'themes/' . $theme . '/editor_template.js' ); // Add plugins foreach ( $plugins as $plugin ) $content .= getFileContents( 'plugins/' . $plugin . '/editor_plugin.js' ); // Add external plugins and init $content .= $ext_plugins . 'tinyMCE.init({' . $mce_options . '});'; // Generate GZIP'd content if ( '.gz' == $cache_ext ) { header('Content-Encoding: gzip'); $content = gzencode( $content, 9, FORCE_GZIP ); } // Stream to client echo $content; // Write file if ( '' != $cacheKey && is_dir($cache_path) && is_readable($cache_path) ) { $old_cache = array(); $handle = opendir($cache_path); while ( false !== ( $file = readdir($handle) ) ) { if ( $file == '.' || $file == '..' ) continue; $saved = filectime("$cache_path/$file"); if ( strpos($file, 'tinymce_') !== false && substr($file, -3) == $cache_ext ) $old_cache["$saved"] = $file; } closedir($handle); krsort($old_cache); if ( 1 >= $old_cache_max ) $del_cache = $old_cache; else $del_cache = array_slice( $old_cache, ($old_cache_max - 1) ); foreach ( $del_cache as $key ) @unlink("$cache_path/$key"); putFileContents( $cache_file, $content ); } ?>wp/dev/wp-includes/js/tinymce/tiny_mce_popup.js0000644000106600010660000001532611021532502017106 0ustar // Some global instances var tinymce = null, tinyMCEPopup, tinyMCE; tinyMCEPopup = { init : function() { var t = this, w, ti, li, q, i, it; li = ('' + document.location.search).replace(/^\?/, '').split('&'); q = {}; for (i=0; i'); tinymce.ScriptLoader.markDone(u); } } }, pickColor : function(e, element_id) { this.execCommand('mceColorPicker', true, { color : document.getElementById(element_id).value, func : function(c) { document.getElementById(element_id).value = c; try { document.getElementById(element_id).onchange(); } catch (ex) { // Try fire event, ignore errors } } }); }, openBrowser : function(element_id, type, option) { tinyMCEPopup.restoreSelection(); this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window); }, close : function() { var t = this; // To avoid domain relaxing issue in Opera function close() { t.editor.windowManager.close(window); tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup }; if (tinymce.isOpera) t.getWin().setTimeout(close, 0); else close(); }, // Internal functions _restoreSelection : function() { var e = window.event.srcElement; if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button')) tinyMCEPopup.restoreSelection(); }, /* _restoreSelection : function() { var e = window.event.srcElement; // If user focus a non text input or textarea if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text') tinyMCEPopup.restoreSelection(); },*/ _onDOMLoaded : function() { var t = this, ti = document.title, bm, h; // Translate page h = document.body.innerHTML; // Replace a=x with a="x" in IE if (tinymce.isIE) h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"') document.dir = t.editor.getParam('directionality',''); document.body.innerHTML = t.editor.translate(h); document.title = ti = t.editor.translate(ti); document.body.style.display = ''; // Restore selection in IE when focus is placed on a non textarea or input element of the type text if (tinymce.isIE) document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection); t.restoreSelection(); t.resizeToInnerSize(); // Set inline title if (!t.isWindow) t.editor.windowManager.setTitle(window, ti); else window.focus(); if (!tinymce.isIE && !t.isWindow) { tinymce.dom.Event._add(document, 'focus', function() { t.editor.windowManager.focus(t.id) }); } // Patch for accessibility tinymce.each(t.dom.select('select'), function(e) { e.onkeydown = tinyMCEPopup._accessHandler; }); // Call onInit // Init must be called before focus so the selection won't get lost by the focus call tinymce.each(t.listeners, function(o) { o.func.call(o.scope, t.editor); }); // Move focus to window if (t.getWindowArg('mce_auto_focus', true)) { window.focus(); // Focus element with mceFocus class tinymce.each(document.forms, function(f) { tinymce.each(f.elements, function(e) { if (t.dom.hasClass(e, 'mceFocus') && !e.disabled) { e.focus(); return false; // Break loop } }); }); } document.onkeyup = tinyMCEPopup._closeWinKeyHandler; }, _accessHandler : function(e) { e = e || window.event; if (e.keyCode == 13 || e.keyCode == 32) { e = e.target || e.srcElement; if (e.onchange) e.onchange(); return tinymce.dom.Event.cancel(e); } }, _closeWinKeyHandler : function(e) { e = e || window.event; if (e.keyCode == 27) tinyMCEPopup.close(); }, _wait : function() { var t = this, ti; if (tinymce.isIE && document.location.protocol != 'https:') { // Fake DOMContentLoaded on IE document.write(' // Write the 'pickColor' function that will be called when the user clicks // a color and do something with the value. This is only required if you // want to do something other than simply populate a form field, which is // what the 'select' function will give you. function pickColor(color) { field.value = color; } NOTES: 1) Requires the functions in AnchorPosition.js and PopupWindow.js 2) Your anchor tag MUST contain both NAME and ID attributes which are the same. For example: 3) There must be at least a space between for IE5.5 to see the anchor tag correctly. Do not do with no space. 4) When a ColorPicker object is created, a handler for 'onmouseup' is attached to any event handler you may have already defined. Do NOT define an event handler for 'onmouseup' after you define a ColorPicker object or the color picker will not hide itself correctly. */ ColorPicker_targetInput = null; function ColorPicker_writeDiv() { document.writeln(""); } function ColorPicker_show(anchorname) { this.showPopup(anchorname); } function ColorPicker_pickColor(color,obj) { obj.hidePopup(); pickColor(color); } // A Default "pickColor" function to accept the color passed back from popup. // User can over-ride this with their own function. function pickColor(color) { if (ColorPicker_targetInput==null) { alert("Target Input is null, which means you either didn't use the 'select' function or you have no defined your own 'pickColor' function to handle the picked color!"); return; } ColorPicker_targetInput.value = color; } // This function is the easiest way to popup the window, select a color, and // have the value populate a form field, which is what most people want to do. function ColorPicker_select(inputobj,linkname) { if (inputobj.type!="text" && inputobj.type!="hidden" && inputobj.type!="textarea") { alert("colorpicker.select: Input object passed is not a valid form input object"); window.ColorPicker_targetInput=null; return; } window.ColorPicker_targetInput = inputobj; this.show(linkname); } // This function runs when you move your mouse over a color block, if you have a newer browser function ColorPicker_highlightColor(c) { var thedoc = (arguments.length>1)?arguments[1]:window.document; var d = thedoc.getElementById("colorPickerSelectedColor"); d.style.backgroundColor = c; d = thedoc.getElementById("colorPickerSelectedColorValue"); d.innerHTML = c; } function ColorPicker() { var windowMode = false; // Create a new PopupWindow object if (arguments.length==0) { var divname = "colorPickerDiv"; } else if (arguments[0] == "window") { var divname = ''; windowMode = true; } else { var divname = arguments[0]; } if (divname != "") { var cp = new PopupWindow(divname); } else { var cp = new PopupWindow(); cp.setSize(225,250); } // Object variables cp.currentValue = "#FFFFFF"; // Method Mappings cp.writeDiv = ColorPicker_writeDiv; cp.highlightColor = ColorPicker_highlightColor; cp.show = ColorPicker_show; cp.select = ColorPicker_select; // Code to populate color picker window var colors = new Array( "#4180B6","#69AEE7","#000000","#000033","#000066","#000099","#0000CC","#0000FF","#330000","#330033","#330066","#330099", "#3300CC","#3300FF","#660000","#660033","#660066","#660099","#6600CC","#6600FF","#990000","#990033","#990066","#990099", "#9900CC","#9900FF","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#FF0000","#FF0033","#FF0066","#FF0099", "#FF00CC","#FF00FF","#7FFFFF","#7FFFFF","#7FF7F7","#7FEFEF","#7FE7E7","#7FDFDF","#7FD7D7","#7FCFCF","#7FC7C7","#7FBFBF", "#7FB7B7","#7FAFAF","#7FA7A7","#7F9F9F","#7F9797","#7F8F8F","#7F8787","#7F7F7F","#7F7777","#7F6F6F","#7F6767","#7F5F5F", "#7F5757","#7F4F4F","#7F4747","#7F3F3F","#7F3737","#7F2F2F","#7F2727","#7F1F1F","#7F1717","#7F0F0F","#7F0707","#7F0000", "#4180B6","#69AEE7","#003300","#003333","#003366","#003399","#0033CC","#0033FF","#333300","#333333","#333366","#333399", "#3333CC","#3333FF","#663300","#663333","#663366","#663399","#6633CC","#6633FF","#993300","#993333","#993366","#993399", "#9933CC","#9933FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#FF3300","#FF3333","#FF3366","#FF3399", "#FF33CC","#FF33FF","#FF7FFF","#FF7FFF","#F77FF7","#EF7FEF","#E77FE7","#DF7FDF","#D77FD7","#CF7FCF","#C77FC7","#BF7FBF", "#B77FB7","#AF7FAF","#A77FA7","#9F7F9F","#977F97","#8F7F8F","#877F87","#7F7F7F","#777F77","#6F7F6F","#677F67","#5F7F5F", "#577F57","#4F7F4F","#477F47","#3F7F3F","#377F37","#2F7F2F","#277F27","#1F7F1F","#177F17","#0F7F0F","#077F07","#007F00", "#4180B6","#69AEE7","#006600","#006633","#006666","#006699","#0066CC","#0066FF","#336600","#336633","#336666","#336699", "#3366CC","#3366FF","#666600","#666633","#666666","#666699","#6666CC","#6666FF","#996600","#996633","#996666","#996699", "#9966CC","#9966FF","#CC6600","#CC6633","#CC6666","#CC6699","#CC66CC","#CC66FF","#FF6600","#FF6633","#FF6666","#FF6699", "#FF66CC","#FF66FF","#FFFF7F","#FFFF7F","#F7F77F","#EFEF7F","#E7E77F","#DFDF7F","#D7D77F","#CFCF7F","#C7C77F","#BFBF7F", "#B7B77F","#AFAF7F","#A7A77F","#9F9F7F","#97977F","#8F8F7F","#87877F","#7F7F7F","#77777F","#6F6F7F","#67677F","#5F5F7F", "#57577F","#4F4F7F","#47477F","#3F3F7F","#37377F","#2F2F7F","#27277F","#1F1F7F","#17177F","#0F0F7F","#07077F","#00007F", "#4180B6","#69AEE7","#009900","#009933","#009966","#009999","#0099CC","#0099FF","#339900","#339933","#339966","#339999", "#3399CC","#3399FF","#669900","#669933","#669966","#669999","#6699CC","#6699FF","#999900","#999933","#999966","#999999", "#9999CC","#9999FF","#CC9900","#CC9933","#CC9966","#CC9999","#CC99CC","#CC99FF","#FF9900","#FF9933","#FF9966","#FF9999", "#FF99CC","#FF99FF","#3FFFFF","#3FFFFF","#3FF7F7","#3FEFEF","#3FE7E7","#3FDFDF","#3FD7D7","#3FCFCF","#3FC7C7","#3FBFBF", "#3FB7B7","#3FAFAF","#3FA7A7","#3F9F9F","#3F9797","#3F8F8F","#3F8787","#3F7F7F","#3F7777","#3F6F6F","#3F6767","#3F5F5F", "#3F5757","#3F4F4F","#3F4747","#3F3F3F","#3F3737","#3F2F2F","#3F2727","#3F1F1F","#3F1717","#3F0F0F","#3F0707","#3F0000", "#4180B6","#69AEE7","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#33CC00","#33CC33","#33CC66","#33CC99", "#33CCCC","#33CCFF","#66CC00","#66CC33","#66CC66","#66CC99","#66CCCC","#66CCFF","#99CC00","#99CC33","#99CC66","#99CC99", "#99CCCC","#99CCFF","#CCCC00","#CCCC33","#CCCC66","#CCCC99","#CCCCCC","#CCCCFF","#FFCC00","#FFCC33","#FFCC66","#FFCC99", "#FFCCCC","#FFCCFF","#FF3FFF","#FF3FFF","#F73FF7","#EF3FEF","#E73FE7","#DF3FDF","#D73FD7","#CF3FCF","#C73FC7","#BF3FBF", "#B73FB7","#AF3FAF","#A73FA7","#9F3F9F","#973F97","#8F3F8F","#873F87","#7F3F7F","#773F77","#6F3F6F","#673F67","#5F3F5F", "#573F57","#4F3F4F","#473F47","#3F3F3F","#373F37","#2F3F2F","#273F27","#1F3F1F","#173F17","#0F3F0F","#073F07","#003F00", "#4180B6","#69AEE7","#00FF00","#00FF33","#00FF66","#00FF99","#00FFCC","#00FFFF","#33FF00","#33FF33","#33FF66","#33FF99", "#33FFCC","#33FFFF","#66FF00","#66FF33","#66FF66","#66FF99","#66FFCC","#66FFFF","#99FF00","#99FF33","#99FF66","#99FF99", "#99FFCC","#99FFFF","#CCFF00","#CCFF33","#CCFF66","#CCFF99","#CCFFCC","#CCFFFF","#FFFF00","#FFFF33","#FFFF66","#FFFF99", "#FFFFCC","#FFFFFF","#FFFF3F","#FFFF3F","#F7F73F","#EFEF3F","#E7E73F","#DFDF3F","#D7D73F","#CFCF3F","#C7C73F","#BFBF3F", "#B7B73F","#AFAF3F","#A7A73F","#9F9F3F","#97973F","#8F8F3F","#87873F","#7F7F3F","#77773F","#6F6F3F","#67673F","#5F5F3F", "#57573F","#4F4F3F","#47473F","#3F3F3F","#37373F","#2F2F3F","#27273F","#1F1F3F","#17173F","#0F0F3F","#07073F","#00003F", "#4180B6","#69AEE7","#FFFFFF","#FFEEEE","#FFDDDD","#FFCCCC","#FFBBBB","#FFAAAA","#FF9999","#FF8888","#FF7777","#FF6666", "#FF5555","#FF4444","#FF3333","#FF2222","#FF1111","#FF0000","#FF0000","#FF0000","#FF0000","#EE0000","#DD0000","#CC0000", "#BB0000","#AA0000","#990000","#880000","#770000","#660000","#550000","#440000","#330000","#220000","#110000","#000000", "#000000","#000000","#000000","#001111","#002222","#003333","#004444","#005555","#006666","#007777","#008888","#009999", "#00AAAA","#00BBBB","#00CCCC","#00DDDD","#00EEEE","#00FFFF","#00FFFF","#00FFFF","#00FFFF","#11FFFF","#22FFFF","#33FFFF", "#44FFFF","#55FFFF","#66FFFF","#77FFFF","#88FFFF","#99FFFF","#AAFFFF","#BBFFFF","#CCFFFF","#DDFFFF","#EEFFFF","#FFFFFF", "#4180B6","#69AEE7","#FFFFFF","#EEFFEE","#DDFFDD","#CCFFCC","#BBFFBB","#AAFFAA","#99FF99","#88FF88","#77FF77","#66FF66", "#55FF55","#44FF44","#33FF33","#22FF22","#11FF11","#00FF00","#00FF00","#00FF00","#00FF00","#00EE00","#00DD00","#00CC00", "#00BB00","#00AA00","#009900","#008800","#007700","#006600","#005500","#004400","#003300","#002200","#001100","#000000", "#000000","#000000","#000000","#110011","#220022","#330033","#440044","#550055","#660066","#770077","#880088","#990099", "#AA00AA","#BB00BB","#CC00CC","#DD00DD","#EE00EE","#FF00FF","#FF00FF","#FF00FF","#FF00FF","#FF11FF","#FF22FF","#FF33FF", "#FF44FF","#FF55FF","#FF66FF","#FF77FF","#FF88FF","#FF99FF","#FFAAFF","#FFBBFF","#FFCCFF","#FFDDFF","#FFEEFF","#FFFFFF", "#4180B6","#69AEE7","#FFFFFF","#EEEEFF","#DDDDFF","#CCCCFF","#BBBBFF","#AAAAFF","#9999FF","#8888FF","#7777FF","#6666FF", "#5555FF","#4444FF","#3333FF","#2222FF","#1111FF","#0000FF","#0000FF","#0000FF","#0000FF","#0000EE","#0000DD","#0000CC", "#0000BB","#0000AA","#000099","#000088","#000077","#000066","#000055","#000044","#000033","#000022","#000011","#000000", "#000000","#000000","#000000","#111100","#222200","#333300","#444400","#555500","#666600","#777700","#888800","#999900", "#AAAA00","#BBBB00","#CCCC00","#DDDD00","#EEEE00","#FFFF00","#FFFF00","#FFFF00","#FFFF00","#FFFF11","#FFFF22","#FFFF33", "#FFFF44","#FFFF55","#FFFF66","#FFFF77","#FFFF88","#FFFF99","#FFFFAA","#FFFFBB","#FFFFCC","#FFFFDD","#FFFFEE","#FFFFFF", "#4180B6","#69AEE7","#FFFFFF","#FFFFFF","#FBFBFB","#F7F7F7","#F3F3F3","#EFEFEF","#EBEBEB","#E7E7E7","#E3E3E3","#DFDFDF", "#DBDBDB","#D7D7D7","#D3D3D3","#CFCFCF","#CBCBCB","#C7C7C7","#C3C3C3","#BFBFBF","#BBBBBB","#B7B7B7","#B3B3B3","#AFAFAF", "#ABABAB","#A7A7A7","#A3A3A3","#9F9F9F","#9B9B9B","#979797","#939393","#8F8F8F","#8B8B8B","#878787","#838383","#7F7F7F", "#7B7B7B","#777777","#737373","#6F6F6F","#6B6B6B","#676767","#636363","#5F5F5F","#5B5B5B","#575757","#535353","#4F4F4F", "#4B4B4B","#474747","#434343","#3F3F3F","#3B3B3B","#373737","#333333","#2F2F2F","#2B2B2B","#272727","#232323","#1F1F1F", "#1B1B1B","#171717","#131313","#0F0F0F","#0B0B0B","#070707","#030303","#000000","#000000","#000000","#000000","#000000"); var total = colors.length; var width = 72; var cp_contents = ""; var windowRef = (windowMode)?"window.opener.":""; if (windowMode) { cp_contents += "Select Color"; cp_contents += ""; } cp_contents += ""; var use_highlight = (document.getElementById || document.all)?true:false; for (var i=0; i '; if ( ((i+1)>=total) || (((i+1) % width) == 0)) { cp_contents += ""; } } // If the browser supports dynamically changing TD cells, add the fancy stuff if (document.getElementById) { var width1 = Math.floor(width/2); var width2 = width = width1; cp_contents += ""; } cp_contents += "
     #FFFFFF
    "; if (windowMode) { cp_contents += "
    "; } // end populate code // Write the contents to the popup object cp.populate(cp_contents+"\n"); // Move the table down a bit so you can see it cp.offsetY = 25; cp.autoHide(); return cp; } wp/dev/wp-includes/rss-functions.php0000644000106600010660000000026710737510563014776 0ustar wp/dev/wp-includes/l10n.php0000644000106600010660000002346311046143564012733 0ustar translate($text), $text); else return $text; } /** * translate_with_context() - Retrieve the translated text and strip context * * If the domain is set in the $l10n global, then the text is run * through the domain's translate method. After it is passed to * the 'gettext' filter hook, along with the untranslated text as * the second parameter. * * If the domain is not set, the $text is just returned. * * @since 2.5 * @uses translate() * * @param string $text Text to translate * @param string $domain Domain to retrieve the translated text * @return string Translated text */ function translate_with_context($text, $domain = 'default') { $whole = translate($text, $domain); $last_bar = strrpos($whole, '|'); if ( false == $last_bar ) { return $whole; } else { return substr($whole, 0, $last_bar); } } /** * __() - Retrieve a translated string * * __() is a convenience function which retrieves the translated * string from the translate(). * * @see translate() An alias of translate() * @since 2.1.0 * * @param string $text Text to translate * @param string $domain Optional. Domain to retrieve the translated text * @return string Translated text */ function __($text, $domain = 'default') { return translate($text, $domain); } // . /** * _e() - Display a translated string * * _e() is a convenience function which displays the returned * translated text from translate(). * * @see translate() Echos returned translate() string * @since 1.2.0 * * @param string $text Text to translate * @param string $domain Optional. Domain to retrieve the translated text */ function _e($text, $domain = 'default') { echo translate($text, $domain); } /** * _c() - Retrieve context translated string * * Quite a few times, there will be collisions with similar * translatable text found in more than two places but with * different translated context. * * In order to use the separate contexts, the _c() function * is used and the translatable string uses a pipe ('|') * which has the context the string is in. * * When the translated string is returned, it is everything * before the pipe, not including the pipe character. If * there is no pipe in the translated text then everything * is returned. * * @since 2.2.0 * * @param string $text Text to translate * @param string $domain Optional. Domain to retrieve the translated text * @return string Translated context string without pipe */ function _c($text, $domain = 'default') { return translate_with_context($text, $domain); } /** * __ngettext() - Retrieve the plural or single form based on the amount * * If the domain is not set in the $l10n list, then a comparsion * will be made and either $plural or $single parameters returned. * * If the domain does exist, then the parameters $single, $plural, * and $number will first be passed to the domain's ngettext method. * Then it will be passed to the 'ngettext' filter hook along with * the same parameters. The expected type will be a string. * * @since 1.2.0 * @uses $l10n Gets list of domain translated string (gettext_reader) objects * @uses apply_filters() Calls 'ngettext' hook on domains text returned, * along with $single, $plural, and $number parameters. Expected to return string. * * @param string $single The text that will be used if $number is 1 * @param string $plural The text that will be used if $number is not 1 * @param int $number The number to compare against to use either $single or $plural * @param string $domain Optional. The domain identifier the text should be retrieved in * @return string Either $single or $plural translated text */ function __ngettext($single, $plural, $number, $domain = 'default') { global $l10n; if (isset($l10n[$domain])) { return apply_filters('ngettext', $l10n[$domain]->ngettext($single, $plural, $number), $single, $plural, $number); } else { if ($number != 1) return $plural; else return $single; } } /** * __ngettext_noop() - register plural strings in POT file, but don't translate them * * Used when you want do keep structures with translatable plural strings and * use them later. * * Example: * $messages = array( * 'post' => ngettext_noop('%s post', '%s posts'), * 'page' => ngettext_noop('%s pages', '%s pages') * ); * ... * $message = $messages[$type]; * $usable_text = sprintf(__ngettext($message[0], $message[1], $count), $count); * * @since 2.5 * @param $single Single form to be i18ned * @param $plural Plural form to be i18ned * @param $number Not used, here for compatibility with __ngettext, optional * @param $domain Not used, here for compatibility with __ngettext, optional * @return array array($single, $plural) */ function __ngettext_noop($single, $plural, $number=1, $domain = 'default') { return array($single, $plural); } /** * load_textdomain() - Loads MO file into the list of domains * * If the domain already exists, the inclusion will fail. If the * MO file is not readable, the inclusion will fail. * * On success, the mofile will be placed in the $l10n global by * $domain and will be an gettext_reader object. * * @since 1.5.0 * @uses $l10n Gets list of domain translated string (gettext_reader) objects * @uses CacheFileReader Reads the MO file * @uses gettext_reader Allows for retrieving translated strings * * @param string $domain Unique identifier for retrieving translated strings * @param string $mofile Path to the .mo file * @return null On failure returns null and also on success returns nothing. */ function load_textdomain($domain, $mofile) { global $l10n; if ( is_readable($mofile)) $input = new CachedFileReader($mofile); else return; $gettext = new gettext_reader($input); if (isset($l10n[$domain])) { $l10n[$domain]->load_tables(); $gettext->load_tables(); $l10n[$domain]->cache_translations = array_merge($gettext->cache_translations, $l10n[$domain]->cache_translations); } else $l10n[$domain] = $gettext; unset($input, $gettext); } /** * load_default_textdomain() - Loads default translated strings based on locale * * Loads the .mo file in WP_LANG_DIR constant path from WordPress root. * The translated (.mo) file is named based off of the locale. * * @since 1.5.0 */ function load_default_textdomain() { $locale = get_locale(); $mofile = WP_LANG_DIR . "/$locale.mo"; load_textdomain('default', $mofile); } /** * load_plugin_textdomain() - Loads the plugin's translated strings * * If the path is not given then it will be the root of the plugin * directory. The .mo file should be named based on the domain with a * dash followed by a dash, and then the locale exactly. * * @since 1.5.0 * * @param string $domain Unique identifier for retrieving translated strings * @param string $abs_rel_path Optional. Relative path to ABSPATH of a folder, * where the .mo file resides. Deprecated, but still functional until 2.7 * @param string $plugin_rel_path Optional. Relative path to WP_PLUGIN_DIR. This is the preferred argument to use. It takes precendence over $abs_rel_path */ function load_plugin_textdomain($domain, $abs_rel_path = false, $plugin_rel_path = false) { $locale = get_locale(); if ( false !== $plugin_rel_path ) $path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/'); else if ( false !== $abs_rel_path) $path = ABSPATH . trim( $abs_rel_path, '/'); else $path = WP_PLUGIN_DIR; $mofile = $path . '/'. $domain . '-' . $locale . '.mo'; load_textdomain($domain, $mofile); } /** * load_theme_textdomain() - Includes theme's translated strings for the theme * * If the current locale exists as a .mo file in the theme's root directory, it * will be included in the translated strings by the $domain. * * The .mo files must be named based on the locale exactly. * * @since 1.5.0 * * @param string $domain Unique identifier for retrieving translated strings */ function load_theme_textdomain($domain) { $locale = get_locale(); $mofile = get_template_directory() . "/$locale.mo"; load_textdomain($domain, $mofile); } ?> wp/dev/wp-includes/capabilities.php0000644000106600010660000003067411001472763014611 0ustar _init(); } function _init () { global $wpdb; global $wp_user_roles; $this->role_key = $wpdb->prefix . 'user_roles'; if ( ! empty($wp_user_roles) ) { $this->roles = $wp_user_roles; $this->use_db = false; } else { $this->roles = get_option($this->role_key); } if ( empty($this->roles) ) return; $this->role_objects = array(); $this->role_names = array(); foreach ($this->roles as $role => $data) { $this->role_objects[$role] = new WP_Role($role, $this->roles[$role]['capabilities']); $this->role_names[$role] = $this->roles[$role]['name']; } } function add_role($role, $display_name, $capabilities = array()) { if ( isset($this->roles[$role]) ) return; $this->roles[$role] = array( 'name' => $display_name, 'capabilities' => $capabilities); if ( $this->use_db ) update_option($this->role_key, $this->roles); $this->role_objects[$role] = new WP_Role($role, $capabilities); $this->role_names[$role] = $display_name; return $this->role_objects[$role]; } function remove_role($role) { if ( ! isset($this->role_objects[$role]) ) return; unset($this->role_objects[$role]); unset($this->role_names[$role]); unset($this->roles[$role]); if ( $this->use_db ) update_option($this->role_key, $this->roles); } function add_cap($role, $cap, $grant = true) { $this->roles[$role]['capabilities'][$cap] = $grant; if ( $this->use_db ) update_option($this->role_key, $this->roles); } function remove_cap($role, $cap) { unset($this->roles[$role]['capabilities'][$cap]); if ( $this->use_db ) update_option($this->role_key, $this->roles); } function &get_role($role) { if ( isset($this->role_objects[$role]) ) return $this->role_objects[$role]; else return null; } function get_names() { return $this->role_names; } function is_role($role) { return isset($this->role_names[$role]); } } class WP_Role { var $name; var $capabilities; function WP_Role($role, $capabilities) { $this->name = $role; $this->capabilities = $capabilities; } function add_cap($cap, $grant = true) { global $wp_roles; if ( ! isset($wp_roles) ) $wp_roles = new WP_Roles(); $this->capabilities[$cap] = $grant; $wp_roles->add_cap($this->name, $cap, $grant); } function remove_cap($cap) { global $wp_roles; if ( ! isset($wp_roles) ) $wp_roles = new WP_Roles(); unset($this->capabilities[$cap]); $wp_roles->remove_cap($this->name, $cap); } function has_cap($cap) { $capabilities = apply_filters('role_has_cap', $this->capabilities, $cap, $this->name); if ( !empty($capabilities[$cap]) ) return $capabilities[$cap]; else return false; } } class WP_User { var $data; var $ID = 0; var $id = 0; // Deprecated, use $ID instead. var $caps = array(); var $cap_key; var $roles = array(); var $allcaps = array(); function WP_User($id, $name = '') { if ( empty($id) && empty($name) ) return; if ( ! is_numeric($id) ) { $name = $id; $id = 0; } if ( ! empty($id) ) $this->data = get_userdata($id); else $this->data = get_userdatabylogin($name); if ( empty($this->data->ID) ) return; foreach (get_object_vars($this->data) as $key => $value) { $this->{$key} = $value; } $this->id = $this->ID; $this->_init_caps(); } function _init_caps() { global $wpdb; $this->cap_key = $wpdb->prefix . 'capabilities'; $this->caps = &$this->{$this->cap_key}; if ( ! is_array($this->caps) ) $this->caps = array(); $this->get_role_caps(); } function get_role_caps() { global $wp_roles; if ( ! isset($wp_roles) ) $wp_roles = new WP_Roles(); //Filter out caps that are not role names and assign to $this->roles if(is_array($this->caps)) $this->roles = array_filter(array_keys($this->caps), array(&$wp_roles, 'is_role')); //Build $allcaps from role caps, overlay user's $caps $this->allcaps = array(); foreach( (array) $this->roles as $role) { $role = $wp_roles->get_role($role); $this->allcaps = array_merge($this->allcaps, $role->capabilities); } $this->allcaps = array_merge($this->allcaps, $this->caps); } function add_role($role) { $this->caps[$role] = true; update_usermeta($this->ID, $this->cap_key, $this->caps); $this->get_role_caps(); $this->update_user_level_from_caps(); } function remove_role($role) { if ( empty($this->roles[$role]) || (count($this->roles) <= 1) ) return; unset($this->caps[$role]); update_usermeta($this->ID, $this->cap_key, $this->caps); $this->get_role_caps(); } function set_role($role) { foreach($this->roles as $oldrole) unset($this->caps[$oldrole]); if ( !empty($role) ) { $this->caps[$role] = true; $this->roles = array($role => true); } else { $this->roles = false; } update_usermeta($this->ID, $this->cap_key, $this->caps); $this->get_role_caps(); $this->update_user_level_from_caps(); } function level_reduction($max, $item) { if(preg_match('/^level_(10|[0-9])$/i', $item, $matches)) { $level = intval($matches[1]); return max($max, $level); } else { return $max; } } function update_user_level_from_caps() { global $wpdb; $this->user_level = array_reduce(array_keys($this->allcaps), array(&$this, 'level_reduction'), 0); update_usermeta($this->ID, $wpdb->prefix.'user_level', $this->user_level); } function add_cap($cap, $grant = true) { $this->caps[$cap] = $grant; update_usermeta($this->ID, $this->cap_key, $this->caps); } function remove_cap($cap) { if ( empty($this->caps[$cap]) ) return; unset($this->caps[$cap]); update_usermeta($this->ID, $this->cap_key, $this->caps); } function remove_all_caps() { global $wpdb; $this->caps = array(); update_usermeta($this->ID, $this->cap_key, ''); update_usermeta($this->ID, $wpdb->prefix.'user_level', ''); $this->get_role_caps(); } //has_cap(capability_or_role_name) or //has_cap('edit_post', post_id) function has_cap($cap) { if ( is_numeric($cap) ) $cap = $this->translate_level_to_cap($cap); $args = array_slice(func_get_args(), 1); $args = array_merge(array($cap, $this->ID), $args); $caps = call_user_func_array('map_meta_cap', $args); // Must have ALL requested caps $capabilities = apply_filters('user_has_cap', $this->allcaps, $caps, $args); foreach ($caps as $cap) { //echo "Checking cap $cap
    "; if(empty($capabilities[$cap]) || !$capabilities[$cap]) return false; } return true; } function translate_level_to_cap($level) { return 'level_' . $level; } } // Map meta capabilities to primitive capabilities. function map_meta_cap($cap, $user_id) { $args = array_slice(func_get_args(), 2); $caps = array(); switch ($cap) { case 'delete_user': $caps[] = 'delete_users'; break; case 'edit_user': if ( !isset($args[0]) || $user_id != $args[0] ) { $caps[] = 'edit_users'; } break; case 'delete_post': $author_data = get_userdata($user_id); //echo "post ID: {$args[0]}
    "; $post = get_post($args[0]); if ( 'page' == $post->post_type ) { $args = array_merge(array('delete_page', $user_id), $args); return call_user_func_array('map_meta_cap', $args); } $post_author_data = get_userdata($post->post_author); //echo "current user id : $user_id, post author id: " . $post_author_data->ID . "
    "; // If the user is the author... if ($user_id == $post_author_data->ID) { // If the post is published... if ($post->post_status == 'publish') $caps[] = 'delete_published_posts'; else // If the post is draft... $caps[] = 'delete_posts'; } else { // The user is trying to edit someone else's post. $caps[] = 'delete_others_posts'; // The post is published, extra cap required. if ($post->post_status == 'publish') $caps[] = 'delete_published_posts'; else if ($post->post_status == 'private') $caps[] = 'delete_private_posts'; } break; case 'delete_page': $author_data = get_userdata($user_id); //echo "post ID: {$args[0]}
    "; $page = get_page($args[0]); $page_author_data = get_userdata($page->post_author); //echo "current user id : $user_id, page author id: " . $page_author_data->ID . "
    "; // If the user is the author... if ($user_id == $page_author_data->ID) { // If the page is published... if ($page->post_status == 'publish') $caps[] = 'delete_published_pages'; else // If the page is draft... $caps[] = 'delete_pages'; } else { // The user is trying to edit someone else's page. $caps[] = 'delete_others_pages'; // The page is published, extra cap required. if ($page->post_status == 'publish') $caps[] = 'delete_published_pages'; else if ($page->post_status == 'private') $caps[] = 'delete_private_pages'; } break; // edit_post breaks down to edit_posts, edit_published_posts, or // edit_others_posts case 'edit_post': $author_data = get_userdata($user_id); //echo "post ID: {$args[0]}
    "; $post = get_post($args[0]); if ( 'page' == $post->post_type ) { $args = array_merge(array('edit_page', $user_id), $args); return call_user_func_array('map_meta_cap', $args); } $post_author_data = get_userdata($post->post_author); //echo "current user id : $user_id, post author id: " . $post_author_data->ID . "
    "; // If the user is the author... if ($user_id == $post_author_data->ID) { // If the post is published... if ($post->post_status == 'publish') $caps[] = 'edit_published_posts'; else // If the post is draft... $caps[] = 'edit_posts'; } else { // The user is trying to edit someone else's post. $caps[] = 'edit_others_posts'; // The post is published, extra cap required. if ($post->post_status == 'publish') $caps[] = 'edit_published_posts'; else if ($post->post_status == 'private') $caps[] = 'edit_private_posts'; } break; case 'edit_page': $author_data = get_userdata($user_id); //echo "post ID: {$args[0]}
    "; $page = get_page($args[0]); $page_author_data = get_userdata($page->post_author); //echo "current user id : $user_id, page author id: " . $page_author_data->ID . "
    "; // If the user is the author... if ($user_id == $page_author_data->ID) { // If the page is published... if ($page->post_status == 'publish') $caps[] = 'edit_published_pages'; else // If the page is draft... $caps[] = 'edit_pages'; } else { // The user is trying to edit someone else's page. $caps[] = 'edit_others_pages'; // The page is published, extra cap required. if ($page->post_status == 'publish') $caps[] = 'edit_published_pages'; else if ($page->post_status == 'private') $caps[] = 'edit_private_pages'; } break; case 'read_post': $post = get_post($args[0]); if ( 'page' == $post->post_type ) { $args = array_merge(array('read_page', $user_id), $args); return call_user_func_array('map_meta_cap', $args); } if ( 'private' != $post->post_status ) { $caps[] = 'read'; break; } $author_data = get_userdata($user_id); $post_author_data = get_userdata($post->post_author); if ($user_id == $post_author_data->ID) $caps[] = 'read'; else $caps[] = 'read_private_posts'; break; case 'read_page': $page = get_page($args[0]); if ( 'private' != $page->post_status ) { $caps[] = 'read'; break; } $author_data = get_userdata($user_id); $page_author_data = get_userdata($page->post_author); if ($user_id == $page_author_data->ID) $caps[] = 'read'; else $caps[] = 'read_private_pages'; break; default: // If no meta caps match, return the original cap. $caps[] = $cap; } return $caps; } // Capability checking wrapper around the global $current_user object. function current_user_can($capability) { $current_user = wp_get_current_user(); if ( empty($current_user) ) return false; $args = array_slice(func_get_args(), 1); $args = array_merge(array($capability), $args); return call_user_func_array(array(&$current_user, 'has_cap'), $args); } // Convenience wrappers around $wp_roles. function get_role($role) { global $wp_roles; if ( ! isset($wp_roles) ) $wp_roles = new WP_Roles(); return $wp_roles->get_role($role); } function add_role($role, $display_name, $capabilities = array()) { global $wp_roles; if ( ! isset($wp_roles) ) $wp_roles = new WP_Roles(); return $wp_roles->add_role($role, $display_name, $capabilities); } function remove_role($role) { global $wp_roles; if ( ! isset($wp_roles) ) $wp_roles = new WP_Roles(); return $wp_roles->remove_role($role); } ?> wp/dev/wp-includes/script-loader.php0000644000106600010660000003457311047641230014727 0ustar base_url = $guessurl; $scripts->default_version = get_bloginfo( 'version' ); $scripts->add( 'common', '/wp-admin/js/common.js', array('jquery'), '20080318' ); $scripts->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' ); $scripts->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '3958' ); $scripts->localize( 'quicktags', 'quicktagsL10n', array( 'quickLinks' => __('(Quick Links)'), 'wordLookup' => __('Enter a word to look up:'), 'dictionaryLookup' => attribute_escape(__('Dictionary lookup')), 'lookup' => attribute_escape(__('lookup')), 'closeAllOpenTags' => attribute_escape(__('Close all open tags')), 'closeTags' => attribute_escape(__('close tags')), 'enterURL' => __('Enter the URL'), 'enterImageURL' => __('Enter the URL of the image'), 'enterImageDescription' => __('Enter a description of the image') ) ); $scripts->add( 'colorpicker', '/wp-includes/js/colorpicker.js', array('prototype'), '3517' ); // Let a plugin replace the visual editor $visual_editor = apply_filters('visual_editor', array('tiny_mce')); $scripts->add( 'editor', false, $visual_editor, '20080321' ); $scripts->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080710' ); // Modify this version when tinyMCE plugins are changed. $mce_version = apply_filters('tiny_mce_version', '20080810'); $scripts->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version ); $scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6'); $scripts->add( 'wp-ajax-response', '/wp-includes/js/wp-ajax-response.js', array('jquery'), '20080316' ); $scripts->localize( 'wp-ajax-response', 'wpAjax', array( 'noPerm' => __('You do not have permission to do that.'), 'broken' => __('An unidentified error has occurred.') ) ); $scripts->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20080622' ); $scripts->add( 'wp-lists', '/wp-includes/js/wp-lists.js', array('wp-ajax-response'), '20080729' ); $scripts->localize( 'wp-lists', 'wpListL10n', array( 'url' => admin_url('admin-ajax.php') ) ); $scripts->add( 'scriptaculous-root', '/wp-includes/js/scriptaculous/scriptaculous.js', array('prototype'), '1.8.0'); $scripts->add( 'scriptaculous-builder', '/wp-includes/js/scriptaculous/builder.js', array('scriptaculous-root'), '1.8.0'); $scripts->add( 'scriptaculous-dragdrop', '/wp-includes/js/scriptaculous/dragdrop.js', array('scriptaculous-builder', 'scriptaculous-effects'), '1.8.0'); $scripts->add( 'scriptaculous-effects', '/wp-includes/js/scriptaculous/effects.js', array('scriptaculous-root'), '1.8.0'); $scripts->add( 'scriptaculous-slider', '/wp-includes/js/scriptaculous/slider.js', array('scriptaculous-effects'), '1.8.0'); $scripts->add( 'scriptaculous-sound', '/wp-includes/js/scriptaculous/sound.js', array( 'scriptaculous-root' ), '1.8.0' ); $scripts->add( 'scriptaculous-controls', '/wp-includes/js/scriptaculous/controls.js', array('scriptaculous-root'), '1.8.0'); $scripts->add( 'scriptaculous', '', array('scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls'), '1.8.0'); $scripts->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop'), '20070118'); $scripts->add( 'jquery', '/wp-includes/js/jquery/jquery.js', false, '1.2.6'); $scripts->add( 'jquery-form', '/wp-includes/js/jquery/jquery.form.js', array('jquery'), '2.02'); $scripts->add( 'jquery-color', '/wp-includes/js/jquery/jquery.color.js', array('jquery'), '2.0-4561'); $scripts->add( 'interface', '/wp-includes/js/jquery/interface.js', array('jquery'), '1.2' ); $scripts->add( 'suggest', '/wp-includes/js/jquery/suggest.js', array('jquery'), '1.1b'); $scripts->add( 'schedule', '/wp-includes/js/jquery/jquery.schedule.js', array('jquery'), '20'); $scripts->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array('jquery'), '3.1-20080430'); $scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2.0.2-20080430'); $scripts->add( 'swfupload-degrade', '/wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js', array('swfupload'), '2.0.2'); $scripts->localize( 'swfupload-degrade', 'uploadDegradeOptions', array( 'is_lighttpd_before_150' => is_lighttpd_before_150(), ) ); $scripts->add( 'swfupload-queue', '/wp-includes/js/swfupload/plugins/swfupload.queue.js', array('swfupload'), '2.0.2'); $scripts->add( 'swfupload-handlers', '/wp-includes/js/swfupload/handlers.js', array('swfupload'), '2.0.2-20080407'); // these error messages came from the sample swfupload js, they might need changing. $scripts->localize( 'swfupload-handlers', 'swfuploadL10n', array( 'queue_limit_exceeded' => __('You have attempted to queue too many files.'), 'file_exceeds_size_limit' => sprintf(__('This file is too big. Your php.ini upload_max_filesize is %s.'), @ini_get('upload_max_filesize')), 'zero_byte_file' => __('This file is empty. Please try another.'), 'invalid_filetype' => __('This file type is not allowed. Please try another.'), 'default_error' => __('An error occurred in the upload. Please try again later.'), 'missing_upload_url' => __('There was a configuration error. Please contact the server administrator.'), 'upload_limit_exceeded' => __('You may only upload 1 file.'), 'http_error' => __('HTTP error.'), 'upload_failed' => __('Upload failed.'), 'io_error' => __('IO error.'), 'security_error' => __('Security error.'), 'file_cancelled' => __('File cancelled.'), 'upload_stopped' => __('Upload stopped.'), 'dismiss' => __('Dismiss'), 'crunching' => __('Crunching…'), 'deleted' => __('Deleted'), ) ); $scripts->add( 'jquery-ui-core', '/wp-includes/js/jquery/ui.core.js', array('jquery'), '1.5.1' ); $scripts->add( 'jquery-ui-tabs', '/wp-includes/js/jquery/ui.tabs.js', array('jquery-ui-core'), '1.5.1' ); $scripts->add( 'jquery-ui-sortable', '/wp-includes/js/jquery/ui.sortable.js', array('jquery-ui-core'), '1.5.1' ); if ( is_admin() ) { $scripts->add( 'ajaxcat', '/wp-admin/js/cat.js', array( 'wp-lists' ), '20071101' ); $scripts->localize( 'ajaxcat', 'catL10n', array( 'add' => attribute_escape(__('Add')), 'how' => __('Separate multiple categories with commas.') ) ); $scripts->add( 'admin-categories', '/wp-admin/js/categories.js', array('wp-lists'), '20071031' ); $scripts->add( 'admin-tags', '/wp-admin/js/tags.js', array('wp-lists'), '20071031' ); $scripts->add( 'admin-custom-fields', '/wp-admin/js/custom-fields.js', array('wp-lists'), '20070823' ); $scripts->add( 'password-strength-meter', '/wp-admin/js/password-strength-meter.js', array('jquery'), '20070405' ); $scripts->localize( 'password-strength-meter', 'pwsL10n', array( 'short' => __('Too short'), 'bad' => __('Bad'), 'good' => __('Good'), 'strong' => __('Strong') ) ); $scripts->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists'), '20080311' ); $scripts->localize( 'admin-comments', 'adminCommentsL10n', array( 'pending' => __('%i% pending') // must look like: "# blah blah" ) ); $scripts->add( 'admin-users', '/wp-admin/js/users.js', array('wp-lists'), '20070823' ); $scripts->add( 'admin-forms', '/wp-admin/js/forms.js', array('jquery'), '20080729'); $scripts->add( 'xfn', '/wp-admin/js/xfn.js', false, '3517' ); $scripts->add( 'upload', '/wp-admin/js/upload.js', array('jquery'), '20070518' ); $scripts->add( 'postbox', '/wp-admin/js/postbox.js', array('jquery'), '20080128' ); $scripts->localize( 'postbox', 'postboxL10n', array( 'requestFile' => admin_url('admin-ajax.php'), ) ); $scripts->add( 'slug', '/wp-admin/js/slug.js', array('jquery'), '20080208' ); $scripts->localize( 'slug', 'slugL10n', array( 'requestFile' => admin_url('admin-ajax.php'), 'save' => __('Save'), 'cancel' => __('Cancel'), ) ); $scripts->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug'), '20080629' ); $scripts->localize( 'post', 'postL10n', array( 'tagsUsed' => __('Tags used on this post:'), 'add' => attribute_escape(__('Add')), 'addTag' => attribute_escape(__('Add new tag')), 'separate' => __('Separate tags with commas'), 'cancel' => __('Cancel'), 'edit' => __('Edit'), ) ); $scripts->add( 'page', '/wp-admin/js/page.js', array('jquery', 'slug', 'postbox'), '20080318' ); $scripts->localize( 'page', 'postL10n', array( 'cancel' => __('Cancel'), 'edit' => __('Edit'), ) ); $scripts->add( 'link', '/wp-admin/js/link.js', array('jquery-ui-tabs', 'wp-lists', 'postbox'), '20080131' ); $scripts->add( 'comment', '/wp-admin/js/comment.js', array('postbox'), '20080219' ); $scripts->localize( 'comment', 'commentL10n', array( 'cancel' => __('Cancel'), 'edit' => __('Edit'), ) ); $scripts->add( 'admin-gallery', '/wp-admin/js/gallery.js', array( 'jquery-ui-sortable' ), '20080709' ); $scripts->add( 'media-upload', '/wp-admin/js/media-upload.js', array( 'thickbox' ), '20080710' ); $scripts->localize( 'upload', 'uploadL10n', array( 'browseTitle' => attribute_escape(__('Browse your files')), 'back' => __('« Back'), 'directTitle' => attribute_escape(__('Direct link to file')), 'edit' => __('Edit'), 'thumb' => __('Thumbnail'), 'full' => __('Full size'), 'icon' => __('Icon'), 'title' => __('Title'), 'show' => __('Show:'), 'link' => __('Link to:'), 'file' => __('File'), 'page' => __('Page'), 'none' => __('None'), 'editorText' => attribute_escape(__('Send to editor »')), 'insert' => __('Insert'), 'urlText' => __('URL'), 'desc' => __('Description'), 'deleteText' => attribute_escape(__('Delete File')), 'saveText' => attribute_escape(__('Save »')), 'confirmText' => __("Are you sure you want to delete the file '%title%'?\nClick ok to delete or cancel to go back.") ) ); $scripts->add( 'admin-widgets', '/wp-admin/js/widgets.js', array( 'interface' ), '20080503' ); $scripts->localize( 'admin-widgets', 'widgetsL10n', array( 'add' => __('Add'), 'edit' => __('Edit'), 'cancel' => __('Cancel'), )); $scripts->add( 'word-count', '/wp-admin/js/word-count.js', array( 'jquery' ), '20080423' ); $scripts->localize( 'word-count', 'wordCountL10n', array( 'count' => __('Word count: %d') )); $scripts->add( 'wp-gears', '/wp-admin/js/wp-gears.js', false, '20080721' ); $scripts->localize( 'wp-gears', 'wpGearsL10n', array( 'updateCompleted' => __('Update completed.'), 'error' => __('Error:') )); $scripts->add( 'theme-preview', '/wp-admin/js/theme-preview.js', array( 'thickbox', 'jquery' ), '20080625' ); } } function wp_default_styles( &$styles ) { if (!$guessurl = site_url()) $guessurl = wp_guess_url(); $styles->base_url = $guessurl; $styles->default_version = get_bloginfo( 'version' ); $styles->text_direction = 'rtl' == get_bloginfo( 'text_direction' ) ? 'rtl' : 'ltr'; $rtl_styles = array( 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets', 'press-this', 'press-this-ie' ); $styles->add( 'wp-admin', '/wp-admin/wp-admin.css' ); $styles->add_data( 'wp-admin', 'rtl', '/wp-admin/rtl.css' ); $styles->add( 'ie', '/wp-admin/css/ie.css' ); $styles->add_data( 'ie', 'conditional', 'gte IE 6' ); $styles->add( 'colors', true ); // Register "meta" stylesheet for admin colors $styles->add( 'colors-fresh', '/wp-admin/css/colors-fresh.css' ); // for login.php. Is there a better way? $styles->add_data( 'colors-fresh', 'rtl', true ); $styles->add( 'global', '/wp-admin/css/global.css' ); $styles->add( 'media', '/wp-admin/css/media.css', array(), '20080709' ); $styles->add( 'widgets', '/wp-admin/css/widgets.css' ); $styles->add( 'dashboard', '/wp-admin/css/dashboard.css' ); $styles->add( 'install', '/wp-admin/css/install.css', array(), '20080708' ); $styles->add( 'theme-editor', '/wp-admin/css/theme-editor.css' ); $styles->add( 'press-this', '/wp-admin/css/press-this.css', array(), '20080710' ); $styles->add( 'press-this-ie', '/wp-admin/css/press-this-ie.css', array(), '20080710' ); $styles->add_data( 'press-this-ie', 'conditional', 'gte IE 6' ); $styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20080613' ); $styles->add( 'login', '/wp-admin/css/login.css' ); foreach ( $rtl_styles as $rtl_style ) $styles->add_data( $rtl_style, 'rtl', true ); } function wp_prototype_before_jquery( $js_array ) { if ( false === $jquery = array_search( 'jquery', $js_array ) ) return $js_array; if ( false === $prototype = array_search( 'prototype', $js_array ) ) return $js_array; if ( $prototype < $jquery ) return $js_array; unset($js_array[$prototype]); array_splice( $js_array, $jquery, 0, 'prototype' ); return $js_array; } // These localizations require information that may not be loaded even by init function wp_just_in_time_script_localization() { wp_localize_script( 'tiny_mce', 'wpTinyMCEConfig', array( 'defaultEditor' => wp_default_editor() ) ); wp_localize_script( 'autosave', 'autosaveL10n', array( 'autosaveInterval' => AUTOSAVE_INTERVAL, 'previewPageText' => __('Preview this Page'), 'previewPostText' => __('Preview this Post'), 'requestFile' => admin_url('admin-ajax.php'), 'savingText' => __('Saving Draft…') ) ); } function wp_style_loader_src( $src, $handle ) { if ( defined('WP_INSTALLING') ) return preg_replace( '#^wp-admin/#', './', $src ); if ( 'colors' == $handle || 'colors-rtl' == $handle ) { global $_wp_admin_css_colors; $color = get_user_option('admin_color'); if ( empty($color) || !isset($_wp_admin_css_colors[$color]) ) $color = 'fresh'; $color = $_wp_admin_css_colors[$color]; $parsed = parse_url( $src ); $url = $color->url; if ( isset($parsed['query']) && $parsed['query'] ) { wp_parse_str( $parsed['query'], $qv ); $url = add_query_arg( $qv, $url ); } return $url; } return $src; } add_action( 'wp_default_scripts', 'wp_default_scripts' ); add_filter( 'wp_print_scripts', 'wp_just_in_time_script_localization' ); add_filter( 'print_scripts_array', 'wp_prototype_before_jquery' ); add_action( 'wp_default_styles', 'wp_default_styles' ); add_filter( 'style_loader_src', 'wp_style_loader_src', 10, 2 ); wp/dev/wp-includes/category-template.php0000644000106600010660000004015211035042456015575 0ustar parent == $id && !in_array($category->term_id, $visited) ) { $visited[] = $category->term_id; $chain .= $before.$category->term_id.$after; $chain .= get_category_children($category->term_id, $before, $after); } } return $chain; } function get_category_link($category_id) { global $wp_rewrite; $catlink = $wp_rewrite->get_category_permastruct(); if ( empty($catlink) ) { $file = get_option('home') . '/'; $catlink = $file . '?cat=' . $category_id; } else { $category = &get_category($category_id); if ( is_wp_error( $category ) ) return $category; $category_nicename = $category->slug; if ( $parent = $category->parent ) $category_nicename = get_category_parents($parent, false, '/', true) . $category_nicename; $catlink = str_replace('%category%', $category_nicename, $catlink); $catlink = get_option('home') . user_trailingslashit($catlink, 'category'); } return apply_filters('category_link', $catlink, $category_id); } function get_category_parents($id, $link = FALSE, $separator = '/', $nicename = FALSE, $visited = array()){ $chain = ''; $parent = &get_category($id); if ( is_wp_error( $parent ) ) return $parent; if ( $nicename ) $name = $parent->slug; else $name = $parent->cat_name; if ( $parent->parent && ($parent->parent != $parent->term_id) && !in_array($parent->parent, $visited) ) { $visited[] = $parent->parent; $chain .= get_category_parents($parent->parent, $link, $separator, $nicename, $visited); } if ( $link ) $chain .= 'cat_name) . '">'.$name.'' . $separator; else $chain .= $name.$separator; return $chain; } function get_the_category($id = false) { global $post; $id = (int) $id; if ( !$id ) $id = (int) $post->ID; $categories = get_object_term_cache($id, 'category'); if ( false === $categories ) $categories = wp_get_object_terms($id, 'category'); if ( !empty($categories) ) usort($categories, '_usort_terms_by_name'); else $categories = array(); foreach(array_keys($categories) as $key) { _make_cat_compat($categories[$key]); } return $categories; } function _usort_terms_by_name($a, $b) { return strcmp($a->name, $b->name); } function _usort_terms_by_ID($a, $b) { if ( $a->term_id > $b->term_id ) return 1; elseif ( $a->term_id < $b->term_id ) return -1; else return 0; } function get_the_category_by_ID($cat_ID) { $cat_ID = (int) $cat_ID; $category = &get_category($cat_ID); if ( is_wp_error( $category ) ) return $category; return $category->name; } function get_the_category_list($separator = '', $parents='', $post_id = false) { global $wp_rewrite; $categories = get_the_category($post_id); if (empty($categories)) return apply_filters('the_category', __('Uncategorized'), $separator, $parents); $rel = ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ) ? 'rel="category tag"' : 'rel="category"'; $thelist = ''; if ( '' == $separator ) { $thelist .= ''; } else { $i = 0; foreach ( $categories as $category ) { if ( 0 < $i ) $thelist .= $separator . ' '; switch ( strtolower($parents) ) { case 'multiple': if ( $category->parent ) $thelist .= get_category_parents($category->parent, TRUE); $thelist .= 'name) . '" ' . $rel . '>' . $category->cat_name.''; break; case 'single': $thelist .= 'name) . '" ' . $rel . '>'; if ( $category->parent ) $thelist .= get_category_parents($category->parent, FALSE); $thelist .= "$category->cat_name"; break; case '': default: $thelist .= 'name) . '" ' . $rel . '>' . $category->name.''; } ++$i; } } return apply_filters('the_category', $thelist, $separator, $parents); } /* * in_category() - Checks whether the current post is within a particular category * * This function checks to see if the post is within the supplied category. The categoy * can be specified by number or name and will be checked as a name first to allow for categories with numeric names. * Note: Prior to v2.5 of WordPress category names where not supported. * * @since 1.2.0 * * @param int|string $category * @return bool true if the post is in the supplied category */ function in_category( $category ) { // Check if the current post is in the given category global $post; if ( empty($category) ) return false; // If category is not an int, check to see if it's a name if ( ! is_int($category) ) { $cat_ID = get_cat_ID($category); if ( $cat_ID ) $category = $cat_ID; } $categories = get_object_term_cache($post->ID, 'category'); if ( false === $categories ) $categories = wp_get_object_terms($post->ID, 'category'); if ( array_key_exists($category, $categories) ) return true; else return false; } function the_category($separator = '', $parents='', $post_id = false) { echo get_the_category_list($separator, $parents, $post_id); } function category_description($category = 0) { global $cat; if ( !$category ) $category = $cat; return get_term_field('description', $category, 'category'); } function wp_dropdown_categories($args = '') { $defaults = array( 'show_option_all' => '', 'show_option_none' => '', 'orderby' => 'ID', 'order' => 'ASC', 'show_last_update' => 0, 'show_count' => 0, 'hide_empty' => 1, 'child_of' => 0, 'exclude' => '', 'echo' => 1, 'selected' => 0, 'hierarchical' => 0, 'name' => 'cat', 'class' => 'postform', 'depth' => 0, 'tab_index' => 0 ); $defaults['selected'] = ( is_category() ) ? get_query_var('cat') : 0; $r = wp_parse_args( $args, $defaults ); $r['include_last_update_time'] = $r['show_last_update']; extract( $r ); $tab_index_attribute = ''; if ( (int) $tab_index > 0 ) $tab_index_attribute = " tabindex=\"$tab_index\""; $categories = get_categories($r); $output = ''; if ( ! empty($categories) ) { $output = "\n"; } $output = apply_filters('wp_dropdown_cats', $output); if ( $echo ) echo $output; return $output; } function wp_list_categories($args = '') { $defaults = array( 'show_option_all' => '', 'orderby' => 'name', 'order' => 'ASC', 'show_last_update' => 0, 'style' => 'list', 'show_count' => 0, 'hide_empty' => 1, 'use_desc_for_title' => 1, 'child_of' => 0, 'feed' => '', 'feed_type' => '', 'feed_image' => '', 'exclude' => '', 'current_category' => 0, 'hierarchical' => true, 'title_li' => __('Categories'), 'echo' => 1, 'depth' => 0 ); $r = wp_parse_args( $args, $defaults ); if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) { $r['pad_counts'] = true; } if ( isset( $r['show_date'] ) ) { $r['include_last_update_time'] = $r['show_date']; } extract( $r ); $categories = get_categories($r); $output = ''; if ( $title_li && 'list' == $style ) $output = '
  • ' . $r['title_li'] . '
      '; if ( empty($categories) ) { if ( 'list' == $style ) $output .= '
    • ' . __("No categories") . '
    • '; else $output .= __("No categories"); } else { global $wp_query; if( !empty($show_option_all) ) if ('list' == $style ) $output .= '
    • ' . $show_option_all . '
    • '; else $output .= '' . $show_option_all . ''; if ( empty( $r['current_category'] ) && is_category() ) $r['current_category'] = $wp_query->get_queried_object_id(); if ( $hierarchical ) $depth = $r['depth']; else $depth = -1; // Flat. $output .= walk_category_tree($categories, $depth, $r); } if ( $title_li && 'list' == $style ) $output .= '
  • '; $output = apply_filters('wp_list_categories', $output); if ( $echo ) echo $output; else return $output; } function wp_tag_cloud( $args = '' ) { $defaults = array( 'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45, 'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC', 'exclude' => '', 'include' => '' ); $args = wp_parse_args( $args, $defaults ); $tags = get_tags( array_merge($args, array('orderby' => 'count', 'order' => 'DESC')) ); // Always query top tags if ( empty($tags) ) return; $return = wp_generate_tag_cloud( $tags, $args ); // Here's where those top tags get sorted according to $args if ( is_wp_error( $return ) ) return false; $return = apply_filters( 'wp_tag_cloud', $return, $args ); if ( 'array' == $args['format'] ) return $return; echo $return; } // $tags = prefetched tag array ( get_tags() ) // $args['format'] = 'flat' => whitespace separated, 'list' => UL, 'array' => array() // $args['orderby'] = 'name', 'count' function wp_generate_tag_cloud( $tags, $args = '' ) { global $wp_rewrite; $defaults = array( 'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45, 'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC' ); $args = wp_parse_args( $args, $defaults ); extract($args); if ( !$tags ) return; $counts = $tag_links = array(); foreach ( (array) $tags as $tag ) { $counts[$tag->name] = $tag->count; $tag_links[$tag->name] = get_tag_link( $tag->term_id ); if ( is_wp_error( $tag_links[$tag->name] ) ) return $tag_links[$tag->name]; $tag_ids[$tag->name] = $tag->term_id; } $min_count = min($counts); $spread = max($counts) - $min_count; if ( $spread <= 0 ) $spread = 1; $font_spread = $largest - $smallest; if ( $font_spread <= 0 ) $font_spread = 1; $font_step = $font_spread / $spread; // SQL cannot save you; this is a second (potentially different) sort on a subset of data. if ( 'name' == $orderby ) uksort($counts, 'strnatcasecmp'); else asort($counts); if ( 'DESC' == $order ) $counts = array_reverse( $counts, true ); elseif ( 'RAND' == $order ) { $keys = array_rand( $counts, count($counts) ); foreach ( $keys as $key ) $temp[$key] = $counts[$key]; $counts = $temp; unset($temp); } $a = array(); $rel = ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ) ? ' rel="tag"' : ''; foreach ( $counts as $tag => $count ) { $tag_id = $tag_ids[$tag]; $tag_link = clean_url($tag_links[$tag]); $a[] = "$tag"; } switch ( $format ) : case 'array' : $return =& $a; break; case 'list' : $return = "
      \n\t
    • "; $return .= join("
    • \n\t
    • ", $a); $return .= "
    • \n
    \n"; break; default : $return = join("\n", $a); break; endswitch; return apply_filters( 'wp_generate_tag_cloud', $return, $tags, $args ); } // // Helper functions // function walk_category_tree() { $walker = new Walker_Category; $args = func_get_args(); return call_user_func_array(array(&$walker, 'walk'), $args); } function walk_category_dropdown_tree() { $walker = new Walker_CategoryDropdown; $args = func_get_args(); return call_user_func_array(array(&$walker, 'walk'), $args); } // // Tags // function get_tag_link( $tag_id ) { global $wp_rewrite; $taglink = $wp_rewrite->get_tag_permastruct(); $tag = &get_term($tag_id, 'post_tag'); if ( is_wp_error( $tag ) ) return $tag; $slug = $tag->slug; if ( empty($taglink) ) { $file = get_option('home') . '/'; $taglink = $file . '?tag=' . $slug; } else { $taglink = str_replace('%tag%', $slug, $taglink); $taglink = get_option('home') . user_trailingslashit($taglink, 'category'); } return apply_filters('tag_link', $taglink, $tag_id); } function get_the_tags( $id = 0 ) { return apply_filters( 'get_the_tags', get_the_terms($id, 'post_tag') ); } function get_the_tag_list( $before = '', $sep = '', $after = '' ) { return apply_filters( 'the_tags', get_the_term_list(0, 'post_tag', $before, $sep, $after) ); } function the_tags( $before = 'Tags: ', $sep = ', ', $after = '' ) { return the_terms( 0, 'post_tag', $before, $sep, $after ); } function get_the_terms( $id = 0, $taxonomy ) { global $post; $id = (int) $id; if ( ! $id && ! in_the_loop() ) return false; // in-the-loop function if ( !$id ) $id = (int) $post->ID; $terms = get_object_term_cache($id, $taxonomy); if ( false === $terms ) $terms = wp_get_object_terms($id, $taxonomy); if ( empty( $terms ) ) return false; return $terms; } function get_the_term_list( $id = 0, $taxonomy, $before = '', $sep = '', $after = '' ) { $terms = get_the_terms($id, $taxonomy); if ( is_wp_error($terms) ) return $terms; if ( empty( $terms ) ) return false; foreach ( $terms as $term ) { $link = get_term_link($term, $taxonomy); if ( is_wp_error( $link ) ) return $link; $term_links[] = ''; } $term_links = apply_filters( "term_links-$taxonomy", $term_links ); return $before . join($sep, $term_links) . $after; } function the_terms( $id, $taxonomy, $before = '', $sep = '', $after = '' ) { $return = get_the_term_list($id, $taxonomy, $before, $sep, $after); if ( is_wp_error( $return ) ) return false; else echo $return; } /** * Check if the current post has the given tag * * @package WordPress * @since 2.6 * * @uses wp_get_object_terms() Gets the tags. * * @param string|int|array $tag Optional. The tag name/id/slug or array of them to check for * @return bool True if the current post has the given tag, or any tag, if no tag specified */ function has_tag($tag = '') { global $post; $taxonomy = 'post_tag'; if ( !in_the_loop() ) return false; // in-the-loop function $post_id = (int) $post->ID; $terms = get_object_term_cache($post_id, $taxonomy); if (empty($terms)) $terms = wp_get_object_terms($post_id, $taxonomy); if (empty($terms)) return false; if (empty($tag)) return (!empty($terms)); $tag = (array) $tag; foreach($terms as $term) { if ( in_array( $term->term_id, $tag ) ) return true; if ( in_array( $term->name, $tag ) ) return true; if ( in_array( $term->slug, $tag ) ) return true; } return false; } ?> wp/dev/wp-includes/class-phpass.php0000644000106600010660000001522711024771575014566 0ustar in 2004-2006 and placed in # the public domain. # # There's absolutely no warranty. # # Please be sure to update the Version line if you edit this file in any way. # It is suggested that you leave the main version number intact, but indicate # your project name (after the slash) and add your own revision information. # # Please do not change the "private" password hashing method implemented in # here, thereby making your hashes incompatible. However, if you must, please # change the hash type identifier (the "$P$") to something different. # # Obviously, since this code is in the public domain, the above are not # requirements (there can be none), but merely suggestions. # /** * Portable PHP password hashing framework. * * @package phpass * @version 0.1 / genuine * @link http://www.openwall.com/phpass/ * @since 2.5 */ class PasswordHash { var $itoa64; var $iteration_count_log2; var $portable_hashes; var $random_state; function PasswordHash($iteration_count_log2, $portable_hashes) { $this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31) $iteration_count_log2 = 8; $this->iteration_count_log2 = $iteration_count_log2; $this->portable_hashes = $portable_hashes; $this->random_state = microtime() . (function_exists('getmypid') ? getmypid() : '') . uniqid(rand(), TRUE); } function get_random_bytes($count) { $output = ''; if (($fh = @fopen('/dev/urandom', 'rb'))) { $output = fread($fh, $count); fclose($fh); } if (strlen($output) < $count) { $output = ''; for ($i = 0; $i < $count; $i += 16) { $this->random_state = md5(microtime() . $this->random_state); $output .= pack('H*', md5($this->random_state)); } $output = substr($output, 0, $count); } return $output; } function encode64($input, $count) { $output = ''; $i = 0; do { $value = ord($input[$i++]); $output .= $this->itoa64[$value & 0x3f]; if ($i < $count) $value |= ord($input[$i]) << 8; $output .= $this->itoa64[($value >> 6) & 0x3f]; if ($i++ >= $count) break; if ($i < $count) $value |= ord($input[$i]) << 16; $output .= $this->itoa64[($value >> 12) & 0x3f]; if ($i++ >= $count) break; $output .= $this->itoa64[($value >> 18) & 0x3f]; } while ($i < $count); return $output; } function gensalt_private($input) { $output = '$P$'; $output .= $this->itoa64[min($this->iteration_count_log2 + ((PHP_VERSION >= '5') ? 5 : 3), 30)]; $output .= $this->encode64($input, 6); return $output; } function crypt_private($password, $setting) { $output = '*0'; if (substr($setting, 0, 2) == $output) $output = '*1'; if (substr($setting, 0, 3) != '$P$') return $output; $count_log2 = strpos($this->itoa64, $setting[3]); if ($count_log2 < 7 || $count_log2 > 30) return $output; $count = 1 << $count_log2; $salt = substr($setting, 4, 8); if (strlen($salt) != 8) return $output; # We're kind of forced to use MD5 here since it's the only # cryptographic primitive available in all versions of PHP # currently in use. To implement our own low-level crypto # in PHP would result in much worse performance and # consequently in lower iteration counts and hashes that are # quicker to crack (by non-PHP code). if (PHP_VERSION >= '5') { $hash = md5($salt . $password, TRUE); do { $hash = md5($hash . $password, TRUE); } while (--$count); } else { $hash = pack('H*', md5($salt . $password)); do { $hash = pack('H*', md5($hash . $password)); } while (--$count); } $output = substr($setting, 0, 12); $output .= $this->encode64($hash, 16); return $output; } function gensalt_extended($input) { $count_log2 = min($this->iteration_count_log2 + 8, 24); # This should be odd to not reveal weak DES keys, and the # maximum valid value is (2**24 - 1) which is odd anyway. $count = (1 << $count_log2) - 1; $output = '_'; $output .= $this->itoa64[$count & 0x3f]; $output .= $this->itoa64[($count >> 6) & 0x3f]; $output .= $this->itoa64[($count >> 12) & 0x3f]; $output .= $this->itoa64[($count >> 18) & 0x3f]; $output .= $this->encode64($input, 3); return $output; } function gensalt_blowfish($input) { # This one needs to use a different order of characters and a # different encoding scheme from the one in encode64() above. # We care because the last character in our encoded string will # only represent 2 bits. While two known implementations of # bcrypt will happily accept and correct a salt string which # has the 4 unused bits set to non-zero, we do not want to take # chances and we also do not want to waste an additional byte # of entropy. $itoa64 = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; $output = '$2a$'; $output .= chr(ord('0') + $this->iteration_count_log2 / 10); $output .= chr(ord('0') + $this->iteration_count_log2 % 10); $output .= '$'; $i = 0; do { $c1 = ord($input[$i++]); $output .= $itoa64[$c1 >> 2]; $c1 = ($c1 & 0x03) << 4; if ($i >= 16) { $output .= $itoa64[$c1]; break; } $c2 = ord($input[$i++]); $c1 |= $c2 >> 4; $output .= $itoa64[$c1]; $c1 = ($c2 & 0x0f) << 2; $c2 = ord($input[$i++]); $c1 |= $c2 >> 6; $output .= $itoa64[$c1]; $output .= $itoa64[$c2 & 0x3f]; } while (1); return $output; } function HashPassword($password) { $random = ''; if (CRYPT_BLOWFISH == 1 && !$this->portable_hashes) { $random = $this->get_random_bytes(16); $hash = crypt($password, $this->gensalt_blowfish($random)); if (strlen($hash) == 60) return $hash; } if (CRYPT_EXT_DES == 1 && !$this->portable_hashes) { if (strlen($random) < 3) $random = $this->get_random_bytes(3); $hash = crypt($password, $this->gensalt_extended($random)); if (strlen($hash) == 20) return $hash; } if (strlen($random) < 6) $random = $this->get_random_bytes(6); $hash = $this->crypt_private($password, $this->gensalt_private($random)); if (strlen($hash) == 34) return $hash; # Returning '*' on error is safe here, but would _not_ be safe # in a crypt(3)-like function used _both_ for generating new # hashes and for validating passwords against existing hashes. return '*'; } function CheckPassword($password, $stored_hash) { $hash = $this->crypt_private($password, $stored_hash); if ($hash[0] == '*') $hash = crypt($password, $stored_hash); return $hash == $stored_hash; } } ?> wp/dev/wp-includes/user.php0000644000106600010660000002360111024005243013114 0ustar add('empty_username', __('ERROR: The username field is empty.')); if ( empty($credentials['user_password']) ) $error->add('empty_password', __('ERROR: The password field is empty.')); return $error; } $user = wp_authenticate($credentials['user_login'], $credentials['user_password']); if ( is_wp_error($user) ) return $user; wp_set_auth_cookie($user->ID, $credentials['remember'], $secure_cookie); do_action('wp_login', $credentials['user_login']); return $user; } function get_profile($field, $user = false) { global $wpdb; if ( !$user ) $user = $wpdb->escape($_COOKIE[USER_COOKIE]); return $wpdb->get_var( $wpdb->prepare("SELECT $field FROM $wpdb->users WHERE user_login = %s", $user) ); } function get_usernumposts($userid) { global $wpdb; $userid = (int) $userid; return $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = %d AND post_type = 'post' AND ", $userid) . get_private_posts_cap_sql('post')); } // TODO: xmlrpc only. Maybe move to xmlrpc.php. function user_pass_ok($user_login,$user_pass) { $user = wp_authenticate($user_login, $user_pass); if ( is_wp_error($user) ) return false; return true; } // // User option functions // function get_user_option( $option, $user = 0 ) { global $wpdb; $option = preg_replace('|[^a-z0-9_]|i', '', $option); if ( empty($user) ) $user = wp_get_current_user(); else $user = get_userdata($user); if ( isset( $user->{$wpdb->prefix . $option} ) ) // Blog specific $result = $user->{$wpdb->prefix . $option}; elseif ( isset( $user->{$option} ) ) // User specific and cross-blog $result = $user->{$option}; else // Blog global $result = get_option( $option ); return apply_filters("get_user_option_{$option}", $result, $option, $user); } function update_user_option( $user_id, $option_name, $newvalue, $global = false ) { global $wpdb; if ( !$global ) $option_name = $wpdb->prefix . $option_name; return update_usermeta( $user_id, $option_name, $newvalue ); } // Get users with capabilities for the current blog. // For setups that use the multi-blog feature. function get_users_of_blog( $id = '' ) { global $wpdb, $blog_id; if ( empty($id) ) $id = (int) $blog_id; $users = $wpdb->get_results( "SELECT user_id, user_login, display_name, user_email, meta_value FROM $wpdb->users, $wpdb->usermeta WHERE " . $wpdb->users . ".ID = " . $wpdb->usermeta . ".user_id AND meta_key = '" . $wpdb->prefix . "capabilities' ORDER BY {$wpdb->usermeta}.user_id" ); return $users; } // // User meta functions // function delete_usermeta( $user_id, $meta_key, $meta_value = '' ) { global $wpdb; if ( !is_numeric( $user_id ) ) return false; $meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key); if ( is_array($meta_value) || is_object($meta_value) ) $meta_value = serialize($meta_value); $meta_value = trim( $meta_value ); if ( ! empty($meta_value) ) $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s AND meta_value = %s", $userid, $meta_key, $meta_value) ); else $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) ); wp_cache_delete($user_id, 'users'); return true; } function get_usermeta( $user_id, $meta_key = '') { global $wpdb; $user_id = (int) $user_id; if ( !$user_id ) return false; if ( !empty($meta_key) ) { $meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key); $user = wp_cache_get($user_id, 'users'); // Check the cached user object if ( false !== $user && isset($user->$meta_key) ) $metas = array($user->$meta_key); else $metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) ); } else { $metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM $wpdb->usermeta WHERE user_id = %d", $user_id) ); } if ( empty($metas) ) { if ( empty($meta_key) ) return array(); else return ''; } $metas = array_map('maybe_unserialize', $metas); if ( count($metas) == 1 ) return $metas[0]; else return $metas; } function update_usermeta( $user_id, $meta_key, $meta_value ) { global $wpdb; if ( !is_numeric( $user_id ) ) return false; $meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key); // FIXME: usermeta data is assumed to be already escaped if ( is_string($meta_value) ) $meta_value = stripslashes($meta_value); $meta_value = maybe_serialize($meta_value); if (empty($meta_value)) { return delete_usermeta($user_id, $meta_key); } $cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) ); if ( !$cur ) { $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->usermeta ( user_id, meta_key, meta_value ) VALUES ( %d, %s, %s )", $user_id, $meta_key, $meta_value) ); } else if ( $cur->meta_value != $meta_value ) { $wpdb->query( $wpdb->prepare("UPDATE $wpdb->usermeta SET meta_value = %s WHERE user_id = %d AND meta_key = %s", $meta_value, $user_id, $meta_key) ); } else { return false; } wp_cache_delete($user_id, 'users'); return true; } // // Private helper functions // // Setup global user vars. Used by set_current_user() for back compat. function setup_userdata($user_id = '') { global $user_login, $userdata, $user_level, $user_ID, $user_email, $user_url, $user_pass_md5, $user_identity; if ( '' == $user_id ) $user = wp_get_current_user(); else $user = new WP_User($user_id); if ( 0 == $user->ID ) return; $userdata = $user->data; $user_login = $user->user_login; $user_level = (int) isset($user->user_level) ? $user->user_level : 0; $user_ID = (int) $user->ID; $user_email = $user->user_email; $user_url = $user->user_url; $user_pass_md5 = md5($user->user_pass); $user_identity = $user->display_name; } function wp_dropdown_users( $args = '' ) { global $wpdb; $defaults = array( 'show_option_all' => '', 'show_option_none' => '', 'orderby' => 'display_name', 'order' => 'ASC', 'include' => '', 'exclude' => '', 'show' => 'display_name', 'echo' => 1, 'selected' => 0, 'name' => 'user', 'class' => '' ); $defaults['selected'] = is_author() ? get_query_var( 'author' ) : 0; $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); $query = "SELECT * FROM $wpdb->users"; $query_where = array(); if ( is_array($include) ) $include = join(',', $include); $include = preg_replace('/[^0-9,]/', '', $include); // (int) if ( $include ) $query_where[] = "ID IN ($include)"; if ( is_array($exclude) ) $exclude = join(',', $exclude); $exclude = preg_replace('/[^0-9,]/', '', $exclude); // (int) if ( $exclude ) $query_where[] = "ID NOT IN ($exclude)"; if ( $query_where ) $query .= " WHERE " . join(' AND', $query_where); $query .= " ORDER BY $orderby $order"; $users = $wpdb->get_results( $query ); $output = ''; if ( !empty($users) ) { $output = ""; } $output = apply_filters('wp_dropdown_users', $output); if ( $echo ) echo $output; return $output; } function _fill_user( &$user ) { global $wpdb; $show = $wpdb->hide_errors(); $metavalues = $wpdb->get_results($wpdb->prepare("SELECT meta_key, meta_value FROM $wpdb->usermeta WHERE user_id = %d", $user->ID)); $wpdb->show_errors($show); if ( $metavalues ) { foreach ( $metavalues as $meta ) { $value = maybe_unserialize($meta->meta_value); $user->{$meta->meta_key} = $value; } } $level = $wpdb->prefix . 'user_level'; if ( isset( $user->{$level} ) ) $user->user_level = $user->{$level}; // For backwards compat. if ( isset($user->first_name) ) $user->user_firstname = $user->first_name; if ( isset($user->last_name) ) $user->user_lastname = $user->last_name; if ( isset($user->description) ) $user->user_description = $user->description; wp_cache_add($user->ID, $user, 'users'); wp_cache_add($user->user_login, $user->ID, 'userlogins'); wp_cache_add($user->user_email, $user->ID, 'useremail'); } ?> wp/dev/wp-includes/wp-diff.php0000644000106600010660000002367011046661417013517 0ustar $parent( $params ); } function _startBlock( $header ) { return ''; } function _lines( $lines, $prefix=' ' ) { } // HTML-escape parameter before calling this function addedLine( $line ) { return "+{$line}"; } // HTML-escape parameter before calling this function deletedLine( $line ) { return "-{$line}"; } // HTML-escape parameter before calling this function contextLine( $line ) { return " {$line}"; } function emptyLine() { return ' '; } function _added( $lines, $encode = true ) { $r = ''; foreach ($lines as $line) { if ( $encode ) $line = htmlspecialchars( $line ); $r .= '' . $this->emptyLine() . $this->addedLine( $line ) . "\n"; } return $r; } function _deleted( $lines, $encode = true ) { $r = ''; foreach ($lines as $line) { if ( $encode ) $line = htmlspecialchars( $line ); $r .= '' . $this->deletedLine( $line ) . $this->emptyLine() . "\n"; } return $r; } function _context( $lines, $encode = true ) { $r = ''; foreach ($lines as $line) { if ( $encode ) $line = htmlspecialchars( $line ); $r .= '' . $this->contextLine( $line ) . $this->contextLine( $line ) . "\n"; } return $r; } // Process changed lines to do word-by-word diffs for extra highlighting (TRAC style) // sometimes these lines can actually be deleted or added rows - we do additional processing // to figure that out function _changed( $orig, $final ) { $r = ''; // Does the aforementioned additional processing // *_matches tell what rows are "the same" in orig and final. Those pairs will be diffed to get word changes // match is numeric: an index in other column // match is 'X': no match. It is a new row // *_rows are column vectors for the orig column and the final column. // row >= 0: an indix of the $orig or $final array // row < 0: a blank row for that column list($orig_matches, $final_matches, $orig_rows, $final_rows) = $this->interleave_changed_lines( $orig, $final ); // These will hold the word changes as determined by an inline diff $orig_diffs = array(); $final_diffs = array(); // Compute word diffs for each matched pair using the inline diff foreach ( $orig_matches as $o => $f ) { if ( is_numeric($o) && is_numeric($f) ) { $text_diff = new Text_Diff( 'auto', array( array($orig[$o]), array($final[$f]) ) ); $renderer = new $this->inline_diff_renderer; $diff = $renderer->render( $text_diff ); // If they're too different, don't include any or if ( $diff_count = preg_match_all( '!(.*?|.*?)!', $diff, $diff_matches ) ) { // length of all text between or $stripped_matches = strlen(strip_tags( join(' ', $diff_matches[0]) )); // since we count lengith of text between or (instead of picking just one), // we double the length of chars not in those tags. $stripped_diff = strlen(strip_tags( $diff )) * 2 - $stripped_matches; $diff_ratio = $stripped_matches / $stripped_diff; if ( $diff_ratio > $this->_diff_threshold ) continue; // Too different. Don't save diffs. } // Un-inline the diffs by removing del or ins $orig_diffs[$o] = preg_replace( '|.*?|', '', $diff ); $final_diffs[$f] = preg_replace( '|.*?|', '', $diff ); } } foreach ( array_keys($orig_rows) as $row ) { // Both columns have blanks. Ignore them. if ( $orig_rows[$row] < 0 && $final_rows[$row] < 0 ) continue; // If we have a word based diff, use it. Otherwise, use the normal line. $orig_line = isset($orig_diffs[$orig_rows[$row]]) ? $orig_diffs[$orig_rows[$row]] : htmlspecialchars($orig[$orig_rows[$row]]); $final_line = isset($final_diffs[$final_rows[$row]]) ? $final_diffs[$final_rows[$row]] : htmlspecialchars($final[$final_rows[$row]]); if ( $orig_rows[$row] < 0 ) { // Orig is blank. This is really an added row. $r .= $this->_added( array($final_line), false ); } elseif ( $final_rows[$row] < 0 ) { // Final is blank. This is really a deleted row. $r .= $this->_deleted( array($orig_line), false ); } else { // A true changed row. $r .= '' . $this->deletedLine( $orig_line ) . $this->addedLine( $final_line ) . "\n"; } } return $r; } // Takes changed blocks and matches which rows in orig turned into which rows in final. // Returns // *_matches ( which rows match with which ) // *_rows ( order of rows in each column interleaved with blank rows as necessary ) function interleave_changed_lines( $orig, $final ) { // Contains all pairwise string comparisons. Keys are such that this need only be a one dimensional array. $matches = array(); foreach ( array_keys($orig) as $o ) { foreach ( array_keys($final) as $f ) { $matches["$o,$f"] = $this->compute_string_distance( $orig[$o], $final[$f] ); } } asort($matches); // Order by string distance. $orig_matches = array(); $final_matches = array(); foreach ( $matches as $keys => $difference ) { list($o, $f) = explode(',', $keys); $o = (int) $o; $f = (int) $f; // Already have better matches for these guys if ( isset($orig_matches[$o]) && isset($final_matches[$f]) ) continue; // First match for these guys. Must be best match if ( !isset($orig_matches[$o]) && !isset($final_matches[$f]) ) { $orig_matches[$o] = $f; $final_matches[$f] = $o; continue; } // Best match of this final is already taken? Must mean this final is a new row. if ( isset($orig_matches[$o]) ) $final_matches[$f] = 'x'; // Best match of this orig is already taken? Must mean this orig is a deleted row. elseif ( isset($final_matches[$f]) ) $orig_matches[$o] = 'x'; } // We read the text in this order ksort($orig_matches); ksort($final_matches); // Stores rows and blanks for each column. $orig_rows = $orig_rows_copy = array_keys($orig_matches); $final_rows = array_keys($final_matches); // Interleaves rows with blanks to keep matches aligned. // We may end up with some extraneous blank rows, but we'll just ignore them later. foreach ( $orig_rows_copy as $orig_row ) { $final_pos = array_search($orig_matches[$orig_row], $final_rows, true); $orig_pos = (int) array_search($orig_row, $orig_rows, true); if ( false === $final_pos ) { // This orig is paired with a blank final. array_splice( $final_rows, $orig_pos, 0, -1 ); } elseif ( $final_pos < $orig_pos ) { // This orig's match is up a ways. Pad final with blank rows. $diff_pos = $final_pos - $orig_pos; while ( $diff_pos < 0 ) array_splice( $final_rows, $orig_pos, 0, $diff_pos++ ); } elseif ( $final_pos > $orig_pos ) { // This orig's match is down a ways. Pad orig with blank rows. $diff_pos = $orig_pos - $final_pos; while ( $diff_pos < 0 ) array_splice( $orig_rows, $orig_pos, 0, $diff_pos++ ); } } // Pad the ends with blank rows if the columns aren't the same length $diff_count = count($orig_rows) - count($final_rows); if ( $diff_count < 0 ) { while ( $diff_count < 0 ) array_push($orig_rows, $diff_count++); } elseif ( $diff_count > 0 ) { $diff_count = -1 * $diff_count; while ( $diff_count < 0 ) array_push($final_rows, $diff_count++); } return array($orig_matches, $final_matches, $orig_rows, $final_rows); /* // Debug echo "\n\n\n\n\n"; echo "-- DEBUG Matches: Orig -> Final --"; foreach ( $orig_matches as $o => $f ) { echo "\n\n\n\n\n"; echo "ORIG: $o, FINAL: $f\n"; var_dump($orig[$o],$final[$f]); } echo "\n\n\n\n\n"; echo "-- DEBUG Matches: Final -> Orig --"; foreach ( $final_matches as $f => $o ) { echo "\n\n\n\n\n"; echo "FINAL: $f, ORIG: $o\n"; var_dump($final[$f],$orig[$o]); } echo "\n\n\n\n\n"; echo "-- DEBUG Rows: Orig -- Final --"; echo "\n\n\n\n\n"; foreach ( $orig_rows as $row => $o ) { if ( $o < 0 ) $o = 'X'; $f = $final_rows[$row]; if ( $f < 0 ) $f = 'X'; echo "$o -- $f\n"; } echo "\n\n\n\n\n"; echo "-- END DEBUG --"; echo "\n\n\n\n\n"; return array($orig_matches, $final_matches, $orig_rows, $final_rows); */ } // Computes a number that is intended to reflect the "distance" between two strings. function compute_string_distance( $string1, $string2 ) { // Vectors containing character frequency for all chars in each string $chars1 = count_chars($string1); $chars2 = count_chars($string2); // L1-norm of difference vector. $difference = array_sum( array_map( array(&$this, 'difference'), $chars1, $chars2 ) ); // $string1 has zero length? Odd. Give huge penalty by not dividing. if ( !$string1 ) return $difference; // Return distance per charcter (of string1) return $difference / strlen($string1); } function difference( $a, $b ) { return abs( $a - $b ); } } // Better word splitting than the PEAR package provides class WP_Text_Diff_Renderer_inline extends Text_Diff_Renderer_inline { function _splitOnWords($string, $newlineEscape = "\n") { $string = str_replace("\0", '', $string); $words = preg_split( '/([^\w])/u', $string, -1, PREG_SPLIT_DELIM_CAPTURE ); $words = str_replace( "\n", $newlineEscape, $words ); return $words; } } ?> wp/dev/wp-includes/class-phpmailer.php0000644000106600010660000012770611024771575015257 0ustar ContentType = "text/html"; else $this->ContentType = "text/plain"; } /** * Sets Mailer to send message using SMTP. * @return void */ function IsSMTP() { $this->Mailer = "smtp"; } /** * Sets Mailer to send message using PHP mail() function. * @return void */ function IsMail() { $this->Mailer = "mail"; } /** * Sets Mailer to send message using the $Sendmail program. * @return void */ function IsSendmail() { $this->Mailer = "sendmail"; } /** * Sets Mailer to send message using the qmail MTA. * @return void */ function IsQmail() { $this->Sendmail = "/var/qmail/bin/sendmail"; $this->Mailer = "sendmail"; } ///////////////////////////////////////////////// // RECIPIENT METHODS ///////////////////////////////////////////////// /** * Adds a "To" address. * @param string $address * @param string $name * @return void */ function AddAddress($address, $name = "") { $cur = count($this->to); $this->to[$cur][0] = trim($address); $this->to[$cur][1] = $name; } /** * Adds a "Cc" address. Note: this function works * with the SMTP mailer on win32, not with the "mail" * mailer. * @param string $address * @param string $name * @return void */ function AddCC($address, $name = "") { $cur = count($this->cc); $this->cc[$cur][0] = trim($address); $this->cc[$cur][1] = $name; } /** * Adds a "Bcc" address. Note: this function works * with the SMTP mailer on win32, not with the "mail" * mailer. * @param string $address * @param string $name * @return void */ function AddBCC($address, $name = "") { $cur = count($this->bcc); $this->bcc[$cur][0] = trim($address); $this->bcc[$cur][1] = $name; } /** * Adds a "Reply-to" address. * @param string $address * @param string $name * @return void */ function AddReplyTo($address, $name = "") { $cur = count($this->ReplyTo); $this->ReplyTo[$cur][0] = trim($address); $this->ReplyTo[$cur][1] = $name; } ///////////////////////////////////////////////// // MAIL SENDING METHODS ///////////////////////////////////////////////// /** * Creates message and assigns Mailer. If the message is * not sent successfully then it returns false. Use the ErrorInfo * variable to view description of the error. * @return bool */ function Send() { $header = ""; $body = ""; $result = true; if((count($this->to) + count($this->cc) + count($this->bcc)) < 1) { $this->SetError($this->Lang("provide_address")); return false; } // Set whether the message is multipart/alternative if(!empty($this->AltBody)) $this->ContentType = "multipart/alternative"; $this->error_count = 0; // reset errors $this->SetMessageType(); $header .= $this->CreateHeader(); $body = $this->CreateBody(); if($body == "") { return false; } // Choose the mailer switch($this->Mailer) { case "sendmail": $result = $this->SendmailSend($header, $body); break; case "mail": $result = $this->MailSend($header, $body); break; case "smtp": $result = $this->SmtpSend($header, $body); break; default: $this->SetError($this->Mailer . $this->Lang("mailer_not_supported")); $result = false; break; } return $result; } /** * Sends mail using the $Sendmail program. * @access private * @return bool */ function SendmailSend($header, $body) { if ($this->Sender != "") $sendmail = sprintf("%s -oi -f %s -t", $this->Sendmail, escapeshellarg($this->Sender)); else $sendmail = sprintf("%s -oi -t", $this->Sendmail); if(!@$mail = popen($sendmail, "w")) { $this->SetError($this->Lang("execute") . $this->Sendmail); return false; } fputs($mail, $header); fputs($mail, $body); $result = pclose($mail) >> 8 & 0xFF; if($result != 0) { $this->SetError($this->Lang("execute") . $this->Sendmail); return false; } return true; } /** * Sends mail using the PHP mail() function. * @access private * @return bool */ function MailSend($header, $body) { $to = ""; for($i = 0; $i < count($this->to); $i++) { if($i != 0) { $to .= ", "; } $to .= $this->to[$i][0]; } if ($this->Sender != "" && strlen(ini_get("safe_mode"))< 1) { $old_from = ini_get("sendmail_from"); ini_set("sendmail_from", $this->Sender); $params = sprintf("-oi -f %s", $this->Sender); $rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $header, $params); } else $rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $header); if (isset($old_from)) ini_set("sendmail_from", $old_from); if(!$rt) { $this->SetError($this->Lang("instantiate")); return false; } return true; } /** * Sends mail via SMTP using PhpSMTP (Author: * Chris Ryan). Returns bool. Returns false if there is a * bad MAIL FROM, RCPT, or DATA input. * @access private * @return bool */ function SmtpSend($header, $body) { include_once($this->PluginDir . "class-smtp.php"); $error = ""; $bad_rcpt = array(); if(!$this->SmtpConnect()) return false; $smtp_from = ($this->Sender == "") ? $this->From : $this->Sender; if(!$this->smtp->Mail($smtp_from)) { $error = $this->Lang("from_failed") . $smtp_from; $this->SetError($error); $this->smtp->Reset(); return false; } // Attempt to send attach all recipients for($i = 0; $i < count($this->to); $i++) { if(!$this->smtp->Recipient($this->to[$i][0])) $bad_rcpt[] = $this->to[$i][0]; } for($i = 0; $i < count($this->cc); $i++) { if(!$this->smtp->Recipient($this->cc[$i][0])) $bad_rcpt[] = $this->cc[$i][0]; } for($i = 0; $i < count($this->bcc); $i++) { if(!$this->smtp->Recipient($this->bcc[$i][0])) $bad_rcpt[] = $this->bcc[$i][0]; } if(count($bad_rcpt) > 0) // Create error message { for($i = 0; $i < count($bad_rcpt); $i++) { if($i != 0) { $error .= ", "; } $error .= $bad_rcpt[$i]; } $error = $this->Lang("recipients_failed") . $error; $this->SetError($error); $this->smtp->Reset(); return false; } if(!$this->smtp->Data($header . $body)) { $this->SetError($this->Lang("data_not_accepted")); $this->smtp->Reset(); return false; } if($this->SMTPKeepAlive == true) $this->smtp->Reset(); else $this->SmtpClose(); return true; } /** * Initiates a connection to an SMTP server. Returns false if the * operation failed. * @access private * @return bool */ function SmtpConnect() { if($this->smtp == NULL) { $this->smtp = new SMTP(); } $this->smtp->do_debug = $this->SMTPDebug; $hosts = explode(";", $this->Host); $index = 0; $connection = ($this->smtp->Connected()); // Retry while there is no connection while($index < count($hosts) && $connection == false) { if(strstr($hosts[$index], ":")) list($host, $port) = explode(":", $hosts[$index]); else { $host = $hosts[$index]; $port = $this->Port; } if($this->smtp->Connect($host, $port, $this->Timeout)) { if ($this->Helo != '') $this->smtp->Hello($this->Helo); else $this->smtp->Hello($this->ServerHostname()); if($this->SMTPAuth) { if(!$this->smtp->Authenticate($this->Username, $this->Password)) { $this->SetError($this->Lang("authenticate")); $this->smtp->Reset(); $connection = false; } } $connection = true; } $index++; } if(!$connection) $this->SetError($this->Lang("connect_host")); return $connection; } /** * Closes the active SMTP session if one exists. * @return void */ function SmtpClose() { if($this->smtp != NULL) { if($this->smtp->Connected()) { $this->smtp->Quit(); $this->smtp->Close(); } } } /** * Sets the language for all class error messages. Returns false * if it cannot load the language file. The default language type * is English. * @param string $lang_type Type of language (e.g. Portuguese: "br") * @param string $lang_path Path to the language file directory * @access public * @return bool */ function SetLanguage($lang_type, $lang_path = "language/") { if(file_exists($lang_path.'phpmailer.lang-'.$lang_type.'.php')) include($lang_path.'phpmailer.lang-'.$lang_type.'.php'); else if(file_exists($lang_path.'phpmailer.lang-en.php')) include($lang_path.'phpmailer.lang-en.php'); else { $this->SetError("Could not load language file"); return false; } $this->language = $PHPMAILER_LANG; return true; } ///////////////////////////////////////////////// // MESSAGE CREATION METHODS ///////////////////////////////////////////////// /** * Creates recipient headers. * @access private * @return string */ function AddrAppend($type, $addr) { $addr_str = $type . ": "; $addr_str .= $this->AddrFormat($addr[0]); if(count($addr) > 1) { for($i = 1; $i < count($addr); $i++) $addr_str .= ", " . $this->AddrFormat($addr[$i]); } $addr_str .= $this->LE; return $addr_str; } /** * Formats an address correctly. * @access private * @return string */ function AddrFormat($addr) { if(empty($addr[1])) $formatted = $addr[0]; else { $formatted = $this->EncodeHeader($addr[1], 'phrase') . " <" . $addr[0] . ">"; } return $formatted; } /** * Wraps message for use with mailers that do not * automatically perform wrapping and for quoted-printable. * Original written by philippe. * @access private * @return string */ function WrapText($message, $length, $qp_mode = false) { $soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE; $message = $this->FixEOL($message); if (substr($message, -1) == $this->LE) $message = substr($message, 0, -1); $line = explode($this->LE, $message); $message = ""; for ($i=0 ;$i < count($line); $i++) { $line_part = explode(" ", $line[$i]); $buf = ""; for ($e = 0; $e $length)) { $space_left = $length - strlen($buf) - 1; if ($e != 0) { if ($space_left > 20) { $len = $space_left; if (substr($word, $len - 1, 1) == "=") $len--; elseif (substr($word, $len - 2, 1) == "=") $len -= 2; $part = substr($word, 0, $len); $word = substr($word, $len); $buf .= " " . $part; $message .= $buf . sprintf("=%s", $this->LE); } else { $message .= $buf . $soft_break; } $buf = ""; } while (strlen($word) > 0) { $len = $length; if (substr($word, $len - 1, 1) == "=") $len--; elseif (substr($word, $len - 2, 1) == "=") $len -= 2; $part = substr($word, 0, $len); $word = substr($word, $len); if (strlen($word) > 0) $message .= $part . sprintf("=%s", $this->LE); else $buf = $part; } } else { $buf_o = $buf; $buf .= ($e == 0) ? $word : (" " . $word); if (strlen($buf) > $length and $buf_o != "") { $message .= $buf_o . $soft_break; $buf = $word; } } } $message .= $buf . $this->LE; } return $message; } /** * Set the body wrapping. * @access private * @return void */ function SetWordWrap() { if($this->WordWrap < 1) return; switch($this->message_type) { case "alt": // fall through case "alt_attachments": $this->AltBody = $this->WrapText($this->AltBody, $this->WordWrap); break; default: $this->Body = $this->WrapText($this->Body, $this->WordWrap); break; } } /** * Assembles message header. * @access private * @return string */ function CreateHeader() { $result = ""; // Set the boundaries $uniq_id = md5(uniqid(time())); $this->boundary[1] = "b1_" . $uniq_id; $this->boundary[2] = "b2_" . $uniq_id; $result .= $this->HeaderLine("Date", $this->RFCDate()); if($this->Sender == "") $result .= $this->HeaderLine("Return-Path", trim($this->From)); else $result .= $this->HeaderLine("Return-Path", trim($this->Sender)); // To be created automatically by mail() if($this->Mailer != "mail") { if(count($this->to) > 0) $result .= $this->AddrAppend("To", $this->to); else if (count($this->cc) == 0) $result .= $this->HeaderLine("To", "undisclosed-recipients:;"); if(count($this->cc) > 0) $result .= $this->AddrAppend("Cc", $this->cc); } $from = array(); $from[0][0] = trim($this->From); $from[0][1] = $this->FromName; $result .= $this->AddrAppend("From", $from); // sendmail and mail() extract Bcc from the header before sending if((($this->Mailer == "sendmail") || ($this->Mailer == "mail")) && (count($this->bcc) > 0)) $result .= $this->AddrAppend("Bcc", $this->bcc); if(count($this->ReplyTo) > 0) $result .= $this->AddrAppend("Reply-to", $this->ReplyTo); // mail() sets the subject itself if($this->Mailer != "mail") $result .= $this->HeaderLine("Subject", $this->EncodeHeader(trim($this->Subject))); $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE); $result .= $this->HeaderLine("X-Priority", $this->Priority); if($this->ConfirmReadingTo != "") { $result .= $this->HeaderLine("Disposition-Notification-To", "<" . trim($this->ConfirmReadingTo) . ">"); } // Add custom headers for($index = 0; $index < count($this->CustomHeader); $index++) { $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), $this->EncodeHeader(trim($this->CustomHeader[$index][1]))); } $result .= $this->HeaderLine("MIME-Version", "1.0"); switch($this->message_type) { case "plain": $result .= $this->HeaderLine("Content-Transfer-Encoding", $this->Encoding); $result .= sprintf("Content-Type: %s; charset=\"%s\"", $this->ContentType, $this->CharSet); break; case "attachments": // fall through case "alt_attachments": if($this->InlineImageExists()) { $result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", "multipart/related", $this->LE, $this->LE, $this->boundary[1], $this->LE); } else { $result .= $this->HeaderLine("Content-Type", "multipart/mixed;"); $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"'); } break; case "alt": $result .= $this->HeaderLine("Content-Type", "multipart/alternative;"); $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"'); break; } if($this->Mailer != "mail") $result .= $this->LE.$this->LE; return $result; } /** * Assembles the message body. Returns an empty string on failure. * @access private * @return string */ function CreateBody() { $result = ""; $this->SetWordWrap(); switch($this->message_type) { case "alt": $result .= $this->GetBoundary($this->boundary[1], "", "text/plain", ""); $result .= $this->EncodeString($this->AltBody, $this->Encoding); $result .= $this->LE.$this->LE; $result .= $this->GetBoundary($this->boundary[1], "", "text/html", ""); $result .= $this->EncodeString($this->Body, $this->Encoding); $result .= $this->LE.$this->LE; $result .= $this->EndBoundary($this->boundary[1]); break; case "plain": $result .= $this->EncodeString($this->Body, $this->Encoding); break; case "attachments": $result .= $this->GetBoundary($this->boundary[1], "", "", ""); $result .= $this->EncodeString($this->Body, $this->Encoding); $result .= $this->LE; $result .= $this->AttachAll(); break; case "alt_attachments": $result .= sprintf("--%s%s", $this->boundary[1], $this->LE); $result .= sprintf("Content-Type: %s;%s" . "\tboundary=\"%s\"%s", "multipart/alternative", $this->LE, $this->boundary[2], $this->LE.$this->LE); // Create text body $result .= $this->GetBoundary($this->boundary[2], "", "text/plain", "") . $this->LE; $result .= $this->EncodeString($this->AltBody, $this->Encoding); $result .= $this->LE.$this->LE; // Create the HTML body $result .= $this->GetBoundary($this->boundary[2], "", "text/html", "") . $this->LE; $result .= $this->EncodeString($this->Body, $this->Encoding); $result .= $this->LE.$this->LE; $result .= $this->EndBoundary($this->boundary[2]); $result .= $this->AttachAll(); break; } if($this->IsError()) $result = ""; return $result; } /** * Returns the start of a message boundary. * @access private */ function GetBoundary($boundary, $charSet, $contentType, $encoding) { $result = ""; if($charSet == "") { $charSet = $this->CharSet; } if($contentType == "") { $contentType = $this->ContentType; } if($encoding == "") { $encoding = $this->Encoding; } $result .= $this->TextLine("--" . $boundary); $result .= sprintf("Content-Type: %s; charset = \"%s\"", $contentType, $charSet); $result .= $this->LE; $result .= $this->HeaderLine("Content-Transfer-Encoding", $encoding); $result .= $this->LE; return $result; } /** * Returns the end of a message boundary. * @access private */ function EndBoundary($boundary) { return $this->LE . "--" . $boundary . "--" . $this->LE; } /** * Sets the message type. * @access private * @return void */ function SetMessageType() { if(count($this->attachment) < 1 && strlen($this->AltBody) < 1) $this->message_type = "plain"; else { if(count($this->attachment) > 0) $this->message_type = "attachments"; if(strlen($this->AltBody) > 0 && count($this->attachment) < 1) $this->message_type = "alt"; if(strlen($this->AltBody) > 0 && count($this->attachment) > 0) $this->message_type = "alt_attachments"; } } /** * Returns a formatted header line. * @access private * @return string */ function HeaderLine($name, $value) { return $name . ": " . $value . $this->LE; } /** * Returns a formatted mail line. * @access private * @return string */ function TextLine($value) { return $value . $this->LE; } ///////////////////////////////////////////////// // ATTACHMENT METHODS ///////////////////////////////////////////////// /** * Adds an attachment from a path on the filesystem. * Returns false if the file could not be found * or accessed. * @param string $path Path to the attachment. * @param string $name Overrides the attachment name. * @param string $encoding File encoding (see $Encoding). * @param string $type File extension (MIME) type. * @return bool */ function AddAttachment($path, $name = "", $encoding = "base64", $type = "application/octet-stream") { if(!@is_file($path)) { $this->SetError($this->Lang("file_access") . $path); return false; } $filename = basename($path); if($name == "") $name = $filename; $cur = count($this->attachment); $this->attachment[$cur][0] = $path; $this->attachment[$cur][1] = $filename; $this->attachment[$cur][2] = $name; $this->attachment[$cur][3] = $encoding; $this->attachment[$cur][4] = $type; $this->attachment[$cur][5] = false; // isStringAttachment $this->attachment[$cur][6] = "attachment"; $this->attachment[$cur][7] = 0; return true; } /** * Attaches all fs, string, and binary attachments to the message. * Returns an empty string on failure. * @access private * @return string */ function AttachAll() { // Return text of body $mime = array(); // Add all attachments for($i = 0; $i < count($this->attachment); $i++) { // Check for string attachment $bString = $this->attachment[$i][5]; if ($bString) $string = $this->attachment[$i][0]; else $path = $this->attachment[$i][0]; $filename = $this->attachment[$i][1]; $name = $this->attachment[$i][2]; $encoding = $this->attachment[$i][3]; $type = $this->attachment[$i][4]; $disposition = $this->attachment[$i][6]; $cid = $this->attachment[$i][7]; $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE); $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $name, $this->LE); $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE); if($disposition == "inline") $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE); $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $name, $this->LE.$this->LE); // Encode as string attachment if($bString) { $mime[] = $this->EncodeString($string, $encoding); if($this->IsError()) { return ""; } $mime[] = $this->LE.$this->LE; } else { $mime[] = $this->EncodeFile($path, $encoding); if($this->IsError()) { return ""; } $mime[] = $this->LE.$this->LE; } } $mime[] = sprintf("--%s--%s", $this->boundary[1], $this->LE); return join("", $mime); } /** * Encodes attachment in requested format. Returns an * empty string on failure. * @access private * @return string */ function EncodeFile ($path, $encoding = "base64") { if(!@$fd = fopen($path, "rb")) { $this->SetError($this->Lang("file_open") . $path); return ""; } $magic_quotes = get_magic_quotes_runtime(); set_magic_quotes_runtime(0); $file_buffer = fread($fd, filesize($path)); $file_buffer = $this->EncodeString($file_buffer, $encoding); fclose($fd); set_magic_quotes_runtime($magic_quotes); return $file_buffer; } /** * Encodes string to requested format. Returns an * empty string on failure. * @access private * @return string */ function EncodeString ($str, $encoding = "base64") { $encoded = ""; switch(strtolower($encoding)) { case "base64": // chunk_split is found in PHP >= 3.0.6 $encoded = chunk_split(base64_encode($str), 76, $this->LE); break; case "7bit": case "8bit": $encoded = $this->FixEOL($str); if (substr($encoded, -(strlen($this->LE))) != $this->LE) $encoded .= $this->LE; break; case "binary": $encoded = $str; break; case "quoted-printable": $encoded = $this->EncodeQP($str); break; default: $this->SetError($this->Lang("encoding") . $encoding); break; } return $encoded; } /** * Encode a header string to best of Q, B, quoted or none. * @access private * @return string */ function EncodeHeader ($str, $position = 'text') { $x = 0; switch (strtolower($position)) { case 'phrase': if (!preg_match('/[\200-\377]/', $str)) { // Can't use addslashes as we don't know what value has magic_quotes_sybase. $encoded = addcslashes($str, "\0..\37\177\\\""); if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) return ($encoded); else return ("\"$encoded\""); } $x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); break; case 'comment': $x = preg_match_all('/[()"]/', $str, $matches); // Fall-through case 'text': default: $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); break; } if ($x == 0) return ($str); $maxlen = 75 - 7 - strlen($this->CharSet); // Try to select the encoding which should produce the shortest output if (strlen($str)/3 < $x) { $encoding = 'B'; $encoded = base64_encode($str); $maxlen -= $maxlen % 4; $encoded = trim(chunk_split($encoded, $maxlen, "\n")); } else { $encoding = 'Q'; $encoded = $this->EncodeQ($str, $position); $encoded = $this->WrapText($encoded, $maxlen, true); $encoded = str_replace("=".$this->LE, "\n", trim($encoded)); } $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded); $encoded = trim(str_replace("\n", $this->LE, $encoded)); return $encoded; } /** * Encode string to quoted-printable. * @access private * @return string */ function EncodeQP ($str) { $encoded = $this->FixEOL($str); if (substr($encoded, -(strlen($this->LE))) != $this->LE) $encoded .= $this->LE; // Replace every high ascii, control and = characters $encoded = preg_replace('/([\000-\010\013\014\016-\037\075\177-\377])/e', "'='.sprintf('%02X', ord('\\1'))", $encoded); // Replace every spaces and tabs when it's the last character on a line $encoded = preg_replace("/([\011\040])".$this->LE."/e", "'='.sprintf('%02X', ord('\\1')).'".$this->LE."'", $encoded); // Maximum line length of 76 characters before CRLF (74 + space + '=') $encoded = $this->WrapText($encoded, 74, true); return $encoded; } /** * Encode string to q encoding. * @access private * @return string */ function EncodeQ ($str, $position = "text") { // There should not be any EOL in the string $encoded = preg_replace("[\r\n]", "", $str); switch (strtolower($position)) { case "phrase": $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); break; case "comment": $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); case "text": default: // Replace every high ascii, control =, ? and _ characters $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e', "'='.sprintf('%02X', ord('\\1'))", $encoded); break; } // Replace every spaces to _ (more readable than =20) $encoded = str_replace(" ", "_", $encoded); return $encoded; } /** * Adds a string or binary attachment (non-filesystem) to the list. * This method can be used to attach ascii or binary data, * such as a BLOB record from a database. * @param string $string String attachment data. * @param string $filename Name of the attachment. * @param string $encoding File encoding (see $Encoding). * @param string $type File extension (MIME) type. * @return void */ function AddStringAttachment($string, $filename, $encoding = "base64", $type = "application/octet-stream") { // Append to $attachment array $cur = count($this->attachment); $this->attachment[$cur][0] = $string; $this->attachment[$cur][1] = $filename; $this->attachment[$cur][2] = $filename; $this->attachment[$cur][3] = $encoding; $this->attachment[$cur][4] = $type; $this->attachment[$cur][5] = true; // isString $this->attachment[$cur][6] = "attachment"; $this->attachment[$cur][7] = 0; } /** * Adds an embedded attachment. This can include images, sounds, and * just about any other document. Make sure to set the $type to an * image type. For JPEG images use "image/jpeg" and for GIF images * use "image/gif". * @param string $path Path to the attachment. * @param string $cid Content ID of the attachment. Use this to identify * the Id for accessing the image in an HTML form. * @param string $name Overrides the attachment name. * @param string $encoding File encoding (see $Encoding). * @param string $type File extension (MIME) type. * @return bool */ function AddEmbeddedImage($path, $cid, $name = "", $encoding = "base64", $type = "application/octet-stream") { if(!@is_file($path)) { $this->SetError($this->Lang("file_access") . $path); return false; } $filename = basename($path); if($name == "") $name = $filename; // Append to $attachment array $cur = count($this->attachment); $this->attachment[$cur][0] = $path; $this->attachment[$cur][1] = $filename; $this->attachment[$cur][2] = $name; $this->attachment[$cur][3] = $encoding; $this->attachment[$cur][4] = $type; $this->attachment[$cur][5] = false; // isStringAttachment $this->attachment[$cur][6] = "inline"; $this->attachment[$cur][7] = $cid; return true; } /** * Returns true if an inline attachment is present. * @access private * @return bool */ function InlineImageExists() { $result = false; for($i = 0; $i < count($this->attachment); $i++) { if($this->attachment[$i][6] == "inline") { $result = true; break; } } return $result; } ///////////////////////////////////////////////// // MESSAGE RESET METHODS ///////////////////////////////////////////////// /** * Clears all recipients assigned in the TO array. Returns void. * @return void */ function ClearAddresses() { $this->to = array(); } /** * Clears all recipients assigned in the CC array. Returns void. * @return void */ function ClearCCs() { $this->cc = array(); } /** * Clears all recipients assigned in the BCC array. Returns void. * @return void */ function ClearBCCs() { $this->bcc = array(); } /** * Clears all recipients assigned in the ReplyTo array. Returns void. * @return void */ function ClearReplyTos() { $this->ReplyTo = array(); } /** * Clears all recipients assigned in the TO, CC and BCC * array. Returns void. * @return void */ function ClearAllRecipients() { $this->to = array(); $this->cc = array(); $this->bcc = array(); } /** * Clears all previously set filesystem, string, and binary * attachments. Returns void. * @return void */ function ClearAttachments() { $this->attachment = array(); } /** * Clears all custom headers. Returns void. * @return void */ function ClearCustomHeaders() { $this->CustomHeader = array(); } ///////////////////////////////////////////////// // MISCELLANEOUS METHODS ///////////////////////////////////////////////// /** * Adds the error message to the error container. * Returns void. * @access private * @return void */ function SetError($msg) { $this->error_count++; $this->ErrorInfo = $msg; } /** * Returns the proper RFC 822 formatted date. * @access private * @return string */ function RFCDate() { $tz = date("Z"); $tzs = ($tz < 0) ? "-" : "+"; $tz = abs($tz); $tz = ($tz/3600)*100 + ($tz%3600)/60; $result = sprintf("%s %s%04d", date("D, j M Y H:i:s"), $tzs, $tz); return $result; } /** * Returns the appropriate server variable. Should work with both * PHP 4.1.0+ as well as older versions. Returns an empty string * if nothing is found. * @access private * @return mixed */ function ServerVar($varName) { global $HTTP_SERVER_VARS; global $HTTP_ENV_VARS; if(!isset($_SERVER)) { $_SERVER = $HTTP_SERVER_VARS; if(!isset($_SERVER["REMOTE_ADDR"])) $_SERVER = $HTTP_ENV_VARS; // must be Apache } if(isset($_SERVER[$varName])) return $_SERVER[$varName]; else return ""; } /** * Returns the server hostname or 'localhost.localdomain' if unknown. * @access private * @return string */ function ServerHostname() { if ($this->Hostname != "") $result = $this->Hostname; elseif ($this->ServerVar('SERVER_NAME') != "") $result = $this->ServerVar('SERVER_NAME'); else $result = "localhost.localdomain"; return $result; } /** * Returns a message in the appropriate language. * @access private * @return string */ function Lang($key) { if(count($this->language) < 1) $this->SetLanguage("en"); // set the default language if(isset($this->language[$key])) return $this->language[$key]; else return "Language string failed to load: " . $key; } /** * Returns true if an error occurred. * @return bool */ function IsError() { return ($this->error_count > 0); } /** * Changes every end of line from CR or LF to CRLF. * @access private * @return string */ function FixEOL($str) { $str = str_replace("\r\n", "\n", $str); $str = str_replace("\r", "\n", $str); $str = str_replace("\n", $this->LE, $str); return $str; } /** * Adds a custom header. * @return void */ function AddCustomHeader($custom_header) { $this->CustomHeader[] = explode(":", $custom_header, 2); } } ?> wp/dev/wp-includes/template-loader.php0000644000106600010660000000421011003032042015202 0ustar wp/dev/wp-includes/feed.php0000644000106600010660000003413111033167352013053 0ustar get_error_message(); $title = apply_filters('get_wp_title_rss', $title); return $title; } /** * Display the blog title for display of the feed title. * * @package WordPress * @subpackage Feed * @since 2.2.0 * @uses apply_filters() Calls 'wp_title_rss' on the blog title. * @see wp_title() $sep parameter usage. * * @param string $sep Optional. */ function wp_title_rss($sep = '»') { echo apply_filters('wp_title_rss', get_wp_title_rss($sep)); } /** * Retrieve the current post title for the feed. * * @package WordPress * @subpackage Feed * @since 2.0.0 * @uses apply_filters() Calls 'the_title_rss' on the post title. * * @return string Current post title. */ function get_the_title_rss() { $title = get_the_title(); $title = apply_filters('the_title_rss', $title); return $title; } /** * Display the post title in the feed. * * @package WordPress * @subpackage Feed * @since 0.71 * @uses get_the_title_rss() Used to retrieve current post title. */ function the_title_rss() { echo get_the_title_rss(); } /** * Display the post content for the feed. * * For encoding the html or the $encode_html parameter, there are three possible * values. '0' will make urls footnotes and use make_url_footnote(). '1' will * encode special characters and automatically display all of the content. The * value of '2' will strip all HTML tags from the content. * * Also note that you cannot set the amount of words and not set the html * encoding. If that is the case, then the html encoding will default to 2, * which will strip all HTML tags. * * To restrict the amount of words of the content, you can use the cut * parameter. If the content is less than the amount, then there won't be any * dots added to the end. If there is content left over, then dots will be added * and the rest of the content will be removed. * * @package WordPress * @subpackage Feed * @since 0.71 * @uses apply_filters() Calls 'the_content_rss' on the content before processing. * @see get_the_content() For the $more_link_text, $stripteaser, and $more_file * parameters. * * @param string $more_link_text Optional. Text to display when more content is available but not displayed. * @param int|bool $stripteaser Optional. Default is 0. * @param string $more_file Optional. * @param int $cut Optional. Amount of words to keep for the content. * @param int $encode_html Optional. How to encode the content. */ function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) { $content = get_the_content($more_link_text, $stripteaser, $more_file); $content = apply_filters('the_content_rss', $content); if ( $cut && !$encode_html ) $encode_html = 2; if ( 1== $encode_html ) { $content = wp_specialchars($content); $cut = 0; } elseif ( 0 == $encode_html ) { $content = make_url_footnote($content); } elseif ( 2 == $encode_html ) { $content = strip_tags($content); } if ( $cut ) { $blah = explode(' ', $content); if ( count($blah) > $cut ) { $k = $cut; $use_dotdotdot = 1; } else { $k = count($blah); $use_dotdotdot = 0; } /** @todo Check performance, might be faster to use array slice instead. */ for ( $i=0; $i<$k; $i++ ) $excerpt .= $blah[$i].' '; $excerpt .= ($use_dotdotdot) ? '...' : ''; $content = $excerpt; } $content = str_replace(']]>', ']]>', $content); echo $content; } /** * Display the post excerpt for the feed. * * @package WordPress * @subpackage Feed * @since 0.71 * @uses apply_filters() Calls 'the_excerpt_rss' hook on the excerpt. */ function the_excerpt_rss() { $output = get_the_excerpt(); echo apply_filters('the_excerpt_rss', $output); } /** * Display the permalink to the post for use in feeds. * * @package WordPress * @subpackage Feed * @since 2.3.0 * @uses apply_filters() Call 'the_permalink_rss' on the post permalink */ function the_permalink_rss() { echo apply_filters('the_permalink_rss', get_permalink()); } /** * Display the feed GUID for the current comment. * * @package WordPress * @subpackage Feed * @since unknown */ function comment_guid() { echo get_comment_guid(); } /** * Retrieve the feed GUID for the current comment. * * @package WordPress * @subpackage Feed * @since unknown * * @return bool|string false on failure or guid for comment on success. */ function get_comment_guid() { global $comment; if ( !is_object($comment) ) return false; return get_the_guid($comment->comment_post_ID) . '#comment-' . $comment->comment_ID; } /** * Display the link to the comments. * * @since 1.5.0 */ function comment_link() { echo get_comment_link(); } /** * Retrieve the current comment author for use in the feeds. * * @package WordPress * @subpackage Feed * @since 2.0.0 * @uses apply_filters() Calls 'comment_author_rss' hook on comment author. * @uses get_comment_author() * * @return string Comment Author */ function get_comment_author_rss() { return apply_filters('comment_author_rss', get_comment_author() ); } /** * Display the current comment author in the feed. * * @package WordPress * @subpackage Feed * @since 1.0.0 */ function comment_author_rss() { echo get_comment_author_rss(); } /** * Display the current comment content for use in the feeds. * * @package WordPress * @subpackage Feed * @since 1.0.0 * @uses apply_filters() Calls 'comment_text_rss' filter on comment content. * @uses get_comment_text() */ function comment_text_rss() { $comment_text = get_comment_text(); $comment_text = apply_filters('comment_text_rss', $comment_text); echo $comment_text; } /** * Retrieve all of the post categories, formatted for use in feeds. * * All of the categories for the current post in the feed loop, will be * retrieved and have feed markup added, so that they can easily be added to the * RSS2, Atom, or RSS1 and RSS0.91 RDF feeds. * * @package WordPress * @subpackage Feed * @since 2.1.0 * @uses apply_filters() * * @param string $type Optional, default is 'rss'. Either 'rss', 'atom', or 'rdf'. * @return string All of the post categories for displaying in the feed. */ function get_the_category_rss($type = 'rss') { $categories = get_the_category(); $tags = get_the_tags(); $the_list = ''; $cat_names = array(); $filter = 'rss'; if ( 'atom' == $type ) $filter = 'raw'; if ( !empty($categories) ) foreach ( (array) $categories as $category ) { $cat_names[] = sanitize_term_field('name', $category->name, $category->term_id, 'category', $filter); } if ( !empty($tags) ) foreach ( (array) $tags as $tag ) { $cat_names[] = sanitize_term_field('name', $tag->name, $tag->term_id, 'post_tag', $filter); } $cat_names = array_unique($cat_names); foreach ( $cat_names as $cat_name ) { if ( 'rdf' == $type ) $the_list .= "\n\t\t\n"; elseif ( 'atom' == $type ) $the_list .= sprintf( '', attribute_escape( apply_filters( 'get_bloginfo_rss', get_bloginfo( 'url' ) ) ), attribute_escape( $cat_name ) ); else $the_list .= "\n\t\t\n"; } return apply_filters('the_category_rss', $the_list, $type); } /** * Display the post categories in the feed. * * @package WordPress * @subpackage Feed * @since 0.71 * @see get_the_category_rss() For better explanation. * * @param string $type Optional, default is 'rss'. Either 'rss', 'atom', or 'rdf'. */ function the_category_rss($type = 'rss') { echo get_the_category_rss($type); } /** * Display the HTML type based on the blog setting. * * The two possible values are either 'xhtml' or 'html'. * * @package WordPress * @subpackage Feed * @since 2.2.0 */ function html_type_rss() { $type = get_bloginfo('html_type'); if (strpos($type, 'xhtml') !== false) $type = 'xhtml'; else $type = 'html'; echo $type; } /** * Display the rss enclosure for the current post. * * Uses the global $post to check whether the post requires a password and if * the user has the password for the post. If not then it will return before * displaying. * * Also uses the function get_post_custom() to get the post's 'enclosure' * metadata field and parses the value to display the enclosure(s). The * enclosure(s) consist of enclosure HTML tag(s) with a URI and other * attributes. * * @package WordPress * @subpackage Template * @since 1.5.0 * @uses apply_filters() Calls 'rss_enclosure' hook on rss enclosure. * @uses get_post_custom() To get the current post enclosure metadata. */ function rss_enclosure() { global $post; if ( !empty($post->post_password) && (!isset($_COOKIE['wp-postpass_'.COOKIEHASH]) || $_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) ) return; foreach (get_post_custom() as $key => $val) { if ($key == 'enclosure') { foreach ((array)$val as $enc) { $enclosure = split("\n", $enc); echo apply_filters('rss_enclosure', '' . "\n"); } } } } /** * Display the atom enclosure for the current post. * * Uses the global $post to check whether the post requires a password and if * the user has the password for the post. If not then it will return before * displaying. * * Also uses the function get_post_custom() to get the post's 'enclosure' * metadata field and parses the value to display the enclosure(s). The * enclosure(s) consist of link HTML tag(s) with a URI and other attributes. * * @package WordPress * @subpackage Template * @since 2.2.0 * @uses apply_filters() Calls 'atom_enclosure' hook on atom enclosure. * @uses get_post_custom() To get the current post enclosure metadata. */ function atom_enclosure() { global $post; if ( !empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) ) return; foreach (get_post_custom() as $key => $val) { if ($key == 'enclosure') { foreach ((array)$val as $enc) { $enclosure = split("\n", $enc); echo apply_filters('atom_enclosure', '' . "\n"); } } } } /** * Determine the type of a string of data with the data formatted. * * Tell whether the type is text, html, or xhtml, per RFC 4287 section 3.1. * * In the case of WordPress, text is defined as containing no markup, * xhtml is defined as "well formed", and html as tag soup (i.e., the rest). * * Container div tags are added to xhtml values, per section 3.1.1.3. * * @link http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.3.1 * * @package WordPress * @subpackage Feed * @since 2.5 * * @param string $data Input string * @return array array(type, value) */ function prep_atom_text_construct($data) { if (strpos($data, '<') === false && strpos($data, '&') === false) { return array('text', $data); } $parser = xml_parser_create(); xml_parse($parser, '
    ' . $data . '
    ', true); $code = xml_get_error_code($parser); xml_parser_free($parser); if (!$code) { if (strpos($data, '<') === false) { return array('text', $data); } else { $data = "
    $data
    "; return array('xhtml', $data); } } if (strpos($data, ']]>') == false) { return array('html', ""); } else { return array('html', htmlspecialchars($data)); } } /** * Display the link for the currently displayed feed in a XSS safe way. * * Generate a correct link for the atom:self element. * * @package WordPress * @subpackage Feed * @since 2.5 */ function self_link() { echo 'http' . ( $_SERVER['https'] == 'on' ? 's' : '' ) . '://' . $_SERVER['HTTP_HOST'] . wp_specialchars(stripslashes($_SERVER['REQUEST_URI']), 1); } ?>wp/dev/wp-includes/feed-rss.php0000644000106600010660000000235310734266201013661 0ustar '; ?> <?php bloginfo_rss('name'); wp_title_rss(); ?> http://backend.userland.com/rss092 <?php the_title_rss() ?> ]]> wp/dev/wp-includes/widgets.php0000644000106600010660000015563311046344117013631 0ustar 1 ) { $_args['name'] = isset($args['name']) ? sprintf($args['name'], $i) : sprintf(__('Sidebar %d'), $i); } else { $_args['name'] = isset($args['name']) ? $args['name'] : __('Sidebar'); } if (isset($args['id'])) { $_args['id'] = $args['id']; } else { $n = count($wp_registered_sidebars); do { $n++; $_args['id'] = "sidebar-$n"; } while (isset($wp_registered_sidebars[$_args['id']])); } register_sidebar($_args); } } function register_sidebar($args = array()) { global $wp_registered_sidebars; if ( is_string($args) ) parse_str($args, $args); $i = count($wp_registered_sidebars) + 1; $defaults = array( 'name' => sprintf(__('Sidebar %d'), $i ), 'id' => "sidebar-$i", 'before_widget' => '
  • ', 'after_widget' => "
  • \n", 'before_title' => '

    ', 'after_title' => "

    \n", ); $sidebar = array_merge($defaults, (array) $args); $wp_registered_sidebars[$sidebar['id']] = $sidebar; return $sidebar['id']; } function unregister_sidebar( $name ) { global $wp_registered_sidebars; if ( isset( $wp_registered_sidebars[$name] ) ) unset( $wp_registered_sidebars[$name] ); } function register_sidebar_widget($name, $output_callback, $classname = '') { // Compat if ( is_array($name) ) { if ( count($name) == 3 ) $name = sprintf($name[0], $name[2]); else $name = $name[0]; } $id = sanitize_title($name); $options = array(); if ( !empty($classname) && is_string($classname) ) $options['classname'] = $classname; $params = array_slice(func_get_args(), 2); $args = array($id, $name, $output_callback, $options); if ( !empty($params) ) $args = array_merge($args, $params); call_user_func_array('wp_register_sidebar_widget', $args); } function wp_register_sidebar_widget($id, $name, $output_callback, $options = array()) { global $wp_registered_widgets; $id = strtolower($id); if ( empty($output_callback) ) { unset($wp_registered_widgets[$id]); return; } $defaults = array('classname' => $output_callback); $options = wp_parse_args($options, $defaults); $widget = array( 'name' => $name, 'id' => $id, 'callback' => $output_callback, 'params' => array_slice(func_get_args(), 4) ); $widget = array_merge($widget, $options); if ( is_callable($output_callback) && ( !isset($wp_registered_widgets[$id]) || did_action( 'widgets_init' ) ) ) $wp_registered_widgets[$id] = $widget; } function wp_widget_description( $id ) { if ( !is_scalar($id) ) return; global $wp_registered_widgets; if ( isset($wp_registered_widgets[$id]['description']) ) return wp_specialchars( $wp_registered_widgets[$id]['description'] ); } function unregister_sidebar_widget($id) { return wp_unregister_sidebar_widget($id); } function wp_unregister_sidebar_widget($id) { wp_register_sidebar_widget($id, '', ''); wp_unregister_widget_control($id); } function register_widget_control($name, $control_callback, $width = '', $height = '') { // Compat if ( is_array($name) ) { if ( count($name) == 3 ) $name = sprintf($name[0], $name[2]); else $name = $name[0]; } $id = sanitize_title($name); $options = array(); if ( !empty($width) ) $options['width'] = $width; if ( !empty($height) ) $options['height'] = $height; $params = array_slice(func_get_args(), 4); $args = array($id, $name, $control_callback, $options); if ( !empty($params) ) $args = array_merge($args, $params); call_user_func_array('wp_register_widget_control', $args); } /* $options: height, width, id_base * height: never used * width: width of fully expanded control form. Try hard to use the default width. * id_base: for multi-widgets (widgets which allow multiple instances such as the text widget), an id_base must be provided. * the widget id will ennd up looking like {$id_base}-{$unique_number} */ function wp_register_widget_control($id, $name, $control_callback, $options = array()) { global $wp_registered_widget_controls; $id = strtolower($id); if ( empty($control_callback) ) { unset($wp_registered_widget_controls[$id]); return; } if ( isset($wp_registered_widget_controls[$id]) && !did_action( 'widgets_init' ) ) return; $defaults = array('width' => 250, 'height' => 200 ); // height is never used $options = wp_parse_args($options, $defaults); $options['width'] = (int) $options['width']; $options['height'] = (int) $options['height']; $widget = array( 'name' => $name, 'id' => $id, 'callback' => $control_callback, 'params' => array_slice(func_get_args(), 4) ); $widget = array_merge($widget, $options); $wp_registered_widget_controls[$id] = $widget; } function unregister_widget_control($id) { return wp_unregister_widget_control($id); } function wp_unregister_widget_control($id) { return wp_register_widget_control($id, '', ''); } function dynamic_sidebar($index = 1) { global $wp_registered_sidebars, $wp_registered_widgets; if ( is_int($index) ) { $index = "sidebar-$index"; } else { $index = sanitize_title($index); foreach ( $wp_registered_sidebars as $key => $value ) { if ( sanitize_title($value['name']) == $index ) { $index = $key; break; } } } $sidebars_widgets = wp_get_sidebars_widgets(); if ( empty($wp_registered_sidebars[$index]) || !array_key_exists($index, $sidebars_widgets) || !is_array($sidebars_widgets[$index]) || empty($sidebars_widgets[$index]) ) return false; $sidebar = $wp_registered_sidebars[$index]; $did_one = false; foreach ( $sidebars_widgets[$index] as $id ) { $params = array_merge( array( array_merge( $sidebar, array('widget_id' => $id, 'widget_name' => $wp_registered_widgets[$id]['name']) ) ), (array) $wp_registered_widgets[$id]['params'] ); // Substitute HTML id and class attributes into before_widget $classname_ = ''; foreach ( (array) $wp_registered_widgets[$id]['classname'] as $cn ) { if ( is_string($cn) ) $classname_ .= '_' . $cn; elseif ( is_object($cn) ) $classname_ .= '_' . get_class($cn); } $classname_ = ltrim($classname_, '_'); $params[0]['before_widget'] = sprintf($params[0]['before_widget'], $id, $classname_); $params = apply_filters( 'dynamic_sidebar_params', $params ); $callback = $wp_registered_widgets[$id]['callback']; if ( is_callable($callback) ) { call_user_func_array($callback, $params); $did_one = true; } } return $did_one; } /* @return mixed false if widget is not active or id of sidebar in which the widget is active */ function is_active_widget($callback, $widget_id = false) { global $wp_registered_widgets; $sidebars_widgets = wp_get_sidebars_widgets(false); if ( is_array($sidebars_widgets) ) foreach ( $sidebars_widgets as $sidebar => $widgets ) if ( is_array($widgets) ) foreach ( $widgets as $widget ) if ( isset($wp_registered_widgets[$widget]['callback']) && $wp_registered_widgets[$widget]['callback'] == $callback ) if ( !$widget_id || $widget_id == $wp_registered_widgets[$widget]['id'] ) return $sidebar; return false; } function is_dynamic_sidebar() { global $wp_registered_widgets, $wp_registered_sidebars; $sidebars_widgets = get_option('sidebars_widgets'); foreach ( $wp_registered_sidebars as $index => $sidebar ) { if ( count($sidebars_widgets[$index]) ) { foreach ( $sidebars_widgets[$index] as $widget ) if ( array_key_exists($widget, $wp_registered_widgets) ) return true; } } return false; } /* Internal Functions */ function wp_get_sidebars_widgets($update = true) { global $wp_registered_widgets, $wp_registered_sidebars; $sidebars_widgets = get_option('sidebars_widgets'); $_sidebars_widgets = array(); if ( !isset($sidebars_widgets['array_version']) ) $sidebars_widgets['array_version'] = 1; switch ( $sidebars_widgets['array_version'] ) { case 1 : foreach ( $sidebars_widgets as $index => $sidebar ) if ( is_array($sidebar) ) foreach ( $sidebar as $i => $name ) { $id = strtolower($name); if ( isset($wp_registered_widgets[$id]) ) { $_sidebars_widgets[$index][$i] = $id; continue; } $id = sanitize_title($name); if ( isset($wp_registered_widgets[$id]) ) { $_sidebars_widgets[$index][$i] = $id; continue; } $found = false; foreach ( $wp_registered_widgets as $widget_id => $widget ) { if ( strtolower($widget['name']) == strtolower($name) ) { $_sidebars_widgets[$index][$i] = $widget['id']; $found = true; break; } elseif ( sanitize_title($widget['name']) == sanitize_title($name) ) { $_sidebars_widgets[$index][$i] = $widget['id']; $found = true; break; } } if ( $found ) continue; unset($_sidebars_widgets[$index][$i]); } $_sidebars_widgets['array_version'] = 2; $sidebars_widgets = $_sidebars_widgets; unset($_sidebars_widgets); case 2 : $sidebars = array_keys( $wp_registered_sidebars ); if ( !empty( $sidebars ) ) { // Move the known-good ones first foreach ( $sidebars as $id ) { if ( array_key_exists( $id, $sidebars_widgets ) ) { $_sidebars_widgets[$id] = $sidebars_widgets[$id]; unset($sidebars_widgets[$id], $sidebars[$id]); } } // Assign to each unmatched registered sidebar the first available orphan unset( $sidebars_widgets[ 'array_version' ] ); while ( ( $sidebar = array_shift( $sidebars ) ) && $widgets = array_shift( $sidebars_widgets ) ) $_sidebars_widgets[ $sidebar ] = $widgets; $_sidebars_widgets['array_version'] = 3; $sidebars_widgets = $_sidebars_widgets; unset($_sidebars_widgets); } if ( $update ) update_option('sidebars_widgets', $sidebars_widgets); } unset($sidebars_widgets['array_version']); return $sidebars_widgets; } function wp_set_sidebars_widgets( $sidebars_widgets ) { update_option( 'sidebars_widgets', $sidebars_widgets ); } function wp_get_widget_defaults() { global $wp_registered_sidebars; $defaults = array(); foreach ( $wp_registered_sidebars as $index => $sidebar ) $defaults[$index] = array(); return $defaults; } /* Default Widgets */ function wp_widget_pages( $args ) { extract( $args ); $options = get_option( 'widget_pages' ); $title = empty( $options['title'] ) ? __( 'Pages' ) : apply_filters('widget_title', $options['title']); $sortby = empty( $options['sortby'] ) ? 'menu_order' : $options['sortby']; $exclude = empty( $options['exclude'] ) ? '' : $options['exclude']; if ( $sortby == 'menu_order' ) { $sortby = 'menu_order, post_title'; } $out = wp_list_pages( array('title_li' => '', 'echo' => 0, 'sort_column' => $sortby, 'exclude' => $exclude) ); if ( !empty( $out ) ) { ?>


    $before_title, 'title_after' => $after_title, 'category_before' => $before_widget, 'category_after' => $after_widget, 'show_images' => true, 'class' => 'linkcat widget' ))); } function wp_widget_search($args) { extract($args); $searchform_template = get_template_directory() . '/searchform.php'; echo $before_widget; // Use current theme search form if it exists if ( file_exists($searchform_template) ) { include_once($searchform_template); } else { ?>


    '; get_calendar(); echo '
    '; echo $after_widget; } function wp_widget_calendar_control() { $options = $newoptions = get_option('widget_calendar'); if ( $_POST["calendar-submit"] ) { $newoptions['title'] = strip_tags(stripslashes($_POST["calendar-title"])); } if ( $options != $newoptions ) { $options = $newoptions; update_option('widget_calendar', $options); } $title = attribute_escape($options['title']); ?>

    $widget_args ); $widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) ); extract( $widget_args, EXTR_SKIP ); $options = get_option('widget_text'); if ( !isset($options[$number]) ) return; $title = apply_filters('widget_title', $options[$number]['title']); $text = apply_filters( 'widget_text', $options[$number]['text'] ); ?>
    $widget_args ); $widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) ); extract( $widget_args, EXTR_SKIP ); $options = get_option('widget_text'); if ( !is_array($options) ) $options = array(); if ( !$updated && !empty($_POST['sidebar']) ) { $sidebar = (string) $_POST['sidebar']; $sidebars_widgets = wp_get_sidebars_widgets(); if ( isset($sidebars_widgets[$sidebar]) ) $this_sidebar =& $sidebars_widgets[$sidebar]; else $this_sidebar = array(); foreach ( $this_sidebar as $_widget_id ) { if ( 'wp_widget_text' == $wp_registered_widgets[$_widget_id]['callback'] && isset($wp_registered_widgets[$_widget_id]['params'][0]['number']) ) { $widget_number = $wp_registered_widgets[$_widget_id]['params'][0]['number']; if ( !in_array( "text-$widget_number", $_POST['widget-id'] ) ) // the widget has been removed. unset($options[$widget_number]); } } foreach ( (array) $_POST['widget-text'] as $widget_number => $widget_text ) { if ( !isset($widget_text['text']) && isset($options[$widget_number]) ) // user clicked cancel continue; $title = strip_tags(stripslashes($widget_text['title'])); if ( current_user_can('unfiltered_html') ) $text = stripslashes( $widget_text['text'] ); else $text = stripslashes(wp_filter_post_kses( $widget_text['text'] )); $options[$widget_number] = compact( 'title', 'text' ); } update_option('widget_text', $options); $updated = true; } if ( -1 == $number ) { $title = ''; $text = ''; $number = '%i%'; } else { $title = attribute_escape($options[$number]['title']); $text = format_to_edit($options[$number]['text']); } ?>

    'widget_text', 'description' => __('Arbitrary text or HTML')); $control_ops = array('width' => 400, 'height' => 350, 'id_base' => 'text'); $name = __('Text'); $id = false; foreach ( array_keys($options) as $o ) { // Old widgets can have null values for some reason if ( !isset($options[$o]['title']) || !isset($options[$o]['text']) ) continue; $id = "text-$o"; // Never never never translate an id wp_register_sidebar_widget($id, $name, 'wp_widget_text', $widget_ops, array( 'number' => $o )); wp_register_widget_control($id, $name, 'wp_widget_text_control', $control_ops, array( 'number' => $o )); } // If there are none, we register the widget's existance with a generic template if ( !$id ) { wp_register_sidebar_widget( 'text-1', $name, 'wp_widget_text', $widget_ops, array( 'number' => -1 ) ); wp_register_widget_control( 'text-1', $name, 'wp_widget_text_control', $control_ops, array( 'number' => -1 ) ); } } // See large comment section at end of this file function wp_widget_categories($args, $widget_args = 1) { extract($args, EXTR_SKIP); if ( is_numeric($widget_args) ) $widget_args = array( 'number' => $widget_args ); $widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) ); extract($widget_args, EXTR_SKIP); $options = get_option('widget_categories'); if ( !isset($options[$number]) ) return; $c = $options[$number]['count'] ? '1' : '0'; $h = $options[$number]['hierarchical'] ? '1' : '0'; $d = $options[$number]['dropdown'] ? '1' : '0'; $title = empty($options[$number]['title']) ? __('Categories') : apply_filters('widget_title', $options[$number]['title']); echo $before_widget; echo $before_title . $title . $after_title; $cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h); if ( $d ) { $cat_args['show_option_none'] = __('Select Category'); wp_dropdown_categories($cat_args); ?>
    $widget_args ); $widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) ); extract($widget_args, EXTR_SKIP); $options = get_option('widget_categories'); if ( !is_array( $options ) ) $options = array(); if ( !$updated && !empty($_POST['sidebar']) ) { $sidebar = (string) $_POST['sidebar']; $sidebars_widgets = wp_get_sidebars_widgets(); if ( isset($sidebars_widgets[$sidebar]) ) $this_sidebar =& $sidebars_widgets[$sidebar]; else $this_sidebar = array(); foreach ( $this_sidebar as $_widget_id ) { if ( 'wp_widget_categories' == $wp_registered_widgets[$_widget_id]['callback'] && isset($wp_registered_widgets[$_widget_id]['params'][0]['number']) ) { $widget_number = $wp_registered_widgets[$_widget_id]['params'][0]['number']; if ( !in_array( "categories-$widget_number", $_POST['widget-id'] ) ) // the widget has been removed. unset($options[$widget_number]); } } foreach ( (array) $_POST['widget-categories'] as $widget_number => $widget_cat ) { if ( !isset($widget_cat['title']) && isset($options[$widget_number]) ) // user clicked cancel continue; $title = trim(strip_tags(stripslashes($widget_cat['title']))); $count = isset($widget_cat['count']); $hierarchical = isset($widget_cat['hierarchical']); $dropdown = isset($widget_cat['dropdown']); $options[$widget_number] = compact( 'title', 'count', 'hierarchical', 'dropdown' ); } update_option('widget_categories', $options); $updated = true; } if ( -1 == $number ) { $title = ''; $count = false; $hierarchical = false; $dropdown = false; $number = '%i%'; } else { $title = attribute_escape( $options[$number]['title'] ); $count = (bool) $options[$number]['count']; $hierarchical = (bool) $options[$number]['hierarchical']; $dropdown = (bool) $options[$number]['dropdown']; } ?>



    'widget_categories', 'description' => __( "A list or dropdown of categories" ) ); $name = __( 'Categories' ); $id = false; foreach ( array_keys($options) as $o ) { // Old widgets can have null values for some reason if ( !isset($options[$o]['title']) ) continue; $id = "categories-$o"; wp_register_sidebar_widget( $id, $name, 'wp_widget_categories', $widget_ops, array( 'number' => $o ) ); wp_register_widget_control( $id, $name, 'wp_widget_categories_control', array( 'id_base' => 'categories' ), array( 'number' => $o ) ); } // If there are none, we register the widget's existance with a generic template if ( !$id ) { wp_register_sidebar_widget( 'categories-1', $name, 'wp_widget_categories', $widget_ops, array( 'number' => -1 ) ); wp_register_widget_control( 'categories-1', $name, 'wp_widget_categories_control', array( 'id_base' => 'categories' ), array( 'number' => -1 ) ); } } function wp_widget_categories_upgrade() { $options = get_option( 'widget_categories' ); if ( !isset( $options['title'] ) ) return $options; $newoptions = array( 1 => $options ); update_option( 'widget_categories', $newoptions ); $sidebars_widgets = get_option( 'sidebars_widgets' ); if ( is_array( $sidebars_widgets ) ) { foreach ( $sidebars_widgets as $sidebar => $widgets ) { if ( is_array( $widgets ) ) { foreach ( $widgets as $widget ) $new_widgets[$sidebar][] = ( $widget == 'categories' ) ? 'categories-1' : $widget; } else { $new_widgets[$sidebar] = $widgets; } } if ( $new_widgets != $sidebars_widgets ) update_option( 'sidebars_widgets', $new_widgets ); } return $newoptions; } function wp_widget_recent_entries($args) { if ( '%BEG_OF_TITLE%' != $args['before_title'] ) { if ( $output = wp_cache_get('widget_recent_entries', 'widget') ) return print($output); ob_start(); } extract($args); $options = get_option('widget_recent_entries'); $title = empty($options['title']) ? __('Recent Posts') : apply_filters('widget_title', $options['title']); if ( !$number = (int) $options['number'] ) $number = 10; else if ( $number < 1 ) $number = 1; else if ( $number > 15 ) $number = 15; $r = new WP_Query(array('showposts' => $number, 'what_to_show' => 'posts', 'nopaging' => 0, 'post_status' => 'publish')); if ($r->have_posts()) : ?>
      have_posts()) : $r->the_post(); ?>


    15 ) $number = 15; if ( !$comments = wp_cache_get( 'recent_comments', 'widget' ) ) { $comments = $wpdb->get_results("SELECT comment_author, comment_author_url, comment_ID, comment_post_ID FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT $number"); wp_cache_add( 'recent_comments', $comments, 'widget' ); } ?>


    'widget_recent_comments', 'description' => __( 'The most recent comments' ) ); wp_register_sidebar_widget('recent-comments', __('Recent Comments'), 'wp_widget_recent_comments', $widget_ops); wp_register_widget_control('recent-comments', __('Recent Comments'), 'wp_widget_recent_comments_control'); if ( is_active_widget('wp_widget_recent_comments') ) add_action('wp_head', 'wp_widget_recent_comments_style'); } // See large comment section at end of this file function wp_widget_rss($args, $widget_args = 1) { extract($args, EXTR_SKIP); if ( is_numeric($widget_args) ) $widget_args = array( 'number' => $widget_args ); $widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) ); extract($widget_args, EXTR_SKIP); $options = get_option('widget_rss'); if ( !isset($options[$number]) ) return; if ( isset($options[$number]['error']) && $options[$number]['error'] ) return; $url = $options[$number]['url']; while ( strstr($url, 'http') != $url ) $url = substr($url, 1); if ( empty($url) ) return; require_once(ABSPATH . WPINC . '/rss.php'); $rss = fetch_rss($url); $link = clean_url(strip_tags($rss->channel['link'])); while ( strstr($link, 'http') != $link ) $link = substr($link, 1); $desc = attribute_escape(strip_tags(html_entity_decode($rss->channel['description'], ENT_QUOTES))); $title = $options[$number]['title']; if ( empty($title) ) $title = htmlentities(strip_tags($rss->channel['title'])); if ( empty($title) ) $title = $desc; if ( empty($title) ) $title = __('Unknown Feed'); $title = apply_filters('widget_title', $title ); $url = clean_url(strip_tags($url)); if ( file_exists(dirname(__FILE__) . '/rss.png') ) $icon = str_replace(ABSPATH, site_url() . '/', dirname(__FILE__)) . '/rss.png'; else $icon = includes_url('images/rss.png'); $title = "RSS $title"; echo $before_widget; echo $before_title . $title . $after_title; wp_widget_rss_output( $rss, $options[$number] ); echo $after_widget; } function wp_widget_rss_output( $rss, $args = array() ) { if ( is_string( $rss ) ) { require_once(ABSPATH . WPINC . '/rss.php'); if ( !$rss = fetch_rss($rss) ) return; } elseif ( is_array($rss) && isset($rss['url']) ) { require_once(ABSPATH . WPINC . '/rss.php'); $args = $rss; if ( !$rss = fetch_rss($rss['url']) ) return; } elseif ( !is_object($rss) ) { return; } extract( $args, EXTR_SKIP ); $items = (int) $items; if ( $items < 1 || 20 < $items ) $items = 10; $show_summary = (int) $show_summary; $show_author = (int) $show_author; $show_date = (int) $show_date; if ( is_array( $rss->items ) && !empty( $rss->items ) ) { $rss->items = array_slice($rss->items, 0, $items); echo '
      '; foreach ($rss->items as $item ) { while ( strstr($item['link'], 'http') != $item['link'] ) $item['link'] = substr($item['link'], 1); $link = clean_url(strip_tags($item['link'])); $title = attribute_escape(strip_tags($item['title'])); if ( empty($title) ) $title = __('Untitled'); $desc = ''; $summary = ''; if ( isset( $item['description'] ) && is_string( $item['description'] ) ) $desc = $summary = str_replace(array("\n", "\r"), ' ', attribute_escape(strip_tags(html_entity_decode($item['description'], ENT_QUOTES)))); elseif ( isset( $item['summary'] ) && is_string( $item['summary'] ) ) $desc = $summary = str_replace(array("\n", "\r"), ' ', attribute_escape(strip_tags(html_entity_decode($item['summary'], ENT_QUOTES)))); if ( $show_summary ) { $desc = ''; $summary = wp_specialchars( $summary ); $summary = "
      $summary
      "; } else { $summary = ''; } $date = ''; if ( $show_date ) { if ( isset($item['pubdate']) ) $date = $item['pubdate']; elseif ( isset($item['published']) ) $date = $item['published']; if ( $date ) { if ( $date_stamp = strtotime( $date ) ) $date = ' ' . date_i18n( get_option( 'date_format' ), $date_stamp ) . ''; else $date = ''; } } $author = ''; if ( $show_author ) { if ( isset($item['dc']['creator']) ) $author = ' ' . wp_specialchars( strip_tags( $item['dc']['creator'] ) ) . ''; elseif ( isset($item['author_name']) ) $author = ' ' . wp_specialchars( strip_tags( $item['author_name'] ) ) . ''; } echo "
    • $title{$date}{$summary}{$author}
    • "; } echo '
    '; } else { echo '
    • ' . __( 'An error has occurred; the feed is probably down. Try again later.' ) . '
    '; } } function wp_widget_rss_control($widget_args) { global $wp_registered_widgets; static $updated = false; if ( is_numeric($widget_args) ) $widget_args = array( 'number' => $widget_args ); $widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) ); extract($widget_args, EXTR_SKIP); $options = get_option('widget_rss'); if ( !is_array($options) ) $options = array(); $urls = array(); foreach ( $options as $option ) if ( isset($option['url']) ) $urls[$option['url']] = true; if ( !$updated && 'POST' == $_SERVER['REQUEST_METHOD'] && !empty($_POST['sidebar']) ) { $sidebar = (string) $_POST['sidebar']; $sidebars_widgets = wp_get_sidebars_widgets(); if ( isset($sidebars_widgets[$sidebar]) ) $this_sidebar =& $sidebars_widgets[$sidebar]; else $this_sidebar = array(); foreach ( $this_sidebar as $_widget_id ) { if ( 'wp_widget_rss' == $wp_registered_widgets[$_widget_id]['callback'] && isset($wp_registered_widgets[$_widget_id]['params'][0]['number']) ) { $widget_number = $wp_registered_widgets[$_widget_id]['params'][0]['number']; if ( !in_array( "rss-$widget_number", $_POST['widget-id'] ) ) // the widget has been removed. unset($options[$widget_number]); } } foreach( (array) $_POST['widget-rss'] as $widget_number => $widget_rss ) { if ( !isset($widget_rss['url']) && isset($options[$widget_number]) ) // user clicked cancel continue; $widget_rss = stripslashes_deep( $widget_rss ); $url = sanitize_url(strip_tags($widget_rss['url'])); $options[$widget_number] = wp_widget_rss_process( $widget_rss, !isset($urls[$url]) ); } update_option('widget_rss', $options); $updated = true; } if ( -1 == $number ) { $title = ''; $url = ''; $items = 10; $error = false; $number = '%i%'; $show_summary = 0; $show_author = 0; $show_date = 0; } else { extract( (array) $options[$number] ); } wp_widget_rss_form( compact( 'number', 'title', 'url', 'items', 'error', 'show_summary', 'show_author', 'show_date' ) ); } function wp_widget_rss_form( $args, $inputs = null ) { $default_inputs = array( 'url' => true, 'title' => true, 'items' => true, 'show_summary' => true, 'show_author' => true, 'show_date' => true ); $inputs = wp_parse_args( $inputs, $default_inputs ); extract( $args ); $number = attribute_escape( $number ); $title = attribute_escape( $title ); $url = attribute_escape( $url ); $items = (int) $items; if ( $items < 1 || 20 < $items ) $items = 10; $show_summary = (int) $show_summary; $show_author = (int) $show_author; $show_date = (int) $show_date; if ( $inputs['url'] ) : ?>

    channel['link'])); while ( strstr($link, 'http') != $link ) $link = substr($link, 1); } } return compact( 'title', 'url', 'link', 'items', 'error', 'show_summary', 'show_author', 'show_date' ); } function wp_widget_rss_register() { if ( !$options = get_option('widget_rss') ) $options = array(); $widget_ops = array('classname' => 'widget_rss', 'description' => __( 'Entries from any RSS or Atom feed' )); $control_ops = array('width' => 400, 'height' => 200, 'id_base' => 'rss'); $name = __('RSS'); $id = false; foreach ( array_keys($options) as $o ) { // Old widgets can have null values for some reason if ( !isset($options[$o]['url']) || !isset($options[$o]['title']) || !isset($options[$o]['items']) ) continue; $id = "rss-$o"; // Never never never translate an id wp_register_sidebar_widget($id, $name, 'wp_widget_rss', $widget_ops, array( 'number' => $o )); wp_register_widget_control($id, $name, 'wp_widget_rss_control', $control_ops, array( 'number' => $o )); } // If there are none, we register the widget's existance with a generic template if ( !$id ) { wp_register_sidebar_widget( 'rss-1', $name, 'wp_widget_rss', $widget_ops, array( 'number' => -1 ) ); wp_register_widget_control( 'rss-1', $name, 'wp_widget_rss_control', $control_ops, array( 'number' => -1 ) ); } } function wp_widget_tag_cloud($args) { extract($args); $options = get_option('widget_tag_cloud'); $title = empty($options['title']) ? __('Tags') : apply_filters('widget_title', $options['title']); echo $before_widget; echo $before_title . $title . $after_title; wp_tag_cloud(); echo $after_widget; } function wp_widget_tag_cloud_control() { $options = $newoptions = get_option('widget_tag_cloud'); if ( $_POST['tag-cloud-submit'] ) { $newoptions['title'] = strip_tags(stripslashes($_POST['tag-cloud-title'])); } if ( $options != $newoptions ) { $options = $newoptions; update_option('widget_tag_cloud', $options); } $title = attribute_escape( $options['title'] ); ?>

    'widget_pages', 'description' => __( "Your blog's WordPress Pages") ); wp_register_sidebar_widget('pages', __('Pages'), 'wp_widget_pages', $widget_ops); wp_register_widget_control('pages', __('Pages'), 'wp_widget_pages_control' ); $widget_ops = array('classname' => 'widget_calendar', 'description' => __( "A calendar of your blog's posts") ); wp_register_sidebar_widget('calendar', __('Calendar'), 'wp_widget_calendar', $widget_ops); wp_register_widget_control('calendar', __('Calendar'), 'wp_widget_calendar_control' ); $widget_ops = array('classname' => 'widget_archive', 'description' => __( "A monthly archive of your blog's posts") ); wp_register_sidebar_widget('archives', __('Archives'), 'wp_widget_archives', $widget_ops); wp_register_widget_control('archives', __('Archives'), 'wp_widget_archives_control' ); $widget_ops = array('classname' => 'widget_links', 'description' => __( "Your blogroll") ); wp_register_sidebar_widget('links', __('Links'), 'wp_widget_links', $widget_ops); $widget_ops = array('classname' => 'widget_meta', 'description' => __( "Log in/out, admin, feed and WordPress links") ); wp_register_sidebar_widget('meta', __('Meta'), 'wp_widget_meta', $widget_ops); wp_register_widget_control('meta', __('Meta'), 'wp_widget_meta_control' ); $widget_ops = array('classname' => 'widget_search', 'description' => __( "A search form for your blog") ); wp_register_sidebar_widget('search', __('Search'), 'wp_widget_search', $widget_ops); $widget_ops = array('classname' => 'widget_recent_entries', 'description' => __( "The most recent posts on your blog") ); wp_register_sidebar_widget('recent-posts', __('Recent Posts'), 'wp_widget_recent_entries', $widget_ops); wp_register_widget_control('recent-posts', __('Recent Posts'), 'wp_widget_recent_entries_control' ); $widget_ops = array('classname' => 'widget_tag_cloud', 'description' => __( "Your most used tags in cloud format") ); wp_register_sidebar_widget('tag_cloud', __('Tag Cloud'), 'wp_widget_tag_cloud', $widget_ops); wp_register_widget_control('tag_cloud', __('Tag Cloud'), 'wp_widget_tag_cloud_control' ); wp_widget_categories_register(); wp_widget_text_register(); wp_widget_rss_register(); wp_widget_recent_comments_register(); do_action('widgets_init'); } add_action('init', 'wp_widgets_init', 1); /* Pattern for multi-widget (allows multiple instances such as the text widget). // Displays widget on blag // $widget_args: number // number: which of the several widgets of this type do we mean function widget_many( $args, $widget_args = 1 ) { extract( $args, EXTR_SKIP ); if ( is_numeric($widget_args) ) $widget_args = array( 'number' => $widget_args ); $widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) ); extract( $widget_args, EXTR_SKIP ); // Data should be stored as array: array( number => data for that instance of the widget, ... ) $options = get_option('widget_many'); if ( !isset($options[$number]) ) return; echo $before_widget; // Do stuff for this widget, drawing data from $options[$number] echo $after_widget; } // Displays form for a particular instance of the widget. Also updates the data after a POST submit // $widget_args: number // number: which of the several widgets of this type do we mean function widget_many_control( $widget_args = 1 ) { global $wp_registered_widgets; static $updated = false; // Whether or not we have already updated the data after a POST submit if ( is_numeric($widget_args) ) $widget_args = array( 'number' => $widget_args ); $widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) ); extract( $widget_args, EXTR_SKIP ); // Data should be stored as array: array( number => data for that instance of the widget, ... ) $options = get_option('widget_many'); if ( !is_array($options) ) $options = array(); // We need to update the data if ( !$updated && !empty($_POST['sidebar']) ) { // Tells us what sidebar to put the data in $sidebar = (string) $_POST['sidebar']; $sidebars_widgets = wp_get_sidebars_widgets(); if ( isset($sidebars_widgets[$sidebar]) ) $this_sidebar =& $sidebars_widgets[$sidebar]; else $this_sidebar = array(); foreach ( $this_sidebar as $_widget_id ) { // Remove all widgets of this type from the sidebar. We'll add the new data in a second. This makes sure we don't get any duplicate data // since widget ids aren't necessarily persistent across multiple updates if ( 'widget_many' == $wp_registered_widgets[$_widget_id]['callback'] && isset($wp_registered_widgets[$_widget_id]['params'][0]['number']) ) { $widget_number = $wp_registered_widgets[$_widget_id]['params'][0]['number']; if ( !in_array( "many-$widget_number", $_POST['widget-id'] ) ) // the widget has been removed. "many-$widget_number" is "{id_base}-{widget_number} unset($options[$widget_number]); } } foreach ( (array) $_POST['widget-many'] as $widget_number => $widget_many_instance ) { // compile data from $widget_many_instance if ( !isset($widget_many_instance['something']) && isset($options[$widget_number]) ) // user clicked cancel continue; $something = wp_specialchars( $widget_many_instance['something'] ); $options[$widget_number] = array( 'something' => $something ); // Even simple widgets should store stuff in array, rather than in scalar } update_option('widget_many', $options); $updated = true; // So that we don't go through this more than once } // Here we echo out the form if ( -1 == $number ) { // We echo out a template for a form which can be converted to a specific form later via JS $something = ''; $number = '%i%'; } else { $something = attribute_escape($options[$number]['something']); } // The form has inputs with names like widget-many[$number][something] so that all data for that instance of // the widget are stored in one $_POST variable: $_POST['widget-many'][$number] ?>

    'widget_many', 'description' => __('Widget which allows multiple instances')); $control_ops = array('width' => 400, 'height' => 350, 'id_base' => 'many'); $name = __('Many'); $registered = false; foreach ( array_keys($options) as $o ) { // Old widgets can have null values for some reason if ( !isset($options[$o]['something']) ) // we used 'something' above in our exampple. Replace with with whatever your real data are. continue; // $id should look like {$id_base}-{$o} $id = "many-$o"; // Never never never translate an id $registered = true; wp_register_sidebar_widget( $id, $name, 'widget_many', $widget_ops, array( 'number' => $o ) ); wp_register_widget_control( $id, $name, 'widget_many_control', $control_ops, array( 'number' => $o ) ); } // If there are none, we register the widget's existance with a generic template if ( !$registered ) { wp_register_sidebar_widget( 'many-1', $name, 'widget_many', $widget_ops, array( 'number' => -1 ) ); wp_register_widget_control( 'many-1', $name, 'widget_many_control', $control_ops, array( 'number' => -1 ) ); } } // This is important add_action( 'widgets_init', 'widget_many_register' ) */ ?> wp/dev/wp-includes/general-template.php0000644000106600010660000011610011024005243015361 0ustar ' . __('Log in') . ''; else $link = '' . __('Log out') . ''; echo apply_filters('loginout', $link); } function wp_register( $before = '
  • ', $after = '
  • ' ) { if ( ! is_user_logged_in() ) { if ( get_option('users_can_register') ) $link = $before . '' . __('Register') . '' . $after; else $link = ''; } else { $link = $before . '' . __('Site Admin') . '' . $after; } echo apply_filters('register', $link); } function wp_meta() { do_action('wp_meta'); } function bloginfo($show='') { echo get_bloginfo($show, 'display'); } /** * Note: some of these values are DEPRECATED. Meaning they could be * taken out at any time and shouldn't be relied upon. Options * without "// DEPRECATED" are the preferred and recommended ways * to get the information. */ function get_bloginfo($show = '', $filter = 'raw') { switch($show) { case 'url' : case 'home' : // DEPRECATED case 'siteurl' : // DEPRECATED $output = get_option('home'); break; case 'wpurl' : $output = get_option('siteurl'); break; case 'description': $output = get_option('blogdescription'); break; case 'rdf_url': $output = get_feed_link('rdf'); break; case 'rss_url': $output = get_feed_link('rss'); break; case 'rss2_url': $output = get_feed_link('rss2'); break; case 'atom_url': $output = get_feed_link('atom'); break; case 'comments_atom_url': $output = get_feed_link('comments_atom'); break; case 'comments_rss2_url': $output = get_feed_link('comments_rss2'); break; case 'pingback_url': $output = get_option('siteurl') .'/xmlrpc.php'; break; case 'stylesheet_url': $output = get_stylesheet_uri(); break; case 'stylesheet_directory': $output = get_stylesheet_directory_uri(); break; case 'template_directory': case 'template_url': $output = get_template_directory_uri(); break; case 'admin_email': $output = get_option('admin_email'); break; case 'charset': $output = get_option('blog_charset'); if ('' == $output) $output = 'UTF-8'; break; case 'html_type' : $output = get_option('html_type'); break; case 'version': global $wp_version; $output = $wp_version; break; case 'language': $output = get_locale(); $output = str_replace('_', '-', $output); break; case 'text_direction': global $wp_locale; $output = $wp_locale->text_direction; break; case 'name': default: $output = get_option('blogname'); break; } $url = true; if (strpos($show, 'url') === false && strpos($show, 'directory') === false && strpos($show, 'home') === false) $url = false; if ( 'display' == $filter ) { if ( $url ) $output = apply_filters('bloginfo_url', $output, $show); else $output = apply_filters('bloginfo', $output, $show); } return $output; } function wp_title($sep = '»', $display = true, $seplocation = '') { global $wpdb, $wp_locale, $wp_query; $cat = get_query_var('cat'); $tag = get_query_var('tag_id'); $category_name = get_query_var('category_name'); $author = get_query_var('author'); $author_name = get_query_var('author_name'); $m = get_query_var('m'); $year = get_query_var('year'); $monthnum = get_query_var('monthnum'); $day = get_query_var('day'); $title = ''; // If there's a category if ( !empty($cat) ) { // category exclusion if ( !stristr($cat,'-') ) $title = apply_filters('single_cat_title', get_the_category_by_ID($cat)); } elseif ( !empty($category_name) ) { if ( stristr($category_name,'/') ) { $category_name = explode('/',$category_name); if ( $category_name[count($category_name)-1] ) $category_name = $category_name[count($category_name)-1]; // no trailing slash else $category_name = $category_name[count($category_name)-2]; // there was a trailling slash } $cat = get_term_by('slug', $category_name, 'category', OBJECT, 'display'); if ( $cat ) $title = apply_filters('single_cat_title', $cat->name); } if ( !empty($tag) ) { $tag = get_term($tag, 'post_tag', OBJECT, 'display'); if ( is_wp_error( $tag ) ) return $tag; if ( ! empty($tag->name) ) $title = apply_filters('single_tag_title', $tag->name); } // If there's an author if ( !empty($author) ) { $title = get_userdata($author); $title = $title->display_name; } if ( !empty($author_name) ) { // We do a direct query here because we don't cache by nicename. $title = $wpdb->get_var($wpdb->prepare("SELECT display_name FROM $wpdb->users WHERE user_nicename = %s", $author_name)); } // If there's a month if ( !empty($m) ) { $my_year = substr($m, 0, 4); $my_month = $wp_locale->get_month(substr($m, 4, 2)); $my_day = intval(substr($m, 6, 2)); $title = "$my_year" . ($my_month ? "$sep $my_month" : "") . ($my_day ? "$sep $my_day" : ""); } if ( !empty($year) ) { $title = $year; if ( !empty($monthnum) ) $title .= " $sep " . $wp_locale->get_month($monthnum); if ( !empty($day) ) $title .= " $sep " . zeroise($day, 2); } // If there is a post if ( is_single() || is_page() ) { $post = $wp_query->get_queried_object(); $title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) ); } // If there's a taxonomy if ( is_tax() ) { $taxonomy = get_query_var( 'taxonomy' ); $tax = get_taxonomy( $taxonomy ); $tax = $tax->label; $term = $wp_query->get_queried_object(); $term = $term->name; if ( 'right' == $seplocation ) $title = "$term $sep $tax"; else $title = "$tax $sep $term"; } $prefix = ''; if ( !empty($title) ) $prefix = " $sep "; // Determines position of the separator if ( 'right' == $seplocation ) $title = $title . $prefix; else $title = $prefix . $title; $title = apply_filters('wp_title', $title, $sep); // Send it out if ( $display ) echo $title; else return $title; } function single_post_title($prefix = '', $display = true) { global $wpdb; $p = get_query_var('p'); $name = get_query_var('name'); if ( intval($p) || '' != $name ) { if ( !$p ) $p = $wpdb->get_var($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_name = %s", $name)); $post = & get_post($p); $title = $post->post_title; $title = apply_filters('single_post_title', $title); if ( $display ) echo $prefix.strip_tags($title); else return strip_tags($title); } } function single_cat_title($prefix = '', $display = true ) { $cat = intval( get_query_var('cat') ); if ( !empty($cat) && !(strtoupper($cat) == 'ALL') ) { $my_cat_name = apply_filters('single_cat_title', get_the_category_by_ID($cat)); if ( !empty($my_cat_name) ) { if ( $display ) echo $prefix.strip_tags($my_cat_name); else return strip_tags($my_cat_name); } } else if ( is_tag() ) { return single_tag_title($prefix, $display); } } function single_tag_title($prefix = '', $display = true ) { if ( !is_tag() ) return; $tag_id = intval( get_query_var('tag_id') ); if ( !empty($tag_id) ) { $my_tag = &get_term($tag_id, 'post_tag', OBJECT, 'display'); if ( is_wp_error( $my_tag ) ) return false; $my_tag_name = apply_filters('single_tag_title', $my_tag->name); if ( !empty($my_tag_name) ) { if ( $display ) echo $prefix . $my_tag_name; else return $my_tag_name; } } } function single_month_title($prefix = '', $display = true ) { global $wp_locale; $m = get_query_var('m'); $year = get_query_var('year'); $monthnum = get_query_var('monthnum'); if ( !empty($monthnum) && !empty($year) ) { $my_year = $year; $my_month = $wp_locale->get_month($monthnum); } elseif ( !empty($m) ) { $my_year = substr($m, 0, 4); $my_month = $wp_locale->get_month(substr($m, 4, 2)); } if ( empty($my_month) ) return false; $result = $prefix . $my_month . $prefix . $my_year; if ( !$display ) return $result; echo $result; } /* link navigation hack by Orien http://icecode.com/ */ function get_archives_link($url, $text, $format = 'html', $before = '', $after = '') { $text = wptexturize($text); $title_text = attribute_escape($text); $url = clean_url($url); if ('link' == $format) $link_html = "\t\n"; elseif ('option' == $format) $link_html = "\t\n"; elseif ('html' == $format) $link_html = "\t
  • $before$text$after
  • \n"; else // custom $link_html = "\t$before$text$after\n"; $link_html = apply_filters( "get_archives_link", $link_html ); return $link_html; } function wp_get_archives($args = '') { global $wpdb, $wp_locale; $defaults = array( 'type' => 'monthly', 'limit' => '', 'format' => 'html', 'before' => '', 'after' => '', 'show_post_count' => false ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); if ( '' == $type ) $type = 'monthly'; if ( '' != $limit ) { $limit = absint($limit); $limit = ' LIMIT '.$limit; } // this is what will separate dates on weekly archive links $archive_week_separator = '–'; // over-ride general date format ? 0 = no: use the date format set in Options, 1 = yes: over-ride $archive_date_format_over_ride = 0; // options for daily archive (only if you over-ride the general date format) $archive_day_date_format = 'Y/m/d'; // options for weekly archive (only if you over-ride the general date format) $archive_week_start_date_format = 'Y/m/d'; $archive_week_end_date_format = 'Y/m/d'; if ( !$archive_date_format_over_ride ) { $archive_day_date_format = get_option('date_format'); $archive_week_start_date_format = get_option('date_format'); $archive_week_end_date_format = get_option('date_format'); } //filters $where = apply_filters('getarchives_where', "WHERE post_type = 'post' AND post_status = 'publish'", $r ); $join = apply_filters('getarchives_join', "", $r); if ( 'monthly' == $type ) { $query = "SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC $limit"; $key = md5($query); $cache = wp_cache_get( 'wp_get_archives' , 'general'); if ( !isset( $cache[ $key ] ) ) { $arcresults = $wpdb->get_results($query); $cache[ $key ] = $arcresults; wp_cache_add( 'wp_get_archives', $cache, 'general' ); } else { $arcresults = $cache[ $key ]; } if ( $arcresults ) { $afterafter = $after; foreach ( $arcresults as $arcresult ) { $url = get_month_link($arcresult->year, $arcresult->month); $text = sprintf(__('%1$s %2$d'), $wp_locale->get_month($arcresult->month), $arcresult->year); if ( $show_post_count ) $after = ' ('.$arcresult->posts.')' . $afterafter; echo get_archives_link($url, $text, $format, $before, $after); } } } elseif ('yearly' == $type) { $query = "SELECT DISTINCT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date) ORDER BY post_date DESC $limit"; $key = md5($query); $cache = wp_cache_get( 'wp_get_archives' , 'general'); if ( !isset( $cache[ $key ] ) ) { $arcresults = $wpdb->get_results($query); $cache[ $key ] = $arcresults; wp_cache_add( 'wp_get_archives', $cache, 'general' ); } else { $arcresults = $cache[ $key ]; } if ($arcresults) { $afterafter = $after; foreach ($arcresults as $arcresult) { $url = get_year_link($arcresult->year); $text = sprintf('%d', $arcresult->year); if ($show_post_count) $after = ' ('.$arcresult->posts.')' . $afterafter; echo get_archives_link($url, $text, $format, $before, $after); } } } elseif ( 'daily' == $type ) { $query = "SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date DESC $limit"; $key = md5($query); $cache = wp_cache_get( 'wp_get_archives' , 'general'); if ( !isset( $cache[ $key ] ) ) { $arcresults = $wpdb->get_results($query); $cache[ $key ] = $arcresults; wp_cache_add( 'wp_get_archives', $cache, 'general' ); } else { $arcresults = $cache[ $key ]; } if ( $arcresults ) { $afterafter = $after; foreach ( $arcresults as $arcresult ) { $url = get_day_link($arcresult->year, $arcresult->month, $arcresult->dayofmonth); $date = sprintf('%1$d-%2$02d-%3$02d 00:00:00', $arcresult->year, $arcresult->month, $arcresult->dayofmonth); $text = mysql2date($archive_day_date_format, $date); if ($show_post_count) $after = ' ('.$arcresult->posts.')'.$afterafter; echo get_archives_link($url, $text, $format, $before, $after); } } } elseif ( 'weekly' == $type ) { $start_of_week = get_option('start_of_week'); $query = "SELECT DISTINCT WEEK(post_date, $start_of_week) AS `week`, YEAR(post_date) AS yr, DATE_FORMAT(post_date, '%Y-%m-%d') AS yyyymmdd, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY WEEK(post_date, $start_of_week), YEAR(post_date) ORDER BY post_date DESC $limit"; $key = md5($query); $cache = wp_cache_get( 'wp_get_archives' , 'general'); if ( !isset( $cache[ $key ] ) ) { $arcresults = $wpdb->get_results($query); $cache[ $key ] = $arcresults; wp_cache_add( 'wp_get_archives', $cache, 'general' ); } else { $arcresults = $cache[ $key ]; } $arc_w_last = ''; $afterafter = $after; if ( $arcresults ) { foreach ( $arcresults as $arcresult ) { if ( $arcresult->week != $arc_w_last ) { $arc_year = $arcresult->yr; $arc_w_last = $arcresult->week; $arc_week = get_weekstartend($arcresult->yyyymmdd, get_option('start_of_week')); $arc_week_start = date_i18n($archive_week_start_date_format, $arc_week['start']); $arc_week_end = date_i18n($archive_week_end_date_format, $arc_week['end']); $url = sprintf('%1$s/%2$s%3$sm%4$s%5$s%6$sw%7$s%8$d', get_option('home'), '', '?', '=', $arc_year, '&', '=', $arcresult->week); $text = $arc_week_start . $archive_week_separator . $arc_week_end; if ($show_post_count) $after = ' ('.$arcresult->posts.')'.$afterafter; echo get_archives_link($url, $text, $format, $before, $after); } } } } elseif ( ( 'postbypost' == $type ) || ('alpha' == $type) ) { ('alpha' == $type) ? $orderby = "post_title ASC " : $orderby = "post_date DESC "; $query = "SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit"; $key = md5($query); $cache = wp_cache_get( 'wp_get_archives' , 'general'); if ( !isset( $cache[ $key ] ) ) { $arcresults = $wpdb->get_results($query); $cache[ $key ] = $arcresults; wp_cache_add( 'wp_get_archives', $cache, 'general' ); } else { $arcresults = $cache[ $key ]; } if ( $arcresults ) { foreach ( $arcresults as $arcresult ) { if ( $arcresult->post_date != '0000-00-00 00:00:00' ) { $url = get_permalink($arcresult); $arc_title = $arcresult->post_title; if ( $arc_title ) $text = strip_tags(apply_filters('the_title', $arc_title)); else $text = $arcresult->ID; echo get_archives_link($url, $text, $format, $before, $after); } } } } } // Used in get_calendar function calendar_week_mod($num) { $base = 7; return ($num - $base*floor($num/$base)); } function get_calendar($initial = true) { global $wpdb, $m, $monthnum, $year, $wp_locale, $posts; $key = md5( $m . $monthnum . $year ); if ( $cache = wp_cache_get( 'get_calendar', 'calendar' ) ) { if ( isset( $cache[ $key ] ) ) { echo $cache[ $key ]; return; } } ob_start(); // Quick check. If we have no posts at all, abort! if ( !$posts ) { $gotsome = $wpdb->get_var("SELECT ID from $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 1"); if ( !$gotsome ) return; } if ( isset($_GET['w']) ) $w = ''.intval($_GET['w']); // week_begins = 0 stands for Sunday $week_begins = intval(get_option('start_of_week')); // Let's figure out when we are if ( !empty($monthnum) && !empty($year) ) { $thismonth = ''.zeroise(intval($monthnum), 2); $thisyear = ''.intval($year); } elseif ( !empty($w) ) { // We need to get the month from MySQL $thisyear = ''.intval(substr($m, 0, 4)); $d = (($w - 1) * 7) + 6; //it seems MySQL's weeks disagree with PHP's $thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('${thisyear}0101', INTERVAL $d DAY) ), '%m')"); } elseif ( !empty($m) ) { $thisyear = ''.intval(substr($m, 0, 4)); if ( strlen($m) < 6 ) $thismonth = '01'; else $thismonth = ''.zeroise(intval(substr($m, 4, 2)), 2); } else { $thisyear = gmdate('Y', current_time('timestamp')); $thismonth = gmdate('m', current_time('timestamp')); } $unixmonth = mktime(0, 0 , 0, $thismonth, 1, $thisyear); // Get the next and previous month and year with at least one post $previous = $wpdb->get_row("SELECT DISTINCT MONTH(post_date) AS month, YEAR(post_date) AS year FROM $wpdb->posts WHERE post_date < '$thisyear-$thismonth-01' AND post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 1"); $next = $wpdb->get_row("SELECT DISTINCT MONTH(post_date) AS month, YEAR(post_date) AS year FROM $wpdb->posts WHERE post_date > '$thisyear-$thismonth-01' AND MONTH( post_date ) != MONTH( '$thisyear-$thismonth-01' ) AND post_type = 'post' AND post_status = 'publish' ORDER BY post_date ASC LIMIT 1"); echo ''; $myweek = array(); for ( $wdcount=0; $wdcount<=6; $wdcount++ ) { $myweek[] = $wp_locale->get_weekday(($wdcount+$week_begins)%7); } foreach ( $myweek as $wd ) { $day_name = (true == $initial) ? $wp_locale->get_weekday_initial($wd) : $wp_locale->get_weekday_abbrev($wd); echo "\n\t\t"; } echo ' '; if ( $previous ) { echo "\n\t\t".''; } else { echo "\n\t\t".''; } echo "\n\t\t".''; if ( $next ) { echo "\n\t\t".''; } else { echo "\n\t\t".''; } echo ' '; // Get days with posts $dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date) FROM $wpdb->posts WHERE MONTH(post_date) = '$thismonth' AND YEAR(post_date) = '$thisyear' AND post_type = 'post' AND post_status = 'publish' AND post_date < '" . current_time('mysql') . '\'', ARRAY_N); if ( $dayswithposts ) { foreach ( $dayswithposts as $daywith ) { $daywithpost[] = $daywith[0]; } } else { $daywithpost = array(); } if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'camino') !== false || strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') !== false) $ak_title_separator = "\n"; else $ak_title_separator = ', '; $ak_titles_for_day = array(); $ak_post_titles = $wpdb->get_results("SELECT post_title, DAYOFMONTH(post_date) as dom " ."FROM $wpdb->posts " ."WHERE YEAR(post_date) = '$thisyear' " ."AND MONTH(post_date) = '$thismonth' " ."AND post_date < '".current_time('mysql')."' " ."AND post_type = 'post' AND post_status = 'publish'" ); if ( $ak_post_titles ) { foreach ( $ak_post_titles as $ak_post_title ) { $post_title = apply_filters( "the_title", $ak_post_title->post_title ); $post_title = str_replace('"', '"', wptexturize( $post_title )); if ( empty($ak_titles_for_day['day_'.$ak_post_title->dom]) ) $ak_titles_for_day['day_'.$ak_post_title->dom] = ''; if ( empty($ak_titles_for_day["$ak_post_title->dom"]) ) // first one $ak_titles_for_day["$ak_post_title->dom"] = $post_title; else $ak_titles_for_day["$ak_post_title->dom"] .= $ak_title_separator . $post_title; } } // See how much we should pad in the beginning $pad = calendar_week_mod(date('w', $unixmonth)-$week_begins); if ( 0 != $pad ) echo "\n\t\t".''; $daysinmonth = intval(date('t', $unixmonth)); for ( $day = 1; $day <= $daysinmonth; ++$day ) { if ( isset($newrow) && $newrow ) echo "\n\t\n\t\n\t\t"; $newrow = false; if ( $day == gmdate('j', (time() + (get_option('gmt_offset') * 3600))) && $thismonth == gmdate('m', time()+(get_option('gmt_offset') * 3600)) && $thisyear == gmdate('Y', time()+(get_option('gmt_offset') * 3600)) ) echo ''; if ( 6 == calendar_week_mod(date('w', mktime(0, 0 , 0, $thismonth, $day, $thisyear))-$week_begins) ) $newrow = true; } $pad = 7 - calendar_week_mod(date('w', mktime(0, 0 , 0, $thismonth, $day, $thisyear))-$week_begins); if ( $pad != 0 && $pad != 7 ) echo "\n\t\t".''; echo "\n\t\n\t\n\t
    ' . sprintf(_c('%1$s %2$s|Used as a calendar caption'), $wp_locale->get_month($thismonth), date('Y', $unixmonth)) . '
    $day_name
    « ' . $wp_locale->get_month_abbrev($wp_locale->get_month($previous->month)) . '  ' . $wp_locale->get_month_abbrev($wp_locale->get_month($next->month)) . ' » 
     
    '; else echo ''; if ( in_array($day, $daywithpost) ) // any posts today? echo '$day"; else echo $day; echo ' 
    "; $output = ob_get_contents(); ob_end_clean(); echo $output; $cache[ $key ] = $output; wp_cache_set( 'get_calendar', $cache, 'calendar' ); } function delete_get_calendar_cache() { wp_cache_delete( 'get_calendar', 'calendar' ); } add_action( 'save_post', 'delete_get_calendar_cache' ); add_action( 'delete_post', 'delete_get_calendar_cache' ); add_action( 'update_option_start_of_week', 'delete_get_calendar_cache' ); add_action( 'update_option_gmt_offset', 'delete_get_calendar_cache' ); add_action( 'update_option_start_of_week', 'delete_get_calendar_cache' ); function allowed_tags() { global $allowedtags; $allowed = ''; foreach ( $allowedtags as $tag => $attributes ) { $allowed .= '<'.$tag; if ( 0 < count($attributes) ) { foreach ( $attributes as $attribute => $limits ) { $allowed .= ' '.$attribute.'=""'; } } $allowed .= '> '; } return htmlentities($allowed); } /***** Date/Time tags *****/ function the_date_xml() { global $post; echo mysql2date('Y-m-d', $post->post_date); //echo ""+$post->post_date; } function the_date($d='', $before='', $after='', $echo = true) { global $post, $day, $previousday; $the_date = ''; if ( $day != $previousday ) { $the_date .= $before; if ( $d=='' ) $the_date .= mysql2date(get_option('date_format'), $post->post_date); else $the_date .= mysql2date($d, $post->post_date); $the_date .= $after; $previousday = $day; } $the_date = apply_filters('the_date', $the_date, $d, $before, $after); if ( $echo ) echo $the_date; else return $the_date; } function the_modified_date($d = '') { echo apply_filters('the_modified_date', get_the_modified_date($d), $d); } function get_the_modified_date($d = '') { if ( '' == $d ) $the_time = get_post_modified_time(get_option('date_format')); else $the_time = get_post_modified_time($d); return apply_filters('get_the_modified_date', $the_time, $d); } function the_time( $d = '' ) { echo apply_filters('the_time', get_the_time( $d ), $d); } function get_the_time( $d = '' ) { if ( '' == $d ) $the_time = get_post_time(get_option('time_format')); else $the_time = get_post_time($d); return apply_filters('get_the_time', $the_time, $d); } function get_post_time( $d = 'U', $gmt = false ) { // returns timestamp global $post; if ( $gmt ) $time = $post->post_date_gmt; else $time = $post->post_date; $time = mysql2date($d, $time); return apply_filters('get_post_time', $time, $d, $gmt); } function the_modified_time($d = '') { echo apply_filters('the_modified_time', get_the_modified_time($d), $d); } function get_the_modified_time($d = '') { if ( '' == $d ) $the_time = get_post_modified_time(get_option('time_format')); else $the_time = get_post_modified_time($d); return apply_filters('get_the_modified_time', $the_time, $d); } function get_post_modified_time( $d = 'U', $gmt = false ) { // returns timestamp global $post; if ( $gmt ) $time = $post->post_modified_gmt; else $time = $post->post_modified; $time = mysql2date($d, $time); return apply_filters('get_the_modified_time', $time, $d, $gmt); } function the_weekday() { global $wp_locale, $post; $the_weekday = $wp_locale->get_weekday(mysql2date('w', $post->post_date)); $the_weekday = apply_filters('the_weekday', $the_weekday); echo $the_weekday; } function the_weekday_date($before='',$after='') { global $wp_locale, $post, $day, $previousweekday; $the_weekday_date = ''; if ( $day != $previousweekday ) { $the_weekday_date .= $before; $the_weekday_date .= $wp_locale->get_weekday(mysql2date('w', $post->post_date)); $the_weekday_date .= $after; $previousweekday = $day; } $the_weekday_date = apply_filters('the_weekday_date', $the_weekday_date, $before, $after); echo $the_weekday_date; } function wp_head() { do_action('wp_head'); } function wp_footer() { do_action('wp_footer'); } function rsd_link() { echo '\n"; } function wlwmanifest_link() { echo ' ' . "\n"; } function noindex() { // If the blog is not public, tell robots to go away. if ( '0' == get_option('blog_public') ) echo "\n"; } function rich_edit_exists() { global $wp_rich_edit_exists; if ( !isset($wp_rich_edit_exists) ) $wp_rich_edit_exists = file_exists(ABSPATH . WPINC . '/js/tinymce/tiny_mce.js'); return $wp_rich_edit_exists; } function user_can_richedit() { global $wp_rich_edit, $pagenow; if ( !isset( $wp_rich_edit) ) { if ( get_user_option( 'rich_editing' ) == 'true' && ( ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval($match[1]) >= 420 ) || !preg_match( '!opera[ /][2-8]|konqueror|safari!i', $_SERVER['HTTP_USER_AGENT'] ) ) && 'comment.php' != $pagenow ) { $wp_rich_edit = true; } else { $wp_rich_edit = false; } } return apply_filters('user_can_richedit', $wp_rich_edit); } function wp_default_editor() { $r = user_can_richedit() ? 'tinymce' : 'html'; // defaults if ( $user = wp_get_current_user() ) { // look for cookie if ( isset($_COOKIE['wordpress_editor_' . $user->ID]) && in_array($_COOKIE['wordpress_editor_' . $user->ID], array('tinymce', 'html', 'test') ) ) $r = $_COOKIE['wordpress_editor_' . $user->ID]; } return apply_filters( 'wp_default_editor', $r ); // filter } function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2) { $rows = get_option('default_post_edit_rows'); if (($rows < 3) || ($rows > 100)) $rows = 12; $rows = "rows='$rows'"; ?>
    \n"); $the_editor_content = apply_filters('the_editor_content', $content); printf($the_editor, $the_editor_content); ?> '%_%', // http://example.com/all_posts.php%_% : %_% is replaced by format (below) 'format' => '?page=%#%', // ?page=%#% : %#% is replaced by the page number 'total' => 1, 'current' => 0, 'show_all' => false, 'prev_next' => true, 'prev_text' => __('« Previous'), 'next_text' => __('Next »'), 'end_size' => 1, // How many numbers on either end including the end 'mid_size' => 2, // How many numbers to either side of current not including current 'type' => 'plain', 'add_args' => false // array of query args to aadd ); $args = wp_parse_args( $args, $defaults ); extract($args, EXTR_SKIP); // Who knows what else people pass in $args $total = (int) $total; if ( $total < 2 ) return; $current = (int) $current; $end_size = 0 < (int) $end_size ? (int) $end_size : 1; // Out of bounds? Make it the default. $mid_size = 0 <= (int) $mid_size ? (int) $mid_size : 2; $add_args = is_array($add_args) ? $add_args : false; $r = ''; $page_links = array(); $n = 0; $dots = false; if ( $prev_next && $current && 1 < $current ) : $link = str_replace('%_%', 2 == $current ? '' : $format, $base); $link = str_replace('%#%', $current - 1, $link); if ( $add_args ) $link = add_query_arg( $add_args, $link ); $page_links[] = ""; endif; for ( $n = 1; $n <= $total; $n++ ) : if ( $n == $current ) : $page_links[] = "$n"; $dots = true; else : if ( $show_all || ( $n <= $end_size || ( $current && $n >= $current - $mid_size && $n <= $current + $mid_size ) || $n > $total - $end_size ) ) : $link = str_replace('%_%', 1 == $n ? '' : $format, $base); $link = str_replace('%#%', $n, $link); if ( $add_args ) $link = add_query_arg( $add_args, $link ); $page_links[] = "$n"; $dots = true; elseif ( $dots && !$show_all ) : $page_links[] = "..."; $dots = false; endif; endif; endfor; if ( $prev_next && $current && ( $current < $total || -1 == $total ) ) : $link = str_replace('%_%', $format, $base); $link = str_replace('%#%', $current + 1, $link); if ( $add_args ) $link = add_query_arg( $add_args, $link ); $page_links[] = ""; endif; switch ( $type ) : case 'array' : return $page_links; break; case 'list' : $r .= "
      \n\t
    • "; $r .= join("
    • \n\t
    • ", $page_links); $r .= "
    • \n
    \n"; break; default : $r = join("\n", $page_links); break; endswitch; return $r; } function wp_admin_css_color($key, $name, $url, $colors = array()) { global $_wp_admin_css_colors; if ( !isset($_wp_admin_css_colors) ) $_wp_admin_css_colors = array(); $_wp_admin_css_colors[$key] = (object) array('name' => $name, 'url' => $url, 'colors' => $colors); } /** * wp_admin_css_uri() - Outputs the URL of a WordPress admin CSS file * * @see WP_Styles::_css_href and its style_loader_src filter. * * @param string $file file relative to wp-admin/ without its ".css" extension. */ function wp_admin_css_uri( $file = 'wp-admin' ) { if ( defined('WP_INSTALLING') ) { $_file = "./$file.css"; } else { $_file = admin_url("$file.css"); } $_file = add_query_arg( 'version', get_bloginfo( 'version' ), $_file ); return apply_filters( 'wp_admin_css_uri', $_file, $file ); } /** * wp_admin_css() - Enqueues or directly prints a stylesheet link to the specified CSS file. * * "Intelligently" decides to enqueue or to print the CSS file. * If the wp_print_styles action has *not* yet been called, the CSS file will be enqueued. * If the wp_print_styles action *has* been called, the CSS link will be printed. * Printing may be forced by passing TRUE as the $force_echo (second) parameter. * * For backward compatibility with WordPress 2.3 calling method: * If the $file (first) parameter does not correspond to a registered CSS file, we assume $file is a * file relative to wp-admin/ without its ".css" extension. A stylesheet link to that generated URL is printed. * * @package WordPress * @since 2.3 * * @uses $wp_styles WordPress Styles Object * * @param string $file Style handle name or file name (without ".css" extension) relative to wp-admin/ * @param bool $force_echo Optional. Force the stylesheet link to be printed rather than enqueued. */ function wp_admin_css( $file = 'wp-admin', $force_echo = false ) { global $wp_styles; if ( !is_a($wp_styles, 'WP_Styles') ) $wp_styles = new WP_Styles(); // For backward compatibility $handle = 0 === strpos( $file, 'css/' ) ? substr( $file, 4 ) : $file; if ( $wp_styles->query( $handle ) ) { if ( $force_echo || did_action( 'wp_print_styles' ) ) // we already printed the style queue. Print this one immediately wp_print_styles( $handle ); else // Add to style queue wp_enqueue_style( $handle ); return; } echo apply_filters( 'wp_admin_css', "\n", $file ); if ( 'rtl' == get_bloginfo( 'text_direction' ) ) echo apply_filters( 'wp_admin_css', "\n", "$file-rtl" ); } /** * Enqueues the default ThickBox js and css. * If any of the settings need to be changed, this can be done with another js file * similar to media-upload.js and theme-preview.js. That file should require array('thickbox') * to ensure it is loaded after. */ function add_thickbox() { wp_enqueue_script( 'thickbox' ); wp_enqueue_style( 'thickbox' ); } /** * Outputs the XHTML generator that is generated on the wp_head hook. */ function wp_generator() { the_generator( apply_filters( 'wp_generator_type', 'xhtml' ) ); } /** * Outputs the generator XML or Comment for RSS, ATOM, etc. * @param {String} $type The type of generator to return. */ function the_generator ( $type ) { echo apply_filters('the_generator',get_the_generator($type),$type) . "\n"; } /** * Creates the generator XML or Comment for RSS, ATOM, etc. * @param {String} $type The type of generator to return. */ function get_the_generator ( $type ) { switch ($type) { case 'html': $gen = '' . "\n"; break; case 'xhtml': $gen = '' . "\n"; break; case 'atom': $gen = 'WordPress'; break; case 'rss2': $gen = 'http://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . ''; break; case 'rdf': $gen = ''; break; case 'comment': $gen = ''; break; case 'export': $gen = ''; break; } return apply_filters( "get_the_generator_{$type}", $gen, $type ); } ?> wp/dev/wp-includes/vars.php0000644000106600010660000000474611041537052013131 0ustar wp/dev/wp-includes/functions.wp-styles.php0000644000106600010660000000216011021574456016127 0ustar do_items( $handles ); } function wp_register_style( $handle, $src, $deps = array(), $ver = false, $media = false ) { global $wp_styles; if ( !is_a($wp_styles, 'WP_Styles') ) $wp_styles = new WP_Styles(); $wp_styles->add( $handle, $src, $deps, $ver, $media ); } function wp_deregister_style( $handle ) { global $wp_styles; if ( !is_a($wp_styles, 'WP_Styles') ) $wp_styles = new WP_Styles(); $wp_styles->remove( $handle ); } function wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $media = false ) { global $wp_styles; if ( !is_a($wp_styles, 'WP_Styles') ) $wp_styles = new WP_Styles(); if ( $src ) { $_handle = explode('?', $handle); $wp_styles->add( $_handle[0], $src, $deps, $ver, $media ); } $wp_styles->enqueue( $handle ); } wp/dev/wp-includes/feed-rss2-comments.php0000644000106600010660000000471310765546356015610 0ustar '; ?> <?php if ( is_singular() ) printf(__('Comments on: %s'), get_the_title_rss()); elseif ( is_search() ) printf(__('Comments for %s searching on %s'), get_bloginfo_rss( 'name' ), attribute_escape($wp_query->query_vars['s'])); else printf(__('Comments for %s'), get_bloginfo_rss( 'name' ) . get_wp_title_rss()); ?> comment_post_ID); get_post_custom($comment_post->ID); ?> <?php if ( !is_singular() ) { $title = get_the_title($comment_post->ID); $title = apply_filters('the_title_rss', $title); printf(__('Comment on %1$s by %2$s'), $title, get_comment_author_rss()); } else { printf(__('By: %s'), get_comment_author_rss()); } ?> post_password) && $_COOKIE['wp-postpass'] != $comment_post->post_password) : ?> ]]> ]]> comment_ID, $comment_post->ID); ?> wp/dev/wp-includes/gettext.php0000644000106600010660000002615710737510563013653 0ustar . Copyright (c) 2005 Nico Kaiser This file is part of PHP-gettext. PHP-gettext is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. PHP-gettext 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 General Public License for more details. You should have received a copy of the GNU General Public License along with PHP-gettext; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * Provides a simple gettext replacement that works independently from * the system's gettext abilities. * It can read MO files and use them for translating strings. * The files are passed to gettext_reader as a Stream (see streams.php) * * This version has the ability to cache all strings and translations to * speed up the string lookup. * While the cache is enabled by default, it can be switched off with the * second parameter in the constructor (e.g. whenusing very large MO files * that you don't want to keep in memory) */ class gettext_reader { //public: var $error = 0; // public variable that holds error code (0 if no error) //private: var $BYTEORDER = 0; // 0: low endian, 1: big endian var $STREAM = NULL; var $short_circuit = false; var $enable_cache = false; var $originals = NULL; // offset of original table var $translations = NULL; // offset of translation table var $pluralheader = NULL; // cache header field for plural forms var $select_string_function = NULL; // cache function, which chooses plural forms var $total = 0; // total string count var $table_originals = NULL; // table for original strings (offsets) var $table_translations = NULL; // table for translated strings (offsets) var $cache_translations = NULL; // original -> translation mapping /* Methods */ /** * Reads a 32bit Integer from the Stream * * @access private * @return Integer from the Stream */ function readint() { if ($this->BYTEORDER == 0) { // low endian $low_end = unpack('V', $this->STREAM->read(4)); return array_shift($low_end); } else { // big endian $big_end = unpack('N', $this->STREAM->read(4)); return array_shift($big_end); } } /** * Reads an array of Integers from the Stream * * @param int count How many elements should be read * @return Array of Integers */ function readintarray($count) { if ($this->BYTEORDER == 0) { // low endian return unpack('V'.$count, $this->STREAM->read(4 * $count)); } else { // big endian return unpack('N'.$count, $this->STREAM->read(4 * $count)); } } /** * Constructor * * @param object Reader the StreamReader object * @param boolean enable_cache Enable or disable caching of strings (default on) */ function gettext_reader($Reader, $enable_cache = true) { // If there isn't a StreamReader, turn on short circuit mode. if (! $Reader || isset($Reader->error) ) { $this->short_circuit = true; return; } // Caching can be turned off $this->enable_cache = $enable_cache; // $MAGIC1 = (int)0x950412de; //bug in PHP 5.0.2, see https://savannah.nongnu.org/bugs/?func=detailitem&item_id=10565 $MAGIC1 = (int) - 1794895138; // $MAGIC2 = (int)0xde120495; //bug $MAGIC2 = (int) - 569244523; // 64-bit fix $MAGIC3 = (int) 2500072158; $this->STREAM = $Reader; $magic = $this->readint(); if ($magic == $MAGIC1 || $magic == $MAGIC3) { // to make sure it works for 64-bit platforms $this->BYTEORDER = 0; } elseif ($magic == ($MAGIC2 & 0xFFFFFFFF)) { $this->BYTEORDER = 1; } else { $this->error = 1; // not MO file return false; } // FIXME: Do we care about revision? We should. $revision = $this->readint(); $this->total = $this->readint(); $this->originals = $this->readint(); $this->translations = $this->readint(); } /** * Loads the translation tables from the MO file into the cache * If caching is enabled, also loads all strings into a cache * to speed up translation lookups * * @access private */ function load_tables() { if (is_array($this->cache_translations) && is_array($this->table_originals) && is_array($this->table_translations)) return; /* get original and translations tables */ $this->STREAM->seekto($this->originals); $this->table_originals = $this->readintarray($this->total * 2); $this->STREAM->seekto($this->translations); $this->table_translations = $this->readintarray($this->total * 2); if ($this->enable_cache) { $this->cache_translations = array (); /* read all strings in the cache */ for ($i = 0; $i < $this->total; $i++) { $this->STREAM->seekto($this->table_originals[$i * 2 + 2]); $original = $this->STREAM->read($this->table_originals[$i * 2 + 1]); $this->STREAM->seekto($this->table_translations[$i * 2 + 2]); $translation = $this->STREAM->read($this->table_translations[$i * 2 + 1]); $this->cache_translations[$original] = $translation; } } } /** * Returns a string from the "originals" table * * @access private * @param int num Offset number of original string * @return string Requested string if found, otherwise '' */ function get_original_string($num) { $length = $this->table_originals[$num * 2 + 1]; $offset = $this->table_originals[$num * 2 + 2]; if (! $length) return ''; $this->STREAM->seekto($offset); $data = $this->STREAM->read($length); return (string)$data; } /** * Returns a string from the "translations" table * * @access private * @param int num Offset number of original string * @return string Requested string if found, otherwise '' */ function get_translation_string($num) { $length = $this->table_translations[$num * 2 + 1]; $offset = $this->table_translations[$num * 2 + 2]; if (! $length) return ''; $this->STREAM->seekto($offset); $data = $this->STREAM->read($length); return (string)$data; } /** * Binary search for string * * @access private * @param string string * @param int start (internally used in recursive function) * @param int end (internally used in recursive function) * @return int string number (offset in originals table) */ function find_string($string, $start = -1, $end = -1) { if (($start == -1) or ($end == -1)) { // find_string is called with only one parameter, set start end end $start = 0; $end = $this->total; } if (abs($start - $end) <= 1) { // We're done, now we either found the string, or it doesn't exist $txt = $this->get_original_string($start); if ($string == $txt) return $start; else return -1; } else if ($start > $end) { // start > end -> turn around and start over return $this->find_string($string, $end, $start); } else { // Divide table in two parts $half = (int)(($start + $end) / 2); $cmp = strcmp($string, $this->get_original_string($half)); if ($cmp == 0) // string is exactly in the middle => return it return $half; else if ($cmp < 0) // The string is in the upper half return $this->find_string($string, $start, $half); else // The string is in the lower half return $this->find_string($string, $half, $end); } } /** * Translates a string * * @access public * @param string string to be translated * @return string translated string (or original, if not found) */ function translate($string) { if ($this->short_circuit) return $string; $this->load_tables(); if ($this->enable_cache) { // Caching enabled, get translated string from cache if (array_key_exists($string, $this->cache_translations)) return $this->cache_translations[$string]; else return $string; } else { // Caching not enabled, try to find string $num = $this->find_string($string); if ($num == -1) return $string; else return $this->get_translation_string($num); } } /** * Get possible plural forms from MO header * * @access private * @return string plural form header */ function get_plural_forms() { // lets assume message number 0 is header // this is true, right? $this->load_tables(); // cache header field for plural forms if (! is_string($this->pluralheader)) { if ($this->enable_cache) { $header = $this->cache_translations[""]; } else { $header = $this->get_translation_string(0); } $header .= "\n"; //make sure our regex matches if (eregi("plural-forms: ([^\n]*)\n", $header, $regs)) $expr = $regs[1]; else $expr = "nplurals=2; plural=n == 1 ? 0 : 1;"; // add parentheses // important since PHP's ternary evaluates from left to right $expr.= ';'; $res= ''; $p= 0; for ($i= 0; $i < strlen($expr); $i++) { $ch= $expr[$i]; switch ($ch) { case '?': $res.= ' ? ('; $p++; break; case ':': $res.= ') : ('; break; case ';': $res.= str_repeat( ')', $p) . ';'; $p= 0; break; default: $res.= $ch; } } $this->pluralheader = $res; } return $this->pluralheader; } /** * Detects which plural form to take * * @access private * @param n count * @return int array index of the right plural form */ function select_string($n) { if (is_null($this->select_string_function)) { $string = $this->get_plural_forms(); if (preg_match("/nplurals\s*=\s*(\d+)\s*\;\s*plural\s*=\s*(.*?)\;+/", $string, $matches)) { $nplurals = $matches[1]; $expression = $matches[2]; $expression = str_replace("n", '$n', $expression); } else { $nplurals = 2; $expression = ' $n == 1 ? 0 : 1 '; } $func_body = " \$plural = ($expression); return (\$plural <= $nplurals)? \$plural : \$plural - 1;"; $this->select_string_function = create_function('$n', $func_body); } return call_user_func($this->select_string_function, $n); } /** * Plural version of gettext * * @access public * @param string single * @param string plural * @param string number * @return translated plural form */ function ngettext($single, $plural, $number) { if ($this->short_circuit) { if ($number != 1) return $plural; else return $single; } // find out the appropriate form $select = $this->select_string($number); // this should contains all strings separated by NULLs $key = $single.chr(0).$plural; if ($this->enable_cache) { if (! array_key_exists($key, $this->cache_translations)) { return ($number != 1) ? $plural : $single; } else { $result = $this->cache_translations[$key]; $list = explode(chr(0), $result); return $list[$select]; } } else { $num = $this->find_string($key); if ($num == -1) { return ($number != 1) ? $plural : $single; } else { $result = $this->get_translation_string($num); $list = explode(chr(0), $result); return $list[$select]; } } } } ?>wp/dev/wp-includes/media.php0000644000106600010660000004251111047641230013225 0ustar tag. Empty values will be omitted. function image_hwstring($width, $height) { $out = ''; if ($width) $out .= 'width="'.intval($width).'" '; if ($height) $out .= 'height="'.intval($height).'" '; return $out; } // Scale an image to fit a particular size (such as 'thumb' or 'medium'), and return an image URL, height and width. // The URL might be the original image, or it might be a resized version. This function won't create a new resized copy, it will just return an already resized one if it exists. // returns an array($url, $width, $height) function image_downsize($id, $size = 'medium') { if ( !wp_attachment_is_image($id) ) return false; $img_url = wp_get_attachment_url($id); $meta = wp_get_attachment_metadata($id); $width = $height = 0; // plugins can use this to provide resize services if ( $out = apply_filters('image_downsize', false, $id, $size) ) return $out; // try for a new style intermediate size if ( $intermediate = image_get_intermediate_size($id, $size) ) { $img_url = str_replace(basename($img_url), $intermediate['file'], $img_url); $width = $intermediate['width']; $height = $intermediate['height']; } elseif ( $size == 'thumbnail' ) { // fall back to the old thumbnail if ( ($thumb_file = wp_get_attachment_thumb_file($id)) && $info = getimagesize($thumb_file) ) { $img_url = str_replace(basename($img_url), basename($thumb_file), $img_url); $width = $info[0]; $height = $info[1]; } } if ( !$width && !$height && isset($meta['width'], $meta['height']) ) { // any other type: use the real image and constrain it list( $width, $height ) = image_constrain_size_for_editor( $meta['width'], $meta['height'], $size ); } if ( $img_url) return array( $img_url, $width, $height ); return false; } /** * An tag for an image attachment, scaling it down if requested. * * {@internal Missing Long Description}} * * @uses apply_filters() The 'get_image_tag_class' filter is the IMG element * class attribute. * @uses apply_filters() The 'get_image_tag' filter is the full IMG element with * all attributes. * * @param int $id Attachment ID. * @param string $alt Image Description for the alt attribute. * @param string $title Image Description for the title attribute. * @param string $align Part of the class name for aligning the image. * @param string $size Optional. Default is 'medium'. * @return string HTML IMG element for given image attachment */ function get_image_tag($id, $alt, $title, $align, $size='medium') { list( $img_src, $width, $height ) = image_downsize($id, $size); $hwstring = image_hwstring($width, $height); $class = 'align'.attribute_escape($align).' size-'.attribute_escape($size).' wp-image-'.$id; $class = apply_filters('get_image_tag_class', $class, $id, $align, $size); $html = ''.attribute_escape($alt).''; $html = apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size ); return $html; } // same as wp_shrink_dimensions, except the max parameters are optional. // if either width or height are empty, no constraint is applied on that dimension. function wp_constrain_dimensions( $current_width, $current_height, $max_width=0, $max_height=0 ) { if ( !$max_width and !$max_height ) return array( $current_width, $current_height ); $width_ratio = $height_ratio = 1.0; if ( $max_width > 0 && $current_width > $max_width ) $width_ratio = $max_width / $current_width; if ( $max_height > 0 && $current_height > $max_height ) $height_ratio = $max_height / $current_height; // the smaller ratio is the one we need to fit it to the constraining box $ratio = min( $width_ratio, $height_ratio ); return array( intval($current_width * $ratio), intval($current_height * $ratio) ); } // calculate dimensions and coordinates for a resized image that fits within a specified width and height // if $crop is true, the largest matching central portion of the image will be cropped out and resized to the required size function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop=false) { if ($orig_w <= 0 || $orig_h <= 0) return false; // at least one of dest_w or dest_h must be specific if ($dest_w <= 0 && $dest_h <= 0) return false; if ( $crop ) { // crop the largest possible portion of the original image that we can size to $dest_w x $dest_h $aspect_ratio = $orig_w / $orig_h; $new_w = min($dest_w, $orig_w); $new_h = min($dest_h, $orig_h); if (!$new_w) { $new_w = intval($new_h * $aspect_ratio); } if (!$new_h) { $new_h = intval($new_w / $aspect_ratio); } $size_ratio = max($new_w / $orig_w, $new_h / $orig_h); $crop_w = ceil($new_w / $size_ratio); $crop_h = ceil($new_h / $size_ratio); $s_x = floor(($orig_w - $crop_w)/2); $s_y = floor(($orig_h - $crop_h)/2); } else { // don't crop, just resize using $dest_w x $dest_h as a maximum bounding box $crop_w = $orig_w; $crop_h = $orig_h; $s_x = 0; $s_y = 0; list( $new_w, $new_h ) = wp_constrain_dimensions( $orig_w, $orig_h, $dest_w, $dest_h ); } // if the resulting image would be the same size or larger we don't want to resize it if ($new_w >= $orig_w && $new_h >= $orig_h) return false; // the return array matches the parameters to imagecopyresampled() // int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h return array(0, 0, $s_x, $s_y, $new_w, $new_h, $crop_w, $crop_h); } // Scale down an image to fit a particular size and save a new copy of the image function image_resize( $file, $max_w, $max_h, $crop=false, $suffix=null, $dest_path=null, $jpeg_quality=90) { $image = wp_load_image( $file ); if ( !is_resource( $image ) ) return new WP_Error('error_loading_image', $image); list($orig_w, $orig_h, $orig_type) = getimagesize( $file ); $dims = image_resize_dimensions($orig_w, $orig_h, $max_w, $max_h, $crop); if (!$dims) return $dims; list($dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) = $dims; $newimage = imagecreatetruecolor( $dst_w, $dst_h); // preserve PNG transparency if ( IMAGETYPE_PNG == $orig_type && function_exists( 'imagealphablending' ) && function_exists( 'imagesavealpha' ) ) { imagealphablending( $newimage, false); imagesavealpha( $newimage, true); } imagecopyresampled( $newimage, $image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); // we don't need the original in memory anymore imagedestroy( $image ); // $suffix will be appended to the destination filename, just before the extension if ( !$suffix ) $suffix = "{$dst_w}x{$dst_h}"; $info = pathinfo($file); $dir = $info['dirname']; $ext = $info['extension']; $name = basename($file, ".{$ext}"); if ( !is_null($dest_path) and $_dest_path = realpath($dest_path) ) $dir = $_dest_path; $destfilename = "{$dir}/{$name}-{$suffix}.{$ext}"; if ( $orig_type == IMAGETYPE_GIF ) { if (!imagegif( $newimage, $destfilename ) ) return new WP_Error('resize_path_invalid', __( 'Resize path invalid' )); } elseif ( $orig_type == IMAGETYPE_PNG ) { if (!imagepng( $newimage, $destfilename ) ) return new WP_Error('resize_path_invalid', __( 'Resize path invalid' )); } else { // all other formats are converted to jpg $destfilename = "{$dir}/{$name}-{$suffix}.jpg"; if (!imagejpeg( $newimage, $destfilename, apply_filters( 'jpeg_quality', $jpeg_quality ) ) ) return new WP_Error('resize_path_invalid', __( 'Resize path invalid' )); } imagedestroy( $newimage ); // Set correct file permissions $stat = stat( dirname( $destfilename )); $perms = $stat['mode'] & 0000666; //same permissions as parent folder, strip off the executable bits @ chmod( $destfilename, $perms ); return $destfilename; } // resize an image to make a thumbnail or intermediate size, and return metadata describing the new copy // returns false if no image was created function image_make_intermediate_size($file, $width, $height, $crop=false) { if ( $width || $height ) { $resized_file = image_resize($file, $width, $height, $crop); if ( !is_wp_error($resized_file) && $resized_file && $info = getimagesize($resized_file) ) { $resized_file = apply_filters('image_make_intermediate_size', $resized_file); return array( 'file' => basename( $resized_file ), 'width' => $info[0], 'height' => $info[1], ); } } return false; } function image_get_intermediate_size($post_id, $size='thumbnail') { if ( !is_array( $imagedata = wp_get_attachment_metadata( $post_id ) ) ) return false; // get the best one for a specified set of dimensions if ( is_array($size) && !empty($imagedata['sizes']) ) { foreach ( $imagedata['sizes'] as $_size => $data ) { // already cropped to width or height; so use this size if ( ( $data['width'] == $size[0] && $data['height'] <= $size[1] ) || ( $data['height'] == $size[1] && $data['width'] <= $size[0] ) ) { $file = $data['file']; list($width, $height) = image_constrain_size_for_editor( $data['width'], $data['height'], $size ); return compact( 'file', 'width', 'height' ); } // add to lookup table: area => size $areas[$data['width'] * $data['height']] = $_size; } if ( !$size || !empty($areas) ) { // find for the smallest image not smaller than the desired size ksort($areas); foreach ( $areas as $_size ) { $data = $imagedata['sizes'][$_size]; if ( $data['width'] >= $size[0] || $data['height'] >= $size[1] ) { $file = $data['file']; list($width, $height) = image_constrain_size_for_editor( $data['width'], $data['height'], $size ); return compact( 'file', 'width', 'height' ); } } } } if ( is_array($size) || empty($size) || empty($imagedata['sizes'][$size]) ) return false; $data = $imagedata['sizes'][$size]; // include the full filesystem path of the intermediate file if ( empty($data['path']) && !empty($data['file']) ) { $file_url = wp_get_attachment_url($post_id); $data['path'] = path_join( dirname($imagedata['file']), $data['file'] ); $data['url'] = path_join( dirname($file_url), $data['file'] ); } return $data; } // get an image to represent an attachment - a mime icon for files, thumbnail or intermediate size for images // returns an array (url, width, height), or false if no image is available function wp_get_attachment_image_src($attachment_id, $size='thumbnail', $icon = false) { // get a thumbnail or intermediate image if there is one if ( $image = image_downsize($attachment_id, $size) ) return $image; if ( $icon && $src = wp_mime_type_icon($attachment_id) ) { $icon_dir = apply_filters( 'icon_dir', includes_url('images/crystal') ); $src_file = $icon_dir . '/' . basename($src); @list($width, $height) = getimagesize($src_file); } if ( $src && $width && $height ) return array( $src, $width, $height ); return false; } // as per wp_get_attachment_image_src, but returns an tag function wp_get_attachment_image($attachment_id, $size='thumbnail', $icon = false) { $html = ''; $image = wp_get_attachment_image_src($attachment_id, $size, $icon); if ( $image ) { list($src, $width, $height) = $image; $hwstring = image_hwstring($width, $height); if ( is_array($size) ) $size = join('x', $size); $html = ''; } return $html; } add_shortcode('wp_caption', 'img_caption_shortcode'); add_shortcode('caption', 'img_caption_shortcode'); function img_caption_shortcode($attr, $content = null) { // Allow plugins/themes to override the default caption template. $output = apply_filters('img_caption_shortcode', '', $attr, $content); if ( $output != '' ) return $output; extract(shortcode_atts(array( 'id' => '', 'align' => 'alignnone', 'width' => '', 'caption' => '' ), $attr)); if ( 1 > (int) $width || empty($caption) ) return $content; if ( $id ) $id = 'id="' . $id . '" '; return '
    ' . $content . '

    ' . $caption . '

    '; } add_shortcode('gallery', 'gallery_shortcode'); function gallery_shortcode($attr) { global $post; // Allow plugins/themes to override the default gallery template. $output = apply_filters('post_gallery', '', $attr); if ( $output != '' ) return $output; // We're trusting author input, so let's at least make sure it looks like a valid orderby statement if ( isset( $attr['orderby'] ) ) { $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] ); if ( !$attr['orderby'] ) unset( $attr['orderby'] ); } extract(shortcode_atts(array( 'order' => 'ASC', 'orderby' => 'menu_order ID', 'id' => $post->ID, 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' => 'dd', 'columns' => 3, 'size' => 'thumbnail', ), $attr)); $id = intval($id); $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); if ( empty($attachments) ) return ''; if ( is_feed() ) { $output = "\n"; foreach ( $attachments as $id => $attachment ) $output .= wp_get_attachment_link($id, $size, true) . "\n"; return $output; } $listtag = tag_escape($listtag); $itemtag = tag_escape($itemtag); $captiontag = tag_escape($captiontag); $columns = intval($columns); $itemwidth = $columns > 0 ? floor(100/$columns) : 100; $output = apply_filters('gallery_style', " \n"; return $output; } function previous_image_link() { adjacent_image_link(true); } function next_image_link() { adjacent_image_link(false); } function adjacent_image_link($prev = true) { global $post; $post = get_post($post); $attachments = array_values(get_children( array('post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') )); foreach ( $attachments as $k => $attachment ) if ( $attachment->ID == $post->ID ) break; $k = $prev ? $k - 1 : $k + 1; if ( isset($attachments[$k]) ) echo wp_get_attachment_link($attachments[$k]->ID, 'thumbnail', true); } function get_attachment_taxonomies($attachment) { if ( is_int( $attachment ) ) $attachment = get_post($attachment); else if ( is_array($attachment) ) $attachment = (object) $attachment; if ( ! is_object($attachment) ) return array(); $filename = basename($attachment->guid); $objects = array('attachment'); if ( false !== strpos($filename, '.') ) $objects[] = 'attachment:' . substr($filename, strrpos($filename, '.') + 1); if ( !empty($attachment->post_mime_type) ) { $objects[] = 'attachment:' . $attachment->post_mime_type; if ( false !== strpos($attachment->post_mime_type, '/') ) foreach ( explode('/', $attachment->post_mime_type) as $token ) if ( !empty($token) ) $objects[] = "attachment:$token"; } $taxonomies = array(); foreach ( $objects as $object ) if ( $taxes = get_object_taxonomies($object) ) $taxonomies = array_merge($taxonomies, $taxes); return array_unique($taxonomies); } ?> wp/dev/wp-includes/rss.php0000644000106600010660000005202011017045414012750 0ustar * @version 0.51 * @license GPL * * @package External * @subpackage MagpieRSS */ /* * Hook to use another RSS object instead of MagpieRSS */ do_action('load_feed_engine'); define('RSS', 'RSS'); define('ATOM', 'Atom'); define('MAGPIE_USER_AGENT', 'WordPress/' . $GLOBALS['wp_version']); class MagpieRSS { var $parser; var $current_item = array(); // item currently being parsed var $items = array(); // collection of parsed items var $channel = array(); // hash of channel fields var $textinput = array(); var $image = array(); var $feed_type; var $feed_version; // parser variables var $stack = array(); // parser stack var $inchannel = false; var $initem = false; var $incontent = false; // if in Atom field var $intextinput = false; var $inimage = false; var $current_field = ''; var $current_namespace = false; //var $ERROR = ""; var $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright'); function MagpieRSS ($source) { # if PHP xml isn't compiled in, die # if ( !function_exists('xml_parser_create') ) trigger_error( "Failed to load PHP's XML Extension. http://www.php.net/manual/en/ref.xml.php" ); $parser = @xml_parser_create(); if ( !is_resource($parser) ) trigger_error( "Failed to create an instance of PHP's XML parser. http://www.php.net/manual/en/ref.xml.php"); $this->parser = $parser; # pass in parser, and a reference to this object # setup handlers # xml_set_object( $this->parser, $this ); xml_set_element_handler($this->parser, 'feed_start_element', 'feed_end_element' ); xml_set_character_data_handler( $this->parser, 'feed_cdata' ); $status = xml_parse( $this->parser, $source ); if (! $status ) { $errorcode = xml_get_error_code( $this->parser ); if ( $errorcode != XML_ERROR_NONE ) { $xml_error = xml_error_string( $errorcode ); $error_line = xml_get_current_line_number($this->parser); $error_col = xml_get_current_column_number($this->parser); $errormsg = "$xml_error at line $error_line, column $error_col"; $this->error( $errormsg ); } } xml_parser_free( $this->parser ); $this->normalize(); } function feed_start_element($p, $element, &$attrs) { $el = $element = strtolower($element); $attrs = array_change_key_case($attrs, CASE_LOWER); // check for a namespace, and split if found $ns = false; if ( strpos( $element, ':' ) ) { list($ns, $el) = split( ':', $element, 2); } if ( $ns and $ns != 'rdf' ) { $this->current_namespace = $ns; } # if feed type isn't set, then this is first element of feed # identify feed from root element # if (!isset($this->feed_type) ) { if ( $el == 'rdf' ) { $this->feed_type = RSS; $this->feed_version = '1.0'; } elseif ( $el == 'rss' ) { $this->feed_type = RSS; $this->feed_version = $attrs['version']; } elseif ( $el == 'feed' ) { $this->feed_type = ATOM; $this->feed_version = $attrs['version']; $this->inchannel = true; } return; } if ( $el == 'channel' ) { $this->inchannel = true; } elseif ($el == 'item' or $el == 'entry' ) { $this->initem = true; if ( isset($attrs['rdf:about']) ) { $this->current_item['about'] = $attrs['rdf:about']; } } // if we're in the default namespace of an RSS feed, // record textinput or image fields elseif ( $this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' ) { $this->intextinput = true; } elseif ( $this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' ) { $this->inimage = true; } # handle atom content constructs elseif ( $this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) ) { // avoid clashing w/ RSS mod_content if ($el == 'content' ) { $el = 'atom_content'; } $this->incontent = $el; } // if inside an Atom content construct (e.g. content or summary) field treat tags as text elseif ($this->feed_type == ATOM and $this->incontent ) { // if tags are inlined, then flatten $attrs_str = join(' ', array_map('map_attrs', array_keys($attrs), array_values($attrs) ) ); $this->append_content( "<$element $attrs_str>" ); array_unshift( $this->stack, $el ); } // Atom support many links per containging element. // Magpie treats link elements of type rel='alternate' // as being equivalent to RSS's simple link element. // elseif ($this->feed_type == ATOM and $el == 'link' ) { if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' ) { $link_el = 'link'; } else { $link_el = 'link_' . $attrs['rel']; } $this->append($link_el, $attrs['href']); } // set stack[0] to current element else { array_unshift($this->stack, $el); } } function feed_cdata ($p, $text) { if ($this->feed_type == ATOM and $this->incontent) { $this->append_content( $text ); } else { $current_el = join('_', array_reverse($this->stack)); $this->append($current_el, $text); } } function feed_end_element ($p, $el) { $el = strtolower($el); if ( $el == 'item' or $el == 'entry' ) { $this->items[] = $this->current_item; $this->current_item = array(); $this->initem = false; } elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' ) { $this->intextinput = false; } elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' ) { $this->inimage = false; } elseif ($this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) ) { $this->incontent = false; } elseif ($el == 'channel' or $el == 'feed' ) { $this->inchannel = false; } elseif ($this->feed_type == ATOM and $this->incontent ) { // balance tags properly // note: i don't think this is actually neccessary if ( $this->stack[0] == $el ) { $this->append_content(""); } else { $this->append_content("<$el />"); } array_shift( $this->stack ); } else { array_shift( $this->stack ); } $this->current_namespace = false; } function concat (&$str1, $str2="") { if (!isset($str1) ) { $str1=""; } $str1 .= $str2; } function append_content($text) { if ( $this->initem ) { $this->concat( $this->current_item[ $this->incontent ], $text ); } elseif ( $this->inchannel ) { $this->concat( $this->channel[ $this->incontent ], $text ); } } // smart append - field and namespace aware function append($el, $text) { if (!$el) { return; } if ( $this->current_namespace ) { if ( $this->initem ) { $this->concat( $this->current_item[ $this->current_namespace ][ $el ], $text); } elseif ($this->inchannel) { $this->concat( $this->channel[ $this->current_namespace][ $el ], $text ); } elseif ($this->intextinput) { $this->concat( $this->textinput[ $this->current_namespace][ $el ], $text ); } elseif ($this->inimage) { $this->concat( $this->image[ $this->current_namespace ][ $el ], $text ); } } else { if ( $this->initem ) { $this->concat( $this->current_item[ $el ], $text); } elseif ($this->intextinput) { $this->concat( $this->textinput[ $el ], $text ); } elseif ($this->inimage) { $this->concat( $this->image[ $el ], $text ); } elseif ($this->inchannel) { $this->concat( $this->channel[ $el ], $text ); } } } function normalize () { // if atom populate rss fields if ( $this->is_atom() ) { $this->channel['descripton'] = $this->channel['tagline']; for ( $i = 0; $i < count($this->items); $i++) { $item = $this->items[$i]; if ( isset($item['summary']) ) $item['description'] = $item['summary']; if ( isset($item['atom_content'])) $item['content']['encoded'] = $item['atom_content']; $this->items[$i] = $item; } } elseif ( $this->is_rss() ) { $this->channel['tagline'] = $this->channel['description']; for ( $i = 0; $i < count($this->items); $i++) { $item = $this->items[$i]; if ( isset($item['description'])) $item['summary'] = $item['description']; if ( isset($item['content']['encoded'] ) ) $item['atom_content'] = $item['content']['encoded']; $this->items[$i] = $item; } } } function is_rss () { if ( $this->feed_type == RSS ) { return $this->feed_version; } else { return false; } } function is_atom() { if ( $this->feed_type == ATOM ) { return $this->feed_version; } else { return false; } } function map_attrs($k, $v) { return "$k=\"$v\""; } function error( $errormsg, $lvl = E_USER_WARNING ) { // append PHP's error message if track_errors enabled if ( isset($php_errormsg) ) { $errormsg .= " ($php_errormsg)"; } if ( MAGPIE_DEBUG ) { trigger_error( $errormsg, $lvl); } else { error_log( $errormsg, 0); } } } require_once( dirname(__FILE__) . '/class-snoopy.php'); if ( !function_exists('fetch_rss') ) : function fetch_rss ($url) { // initialize constants init(); if ( !isset($url) ) { // error("fetch_rss called without a url"); return false; } // if cache is disabled if ( !MAGPIE_CACHE_ON ) { // fetch file, and parse it $resp = _fetch_remote_file( $url ); if ( is_success( $resp->status ) ) { return _response_to_rss( $resp ); } else { // error("Failed to fetch $url and cache is off"); return false; } } // else cache is ON else { // Flow // 1. check cache // 2. if there is a hit, make sure its fresh // 3. if cached obj fails freshness check, fetch remote // 4. if remote fails, return stale object, or error $cache = new RSSCache( MAGPIE_CACHE_DIR, MAGPIE_CACHE_AGE ); if (MAGPIE_DEBUG and $cache->ERROR) { debug($cache->ERROR, E_USER_WARNING); } $cache_status = 0; // response of check_cache $request_headers = array(); // HTTP headers to send with fetch $rss = 0; // parsed RSS object $errormsg = 0; // errors, if any if (!$cache->ERROR) { // return cache HIT, MISS, or STALE $cache_status = $cache->check_cache( $url ); } // if object cached, and cache is fresh, return cached obj if ( $cache_status == 'HIT' ) { $rss = $cache->get( $url ); if ( isset($rss) and $rss ) { $rss->from_cache = 1; if ( MAGPIE_DEBUG > 1) { debug("MagpieRSS: Cache HIT", E_USER_NOTICE); } return $rss; } } // else attempt a conditional get // setup headers if ( $cache_status == 'STALE' ) { $rss = $cache->get( $url ); if ( $rss->etag and $rss->last_modified ) { $request_headers['If-None-Match'] = $rss->etag; $request_headers['If-Last-Modified'] = $rss->last_modified; } } $resp = _fetch_remote_file( $url, $request_headers ); if (isset($resp) and $resp) { if ($resp->status == '304' ) { // we have the most current copy if ( MAGPIE_DEBUG > 1) { debug("Got 304 for $url"); } // reset cache on 304 (at minutillo insistent prodding) $cache->set($url, $rss); return $rss; } elseif ( is_success( $resp->status ) ) { $rss = _response_to_rss( $resp ); if ( $rss ) { if (MAGPIE_DEBUG > 1) { debug("Fetch successful"); } // add object to cache $cache->set( $url, $rss ); return $rss; } } else { $errormsg = "Failed to fetch $url. "; if ( $resp->error ) { # compensate for Snoopy's annoying habbit to tacking # on '\n' $http_error = substr($resp->error, 0, -2); $errormsg .= "(HTTP Error: $http_error)"; } else { $errormsg .= "(HTTP Response: " . $resp->response_code .')'; } } } else { $errormsg = "Unable to retrieve RSS file for unknown reasons."; } // else fetch failed // attempt to return cached object if ($rss) { if ( MAGPIE_DEBUG ) { debug("Returning STALE object for $url"); } return $rss; } // else we totally failed // error( $errormsg ); return false; } // end if ( !MAGPIE_CACHE_ON ) { } // end fetch_rss() endif; function _fetch_remote_file ($url, $headers = "" ) { // Snoopy is an HTTP client in PHP $client = new Snoopy(); $client->agent = MAGPIE_USER_AGENT; $client->read_timeout = MAGPIE_FETCH_TIME_OUT; $client->use_gzip = MAGPIE_USE_GZIP; if (is_array($headers) ) { $client->rawheaders = $headers; } @$client->fetch($url); return $client; } function _response_to_rss ($resp) { $rss = new MagpieRSS( $resp->results ); // if RSS parsed successfully if ( $rss and !$rss->ERROR) { // find Etag, and Last-Modified foreach($resp->headers as $h) { // 2003-03-02 - Nicola Asuni (www.tecnick.com) - fixed bug "Undefined offset: 1" if (strpos($h, ": ")) { list($field, $val) = explode(": ", $h, 2); } else { $field = $h; $val = ""; } if ( $field == 'ETag' ) { $rss->etag = $val; } if ( $field == 'Last-Modified' ) { $rss->last_modified = $val; } } return $rss; } // else construct error message else { $errormsg = "Failed to parse RSS file."; if ($rss) { $errormsg .= " (" . $rss->ERROR . ")"; } // error($errormsg); return false; } // end if ($rss and !$rss->error) } /*=======================================================================*\ Function: init Purpose: setup constants with default values check for user overrides \*=======================================================================*/ function init () { if ( defined('MAGPIE_INITALIZED') ) { return; } else { define('MAGPIE_INITALIZED', 1); } if ( !defined('MAGPIE_CACHE_ON') ) { define('MAGPIE_CACHE_ON', 1); } if ( !defined('MAGPIE_CACHE_DIR') ) { define('MAGPIE_CACHE_DIR', './cache'); } if ( !defined('MAGPIE_CACHE_AGE') ) { define('MAGPIE_CACHE_AGE', 60*60); // one hour } if ( !defined('MAGPIE_CACHE_FRESH_ONLY') ) { define('MAGPIE_CACHE_FRESH_ONLY', 0); } if ( !defined('MAGPIE_DEBUG') ) { define('MAGPIE_DEBUG', 0); } if ( !defined('MAGPIE_USER_AGENT') ) { $ua = 'WordPress/' . $GLOBALS['wp_version']; if ( MAGPIE_CACHE_ON ) { $ua = $ua . ')'; } else { $ua = $ua . '; No cache)'; } define('MAGPIE_USER_AGENT', $ua); } if ( !defined('MAGPIE_FETCH_TIME_OUT') ) { define('MAGPIE_FETCH_TIME_OUT', 2); // 2 second timeout } // use gzip encoding to fetch rss files if supported? if ( !defined('MAGPIE_USE_GZIP') ) { define('MAGPIE_USE_GZIP', true); } } function is_info ($sc) { return $sc >= 100 && $sc < 200; } function is_success ($sc) { return $sc >= 200 && $sc < 300; } function is_redirect ($sc) { return $sc >= 300 && $sc < 400; } function is_error ($sc) { return $sc >= 400 && $sc < 600; } function is_client_error ($sc) { return $sc >= 400 && $sc < 500; } function is_server_error ($sc) { return $sc >= 500 && $sc < 600; } class RSSCache { var $BASE_CACHE; // where the cache files are stored var $MAX_AGE = 43200; // when are files stale, default twelve hours var $ERROR = ''; // accumulate error messages function RSSCache ($base='', $age='') { $this->BASE_CACHE = WP_CONTENT_DIR . '/cache'; if ( $base ) { $this->BASE_CACHE = $base; } if ( $age ) { $this->MAX_AGE = $age; } } /*=======================================================================*\ Function: set Purpose: add an item to the cache, keyed on url Input: url from wich the rss file was fetched Output: true on sucess \*=======================================================================*/ function set ($url, $rss) { global $wpdb; $cache_option = 'rss_' . $this->file_name( $url ); $cache_timestamp = 'rss_' . $this->file_name( $url ) . '_ts'; // shouldn't these be using get_option() ? if ( !$wpdb->get_var( $wpdb->prepare( "SELECT option_name FROM $wpdb->options WHERE option_name = %s", $cache_option ) ) ) add_option($cache_option, '', '', 'no'); if ( !$wpdb->get_var( $wpdb->prepare( "SELECT option_name FROM $wpdb->options WHERE option_name = %s", $cache_timestamp ) ) ) add_option($cache_timestamp, '', '', 'no'); update_option($cache_option, $rss); update_option($cache_timestamp, time() ); return $cache_option; } /*=======================================================================*\ Function: get Purpose: fetch an item from the cache Input: url from wich the rss file was fetched Output: cached object on HIT, false on MISS \*=======================================================================*/ function get ($url) { $this->ERROR = ""; $cache_option = 'rss_' . $this->file_name( $url ); if ( ! get_option( $cache_option ) ) { $this->debug( "Cache doesn't contain: $url (cache option: $cache_option)" ); return 0; } $rss = get_option( $cache_option ); return $rss; } /*=======================================================================*\ Function: check_cache Purpose: check a url for membership in the cache and whether the object is older then MAX_AGE (ie. STALE) Input: url from wich the rss file was fetched Output: cached object on HIT, false on MISS \*=======================================================================*/ function check_cache ( $url ) { $this->ERROR = ""; $cache_option = $this->file_name( $url ); $cache_timestamp = 'rss_' . $this->file_name( $url ) . '_ts'; if ( $mtime = get_option($cache_timestamp) ) { // find how long ago the file was added to the cache // and whether that is longer then MAX_AGE $age = time() - $mtime; if ( $this->MAX_AGE > $age ) { // object exists and is current return 'HIT'; } else { // object exists but is old return 'STALE'; } } else { // object does not exist return 'MISS'; } } /*=======================================================================*\ Function: serialize \*=======================================================================*/ function serialize ( $rss ) { return serialize( $rss ); } /*=======================================================================*\ Function: unserialize \*=======================================================================*/ function unserialize ( $data ) { return unserialize( $data ); } /*=======================================================================*\ Function: file_name Purpose: map url to location in cache Input: url from wich the rss file was fetched Output: a file name \*=======================================================================*/ function file_name ($url) { return md5( $url ); } /*=======================================================================*\ Function: error Purpose: register error \*=======================================================================*/ function error ($errormsg, $lvl=E_USER_WARNING) { // append PHP's error message if track_errors enabled if ( isset($php_errormsg) ) { $errormsg .= " ($php_errormsg)"; } $this->ERROR = $errormsg; if ( MAGPIE_DEBUG ) { trigger_error( $errormsg, $lvl); } else { error_log( $errormsg, 0); } } function debug ($debugmsg, $lvl=E_USER_NOTICE) { if ( MAGPIE_DEBUG ) { $this->error("MagpieRSS [debug] $debugmsg", $lvl); } } } if ( !function_exists('parse_w3cdtf') ) : function parse_w3cdtf ( $date_str ) { # regex to match wc3dtf $pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/"; if ( preg_match( $pat, $date_str, $match ) ) { list( $year, $month, $day, $hours, $minutes, $seconds) = array( $match[1], $match[2], $match[3], $match[4], $match[5], $match[7]); # calc epoch for current date assuming GMT $epoch = gmmktime( $hours, $minutes, $seconds, $month, $day, $year); $offset = 0; if ( $match[11] == 'Z' ) { # zulu time, aka GMT } else { list( $tz_mod, $tz_hour, $tz_min ) = array( $match[8], $match[9], $match[10]); # zero out the variables if ( ! $tz_hour ) { $tz_hour = 0; } if ( ! $tz_min ) { $tz_min = 0; } $offset_secs = (($tz_hour*60)+$tz_min)*60; # is timezone ahead of GMT? then subtract offset # if ( $tz_mod == '+' ) { $offset_secs = $offset_secs * -1; } $offset = $offset_secs; } $epoch = $epoch + $offset; return $epoch; } else { return -1; } } endif; if ( !function_exists('wp_rss') ) : function wp_rss( $url, $num_items = -1 ) { if ( $rss = fetch_rss( $url ) ) { echo '
      '; if ( $num_items !== -1 ) { $rss->items = array_slice( $rss->items, 0, $num_items ); } foreach ( $rss->items as $item ) { printf( '
    • %3$s
    • ', clean_url( $item['link'] ), attribute_escape( strip_tags( $item['description'] ) ), htmlentities( $item['title'] ) ); } echo '
    '; } else { _e( 'An error has occurred, which probably means the feed is down. Try again later.' ); } } endif; if ( !function_exists('get_rss') ) : function get_rss ($url, $num_items = 5) { // Like get posts, but for RSS $rss = fetch_rss($url); if ( $rss ) { $rss->items = array_slice($rss->items, 0, $num_items); foreach ($rss->items as $item ) { echo "
  • \n"; echo ""; echo htmlentities($item['title']); echo "
    \n"; echo "
  • \n"; } } else { return false; } } endif; ?>wp/dev/wp-includes/link-template.php0000644000106600010660000006257411043454271014732 0ustar use_trailing_slashes ) $string = trailingslashit($string); else $string = untrailingslashit($string); // Note that $type_of_url can be one of following: // single, single_trackback, single_feed, single_paged, feed, category, page, year, month, day, paged $string = apply_filters('user_trailingslashit', $string, $type_of_url); return $string; } function permalink_anchor($mode = 'id') { global $post; switch ( strtolower($mode) ) { case 'title': $title = sanitize_title($post->post_title) . '-' . $post->ID; echo ''; break; case 'id': default: echo ''; break; } } function get_permalink($id = 0, $leavename=false) { $rewritecode = array( '%year%', '%monthnum%', '%day%', '%hour%', '%minute%', '%second%', $leavename? '' : '%postname%', '%post_id%', '%category%', '%author%', $leavename? '' : '%pagename%', ); $post = &get_post($id); if ( empty($post->ID) ) return FALSE; if ( $post->post_type == 'page' ) return get_page_link($post->ID, $leavename); elseif ($post->post_type == 'attachment') return get_attachment_link($post->ID); $permalink = get_option('permalink_structure'); if ( '' != $permalink && !in_array($post->post_status, array('draft', 'pending')) ) { $unixtime = strtotime($post->post_date); $category = ''; if ( strpos($permalink, '%category%') !== false ) { $cats = get_the_category($post->ID); if ( $cats ) usort($cats, '_usort_terms_by_ID'); // order by ID $category = $cats[0]->slug; if ( $parent=$cats[0]->parent ) $category = get_category_parents($parent, FALSE, '/', TRUE) . $category; // show default category in permalinks, without // having to assign it explicitly if ( empty($category) ) { $default_category = get_category( get_option( 'default_category' ) ); $category = is_wp_error( $default_category ) ? '' : $default_category->slug; } } $author = ''; if ( strpos($permalink, '%author%') !== false ) { $authordata = get_userdata($post->post_author); $author = $authordata->user_nicename; } $date = explode(" ",date('Y m d H i s', $unixtime)); $rewritereplace = array( $date[0], $date[1], $date[2], $date[3], $date[4], $date[5], $post->post_name, $post->ID, $category, $author, $post->post_name, ); $permalink = get_option('home') . str_replace($rewritecode, $rewritereplace, $permalink); $permalink = user_trailingslashit($permalink, 'single'); return apply_filters('post_link', $permalink, $post); } else { // if they're not using the fancy permalink option $permalink = get_option('home') . '/?p=' . $post->ID; return apply_filters('post_link', $permalink, $post); } } // get permalink from post ID function post_permalink($post_id = 0, $deprecated = '') { return get_permalink($post_id); } // Respects page_on_front. Use this one. function get_page_link($id = false, $leavename = false) { global $post; $id = (int) $id; if ( !$id ) $id = (int) $post->ID; if ( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) $link = get_option('home'); else $link = _get_page_link( $id , $leavename ); return apply_filters('page_link', $link, $id); } // Ignores page_on_front. Internal use only. function _get_page_link( $id = false, $leavename = false ) { global $post, $wp_rewrite; if ( !$id ) $id = (int) $post->ID; else $post = &get_post($id); $pagestruct = $wp_rewrite->get_page_permastruct(); if ( '' != $pagestruct && isset($post->post_status) && 'draft' != $post->post_status ) { $link = get_page_uri($id); $link = ( $leavename ) ? $pagestruct : str_replace('%pagename%', $link, $pagestruct); $link = get_option('home') . "/$link"; $link = user_trailingslashit($link, 'page'); } else { $link = get_option('home') . "/?page_id=$id"; } return apply_filters( '_get_page_link', $link, $id ); } function get_attachment_link($id = false) { global $post, $wp_rewrite; $link = false; if (! $id) { $id = (int) $post->ID; } $object = get_post($id); if ( $wp_rewrite->using_permalinks() && ($object->post_parent > 0) && ($object->post_parent != $id) ) { $parent = get_post($object->post_parent); if ( 'page' == $parent->post_type ) $parentlink = _get_page_link( $object->post_parent ); // Ignores page_on_front else $parentlink = get_permalink( $object->post_parent ); if ( is_numeric($object->post_name) || false !== strpos(get_option('permalink_structure'), '%category%') ) $name = 'attachment/' . $object->post_name; // // is paged so we use the explicit attachment marker else $name = $object->post_name; if (strpos($parentlink, '?') === false) $link = user_trailingslashit( trailingslashit($parentlink) . $name ); } if (! $link ) { $link = get_bloginfo('url') . "/?attachment_id=$id"; } return apply_filters('attachment_link', $link, $id); } function get_year_link($year) { global $wp_rewrite; if ( !$year ) $year = gmdate('Y', time()+(get_option('gmt_offset') * 3600)); $yearlink = $wp_rewrite->get_year_permastruct(); if ( !empty($yearlink) ) { $yearlink = str_replace('%year%', $year, $yearlink); return apply_filters('year_link', get_option('home') . user_trailingslashit($yearlink, 'year'), $year); } else { return apply_filters('year_link', get_option('home') . '/?m=' . $year, $year); } } function get_month_link($year, $month) { global $wp_rewrite; if ( !$year ) $year = gmdate('Y', time()+(get_option('gmt_offset') * 3600)); if ( !$month ) $month = gmdate('m', time()+(get_option('gmt_offset') * 3600)); $monthlink = $wp_rewrite->get_month_permastruct(); if ( !empty($monthlink) ) { $monthlink = str_replace('%year%', $year, $monthlink); $monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink); return apply_filters('month_link', get_option('home') . user_trailingslashit($monthlink, 'month'), $year, $month); } else { return apply_filters('month_link', get_option('home') . '/?m=' . $year . zeroise($month, 2), $year, $month); } } function get_day_link($year, $month, $day) { global $wp_rewrite; if ( !$year ) $year = gmdate('Y', time()+(get_option('gmt_offset') * 3600)); if ( !$month ) $month = gmdate('m', time()+(get_option('gmt_offset') * 3600)); if ( !$day ) $day = gmdate('j', time()+(get_option('gmt_offset') * 3600)); $daylink = $wp_rewrite->get_day_permastruct(); if ( !empty($daylink) ) { $daylink = str_replace('%year%', $year, $daylink); $daylink = str_replace('%monthnum%', zeroise(intval($month), 2), $daylink); $daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink); return apply_filters('day_link', get_option('home') . user_trailingslashit($daylink, 'day'), $year, $month, $day); } else { return apply_filters('day_link', get_option('home') . '/?m=' . $year . zeroise($month, 2) . zeroise($day, 2), $year, $month, $day); } } function get_feed_link($feed = '') { global $wp_rewrite; $permalink = $wp_rewrite->get_feed_permastruct(); if ( '' != $permalink ) { if ( false !== strpos($feed, 'comments_') ) { $feed = str_replace('comments_', '', $feed); $permalink = $wp_rewrite->get_comment_feed_permastruct(); } if ( get_default_feed() == $feed ) $feed = ''; $permalink = str_replace('%feed%', $feed, $permalink); $permalink = preg_replace('#/+#', '/', "/$permalink"); $output = get_option('home') . user_trailingslashit($permalink, 'feed'); } else { if ( empty($feed) ) $feed = get_default_feed(); if ( false !== strpos($feed, 'comments_') ) $feed = str_replace('comments_', 'comments-', $feed); $output = get_option('home') . "/?feed={$feed}"; } return apply_filters('feed_link', $output, $feed); } function get_post_comments_feed_link($post_id = '', $feed = '') { global $id; if ( empty($post_id) ) $post_id = (int) $id; if ( empty($feed) ) $feed = get_default_feed(); if ( '' != get_option('permalink_structure') ) { $url = trailingslashit( get_permalink($post_id) ) . 'feed'; if ( $feed != get_default_feed() ) $url .= "/$feed"; $url = user_trailingslashit($url, 'single_feed'); } else { $type = get_post_field('post_type', $post_id); if ( 'page' == $type ) $url = get_option('home') . "/?feed=$feed&page_id=$post_id"; else $url = get_option('home') . "/?feed=$feed&p=$post_id"; } return apply_filters('post_comments_feed_link', $url); } /** post_comments_feed_link() - Output the comment feed link for a post. * * Prints out the comment feed link for a post. Link text is placed in the * anchor. If no link text is specified, default text is used. If no post ID * is specified, the current post is used. * * @package WordPress * @subpackage Feed * @since 2.5 * * @param string Descriptive text * @param int Optional post ID. Default to current post. * @return string Link to the comment feed for the current post */ function post_comments_feed_link( $link_text = '', $post_id = '', $feed = '' ) { $url = get_post_comments_feed_link($post_id, $feed); if ( empty($link_text) ) $link_text = __('Comments Feed'); echo "$link_text"; } function get_author_feed_link( $author_id, $feed = '' ) { $author_id = (int) $author_id; $permalink_structure = get_option('permalink_structure'); if ( empty($feed) ) $feed = get_default_feed(); if ( '' == $permalink_structure ) { $link = get_option('home') . '?feed=rss2&author=' . $author_id; } else { $link = get_author_posts_url($author_id); $link = trailingslashit($link) . user_trailingslashit('feed', 'feed'); } $link = apply_filters('author_feed_link', $link); return $link; } /** get_category_feed_link() - Get the feed link for a given category * * Returns a link to the feed for all post in a given category. A specific feed can be requested * or left blank to get the default feed. * * @package WordPress * @subpackage Feed * @since 2.5 * * @param int $cat_id ID of a category * @param string $feed Feed type * @return string Link to the feed for the category specified by $cat_id */ function get_category_feed_link($cat_id, $feed = '') { $cat_id = (int) $cat_id; $category = get_category($cat_id); if ( empty($category) || is_wp_error($category) ) return false; if ( empty($feed) ) $feed = get_default_feed(); $permalink_structure = get_option('permalink_structure'); if ( '' == $permalink_structure ) { $link = get_option('home') . "?feed=$feed&cat=" . $cat_id; } else { $link = get_category_link($cat_id); if( $feed == get_default_feed() ) $feed_link = 'feed'; else $feed_link = "feed/$feed"; $link = trailingslashit($link) . user_trailingslashit($feed_link, 'feed'); } $link = apply_filters('category_feed_link', $link, $feed); return $link; } function get_tag_feed_link($tag_id, $feed = '') { $tag_id = (int) $tag_id; $tag = get_tag($tag_id); if ( empty($tag) || is_wp_error($tag) ) return false; $permalink_structure = get_option('permalink_structure'); if ( empty($feed) ) $feed = get_default_feed(); if ( '' == $permalink_structure ) { $link = get_option('home') . "?feed=$feed&tag=" . $tag->slug; } else { $link = get_tag_link($tag->term_id); if ( $feed == get_default_feed() ) $feed_link = 'feed'; else $feed_link = "feed/$feed"; $link = trailingslashit($link) . user_trailingslashit($feed_link, 'feed'); } $link = apply_filters('tag_feed_link', $link, $feed); return $link; } function get_search_feed_link($search_query = '', $feed = '') { if ( empty($search_query) ) $search = attribute_escape(get_search_query()); else $search = attribute_escape(stripslashes($search_query)); if ( empty($feed) ) $feed = get_default_feed(); $link = get_option('home') . "?s=$search&feed=$feed"; $link = apply_filters('search_feed_link', $link); return $link; } function get_search_comments_feed_link($search_query = '', $feed = '') { if ( empty($search_query) ) $search = attribute_escape(get_search_query()); else $search = attribute_escape(stripslashes($search_query)); if ( empty($feed) ) $feed = get_default_feed(); $link = get_option('home') . "?s=$search&feed=comments-$feed"; $link = apply_filters('search_feed_link', $link); return $link; } function get_edit_post_link( $id = 0, $context = 'display' ) { if ( !$post = &get_post( $id ) ) return; if ( 'display' == $context ) $action = 'action=edit&'; else $action = 'action=edit&'; switch ( $post->post_type ) : case 'page' : if ( !current_user_can( 'edit_page', $post->ID ) ) return; $file = 'page'; $var = 'post'; break; case 'attachment' : if ( !current_user_can( 'edit_post', $post->ID ) ) return; $file = 'media'; $var = 'attachment_id'; break; case 'revision' : if ( !current_user_can( 'edit_post', $post->ID ) ) return; $file = 'revision'; $var = 'revision'; $action = ''; break; default : if ( !current_user_can( 'edit_post', $post->ID ) ) return; $file = 'post'; $var = 'post'; break; endswitch; return apply_filters( 'get_edit_post_link', admin_url("$file.php?{$action}$var=$post->ID"), $post->ID, $context ); } function edit_post_link( $link = 'Edit This', $before = '', $after = '' ) { global $post; if ( $post->post_type == 'page' ) { if ( !current_user_can( 'edit_page', $post->ID ) ) return; } else { if ( !current_user_can( 'edit_post', $post->ID ) ) return; } $link = '' . $link . ''; echo $before . apply_filters( 'edit_post_link', $link, $post->ID ) . $after; } function get_edit_comment_link( $comment_id = 0 ) { $comment = &get_comment( $comment_id ); $post = &get_post( $comment->comment_post_ID ); if ( $post->post_type == 'page' ) { if ( !current_user_can( 'edit_page', $post->ID ) ) return; } else { if ( !current_user_can( 'edit_post', $post->ID ) ) return; } $location = admin_url('comment.php?action=editcomment&c=') . $comment->comment_ID; return apply_filters( 'get_edit_comment_link', $location ); } function edit_comment_link( $link = 'Edit This', $before = '', $after = '' ) { global $comment, $post; if ( $post->post_type == 'attachment' ) { } elseif ( $post->post_type == 'page' ) { if ( !current_user_can( 'edit_page', $post->ID ) ) return; } else { if ( !current_user_can( 'edit_post', $post->ID ) ) return; } $link = '' . $link . ''; echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after; } // Navigation links function get_previous_post($in_same_cat = false, $excluded_categories = '') { return get_adjacent_post($in_same_cat, $excluded_categories); } function get_next_post($in_same_cat = false, $excluded_categories = '') { return get_adjacent_post($in_same_cat, $excluded_categories, false); } function get_adjacent_post($in_same_cat = false, $excluded_categories = '', $previous = true) { global $post, $wpdb; if( empty($post) || !is_single() || is_attachment() ) return null; $current_post_date = $post->post_date; $join = ''; $posts_in_ex_cats_sql = ''; if ( $in_same_cat || !empty($excluded_categories) ) { $join = " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id"; if ( $in_same_cat ) { $cat_array = wp_get_object_terms($post->ID, 'category', 'fields=ids'); $join .= " AND tt.taxonomy = 'category' AND tt.term_id IN (" . implode($cat_array, ',') . ')'; } $posts_in_ex_cats_sql = "AND tt.taxonomy = 'category'"; if ( !empty($excluded_categories) ) { $excluded_categories = array_map('intval', explode(' and ', $excluded_categories)); if ( !empty($cat_array) ) { $excluded_categories = array_diff($excluded_categories, $cat_array); $posts_in_ex_cats_sql = ''; } if ( !empty($excluded_categories) ) { $posts_in_ex_cats_sql = " AND tt.taxonomy = 'category' AND tt.term_id NOT IN (" . implode($excluded_categories, ',') . ')'; } } } $adjacent = $previous ? 'previous' : 'next'; $op = $previous ? '<' : '>'; $order = $previous ? 'DESC' : 'ASC'; $join = apply_filters( "get_{$adjacent}_post_join", $join, $in_same_cat, $excluded_categories ); $where = apply_filters( "get_{$adjacent}_post_where", $wpdb->prepare("WHERE p.post_date $op %s AND p.post_type = 'post' AND p.post_status = 'publish' $posts_in_ex_cats_sql", $current_post_date), $in_same_cat, $excluded_categories ); $sort = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1" ); return $wpdb->get_row("SELECT p.* FROM $wpdb->posts AS p $join $where $sort"); } function previous_post_link($format='« %link', $link='%title', $in_same_cat = false, $excluded_categories = '') { adjacent_post_link($format, $link, $in_same_cat, $excluded_categories, true); } function next_post_link($format='%link »', $link='%title', $in_same_cat = false, $excluded_categories = '') { adjacent_post_link($format, $link, $in_same_cat, $excluded_categories, false); } function adjacent_post_link($format, $link, $in_same_cat = false, $excluded_categories = '', $previous = true) { if ( $previous && is_attachment() ) $post = & get_post($GLOBALS['post']->post_parent); else $post = get_adjacent_post($in_same_cat, $excluded_categories, $previous); if ( !$post ) return; $title = $post->post_title; if ( empty($post->post_title) ) $title = $previous ? __('Previous Post') : __('Next Post'); $title = apply_filters('the_title', $title, $post); $string = ''; $link = str_replace('%title', $title, $link); $link = $string . $link . ''; $format = str_replace('%link', $link, $format); $adjacent = $previous ? 'previous' : 'next'; echo apply_filters( "{$adjacent}_post_link", $format, $link ); } function get_pagenum_link($pagenum = 1) { global $wp_rewrite; $pagenum = (int) $pagenum; $request = remove_query_arg( 'paged' ); $home_root = parse_url(get_option('home')); $home_root = ( isset($home_root['path']) ) ? $home_root['path'] : ''; $home_root = preg_quote( trailingslashit( $home_root ), '|' ); $request = preg_replace('|^'. $home_root . '|', '', $request); $request = preg_replace('|^/+|', '', $request); if ( !$wp_rewrite->using_permalinks() || is_admin() ) { $base = trailingslashit( get_bloginfo( 'home' ) ); if ( $pagenum > 1 ) { $result = add_query_arg( 'paged', $pagenum, $base . $request ); } else { $result = $base . $request; } } else { $qs_regex = '|\?.*?$|'; preg_match( $qs_regex, $request, $qs_match ); if ( !empty( $qs_match[0] ) ) { $query_string = $qs_match[0]; $request = preg_replace( $qs_regex, '', $request ); } else { $query_string = ''; } $request = preg_replace( '|page/\d+/?$|', '', $request); $request = preg_replace( '|^index\.php|', '', $request); $request = ltrim($request, '/'); $base = trailingslashit( get_bloginfo( 'url' ) ); if ( $wp_rewrite->using_index_permalinks() && ( $pagenum > 1 || '' != $request ) ) $base .= 'index.php/'; if ( $pagenum > 1 ) { $request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( 'page/' . $pagenum, 'paged' ); } $result = $base . $request . $query_string; } $result = apply_filters('get_pagenum_link', $result); return $result; } function get_next_posts_page_link($max_page = 0) { global $paged; if ( !is_single() ) { if ( !$paged ) $paged = 1; $nextpage = intval($paged) + 1; if ( !$max_page || $max_page >= $nextpage ) return get_pagenum_link($nextpage); } } function next_posts($max_page = 0) { echo clean_url(get_next_posts_page_link($max_page)); } function next_posts_link($label='Next Page »', $max_page=0) { global $paged, $wp_query; if ( !$max_page ) { $max_page = $wp_query->max_num_pages; } if ( !$paged ) $paged = 1; $nextpage = intval($paged) + 1; if ( (! is_single()) && (empty($paged) || $nextpage <= $max_page) ) { echo ''. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .''; } } function get_previous_posts_page_link() { global $paged; if ( !is_single() ) { $nextpage = intval($paged) - 1; if ( $nextpage < 1 ) $nextpage = 1; return get_pagenum_link($nextpage); } } function previous_posts() { echo clean_url(get_previous_posts_page_link()); } function previous_posts_link($label='« Previous Page') { global $paged; if ( (!is_single()) && ($paged > 1) ) { echo ''. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .''; } } function posts_nav_link($sep=' — ', $prelabel='« Previous Page', $nxtlabel='Next Page »') { global $wp_query; if ( !is_singular() ) { $max_num_pages = $wp_query->max_num_pages; $paged = get_query_var('paged'); //only have sep if there's both prev and next results if ($paged < 2 || $paged >= $max_num_pages) { $sep = ''; } if ( $max_num_pages > 1 ) { previous_posts_link($prelabel); echo preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $sep); next_posts_link($nxtlabel); } } } function get_shortcut_link() { $link = "javascript: var d=document, w=window, e=w.getSelection, k=d.getSelection, x=d.selection, s=(e?e():(k)?k():(x?x.createRange().text:0)), f='" . admin_url('press-this.php') . "', l=d.location, e=encodeURIComponent, g=f+'?u='+e(l.href)+'&t='+e(d.title)+'&s='+e(s)+'&v=2'; function a(){ if(!w.open(g,'t','toolbar=0,resizable=0,scrollbars=1,status=1,width=700,height=500')){ l.href=g; } }"; if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) $link .= 'setTimeout(a,0);'; else $link .= 'a();'; $link .= "void(0);"; $link = str_replace(array("\r", "\n", "\t"), '', $link); return apply_filters('shortcut_link', $link); } /** Return the site url * * * @package WordPress * @since 2.6 * * Returns the 'site_url' option with the appropriate protocol, 'https' if is_ssl() and 'http' otherwise. * If $scheme is 'http' or 'https', is_ssl() is overridden. * * @param string $path Optional path relative to the site url * @param string $scheme Optional scheme to give the site url context. Currently 'http','https', 'login', 'login_post', or 'admin' * @return string Site url link with optional path appended */ function site_url($path = '', $scheme = null) { // should the list of allowed schemes be maintained elsewhere? if ( !in_array($scheme, array('http', 'https')) ) { if ( ('login_post' == $scheme) && ( force_ssl_login() || force_ssl_admin() ) ) $scheme = 'https'; elseif ( ('login' == $scheme) && ( force_ssl_admin() ) ) $scheme = 'https'; elseif ( ('admin' == $scheme) && force_ssl_admin() ) $scheme = 'https'; else $scheme = ( is_ssl() ? 'https' : 'http' ); } $url = str_replace( 'http://', "{$scheme}://", get_option('siteurl') ); if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) $url .= '/' . ltrim($path, '/'); return $url; } /** Return the admin url * * * @package WordPress * @since 2.6 * * Returns the url to the admin area * * @param string $path Optional path relative to the admin url * @return string Admin url link with optional path appended */ function admin_url($path = '') { $url = site_url('wp-admin/', 'admin'); if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) $url .= ltrim($path, '/'); return $url; } /** Return the includes url * * * @package WordPress * @since 2.6 * * Returns the url to the includes directory * * @param string $path Optional path relative to the includes url * @return string Includes url link with optional path appended */ function includes_url($path = '') { $url = site_url() . '/' . WPINC . '/'; if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) $url .= ltrim($path, '/'); return $url; } /** Return the content url * * * @package WordPress * @since 2.6 * * Returns the url to the content directory * * @param string $path Optional path relative to the content url * @return string Content url link with optional path appended */ function content_url($path = '') { $scheme = ( is_ssl() ? 'https' : 'http' ); $url = WP_CONTENT_URL; if ( 0 === strpos($url, 'http') ) { if ( is_ssl() ) $url = str_replace( 'http://', "{$scheme}://", $url ); } if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) $url .= '/' . ltrim($path, '/'); return $url; } /** Return the plugins url * * * @package WordPress * @since 2.6 * * Returns the url to the plugins directory * * @param string $path Optional path relative to the plugins url * @return string Plugins url link with optional path appended */ function plugins_url($path = '') { $scheme = ( is_ssl() ? 'https' : 'http' ); $url = WP_PLUGIN_URL; if ( 0 === strpos($url, 'http') ) { if ( is_ssl() ) $url = str_replace( 'http://', "{$scheme}://", $url ); } if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) $url .= '/' . ltrim($path, '/'); return $url; } ?> wp/dev/wp-feed.php0000644000106600010660000000122511016305267011243 0ustar wp/dev/wp-mail.php0000644000106600010660000001440411016305267011265 0ustar connect(get_option('mailserver_url'), get_option('mailserver_port'))) wp_die(wp_specialchars($pop3->ERROR)); if (!$pop3->user(get_option('mailserver_login'))) wp_die(wp_specialchars($pop3->ERROR)); $count = $pop3->pass(get_option('mailserver_pass')); if (false === $count) wp_die(wp_specialchars($pop3->ERROR)); if (0 == $count) echo "

    There doesn't seem to be any new mail.

    \n"; // will fall-through to end of for loop for ($i=1; $i <= $count; $i++) : $message = $pop3->get($i); $content = ''; $content_type = ''; $content_transfer_encoding = ''; $boundary = ''; $bodysignal = 0; $post_author = 1; $author_found = false; $dmonths = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); foreach ($message as $line) : if (strlen($line) < 3) $bodysignal = 1; if ($bodysignal) { $content .= $line; } else { if (preg_match('/Content-Type: /i', $line)) { $content_type = trim($line); $content_type = substr($content_type, 14, strlen($content_type)-14); $content_type = explode(';', $content_type); $content_type = $content_type[0]; } if (preg_match('/Content-Transfer-Encoding: /i', $line)) { $content_transfer_encoding = trim($line); $content_transfer_encoding = substr($content_transfer_encoding, 27, strlen($content_transfer_encoding)-14); $content_transfer_encoding = explode(';', $content_transfer_encoding); $content_transfer_encoding = $content_transfer_encoding[0]; } if (($content_type == 'multipart/alternative') && (preg_match('/boundary="/', $line)) && ($boundary == '')) { $boundary = trim($line); $boundary = explode('"', $boundary); $boundary = $boundary[1]; } if (preg_match('/Subject: /i', $line)) { $subject = trim($line); $subject = substr($subject, 9, strlen($subject)-9); $subject = wp_iso_descrambler($subject); // Captures any text in the subject before $phone_delim as the subject $subject = explode($phone_delim, $subject); $subject = $subject[0]; } // Set the author using the email address (From or Reply-To, the last used) // otherwise use the site admin if ( preg_match('/(From|Reply-To): /', $line) ) { if ( preg_match('|[a-z0-9_.-]+@[a-z0-9_.-]+(?!.*<)|i', $line, $matches) ) $author = $matches[0]; else $author = trim($line); $author = sanitize_email($author); if ( is_email($author) ) { echo "Author = {$author}

    "; $userdata = get_user_by_email($author); if (!$userdata) { $post_author = 1; $author_found = false; } else { $post_author = $userdata->ID; $author_found = true; } } else { $post_author = 1; $author_found = false; } } if (preg_match('/Date: /i', $line)) { // of the form '20 Mar 2002 20:32:37' $ddate = trim($line); $ddate = str_replace('Date: ', '', $ddate); if (strpos($ddate, ',')) { $ddate = trim(substr($ddate, strpos($ddate, ',')+1, strlen($ddate))); } $date_arr = explode(' ', $ddate); $date_time = explode(':', $date_arr[3]); $ddate_H = $date_time[0]; $ddate_i = $date_time[1]; $ddate_s = $date_time[2]; $ddate_m = $date_arr[1]; $ddate_d = $date_arr[0]; $ddate_Y = $date_arr[2]; for ($j=0; $j<12; $j++) { if ($ddate_m == $dmonths[$j]) { $ddate_m = $j+1; } } $time_zn = intval($date_arr[4]) * 36; $ddate_U = gmmktime($ddate_H, $ddate_i, $ddate_s, $ddate_m, $ddate_d, $ddate_Y); $ddate_U = $ddate_U - $time_zn; $post_date = gmdate('Y-m-d H:i:s', $ddate_U + $time_difference); $post_date_gmt = gmdate('Y-m-d H:i:s', $ddate_U); } } endforeach; // Set $post_status based on $author_found and on author's publish_posts capability if ($author_found) { $user = new WP_User($post_author); if ($user->has_cap('publish_posts')) $post_status = 'publish'; else $post_status = 'pending'; } else { // Author not found in DB, set status to pending. Author already set to admin. $post_status = 'pending'; } $subject = trim($subject); if ($content_type == 'multipart/alternative') { $content = explode('--'.$boundary, $content); $content = $content[2]; $content = explode('Content-Transfer-Encoding: quoted-printable', $content); $content = strip_tags($content[1], '


    '); } $content = trim($content); if (stripos($content_transfer_encoding, "quoted-printable") !== false) { $content = quoted_printable_decode($content); } // Captures any text in the body after $phone_delim as the body $content = explode($phone_delim, $content); $content[1] ? $content = $content[1] : $content = $content[0]; $content = trim($content); $post_content = apply_filters('phone_content', $content); $post_title = xmlrpc_getposttitle($content); if ($post_title == '') $post_title = $subject; if (empty($post_categories)) $post_categories[] = get_option('default_email_category'); $post_category = $post_categories; $post_data = compact('post_content','post_title','post_date','post_date_gmt','post_author','post_category', 'post_status'); $post_data = add_magic_quotes($post_data); $post_ID = wp_insert_post($post_data); if ( is_wp_error( $post_ID ) ) echo "\n" . $post_ID->get_error_message(); if (!$post_ID) { // we couldn't post, for whatever reason. better move forward to the next email continue; } do_action('publish_phone', $post_ID); echo "\n

    Author: " . wp_specialchars($post_author) . "

    "; echo "\n

    Posted title: " . wp_specialchars($post_title) . "
    "; if(!$pop3->delete($i)) { echo '

    Oops '.wp_specialchars($pop3->ERROR).'

    '; $pop3->reset(); exit; } else { echo "

    Mission complete, message $i deleted.

    "; } endfor; $pop3->quit(); ?>wp/dev/wp-commentsrss2.php0000644000106600010660000000116111016305267012776 0ustar wp/dev/wp-trackback.php0000644000106600010660000000655211016305267012275 0ustar \n"; echo "\n"; echo "1\n"; echo "$error_message\n"; echo ""; die(); } else { echo '\n"; echo "\n"; echo "0\n"; echo ""; } } // trackback is done by a POST $request_array = 'HTTP_POST_VARS'; if ( !$_GET['tb_id'] ) { $tb_id = explode('/', $_SERVER['REQUEST_URI']); $tb_id = intval( $tb_id[ count($tb_id) - 1 ] ); } $tb_url = $_POST['url']; $charset = $_POST['charset']; // These three are stripslashed here so that they can be properly escaped after mb_convert_encoding() $title = stripslashes($_POST['title']); $excerpt = stripslashes($_POST['excerpt']); $blog_name = stripslashes($_POST['blog_name']); if ($charset) $charset = strtoupper( trim($charset) ); else $charset = 'ASCII, UTF-8, ISO-8859-1, JIS, EUC-JP, SJIS'; // No valid uses for UTF-7 if ( false !== strpos($charset, 'UTF-7') ) die; if ( function_exists('mb_convert_encoding') ) { // For international trackbacks $title = mb_convert_encoding($title, get_option('blog_charset'), $charset); $excerpt = mb_convert_encoding($excerpt, get_option('blog_charset'), $charset); $blog_name = mb_convert_encoding($blog_name, get_option('blog_charset'), $charset); } // Now that mb_convert_encoding() has been given a swing, we need to escape these three $title = $wpdb->escape($title); $excerpt = $wpdb->escape($excerpt); $blog_name = $wpdb->escape($blog_name); if ( is_single() || is_page() ) $tb_id = $posts[0]->ID; if ( !intval( $tb_id ) ) trackback_response(1, 'I really need an ID for this to work.'); if (empty($title) && empty($tb_url) && empty($blog_name)) { // If it doesn't look like a trackback at all... wp_redirect(get_permalink($tb_id)); exit; } if ( !empty($tb_url) && !empty($title) ) { header('Content-Type: text/xml; charset=' . get_option('blog_charset') ); if ( !pings_open($tb_id) ) trackback_response(1, 'Sorry, trackbacks are closed for this item.'); $title = wp_html_excerpt( $title, 250 ).'...'; $excerpt = wp_html_excerpt( $excerpt, 252 ).'...'; $comment_post_ID = (int) $tb_id; $comment_author = $blog_name; $comment_author_email = ''; $comment_author_url = $tb_url; $comment_content = "$title\n\n$excerpt"; $comment_type = 'trackback'; $dupe = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $comment_post_ID, $comment_author_url) ); if ( $dupe ) trackback_response(1, 'We already have a ping from that URL for this post.'); $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type'); wp_new_comment($commentdata); do_action('trackback_post', $wpdb->insert_id); trackback_response(0); } ?>wp/dev/wp-app.php0000644000106600010660000010243011041402451011107 0ustar * @author Modified by Dougal Campbell * @version 1.0.5-dc */ /** * WordPress is handling an Atom Publishing Protocol request. * * @var bool */ define('APP_REQUEST', true); /** Set up WordPress environment */ require_once('./wp-load.php'); /** Post Template API */ require_once(ABSPATH . WPINC . '/post-template.php'); /** Atom Publishing Protocol Class */ require_once(ABSPATH . WPINC . '/atomlib.php'); /** Feed Handling API */ require_once(ABSPATH . WPINC . '/feed.php'); $_SERVER['PATH_INFO'] = preg_replace( '/.*\/wp-app\.php/', '', $_SERVER['REQUEST_URI'] ); /** * Whether to enable Atom Publishing Protocol Logging. * * @name app_logging * @var int|bool */ $app_logging = 0; /** * Whether to always authenticate user. Permanently set to true. * * @name always_authenticate * @var int|bool * @todo Should be an option somewhere */ $always_authenticate = 1; /** * log_app() - Writes logging info to a file. * * @uses $app_logging * @package WordPress * @subpackage Logging * * @param string $label Type of logging * @param string $msg Information describing logging reason. */ function log_app($label,$msg) { global $app_logging; if ($app_logging) { $fp = fopen( 'wp-app.log', 'a+'); $date = gmdate( 'Y-m-d H:i:s' ); fwrite($fp, "\n\n$date - $label\n$msg\n"); fclose($fp); } } if ( !function_exists('wp_set_current_user') ) : /** * wp_set_current_user() - Sets the current WordPress User * * Pluggable function which is also found in pluggable.php. * * @see wp-includes/pluggable.php Documentation for this function. * @uses $current_user Global of current user to test whether $id is the same. * * @param int $id The user's ID * @param string $name Optional. The username of the user. * @return WP_User Current user's User object */ function wp_set_current_user($id, $name = '') { global $current_user; if ( isset($current_user) && ($id == $current_user->ID) ) return $current_user; $current_user = new WP_User($id, $name); return $current_user; } endif; /** * wa_posts_where_include_drafts_filter() - Filter to add more post statuses * * @param string $where SQL statement to filter * @return string Filtered SQL statement with added post_status for where clause */ function wa_posts_where_include_drafts_filter($where) { $where = str_replace("post_status = 'publish'","post_status = 'publish' OR post_status = 'future' OR post_status = 'draft' OR post_status = 'inherit'", $where); return $where; } add_filter('posts_where', 'wa_posts_where_include_drafts_filter'); /** * @internal * Left undocumented to work on later. If you want to finish, then please do so. * * @package WordPress * @subpackage Publishing */ class AtomServer { var $ATOM_CONTENT_TYPE = 'application/atom+xml'; var $CATEGORIES_CONTENT_TYPE = 'application/atomcat+xml'; var $SERVICE_CONTENT_TYPE = 'application/atomsvc+xml'; var $ATOM_NS = 'http://www.w3.org/2005/Atom'; var $ATOMPUB_NS = 'http://www.w3.org/2007/app'; var $ENTRIES_PATH = "posts"; var $CATEGORIES_PATH = "categories"; var $MEDIA_PATH = "attachments"; var $ENTRY_PATH = "post"; var $SERVICE_PATH = "service"; var $MEDIA_SINGLE_PATH = "attachment"; var $params = array(); var $media_content_types = array('image/*','audio/*','video/*'); var $atom_content_types = array('application/atom+xml'); var $selectors = array(); // support for head var $do_output = true; function AtomServer() { $this->script_name = array_pop(explode('/',$_SERVER['SCRIPT_NAME'])); $this->app_base = get_bloginfo('url') . '/' . $this->script_name . '/'; if ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) { $this->app_base = preg_replace( '/^http:\/\//', 'https://', $this->app_base ); } $this->selectors = array( '@/service$@' => array('GET' => 'get_service'), '@/categories$@' => array('GET' => 'get_categories_xml'), '@/post/(\d+)$@' => array('GET' => 'get_post', 'PUT' => 'put_post', 'DELETE' => 'delete_post'), '@/posts/?(\d+)?$@' => array('GET' => 'get_posts', 'POST' => 'create_post'), '@/attachments/?(\d+)?$@' => array('GET' => 'get_attachment', 'POST' => 'create_attachment'), '@/attachment/file/(\d+)$@' => array('GET' => 'get_file', 'PUT' => 'put_file', 'DELETE' => 'delete_file'), '@/attachment/(\d+)$@' => array('GET' => 'get_attachment', 'PUT' => 'put_attachment', 'DELETE' => 'delete_attachment'), ); } function handle_request() { global $always_authenticate; if( !empty( $_SERVER['ORIG_PATH_INFO'] ) ) $path = $_SERVER['ORIG_PATH_INFO']; else $path = $_SERVER['PATH_INFO']; $method = $_SERVER['REQUEST_METHOD']; log_app('REQUEST',"$method $path\n================"); $this->process_conditionals(); //$this->process_conditionals(); // exception case for HEAD (treat exactly as GET, but don't output) if($method == 'HEAD') { $this->do_output = false; $method = 'GET'; } // redirect to /service in case no path is found. if(strlen($path) == 0 || $path == '/') { $this->redirect($this->get_service_url()); } // check to see if AtomPub is enabled if( !get_option( 'enable_app' ) ) $this->forbidden( sprintf( __( 'AtomPub services are disabled on this blog. An admin user can enable them at %s' ), admin_url('options-writing.php') ) ); // dispatch foreach($this->selectors as $regex => $funcs) { if(preg_match($regex, $path, $matches)) { if(isset($funcs[$method])) { // authenticate regardless of the operation and set the current // user. each handler will decide if auth is required or not. if(!$this->authenticate()) { if ($always_authenticate) { $this->auth_required('Credentials required.'); } } array_shift($matches); call_user_func_array(array(&$this,$funcs[$method]), $matches); exit(); } else { // only allow what we have handlers for... $this->not_allowed(array_keys($funcs)); } } } // oops, nothing found $this->not_found(); } function get_service() { log_app('function','get_service()'); if( !current_user_can( 'edit_posts' ) ) $this->auth_required( __( 'Sorry, you do not have the right to access this blog.' ) ); $entries_url = attribute_escape($this->get_entries_url()); $categories_url = attribute_escape($this->get_categories_url()); $media_url = attribute_escape($this->get_attachments_url()); foreach ($this->media_content_types as $med) { $accepted_media_types = $accepted_media_types . "" . $med . ""; } $atom_prefix="atom"; $atom_blogname=get_bloginfo('name'); $service_doc = << <$atom_prefix:title>$atom_blogname Workspace <$atom_prefix:title>$atom_blogname Posts $this->ATOM_CONTENT_TYPE;type=entry <$atom_prefix:title>$atom_blogname Media $accepted_media_types EOD; $this->output($service_doc, $this->SERVICE_CONTENT_TYPE); } function get_categories_xml() { log_app('function','get_categories_xml()'); if( !current_user_can( 'edit_posts' ) ) $this->auth_required( __( 'Sorry, you do not have the right to access this blog.' ) ); $home = attribute_escape(get_bloginfo_rss('home')); $categories = ""; $cats = get_categories("hierarchical=0&hide_empty=0"); foreach ((array) $cats as $cat) { $categories .= " name) . "\" />\n"; } $output = << $categories EOD; $this->output($output, $this->CATEGORIES_CONTENT_TYPE); } /* * Create Post (No arguments) */ function create_post() { global $blog_id, $user_ID; $this->get_accepted_content_type($this->atom_content_types); $parser = new AtomParser(); if(!$parser->parse()) { $this->client_error(); } $entry = array_pop($parser->feed->entries); log_app('Received entry:', print_r($entry,true)); $catnames = array(); foreach($entry->categories as $cat) array_push($catnames, $cat["term"]); $wp_cats = get_categories(array('hide_empty' => false)); $post_category = array(); foreach($wp_cats as $cat) { if(in_array($cat->name, $catnames)) array_push($post_category, $cat->term_id); } $publish = (isset($entry->draft) && trim($entry->draft) == 'yes') ? false : true; $cap = ($publish) ? 'publish_posts' : 'edit_posts'; if(!current_user_can($cap)) $this->auth_required(__('Sorry, you do not have the right to edit/publish new posts.')); $blog_ID = (int ) $blog_id; $post_status = ($publish) ? 'publish' : 'draft'; $post_author = (int) $user_ID; $post_title = $entry->title[1]; $post_content = $entry->content[1]; $post_excerpt = $entry->summary[1]; $pubtimes = $this->get_publish_time($entry->published); $post_date = $pubtimes[0]; $post_date_gmt = $pubtimes[1]; if ( isset( $_SERVER['HTTP_SLUG'] ) ) $post_name = $_SERVER['HTTP_SLUG']; $post_data = compact('blog_ID', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'post_name'); $this->escape($post_data); log_app('Inserting Post. Data:', print_r($post_data,true)); $postID = wp_insert_post($post_data); if ( is_wp_error( $postID ) ) $this->internal_error($postID->get_error_message()); if (!$postID) $this->internal_error(__('Sorry, your entry could not be posted. Something wrong happened.')); // getting warning here about unable to set headers // because something in the cache is printing to the buffer // could we clean up wp_set_post_categories or cache to not print // this could affect our ability to send back the right headers @wp_set_post_categories($postID, $post_category); $output = $this->get_entry($postID); log_app('function',"create_post($postID)"); $this->created($postID, $output); } function get_post($postID) { global $entry; if( !current_user_can( 'edit_post', $postID ) ) $this->auth_required( __( 'Sorry, you do not have the right to access this post.' ) ); $this->set_current_entry($postID); $output = $this->get_entry($postID); log_app('function',"get_post($postID)"); $this->output($output); } function put_post($postID) { // checked for valid content-types (atom+xml) // quick check and exit $this->get_accepted_content_type($this->atom_content_types); $parser = new AtomParser(); if(!$parser->parse()) { $this->bad_request(); } $parsed = array_pop($parser->feed->entries); log_app('Received UPDATED entry:', print_r($parsed,true)); // check for not found global $entry; $this->set_current_entry($postID); if(!current_user_can('edit_post', $entry['ID'])) $this->auth_required(__('Sorry, you do not have the right to edit this post.')); $publish = (isset($parsed->draft) && trim($parsed->draft) == 'yes') ? false : true; $post_status = ($publish) ? 'publish' : 'draft'; extract($entry); $post_title = $parsed->title[1]; $post_content = $parsed->content[1]; $post_excerpt = $parsed->summary[1]; $pubtimes = $this->get_publish_time($entry->published); $post_date = $pubtimes[0]; $post_date_gmt = $pubtimes[1]; $pubtimes = $this->get_publish_time($parsed->updated); $post_modified = $pubtimes[0]; $post_modified_gmt = $pubtimes[1]; $postdata = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'post_date', 'post_date_gmt', 'post_modified', 'post_modified_gmt'); $this->escape($postdata); $result = wp_update_post($postdata); if (!$result) { $this->internal_error(__('For some strange yet very annoying reason, this post could not be edited.')); } log_app('function',"put_post($postID)"); $this->ok(); } function delete_post($postID) { // check for not found global $entry; $this->set_current_entry($postID); if(!current_user_can('edit_post', $postID)) { $this->auth_required(__('Sorry, you do not have the right to delete this post.')); } if ($entry['post_type'] == 'attachment') { $this->delete_attachment($postID); } else { $result = wp_delete_post($postID); if (!$result) { $this->internal_error(__('For some strange yet very annoying reason, this post could not be deleted.')); } log_app('function',"delete_post($postID)"); $this->ok(); } } function get_attachment($postID = NULL) { if( !current_user_can( 'upload_files' ) ) $this->auth_required( __( 'Sorry, you do not have permission to upload files.' ) ); if (!isset($postID)) { $this->get_attachments(); } else { $this->set_current_entry($postID); $output = $this->get_entry($postID, 'attachment'); log_app('function',"get_attachment($postID)"); $this->output($output); } } function create_attachment() { $type = $this->get_accepted_content_type(); if(!current_user_can('upload_files')) $this->auth_required(__('You do not have permission to upload files.')); $fp = fopen("php://input", "rb"); $bits = NULL; while(!feof($fp)) { $bits .= fread($fp, 4096); } fclose($fp); $slug = ''; if ( isset( $_SERVER['HTTP_SLUG'] ) ) $slug = sanitize_file_name( $_SERVER['HTTP_SLUG'] ); elseif ( isset( $_SERVER['HTTP_TITLE'] ) ) $slug = sanitize_file_name( $_SERVER['HTTP_TITLE'] ); elseif ( empty( $slug ) ) // just make a random name $slug = substr( md5( uniqid( microtime() ) ), 0, 7); $ext = preg_replace( '|.*/([a-z0-9]+)|', '$1', $_SERVER['CONTENT_TYPE'] ); $slug = "$slug.$ext"; $file = wp_upload_bits( $slug, NULL, $bits); log_app('wp_upload_bits returns:',print_r($file,true)); $url = $file['url']; $file = $file['file']; do_action('wp_create_file_in_uploads', $file); // replicate // Construct the attachment array $attachment = array( 'post_title' => $slug, 'post_content' => $slug, 'post_status' => 'attachment', 'post_parent' => 0, 'post_mime_type' => $type, 'guid' => $url ); // Save the data $postID = wp_insert_attachment($attachment, $file); if (!$postID) $this->internal_error(__('Sorry, your entry could not be posted. Something wrong happened.')); $output = $this->get_entry($postID, 'attachment'); $this->created($postID, $output, 'attachment'); log_app('function',"create_attachment($postID)"); } function put_attachment($postID) { // checked for valid content-types (atom+xml) // quick check and exit $this->get_accepted_content_type($this->atom_content_types); $parser = new AtomParser(); if(!$parser->parse()) { $this->bad_request(); } $parsed = array_pop($parser->feed->entries); // check for not found global $entry; $this->set_current_entry($postID); if(!current_user_can('edit_post', $entry['ID'])) $this->auth_required(__('Sorry, you do not have the right to edit this post.')); extract($entry); $post_title = $parsed->title[1]; $post_content = $parsed->content[1]; $pubtimes = $this->get_publish_time($parsed->updated); $post_modified = $pubtimes[0]; $post_modified_gmt = $pubtimes[1]; $postdata = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'post_modified', 'post_modified_gmt'); $this->escape($postdata); $result = wp_update_post($postdata); if (!$result) { $this->internal_error(__('For some strange yet very annoying reason, this post could not be edited.')); } log_app('function',"put_attachment($postID)"); $this->ok(); } function delete_attachment($postID) { log_app('function',"delete_attachment($postID). File '$location' deleted."); // check for not found global $entry; $this->set_current_entry($postID); if(!current_user_can('edit_post', $postID)) { $this->auth_required(__('Sorry, you do not have the right to delete this post.')); } $location = get_post_meta($entry['ID'], '_wp_attached_file', true); $filetype = wp_check_filetype($location); if(!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext'])) $this->internal_error(__('Error ocurred while accessing post metadata for file location.')); // delete file @unlink($location); // delete attachment $result = wp_delete_post($postID); if (!$result) { $this->internal_error(__('For some strange yet very annoying reason, this post could not be deleted.')); } log_app('function',"delete_attachment($postID). File '$location' deleted."); $this->ok(); } function get_file($postID) { // check for not found global $entry; $this->set_current_entry($postID); // then whether user can edit the specific post if(!current_user_can('edit_post', $postID)) { $this->auth_required(__('Sorry, you do not have the right to edit this post.')); } $location = get_post_meta($entry['ID'], '_wp_attached_file', true); $filetype = wp_check_filetype($location); if(!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext'])) $this->internal_error(__('Error ocurred while accessing post metadata for file location.')); status_header('200'); header('Content-Type: ' . $entry['post_mime_type']); header('Connection: close'); $fp = fopen($location, "rb"); while(!feof($fp)) { echo fread($fp, 4096); } fclose($fp); log_app('function',"get_file($postID)"); exit; } function put_file($postID) { // first check if user can upload if(!current_user_can('upload_files')) $this->auth_required(__('You do not have permission to upload files.')); // check for not found global $entry; $this->set_current_entry($postID); // then whether user can edit the specific post if(!current_user_can('edit_post', $postID)) { $this->auth_required(__('Sorry, you do not have the right to edit this post.')); } $location = get_post_meta($entry['ID'], '_wp_attached_file', true); $filetype = wp_check_filetype($location); if(!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext'])) $this->internal_error(__('Error ocurred while accessing post metadata for file location.')); $fp = fopen("php://input", "rb"); $localfp = fopen($location, "w+"); while(!feof($fp)) { fwrite($localfp,fread($fp, 4096)); } fclose($fp); fclose($localfp); $ID = $entry['ID']; $pubtimes = $this->get_publish_time($entry->published); $post_date = $pubtimes[0]; $post_date_gmt = $pubtimes[1]; $pubtimes = $this->get_publish_time($parsed->updated); $post_modified = $pubtimes[0]; $post_modified_gmt = $pubtimes[1]; $post_data = compact('ID', 'post_date', 'post_date_gmt', 'post_modified', 'post_modified_gmt'); $result = wp_update_post($post_data); if (!$result) { $this->internal_error(__('Sorry, your entry could not be posted. Something wrong happened.')); } log_app('function',"put_file($postID)"); $this->ok(); } function get_entries_url($page = NULL) { if($GLOBALS['post_type'] == 'attachment') { $path = $this->MEDIA_PATH; } else { $path = $this->ENTRIES_PATH; } $url = $this->app_base . $path; if(isset($page) && is_int($page)) { $url .= "/$page"; } return $url; } function the_entries_url($page = NULL) { echo $this->get_entries_url($page); } function get_categories_url($deprecated = '') { return $this->app_base . $this->CATEGORIES_PATH; } function the_categories_url() { echo $this->get_categories_url(); } function get_attachments_url($page = NULL) { $url = $this->app_base . $this->MEDIA_PATH; if(isset($page) && is_int($page)) { $url .= "/$page"; } return $url; } function the_attachments_url($page = NULL) { echo $this->get_attachments_url($page); } function get_service_url() { return $this->app_base . $this->SERVICE_PATH; } function get_entry_url($postID = NULL) { if(!isset($postID)) { global $post; $postID = (int) $post->ID; } $url = $this->app_base . $this->ENTRY_PATH . "/$postID"; log_app('function',"get_entry_url() = $url"); return $url; } function the_entry_url($postID = NULL) { echo $this->get_entry_url($postID); } function get_media_url($postID = NULL) { if(!isset($postID)) { global $post; $postID = (int) $post->ID; } $url = $this->app_base . $this->MEDIA_SINGLE_PATH ."/file/$postID"; log_app('function',"get_media_url() = $url"); return $url; } function the_media_url($postID = NULL) { echo $this->get_media_url($postID); } function set_current_entry($postID) { global $entry; log_app('function',"set_current_entry($postID)"); if(!isset($postID)) { // $this->bad_request(); $this->not_found(); } $entry = wp_get_single_post($postID,ARRAY_A); if(!isset($entry) || !isset($entry['ID'])) $this->not_found(); return; } function get_posts($page = 1, $post_type = 'post') { log_app('function',"get_posts($page, '$post_type')"); $feed = $this->get_feed($page, $post_type); $this->output($feed); } function get_attachments($page = 1, $post_type = 'attachment') { log_app('function',"get_attachments($page, '$post_type')"); $GLOBALS['post_type'] = $post_type; $feed = $this->get_feed($page, $post_type); $this->output($feed); } function get_feed($page = 1, $post_type = 'post') { global $post, $wp, $wp_query, $posts, $wpdb, $blog_id; log_app('function',"get_feed($page, '$post_type')"); ob_start(); if(!isset($page)) { $page = 1; } $page = (int) $page; $count = get_option('posts_per_rss'); wp('what_to_show=posts&posts_per_page=' . $count . '&offset=' . ($count * ($page-1) . '&orderby=modified')); $post = $GLOBALS['post']; $posts = $GLOBALS['posts']; $wp = $GLOBALS['wp']; $wp_query = $GLOBALS['wp_query']; $wpdb = $GLOBALS['wpdb']; $blog_id = (int) $GLOBALS['blog_id']; log_app('function',"query_posts(# " . print_r($wp_query, true) . "#)"); log_app('function',"total_count(# $wp_query->max_num_pages #)"); $last_page = $wp_query->max_num_pages; $next_page = (($page + 1) > $last_page) ? NULL : $page + 1; $prev_page = ($page - 1) < 1 ? NULL : $page - 1; $last_page = ((int)$last_page == 1 || (int)$last_page == 0) ? NULL : (int) $last_page; $self_page = $page > 1 ? $page : NULL; ?> the_entries_url() ?> <?php bloginfo_rss('name') ?> Copyright echo_entry(); } } ?> echo_entry(); log_app('$post',print_r($GLOBALS['post'],true)); $entry = ob_get_contents(); break; } } ob_end_clean(); log_app('get_entry returning:',$entry); return $entry; } function echo_entry() { ?> ID); ?> <?php echo $content ?> post_status == 'draft' ? 'yes' : 'no') ?> post_type == 'attachment') { ?> post_content ) ) : list($content_type, $content) = prep_atom_text_construct(get_the_content()); ?> 302 Found

    Found

    The document has moved here.

    EOD; header('HTTP/1.1 302 Moved'); header('Content-Type: text/html'); header('Location: ' . $url); echo $content; exit; } function client_error($msg = 'Client Error') { log_app('Status','400: Client Error'); header('Content-Type: text/plain'); status_header('400'); exit; } function created($post_ID, $content, $post_type = 'post') { log_app('created()::$post_ID',"$post_ID, $post_type"); $edit = $this->get_entry_url($post_ID); switch($post_type) { case 'post': $ctloc = $this->get_entry_url($post_ID); break; case 'attachment': $edit = $this->app_base . "attachments/$post_ID"; break; } header("Content-Type: $this->ATOM_CONTENT_TYPE"); if(isset($ctloc)) header('Content-Location: ' . $ctloc); header('Location: ' . $edit); status_header('201'); echo $content; exit; } function auth_required($msg) { log_app('Status','401: Auth Required'); nocache_headers(); header('WWW-Authenticate: Basic realm="WordPress Atom Protocol"'); header("HTTP/1.1 401 $msg"); header('Status: ' . $msg); header('Content-Type: text/html'); $content = << 401 Unauthorized

    401 Unauthorized

    $msg

    EOD; echo $content; exit; } function output($xml, $ctype = 'application/atom+xml') { status_header('200'); $xml = ''."\n".$xml; header('Connection: close'); header('Content-Length: '. strlen($xml)); header('Content-Type: ' . $ctype); header('Content-Disposition: attachment; filename=atom.xml'); header('Date: '. date('r')); if($this->do_output) echo $xml; log_app('function', "output:\n$xml"); exit; } function escape(&$array) { global $wpdb; foreach ($array as $k => $v) { if (is_array($v)) { $this->escape($array[$k]); } else if (is_object($v)) { //skip } else { $array[$k] = $wpdb->escape($v); } } } /* * Access credential through various methods and perform login */ function authenticate() { log_app("authenticate()",print_r($_ENV, true)); // if using mod_rewrite/ENV hack // http://www.besthostratings.com/articles/http-auth-php-cgi.html if(isset($_SERVER['HTTP_AUTHORIZATION'])) { list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6))); } // If Basic Auth is working... if(isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { log_app("Basic Auth",$_SERVER['PHP_AUTH_USER']); $user = wp_authenticate($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']); if ( $user && !is_wp_error($user) ) { wp_set_current_user($user->ID); log_app("authenticate()", $_SERVER['PHP_AUTH_USER']); return true; } } return false; } function get_accepted_content_type($types = NULL) { if(!isset($types)) { $types = $this->media_content_types; } if(!isset($_SERVER['CONTENT_LENGTH']) || !isset($_SERVER['CONTENT_TYPE'])) { $this->length_required(); } $type = $_SERVER['CONTENT_TYPE']; list($type,$subtype) = explode('/',$type); list($subtype) = explode(";",$subtype); // strip MIME parameters log_app("get_accepted_content_type", "type=$type, subtype=$subtype"); foreach($types as $t) { list($acceptedType,$acceptedSubtype) = explode('/',$t); if($acceptedType == '*' || $acceptedType == $type) { if($acceptedSubtype == '*' || $acceptedSubtype == $subtype) return $type . "/" . $subtype; } } $this->invalid_media(); } function process_conditionals() { if(empty($this->params)) return; if($_SERVER['REQUEST_METHOD'] == 'DELETE') return; switch($this->params[0]) { case $this->ENTRY_PATH: global $post; $post = wp_get_single_post($this->params[1]); $wp_last_modified = get_post_modified_time('D, d M Y H:i:s', true); $post = NULL; break; case $this->ENTRIES_PATH: $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0).' GMT'; break; default: return; } $wp_etag = md5($wp_last_modified); @header("Last-Modified: $wp_last_modified"); @header("ETag: $wp_etag"); // Support for Conditional GET if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) $client_etag = stripslashes($_SERVER['HTTP_IF_NONE_MATCH']); else $client_etag = false; $client_last_modified = trim( $_SERVER['HTTP_IF_MODIFIED_SINCE']); // If string is empty, return 0. If not, attempt to parse into a timestamp $client_modified_timestamp = $client_last_modified ? strtotime($client_last_modified) : 0; // Make a timestamp for our most recent modification... $wp_modified_timestamp = strtotime($wp_last_modified); if ( ($client_last_modified && $client_etag) ? (($client_modified_timestamp >= $wp_modified_timestamp) && ($client_etag == $wp_etag)) : (($client_modified_timestamp >= $wp_modified_timestamp) || ($client_etag == $wp_etag)) ) { status_header( 304 ); exit; } } function rfc3339_str2time($str) { $match = false; if(!preg_match("/(\d{4}-\d{2}-\d{2})T(\d{2}\:\d{2}\:\d{2})\.?\d{0,3}(Z|[+-]+\d{2}\:\d{2})/", $str, $match)) return false; if($match[3] == 'Z') $match[3] == '+0000'; return strtotime($match[1] . " " . $match[2] . " " . $match[3]); } function get_publish_time($published) { $pubtime = $this->rfc3339_str2time($published); if(!$pubtime) { return array(current_time('mysql'),current_time('mysql',1)); } else { return array(date("Y-m-d H:i:s", $pubtime), gmdate("Y-m-d H:i:s", $pubtime)); } } } $server = new AtomServer(); $server->handle_request(); ?> wp/dev/wp-rss.php0000644000106600010660000000074411016305267011154 0ustar wp/dev/license.txt0000644000106600010660000003605710762616541011410 0ustar GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, 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 or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's 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 give any other recipients of the Program a copy of this License along with the Program. 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 Program or any portion of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, 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 Program, 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 Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) 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; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, 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 executable. However, as a special exception, the source code 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. If distribution of executable or 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 counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program 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. 5. 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 Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program 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 to this License. 7. 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 Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program 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 Program. 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. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program 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. 9. The Free Software Foundation may publish revised and/or new versions of the 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 Program 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 Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, 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 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS wp/dev/wp-content/0000775000106600010660000000000011075377332011312 5ustar wp/dev/wp-content/plugins/0000775000106600010660000000000011051167753012771 5ustar wp/dev/wp-content/plugins/akismet/0000775000106600010660000000000011051167753014426 5ustar wp/dev/wp-content/plugins/akismet/akismet.gif0000674000106600010660000000533110473133324016547 0ustar GIF89ax2}|ϋތ~рӁԉ܈ۅ؄ׇڐ㎭Ꭼ݀Ҋ|҃ՆهقՃz{Ώ}Ѝ⎬Ꮽ〉ߍ~}ϑ䌪~Њшۄ։܉ۂԆفԐ゠Յ؊܁ӆ؈ڃy̅ׄג䒱{{zz|π싩އyxy咰등xڋՙ⋦Ԙᒮܓz̐ئъҗ蔰ݞ薰獩ִ앰ݗ쉤ҌՖ䏪ؒۖ䐫㋥ԙތ֑ꓯ݌ҍ똲!,x2S H*\ȰÇp9Eŋ3jȱǏ Oq /lZɲ˗0cʜI͛C,+7 J(͜|A2QH-Xj"ׯ^ BhӦM¶m"p>Kx7߿ ѨP$THSuAU[vj3eWy$>V ukLHʔf9͝~hҥN#G@bkƬl7Y߿'2nq㣓^ҧSO]sI॰[Wyǩj}k@}U(Abh†&$) *j 8tw s=a|g}jȡ ㏕|`-؞D(ah_!X*te)J橈J6ǤPFy#Ue[䩧P@#آ` .)cmJy!Vcv޹9^Zriy(P*h*Pb鬛`9`4&5#B EZ-*VK(]Raj2;B9Xn +üBfHJJn2@ 4/+'"/.\m /+;r&^Y&q~lԒl1-lQD҆16,pЂs.,A M`;d/hg{.,?s/|6Jmvg ;^8j<-tkw^뽷} x` .z8N:2 k=9Dp9晗y{n3P?C?^@ a'];ٷy^=@ 0Kz,>;`/w}O>9ЃGj}*k? ~?`{Ab &x]}ۜg? 1 v!v 7p@ To~,Ğ a5$`s?g.zq N0x1hRV!E/ы5cu;jeTWB7!9wXt̸= ѐ`"H,ހ\$HI>bp,)@ZR z' Jэ)Q.J$,/9K[ЌV@r *D a)b&\&3gJդ 9Ӟ!E9ER ,&:[NK6g( Vʂ DbrTAm9RV.8CSzHu)T@YSui` in your template. See also: [WP Stats plugin](http://wordpress.org/extend/plugins/stats/). PS: You'll need a [WordPress.com API key](http://wordpress.com/api-keys/) to use it. == Installation == Upload the Akismet plugin to your blog, Activate it, then enter your [WordPress.com API key](http://wordpress.com/api-keys/). 1, 2, 3: You're done! wp/dev/wp-content/plugins/akismet/akismet.php0000674000106600010660000010170211032537235016571 0ustar WordPress.com API key to use it. You can review the spam it catches under "Comments." To show off your Akismet stats just put <?php akismet_counter(); ?> in your template. See also: WP Stats plugin. Version: 2.1.6 Author: Matt Mullenweg Author URI: http://photomatt.net/ */ // If you hardcode a WP.com API key here, all key config screens will be hidden $wpcom_api_key = ''; function akismet_init() { global $wpcom_api_key, $akismet_api_host, $akismet_api_port; if ( $wpcom_api_key ) $akismet_api_host = $wpcom_api_key . '.rest.akismet.com'; else $akismet_api_host = get_option('wordpress_api_key') . '.rest.akismet.com'; $akismet_api_port = 80; add_action('admin_menu', 'akismet_config_page'); } add_action('init', 'akismet_init'); if ( !function_exists('wp_nonce_field') ) { function akismet_nonce_field($action = -1) { return; } $akismet_nonce = -1; } else { function akismet_nonce_field($action = -1) { return wp_nonce_field($action); } $akismet_nonce = 'akismet-update-key'; } if ( !function_exists('number_format_i18n') ) { function number_format_i18n( $number, $decimals = null ) { return number_format( $number, $decimals ); } } function akismet_config_page() { if ( function_exists('add_submenu_page') ) add_submenu_page('plugins.php', __('Akismet Configuration'), __('Akismet Configuration'), 'manage_options', 'akismet-key-config', 'akismet_conf'); } function akismet_conf() { global $akismet_nonce, $wpcom_api_key; if ( isset($_POST['submit']) ) { if ( function_exists('current_user_can') && !current_user_can('manage_options') ) die(__('Cheatin’ uh?')); check_admin_referer( $akismet_nonce ); $key = preg_replace( '/[^a-h0-9]/i', '', $_POST['key'] ); if ( empty($key) ) { $key_status = 'empty'; $ms[] = 'new_key_empty'; delete_option('wordpress_api_key'); } else { $key_status = akismet_verify_key( $key ); } if ( $key_status == 'valid' ) { update_option('wordpress_api_key', $key); $ms[] = 'new_key_valid'; } else if ( $key_status == 'invalid' ) { $ms[] = 'new_key_invalid'; } else if ( $key_status == 'failed' ) { $ms[] = 'new_key_failed'; } if ( isset( $_POST['akismet_discard_month'] ) ) update_option( 'akismet_discard_month', 'true' ); else update_option( 'akismet_discard_month', 'false' ); } if ( $key_status != 'valid' ) { $key = get_option('wordpress_api_key'); if ( empty( $key ) ) { if ( $key_status != 'failed' ) { if ( akismet_verify_key( '1234567890ab' ) == 'failed' ) $ms[] = 'no_connection'; else $ms[] = 'key_empty'; } $key_status = 'empty'; } else { $key_status = akismet_verify_key( $key ); } if ( $key_status == 'valid' ) { $ms[] = 'key_valid'; } else if ( $key_status == 'invalid' ) { delete_option('wordpress_api_key'); $ms[] = 'key_empty'; } else if ( !empty($key) && $key_status == 'failed' ) { $ms[] = 'key_failed'; } } $messages = array( 'new_key_empty' => array('color' => 'aa0', 'text' => __('Your key has been cleared.')), 'new_key_valid' => array('color' => '2d2', 'text' => __('Your key has been verified. Happy blogging!')), 'new_key_invalid' => array('color' => 'd22', 'text' => __('The key you entered is invalid. Please double-check it.')), 'new_key_failed' => array('color' => 'd22', 'text' => __('The key you entered could not be verified because a connection to akismet.com could not be established. Please check your server configuration.')), 'no_connection' => array('color' => 'd22', 'text' => __('There was a problem connecting to the Akismet server. Please check your server configuration.')), 'key_empty' => array('color' => 'aa0', 'text' => sprintf(__('Please enter an API key. (Get your key.)'), 'http://wordpress.com/profile/')), 'key_valid' => array('color' => '2d2', 'text' => __('This key is valid.')), 'key_failed' => array('color' => 'aa0', 'text' => __('The key below was previously validated but a connection to akismet.com can not be established at this time. Please check your server configuration.'))); ?>

    Akismet will greatly reduce or even completely eliminate the comment and trackback spam you get on your site. If one does happen to get through, simply mark it as "spam" on the moderation screen and Akismet will learn from the mistakes. If you don\'t have a WordPress.com account yet, you can get one at WordPress.com.'), 'http://akismet.com/', 'http://wordpress.com/api-keys/'); ?>

    (What is this?'); ?>)

    ".__('Akismet is almost ready.')." ".sprintf(__('You must enter your WordPress.com API key for it to work.'), "plugins.php?page=akismet-key-config")."

    "; } add_action('admin_notices', 'akismet_warning'); return; } // Returns array with headers in $response[0] and body in $response[1] function akismet_http_post($request, $host, $path, $port = 80) { global $wp_version; $http_request = "POST $path HTTP/1.0\r\n"; $http_request .= "Host: $host\r\n"; $http_request .= "Content-Type: application/x-www-form-urlencoded; charset=" . get_option('blog_charset') . "\r\n"; $http_request .= "Content-Length: " . strlen($request) . "\r\n"; $http_request .= "User-Agent: WordPress/$wp_version | Akismet/2.0\r\n"; $http_request .= "\r\n"; $http_request .= $request; $response = ''; if( false != ( $fs = @fsockopen($host, $port, $errno, $errstr, 10) ) ) { fwrite($fs, $http_request); while ( !feof($fs) ) $response .= fgets($fs, 1160); // One TCP-IP packet fclose($fs); $response = explode("\r\n\r\n", $response, 2); } return $response; } function akismet_auto_check_comment( $comment ) { global $akismet_api_host, $akismet_api_port; $comment['user_ip'] = preg_replace( '/[^0-9., ]/', '', $_SERVER['REMOTE_ADDR'] ); $comment['user_agent'] = $_SERVER['HTTP_USER_AGENT']; $comment['referrer'] = $_SERVER['HTTP_REFERER']; $comment['blog'] = get_option('home'); $ignore = array( 'HTTP_COOKIE' ); foreach ( $_SERVER as $key => $value ) if ( !in_array( $key, $ignore ) ) $comment["$key"] = $value; $query_string = ''; foreach ( $comment as $key => $data ) $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&'; $response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port); if ( 'true' == $response[1] ) { add_filter('pre_comment_approved', create_function('$a', 'return \'spam\';')); update_option( 'akismet_spam_count', get_option('akismet_spam_count') + 1 ); do_action( 'akismet_spam_caught' ); $post = get_post( $comment['comment_post_ID'] ); $last_updated = strtotime( $post->post_modified_gmt ); $diff = time() - $last_updated; $diff = $diff / 86400; if ( $post->post_type == 'post' && $diff > 30 && get_option( 'akismet_discard_month' ) == 'true' ) die; } akismet_delete_old(); return $comment; } function akismet_delete_old() { global $wpdb; $now_gmt = current_time('mysql', 1); $wpdb->query("DELETE FROM $wpdb->comments WHERE DATE_SUB('$now_gmt', INTERVAL 15 DAY) > comment_date_gmt AND comment_approved = 'spam'"); $n = mt_rand(1, 5000); if ( $n == 11 ) // lucky number $wpdb->query("OPTIMIZE TABLE $wpdb->comments"); } function akismet_submit_nonspam_comment ( $comment_id ) { global $wpdb, $akismet_api_host, $akismet_api_port; $comment_id = (int) $comment_id; $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment_id'"); if ( !$comment ) // it was deleted return; $comment->blog = get_option('home'); $query_string = ''; foreach ( $comment as $key => $data ) $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&'; $response = akismet_http_post($query_string, $akismet_api_host, "/1.1/submit-ham", $akismet_api_port); } function akismet_submit_spam_comment ( $comment_id ) { global $wpdb, $akismet_api_host, $akismet_api_port; $comment_id = (int) $comment_id; $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment_id'"); if ( !$comment ) // it was deleted return; if ( 'spam' != $comment->comment_approved ) return; $comment->blog = get_option('home'); $query_string = ''; foreach ( $comment as $key => $data ) $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&'; $response = akismet_http_post($query_string, $akismet_api_host, "/1.1/submit-spam", $akismet_api_port); } add_action('wp_set_comment_status', 'akismet_submit_spam_comment'); add_action('edit_comment', 'akismet_submit_spam_comment'); add_action('preprocess_comment', 'akismet_auto_check_comment', 1); // Total spam in queue // get_option( 'akismet_spam_count' ) is the total caught ever function akismet_spam_count( $type = false ) { global $wpdb; if ( !$type ) { // total $count = wp_cache_get( 'akismet_spam_count', 'widget' ); if ( false === $count ) { if ( function_exists('wp_count_comments') ) { $count = wp_count_comments(); $count = $count->spam; } else { $count = (int) $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = 'spam'"); } wp_cache_set( 'akismet_spam_count', $count, 'widget', 3600 ); } return $count; } elseif ( 'comments' == $type || 'comment' == $type ) { // comments $type = ''; } else { // pingback, trackback, ... $type = $wpdb->escape( $type ); } return (int) $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = 'spam' AND comment_type='$type'"); } function akismet_spam_comments( $type = false, $page = 1, $per_page = 50 ) { global $wpdb; $page = (int) $page; if ( $page < 2 ) $page = 1; $per_page = (int) $per_page; if ( $per_page < 1 ) $per_page = 50; $start = ( $page - 1 ) * $per_page; $end = $start + $per_page; if ( $type ) { if ( 'comments' == $type || 'comment' == $type ) $type = ''; else $type = $wpdb->escape( $type ); return $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE comment_approved = 'spam' AND comment_type='$type' ORDER BY comment_date DESC LIMIT $start, $end"); } // All return $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE comment_approved = 'spam' ORDER BY comment_date DESC LIMIT $start, $end"); } // Totals for each comment type // returns array( type => count, ... ) function akismet_spam_totals() { global $wpdb; $totals = $wpdb->get_results( "SELECT comment_type, COUNT(*) AS cc FROM $wpdb->comments WHERE comment_approved = 'spam' GROUP BY comment_type" ); $return = array(); foreach ( $totals as $total ) $return[$total->comment_type ? $total->comment_type : 'comment'] = $total->cc; return $return; } function akismet_manage_page() { global $wpdb, $submenu; $count = sprintf(__('Akismet Spam (%s)'), akismet_spam_count()); if ( isset( $submenu['edit-comments.php'] ) ) add_submenu_page('edit-comments.php', __('Akismet Spam'), $count, 'moderate_comments', 'akismet-admin', 'akismet_caught' ); elseif ( function_exists('add_management_page') ) add_management_page(__('Akismet Spam'), $count, 'moderate_comments', 'akismet-admin', 'akismet_caught'); } function akismet_caught() { global $wpdb, $comment, $akismet_caught, $akismet_nonce; akismet_recheck_queue(); if (isset($_POST['submit']) && 'recover' == $_POST['action'] && ! empty($_POST['not_spam'])) { check_admin_referer( $akismet_nonce ); if ( function_exists('current_user_can') && !current_user_can('moderate_comments') ) die(__('You do not have sufficient permission to moderate comments.')); $i = 0; foreach ($_POST['not_spam'] as $comment): $comment = (int) $comment; if ( function_exists('wp_set_comment_status') ) wp_set_comment_status($comment, 'approve'); else $wpdb->query("UPDATE $wpdb->comments SET comment_approved = '1' WHERE comment_ID = '$comment'"); akismet_submit_nonspam_comment($comment); ++$i; endforeach; $to = add_query_arg( 'recovered', $i, $_SERVER['HTTP_REFERER'] ); wp_redirect( $to ); exit; } if ('delete' == $_POST['action']) { check_admin_referer( $akismet_nonce ); if ( function_exists('current_user_can') && !current_user_can('moderate_comments') ) die(__('You do not have sufficient permission to moderate comments.')); $delete_time = $wpdb->escape( $_POST['display_time'] ); $nuked = $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_approved = 'spam' AND '$delete_time' > comment_date_gmt" ); wp_cache_delete( 'akismet_spam_count', 'widget' ); $to = add_query_arg( 'deleted', 'all', $_SERVER['HTTP_REFERER'] ); wp_redirect( $to ); exit; } if ( isset( $_GET['recovered'] ) ) { $i = (int) $_GET['recovered']; echo '

    ' . sprintf(__('%1$s comments recovered.'), $i) . "

    "; } if (isset( $_GET['deleted'] ) ) echo '

    ' . __('All spam deleted.') . '

    '; if ( isset( $GLOBALS['submenu']['edit-comments.php'] ) ) $link = 'edit-comments.php'; else $link = 'edit.php'; ?>
    '; } else { echo '

    '.__('You can delete all of the spam from your database with a single click. This operation cannot be undone, so you may wish to check to ensure that no legitimate comments got through first. Spam is automatically deleted after 15 days, so don’t sweat it.').'

    '; ?>
       

    '.__('These are the latest comments identified as spam by Akismet. If you see any mistakes, simply mark the comment as "not spam" and Akismet will learn from the submission. If you wish to recover a comment from spam, simply select the comment, and click Not Spam. After 15 days we clean out the junk for you.').'

    '; ?> escape($_POST['s']); $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE (comment_author LIKE '%$s%' OR comment_author_email LIKE '%$s%' OR comment_author_url LIKE ('%$s%') OR comment_author_IP LIKE ('%$s%') OR comment_content LIKE ('%$s%') ) AND comment_approved = 'spam' ORDER BY comment_date DESC"); } else { if ( isset( $_GET['apage'] ) ) $page = (int) $_GET['apage']; else $page = 1; if ( $page < 2 ) $page = 1; $current_type = false; if ( isset( $_GET['ctype'] ) ) $current_type = preg_replace( '|[^a-z]|', '', $_GET['ctype'] ); $comments = akismet_spam_comments( $current_type, $page ); $total = akismet_spam_count( $current_type ); $totals = akismet_spam_totals(); ?>
    • >
    • $type_count ) { if ( 'comment' == $type ) { $type = 'comments'; $show = __('Comments'); } else { $show = ucwords( $type ); } $type_count = number_format_i18n( $type_count ); $extra = $current_type === $type ? ' class="active"' : ''; echo "
    • $show ($type_count)
    • "; } do_action( 'akismet_tabs' ); // so plugins can add more tabs easily ?>
    " id="akismetsearch">

    50 ) { $total_pages = ceil( $total / 50 ); $r = ''; if ( 1 < $page ) { $args['apage'] = ( 1 == $page - 1 ) ? '' : $page - 1; $r .= '' . "\n"; } if ( ( $total_pages = ceil( $total / 50 ) ) > 1 ) { for ( $page_num = 1; $page_num <= $total_pages; $page_num++ ) : if ( $page == $page_num ) : $r .= "$page_num\n"; else : $p = false; if ( $page_num < 3 || ( $page_num >= $page - 3 && $page_num <= $page + 3 ) || $page_num > $total_pages - 3 ) : $args['apage'] = ( 1 == $page_num ) ? '' : $page_num; $r .= '' . ( $page_num ) . "\n"; $in = true; elseif ( $in == true ) : $r .= "...\n"; $in = false; endif; endif; endfor; } if ( ( $page ) * 50 < $total || -1 == $total ) { $args['apage'] = $page + 1; $r .= '' . "\n"; } echo "

    $r

    "; ?>
      comment_date); $post = get_post($comment->comment_post_ID); $post_title = $post->post_title; if ($i % 2) $class = 'class="alternate"'; else $class = ''; echo "\n\t
    • "; ?>

      comment_author_email) { ?>| comment_author_url && 'http://' != $comment->comment_author_url) { ?> | |

      — [ comment_post_ID); $post_title = wp_specialchars( $post->post_title, 'double' ); $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title; ?> ]

    50 ) { $total_pages = ceil( $total / 50 ); $r = ''; if ( 1 < $page ) { $args['apage'] = ( 1 == $page - 1 ) ? '' : $page - 1; $r .= '' . "\n"; } if ( ( $total_pages = ceil( $total / 50 ) ) > 1 ) { for ( $page_num = 1; $page_num <= $total_pages; $page_num++ ) : if ( $page == $page_num ) : $r .= "$page_num\n"; else : $p = false; if ( $page_num < 3 || ( $page_num >= $page - 3 && $page_num <= $page + 3 ) || $page_num > $total_pages - 3 ) : $args['apage'] = ( 1 == $page_num ) ? '' : $page_num; $r .= '' . ( $page_num ) . "\n"; $in = true; elseif ( $in == true ) : $r .= "...\n"; $in = false; endif; endif; endfor; } if ( ( $page ) * 50 < $total || -1 == $total ) { $args['apage'] = $page + 1; $r .= '' . "\n"; } echo "

    $r

    "; } ?>

       

    '.__('Spam').''; global $submenu; if ( isset( $submenu['edit-comments.php'] ) ) $link = 'edit-comments.php'; else $link = 'edit.php'; echo '

    '.sprintf(__('Akismet has protected your site from %3$s spam comments.'), 'http://akismet.com/', clean_url("$link?page=akismet-admin"), number_format_i18n($count) ).'

    '; } add_action('activity_box_end', 'akismet_stats'); // WP 2.5+ function akismet_rightnow() { global $submenu; if ( isset( $submenu['edit-comments.php'] ) ) $link = 'edit-comments.php'; else $link = 'edit.php'; if ( $count = get_option('akismet_spam_count') ) { $intro = sprintf( __ngettext( 'Akismet has protected your site from %2$s spam comment already,', 'Akismet has protected your site from %2$s spam comments already,', $count ), 'http://akismet.com/', number_format_i18n( $count ) ); } else { $intro = sprintf( __('Akismet blocks spam from getting to your blog,'), 'http://akismet.com/' ); } if ( $queue_count = akismet_spam_count() ) { $queue_text = sprintf( __ngettext( 'and there\'s %1$s comment in your spam queue right now.', 'and there are %1$s comments in your spam queue right now.', $queue_count ), number_format_i18n( $queue_count ), clean_url("$link?page=akismet-admin") ); } else { $queue_text = sprintf( __( "but there's nothing in your spam queue at the moment." ), clean_url("$link?page=akismet-admin") ); } $text = sprintf( _c( '%1$s %2$s|akismet_rightnow' ), $intro, $queue_text ); echo "

    $text

    \n"; } add_action('rightnow_end', 'akismet_rightnow'); // For WP <= 2.3.x if ( 'moderation.php' == $pagenow ) { function akismet_recheck_button( $page ) { global $submenu; if ( isset( $submenu['edit-comments.php'] ) ) $link = 'edit-comments.php'; else $link = 'edit.php'; $button = "" . __('Recheck Queue for Spam') . ""; $page = str_replace( '
    ', '
    ' . $button, $page ); return $page; } if ( $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'" ) ) ob_start( 'akismet_recheck_button' ); } // For WP >= 2.5 function akismet_check_for_spam_button($comment_status) { if ( 'approved' == $comment_status ) return; echo "
    " . __('Check for Spam') . ""; } add_action('manage_comments_nav', 'akismet_check_for_spam_button'); function akismet_recheck_queue() { global $wpdb, $akismet_api_host, $akismet_api_port; if ( !isset( $_GET['recheckqueue'] ) ) return; $moderation = $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE comment_approved = '0'", ARRAY_A ); foreach ( $moderation as $c ) { $c['user_ip'] = $c['comment_author_IP']; $c['user_agent'] = $c['comment_agent']; $c['referrer'] = ''; $c['blog'] = get_option('home'); $id = (int) $c['comment_ID']; $query_string = ''; foreach ( $c as $key => $data ) $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&'; $response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port); if ( 'true' == $response[1] ) { $wpdb->query( "UPDATE $wpdb->comments SET comment_approved = 'spam' WHERE comment_ID = $id" ); } } wp_redirect( $_SERVER['HTTP_REFERER'] ); exit; } function akismet_check_db_comment( $id ) { global $wpdb, $akismet_api_host, $akismet_api_port; $id = (int) $id; $c = $wpdb->get_row( "SELECT * FROM $wpdb->comments WHERE comment_ID = '$id'", ARRAY_A ); if ( !$c ) return; $c['user_ip'] = $c['comment_author_IP']; $c['user_agent'] = $c['comment_agent']; $c['referrer'] = ''; $c['blog'] = get_option('home'); $id = $c['comment_ID']; $query_string = ''; foreach ( $c as $key => $data ) $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&'; $response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port); return $response[1]; } // This option causes tons of FPs, was removed in 2.1 function akismet_kill_proxy_check( $option ) { return 0; } add_filter('option_open_proxy_check', 'akismet_kill_proxy_check'); // Widget stuff function widget_akismet_register() { if ( function_exists('register_sidebar_widget') ) : function widget_akismet($args) { extract($args); $options = get_option('widget_akismet'); $count = number_format_i18n(get_option('akismet_spam_count')); ?>

    wp/dev/wp-content/plugins/hello.php0000674000106600010660000000374511025564626014620 0ustar Hello, Dolly in the upper right of your admin screen on every page. Author: Matt Mullenweg Version: 1.5 Author URI: http://ma.tt/ */ // These are the lyrics to Hello Dolly $lyrics = "Hello, Dolly Well, hello, Dolly It's so nice to have you back where you belong You're lookin' swell, Dolly I can tell, Dolly You're still glowin', you're still crowin' You're still goin' strong We feel the room swayin' While the band's playin' One of your old favourite songs from way back when So, take her wrap, fellas Find her an empty lap, fellas Dolly'll never go away again Hello, Dolly Well, hello, Dolly It's so nice to have you back where you belong You're lookin' swell, Dolly I can tell, Dolly You're still glowin', you're still crowin' You're still goin' strong We feel the room swayin' While the band's playin' One of your old favourite songs from way back when Golly, gee, fellas Find her a vacant knee, fellas Dolly'll never go away Dolly'll never go away Dolly'll never go away again"; // Here we split it into lines $lyrics = explode("\n", $lyrics); // And then randomly choose a line $chosen = wptexturize( $lyrics[ mt_rand(0, count($lyrics) - 1) ] ); // This just echoes the chosen line, we'll position it later function hello_dolly() { global $chosen; echo "

    $chosen

    "; } // Now we set that function up to execute when the admin_footer action is called add_action('admin_footer', 'hello_dolly'); // We need some CSS to position the paragraph function dolly_css() { echo " "; } add_action('admin_head', 'dolly_css'); ?>wp/dev/wp-content/uploads/0000775000106600010660000000000011075377332012761 5ustar wp/dev/wp-content/uploads/js_cache/0000775000106600010660000000000011075377332014520 5ustar wp/dev/wp-content/uploads/js_cache/tinymce_5175abf783777d242fd176d5ffafb4e5.gz0000644000106600010660000022161511075377332023300 0ustar i{ȱ0 >g"IÊ[,9ܒB"b@F۟Z(ɓ9^$/UUK?Qry&ʎ׹a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=PH-23iY)tƮaJG6?.&CӀOhD 񀋋@ [[ZBa`L;TE93_}q,U-FH9SK`@%Riם.ܧG?Fn9$ @$j(4%a/S:*F4t kowp/dev/wp-content/themes/0000775000106600010660000000000011051167752012574 5ustar wp/dev/wp-content/themes/default/0000775000106600010660000000000011051167753014221 5ustar wp/dev/wp-content/themes/default/style.css0000674000106600010660000002307411036167623016101 0ustar /* Theme Name: WordPress Default Theme URI: http://wordpress.org/ Description: The default WordPress theme based on the famous Kubrick. Version: 1.6 Author: Michael Heilemann Author URI: http://binarybonsai.com/ Tags: blue, custom header, fixed width, two columns, widgets Kubrick v1.5 http://binarybonsai.com/kubrick/ This theme was designed and built by Michael Heilemann, whose blog you will find at http://binarybonsai.com/ The CSS, XHTML and design is released under GPL: http://www.opensource.org/licenses/gpl-license.php */ /* Begin Typography & Colors */ body { font-size: 62.5%; /* Resets 1em to 10px */ font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; background: #d5d6d7 url('images/kubrickbgcolor.jpg'); color: #333; text-align: center; } #page { background-color: white; border: 1px solid #959596; text-align: left; } #header { background: #73a0c5 url('images/kubrickheader.jpg') no-repeat bottom center; } #headerimg { margin: 7px 9px 0; height: 192px; width: 740px; } #content { font-size: 1.2em } .widecolumn .entry p { font-size: 1.05em; } .narrowcolumn .entry, .widecolumn .entry { line-height: 1.4em; } .widecolumn { line-height: 1.6em; } .narrowcolumn .postmetadata { text-align: center; } .alt { background-color: #f8f8f8; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; } #footer { background: #eee url('images/kubrickfooter.jpg') no-repeat top; border: none; } small { font-family: Arial, Helvetica, Sans-Serif; font-size: 0.9em; line-height: 1.5em; } h1, h2, h3 { font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif; font-weight: bold; } h1 { font-size: 4em; text-align: center; } #headerimg .description { font-size: 1.2em; text-align: center; } h2 { font-size: 1.6em; } h2.pagetitle { font-size: 1.6em; } #sidebar h2 { font-family: 'Lucida Grande', Verdana, Sans-Serif; font-size: 1.2em; } h3 { font-size: 1.3em; } h1, h1 a, h1 a:hover, h1 a:visited, #headerimg .description { text-decoration: none; color: white; } h2, h2 a, h2 a:visited, h3, h3 a, h3 a:visited { color: #333; } h2, h2 a, h2 a:hover, h2 a:visited, h3, h3 a, h3 a:hover, h3 a:visited, #sidebar h2, #wp-calendar caption, cite { text-decoration: none; } .entry p a:visited { color: #b85b5a; } .commentlist li, #commentform input, #commentform textarea { font: 0.9em 'Lucida Grande', Verdana, Arial, Sans-Serif; } .commentlist li { font-weight: bold; } .commentlist li .avatar { float: right; border: 1px solid #eee; padding: 2px; background: #fff; } .commentlist cite, .commentlist cite a { font-weight: bold; font-style: normal; font-size: 1.1em; } .commentlist p { font-weight: normal; line-height: 1.5em; text-transform: none; } #commentform p { font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; } .commentmetadata { font-weight: normal; } #sidebar { font: 1em 'Lucida Grande', Verdana, Arial, Sans-Serif; } small, #sidebar ul ul li, #sidebar ul ol li, .nocomments, .postmetadata, blockquote, strike { color: #777; } code { font: 1.1em 'Courier New', Courier, Fixed; } acronym, abbr, span.caps { font-size: 0.9em; letter-spacing: .07em; } a, h2 a:hover, h3 a:hover { color: #06c; text-decoration: none; } a:hover { color: #147; text-decoration: underline; } #wp-calendar #prev a, #wp-calendar #next a { font-size: 9pt; } #wp-calendar a { text-decoration: none; } #wp-calendar caption { font: bold 1.3em 'Lucida Grande', Verdana, Arial, Sans-Serif; text-align: center; } #wp-calendar th { font-style: normal; text-transform: capitalize; } /* End Typography & Colors */ /* Begin Structure */ body { margin: 0 0 20px 0; padding: 0; } #page { background-color: white; margin: 20px auto; padding: 0; width: 760px; border: 1px solid #959596; } #header { background-color: #73a0c5; margin: 0 0 0 1px; padding: 0; height: 200px; width: 758px; } #headerimg { margin: 0; height: 200px; width: 100%; } .narrowcolumn { float: left; padding: 0 0 20px 45px; margin: 0px 0 0; width: 450px; } .widecolumn { padding: 10px 0 20px 0; margin: 5px 0 0 150px; width: 450px; } .post { margin: 0 0 40px; text-align: justify; } .post hr { display: block; } .widecolumn .post { margin: 0; } .narrowcolumn .postmetadata { padding-top: 5px; } .widecolumn .postmetadata { margin: 30px 0; } .widecolumn .smallattachment { text-align: center; float: left; width: 128px; margin: 5px 5px 5px 0px; } .widecolumn .attachment { text-align: center; margin: 5px 0px; } .postmetadata { clear: both; } .clear { clear: both; } #footer { padding: 0; margin: 0 auto; width: 760px; clear: both; } #footer p { margin: 0; padding: 20px 0; text-align: center; } /* End Structure */ /* Begin Headers */ h1 { padding-top: 70px; margin: 0; } h2 { margin: 30px 0 0; } h2.pagetitle { margin-top: 30px; text-align: center; } #sidebar h2 { margin: 5px 0 0; padding: 0; } h3 { padding: 0; margin: 30px 0 0; } h3.comments { padding: 0; margin: 40px auto 20px ; } /* End Headers */ /* Begin Images */ p img { padding: 0; max-width: 100%; } /* Using 'class="alignright"' on an image will (who would've thought?!) align the image to the right. And using 'class="centered', will of course center the image. This is much better than using align="center", being much more futureproof (and valid) */ img.centered { display: block; margin-left: auto; margin-right: auto; } img.alignright { padding: 4px; margin: 0 0 2px 7px; display: inline; } img.alignleft { padding: 4px; margin: 0 7px 2px 0; display: inline; } .alignright { float: right; } .alignleft { float: left } /* End Images */ /* Begin Lists Special stylized non-IE bullets Do not work in Internet Explorer, which merely default to normal bullets. */ html>body .entry ul { margin-left: 0px; padding: 0 0 0 30px; list-style: none; padding-left: 10px; text-indent: -10px; } html>body .entry li { margin: 7px 0 8px 10px; } .entry ul li:before, #sidebar ul ul li:before { content: "\00BB \0020"; } .entry ol { padding: 0 0 0 35px; margin: 0; } .entry ol li { margin: 0; padding: 0; } .postmetadata ul, .postmetadata li { display: inline; list-style-type: none; list-style-image: none; } #sidebar ul, #sidebar ul ol { margin: 0; padding: 0; } #sidebar ul li { list-style-type: none; list-style-image: none; margin-bottom: 15px; } #sidebar ul p, #sidebar ul select { margin: 5px 0 8px; } #sidebar ul ul, #sidebar ul ol { margin: 5px 0 0 10px; } #sidebar ul ul ul, #sidebar ul ol { margin: 0 0 0 10px; } ol li, #sidebar ul ol li { list-style: decimal outside; } #sidebar ul ul li, #sidebar ul ol li { margin: 3px 0 0; padding: 0; } /* End Entry Lists */ /* Begin Form Elements */ #searchform { margin: 10px auto; padding: 5px 3px; text-align: center; } #sidebar #searchform #s { width: 108px; padding: 2px; } #sidebar #searchsubmit { padding: 1px; } .entry form { /* This is mainly for password protected posts, makes them look better. */ text-align:center; } select { width: 130px; } #commentform input { width: 170px; padding: 2px; margin: 5px 5px 1px 0; } #commentform textarea { width: 100%; padding: 2px; } #commentform #submit { margin: 0; float: right; } /* End Form Elements */ /* Begin Comments*/ .alt { margin: 0; padding: 10px; } .commentlist { padding: 0; text-align: justify; } .commentlist li { margin: 15px 0 3px; padding: 5px 10px 3px; list-style: none; } .commentlist p { margin: 10px 5px 10px 0; } #commentform p { margin: 5px 0; } .nocomments { text-align: center; margin: 0; padding: 0; } .commentmetadata { margin: 0; display: block; } /* End Comments */ /* Begin Sidebar */ #sidebar { padding: 20px 0 10px 0; margin-left: 545px; width: 190px; } #sidebar form { margin: 0; } /* End Sidebar */ /* Begin Calendar */ #wp-calendar { empty-cells: show; margin: 10px auto 0; width: 155px; } #wp-calendar #next a { padding-right: 10px; text-align: right; } #wp-calendar #prev a { padding-left: 10px; text-align: left; } #wp-calendar a { display: block; } #wp-calendar caption { text-align: center; width: 100%; } #wp-calendar td { padding: 3px 0; text-align: center; } #wp-calendar td.pad:hover { /* Doesn't work in IE */ background-color: #fff; } /* End Calendar */ /* Begin Various Tags & Classes */ acronym, abbr, span.caps { cursor: help; } acronym, abbr { border-bottom: 1px dashed #999; } blockquote { margin: 15px 30px 0 10px; padding-left: 20px; border-left: 5px solid #ddd; } blockquote cite { margin: 5px 0 0; display: block; } .center { text-align: center; } .hidden { display: none; } hr { display: none; } a img { border: none; } .navigation { display: block; text-align: center; margin-top: 10px; margin-bottom: 60px; } /* End Various Tags & Classes*/ /* Captions */ .aligncenter, div.aligncenter { display: block; margin-left: auto; margin-right: auto; } .wp-caption { border: 1px solid #ddd; text-align: center; background-color: #f3f3f3; padding-top: 4px; margin: 10px; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } .wp-caption img { margin: 0; padding: 0; border: 0 none; } .wp-caption p.wp-caption-text { font-size: 11px; line-height: 17px; padding: 0 4px 5px; margin: 0; } /* End captions */ /* "Daisy, Daisy, give me your answer do. I'm half crazy all for the love of you. It won't be a stylish marriage, I can't afford a carriage. But you'll look sweet upon the seat of a bicycle built for two." */ wp/dev/wp-content/themes/default/archives.php0000674000106600010660000000054010530007025016520 0ustar

    Archives by Month:

    Archives by Subject:

    wp/dev/wp-content/themes/default/image.php0000674000106600010660000000472110772563232016022 0ustar

    post_parent); ?> »

    ID, 'medium' ); ?>

    post_excerpt) ) the_excerpt(); // this is the "caption" ?>
    Read the rest of this entry »

    '); ?>

    Sorry, no attachments matched your criteria.

    wp/dev/wp-content/themes/default/rtl.css0000674000106600010660000000335510773003312015531 0ustar /* Theme name: WordPress Default - kubrick - Editors: Navid Kashani Persian Wordpress Project : wp-persian.com */ body, .commentlist li, #commentform input, #commentform textarea, #commentform p, #sidebar, #wp-calendar caption { font-family:tahoma, arial; } #page { text-align:right; direction:rtl; } h1, h2, h3, #sidebar h2 { font-family:arial, tahoma; } .commentlist li .avatar { float:left; } #header { margin:0 1px 0 0; } .narrowcolumn { float:right; padding: 0 45px 20px 0; } .widecolumn { margin: 5px 150px 0 0; } .widecolumn .smallattachment { margin: 5px 0 5px 5px; } .postmetadata { clear:right; } #sidebar { margin-left: 0; margin-right: 545px; } img.alignright { margin: 0 7px 2px 0; } img.alignleft { margin: 0 0 2px 7px; } .alignright { float: left; } .alignleft { float: right; } code { display:block; direction:ltr; text-align:left; } acronym, abbr, span.caps { letter-spacing:0; /* fix opera bug */ } html>body .entry ul { padding:0 10px 0 0; text-indent:10px; } html>body .entry li { margin: 7px 10px 8px 0; } .entry ol { padding: 0 35px 0 0; } #sidebar ul ul, #sidebar ul ol { margin: 5px 10px 0 0; } #sidebar ul ul ul, #sidebar ul ol { margin: 0 10px 0 0; } #commentform input { margin: 5px 0 1px 5px; } #commentform #submit { float:left; } .commentlist p { margin: 10px 0 10px 5px; } #wp-calendar #next a { padding-right:0; padding-left:10px; text-align:left; } #wp-calendar #prev a { padding-left:0; padding-right:10px; text-align:right; } blockquote { margin: 15px 10px 0 30px; padding-left: 0; padding-right: 20px; border-left: 0 none; border-right: 5px solid #ddd; } #email, #url { direction:ltr; }wp/dev/wp-content/themes/default/searchform.php0000674000106600010660000000044211007310722017047 0ustar
    wp/dev/wp-content/themes/default/images/0000775000106600010660000000000011051167753015466 5ustar wp/dev/wp-content/themes/default/images/kubrickfooter.jpg0000674000106600010660000000461310204500056021030 0ustar JFIFddDucky<&Adobed H        ?`3 0"@3q`Aa!1`Q@PqA !а36XhC J M@PLR1H$<:oW-0nïŖXuck7Mws  oi鯺XK a,%XK a,%XK a,%XK a,%XK a,%XK a,%XK a,%XK a,%XK a,%XK a,%XK a,%XK czi?>??>??89Ǟ=s}q}\s}\yg}~?_/xx矷8y珧oXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQ}}?!϶~g> U|UUUUUUUUUUU_UUUUUUUU|UUUUUUUUUUUUUUUUUUUUU_1}UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUdg,UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUg,?gUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUYKg,oUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUYzKgهUc+UUUUUUWªUU_ UUUW¯UU_ Wª?~S3[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[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yL}>CSI {_R}O'Tw횏>` f?;bx/v[ >c0t}O3 N$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@\-}K?pL{>SxyS߶jOyɢ@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$A$Ϲ/O]fϢ$™w ݖB{fϭJ$]1lS}yL}>AS& _Sܓ>O'Umw횏>` f?;bx/v[ >c'tO3L$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@^}OrL>RyV5߶j`*V?;bx/v[ >ctjSx}yM{}>s)C0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 `WtL{>RyX5߶jԦ}pVS&``````````````````````kUDϹ/畗]fϢ$ʕw ݖB{fϭxM?DĬx6J .N۶Ym]l~NM?/Wh\<\;ÿeo]vmo-,??gA``````````````````````}a\{.aܲׯ^j,m?z#m+?~G]& (_mn޽n%K,#l_4?+QU_\=GE0LFewp/dev/wp-content/themes/default/images/kubrickbgcolor.jpg0000674000106600010660000000105410204500056021155 0ustar JFIFddDucky<&Adobed  *       <<o```` ????!?!?! I$I$I$I$I$I$I$I$???wp/dev/wp-content/themes/default/images/kubrickbg-rtl.jpg0000674000106600010660000000317110577557637020755 0ustar JFIFddC      C ( }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?!} Io]n?Jՠ ( ( ( ( ( ( ~P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@dx@R[(*_} Io]n?Jՠ ( ( ( ( ( ( ~P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@dx@R[(*_} Io]n?Jՠ ( ( ( ( ( ( ~P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@dx@R[(*_} Io]n?Jՠ ( ( ( ( ( ( ~P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@dx@R[(*_} Io]n?Jՠ ( ( ( ( ( ( ~P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@dx@R[(*_wp/dev/wp-content/themes/default/images/header-img.php0000674000106600010660000000403511037417535020204 0ustar array('r1', 'g1', 'b1'), 'lower'=>array('r2', 'g2', 'b2')); foreach ( $vars as $var => $subvars ) { if ( isset($_GET[$var]) ) { foreach ( $subvars as $index => $subvar ) { $length = strlen($_GET[$var]) / 3; $v = substr($_GET[$var], $index * $length, $length); if ( $length == 1 ) $v = '' . $v . $v; $$subvar = hexdec( $v ); if ( $$subvar < 0 || $$subvar > 255 ) $default = true; } } else { $default = true; } } if ( $default ) list ( $r1, $g1, $b1, $r2, $g2, $b2 ) = array ( 105, 174, 231, 65, 128, 182 ); // Create the image $im = imagecreatefromjpeg($img); // Get the background color, define the rectangle height $white = imagecolorat( $im, 15, 15 ); $h = 182; // Define the boundaries of the rounded edges ( y => array ( x1, x2 ) ) $corners = array( 0 => array ( 25, 734 ), 1 => array ( 23, 736 ), 2 => array ( 22, 737 ), 3 => array ( 21, 738 ), 4 => array ( 21, 738 ), 177 => array ( 21, 738 ), 178 => array ( 21, 738 ), 179 => array ( 22, 737 ), 180 => array ( 23, 736 ), 181 => array ( 25, 734 ), ); // Blank out the blue thing for ( $i = 0; $i < $h; $i++ ) { $x1 = 19; $x2 = 740; imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white ); } // Draw a new color thing for ( $i = 0; $i < $h; $i++ ) { $x1 = 20; $x2 = 739; $r = ( $r2 - $r1 != 0 ) ? $r1 + ( $r2 - $r1 ) * ( $i / $h ) : $r1; $g = ( $g2 - $g1 != 0 ) ? $g1 + ( $g2 - $g1 ) * ( $i / $h ) : $g1; $b = ( $b2 - $b1 != 0 ) ? $b1 + ( $b2 - $b1 ) * ( $i / $h ) : $b1; $color = imagecolorallocate( $im, $r, $g, $b ); if ( array_key_exists($i, $corners) ) { imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white ); list ( $x1, $x2 ) = $corners[$i]; } imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $color ); } //die; header("Content-Type: image/jpeg"); imagejpeg($im, '', 92); imagedestroy($im); ?> wp/dev/wp-content/themes/default/images/kubrickbgwide.jpg0000674000106600010660000000176610204500056021001 0ustar JFIFddDucky<&Adobed q       (`3q``1 M`  SXB@! T7Z2D ֌u$@h7Z;?m?m?v mpHv mpHv ?!qakGƼqa??!?! I$I$I$I$I$I$I$I$I$I$I$HI$I$I$I$I$I$I$I$I$I$I$@I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$$I$I$I$I$I$I$I$I$I$I$I$?k,`>,`>,`>,`>,??wp/dev/wp-content/themes/default/images/audio.jpg0000674000106600010660000001107710347617334017302 0ustar JFIFddDuckyPAdobed      `` !1Aaq"Q2R#bBr$!1AQaq2R3r4 ?꯼e,x bY[-40]|ͻOCјfe7S~-oX{\bҗwݵ2^Kys-̗k%4fbI?(JI^~:GET ,glBF"tc?G]\7Њ, ;h]u8F貀:E~Qn]kq\Ik%C"hJNQy=oZF\=E=6?}_>u_Z5Tǁ #EE>`$҆-ŽB.),bAuc!2)Xo ftWңs(8סivI2XMO u-/퍒ɐz8 tˣe}K?>*Ϲ%#hBzBp,1VZIn awFCO"g'ǡVrpkF.bccAaTuY^\p"`kHǾv/X?Yvׯ(4+qF/aTws[k]C$`y{ RHLEO3e'r`,箶2uLn 4YVCgI32XXK.~7-0cu;]ow٭-yn4\fVz}-g2`46TDe{^d}Y$VTPզ82lڞe-kR]YHzB;箄-EPcJ)]]6\e-+HZUpvBAۡ;GBBzܨP >ru2[TV|i4 ;8Ao*#jUe`{U O\lhƁVRc,||WTi?ī|<nWW}80Cvf9cJ[x#xkDzaVe8- ;K xܛ5$[2nݸ} ר6Bߞcfw@φTGsᢨGsᢨGsᢨZqOcywXO%(,LQԏ0 68.+ӚZH7 S]^SQA$@ˍ^b3rlOfp2㗫ۻO |GgA)} &H Z&a@-Nwƾwp/dev/wp-content/themes/default/page.php0000674000106600010660000000115010530007025015626 0ustar

    Read the rest of this page »

    '); ?> '

    Pages: ', 'after' => '

    ', 'next_or_number' => 'number')); ?>
    ', '

    '); ?>
    wp/dev/wp-content/themes/default/footer.php0000674000106600010660000000131310640570775016234 0ustar
    wp/dev/wp-content/themes/default/functions.php0000674000106600010660000004155610757142553016761 0ustar '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', )); function kubrick_head() { $head = "\n"; if ( '' != $output ) echo $head . $output . $foot; } add_action('wp_head', 'kubrick_head'); function kubrick_header_image() { return apply_filters('kubrick_header_image', get_option('kubrick_header_image')); } function kubrick_upper_color() { if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) { parse_str(substr($url, strpos($url, '?') + 1), $q); return $q['upper']; } else return '69aee7'; } function kubrick_lower_color() { if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) { parse_str(substr($url, strpos($url, '?') + 1), $q); return $q['lower']; } else return '4180b6'; } function kubrick_header_image_url() { if ( $image = kubrick_header_image() ) $url = get_template_directory_uri() . '/images/' . $image; else $url = get_template_directory_uri() . '/images/kubrickheader.jpg'; return $url; } function kubrick_header_color() { return apply_filters('kubrick_header_color', get_option('kubrick_header_color')); } function kubrick_header_color_string() { $color = kubrick_header_color(); if ( false === $color ) return 'white'; return $color; } function kubrick_header_display() { return apply_filters('kubrick_header_display', get_option('kubrick_header_display')); } function kubrick_header_display_string() { $display = kubrick_header_display(); return $display ? $display : 'inline'; } add_action('admin_menu', 'kubrick_add_theme_page'); function kubrick_add_theme_page() { if ( isset( $_GET['page'] ) && $_GET['page'] == basename(__FILE__) ) { if ( isset( $_REQUEST['action'] ) && 'save' == $_REQUEST['action'] ) { check_admin_referer('kubrick-header'); if ( isset($_REQUEST['njform']) ) { if ( isset($_REQUEST['defaults']) ) { delete_option('kubrick_header_image'); delete_option('kubrick_header_color'); delete_option('kubrick_header_display'); } else { if ( '' == $_REQUEST['njfontcolor'] ) delete_option('kubrick_header_color'); else { $fontcolor = preg_replace('/^.*(#[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['njfontcolor']); update_option('kubrick_header_color', $fontcolor); } if ( preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njuppercolor'], $uc) && preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njlowercolor'], $lc) ) { $uc = ( strlen($uc[0]) == 3 ) ? $uc[0]{0}.$uc[0]{0}.$uc[0]{1}.$uc[0]{1}.$uc[0]{2}.$uc[0]{2} : $uc[0]; $lc = ( strlen($lc[0]) == 3 ) ? $lc[0]{0}.$lc[0]{0}.$lc[0]{1}.$lc[0]{1}.$lc[0]{2}.$lc[0]{2} : $lc[0]; update_option('kubrick_header_image', "header-img.php?upper=$uc&lower=$lc"); } if ( isset($_REQUEST['toggledisplay']) ) { if ( false === get_option('kubrick_header_display') ) update_option('kubrick_header_display', 'none'); else delete_option('kubrick_header_display'); } } } else { if ( isset($_REQUEST['headerimage']) ) { check_admin_referer('kubrick-header'); if ( '' == $_REQUEST['headerimage'] ) delete_option('kubrick_header_image'); else { $headerimage = preg_replace('/^.*?(header-img.php\?upper=[0-9a-fA-F]{6}&lower=[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['headerimage']); update_option('kubrick_header_image', $headerimage); } } if ( isset($_REQUEST['fontcolor']) ) { check_admin_referer('kubrick-header'); if ( '' == $_REQUEST['fontcolor'] ) delete_option('kubrick_header_color'); else { $fontcolor = preg_replace('/^.*?(#[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['fontcolor']); update_option('kubrick_header_color', $fontcolor); } } if ( isset($_REQUEST['fontdisplay']) ) { check_admin_referer('kubrick-header'); if ( '' == $_REQUEST['fontdisplay'] || 'inline' == $_REQUEST['fontdisplay'] ) delete_option('kubrick_header_display'); else update_option('kubrick_header_display', 'none'); } } //print_r($_REQUEST); wp_redirect("themes.php?page=functions.php&saved=true"); die; } add_action('admin_head', 'kubrick_theme_page_head'); } add_theme_page(__('Customize Header'), __('Header Image and Color'), 'edit_themes', basename(__FILE__), 'kubrick_theme_page'); } function kubrick_theme_page_head() { ?>

    '.__('Options saved.').'

    '; ?>


    red', '#FF0000', 'rgb(255, 0, 0)'); ?>
    #FF0000', '#F00'); ?>
    #FF0000', '#F00'); ?>

    wp/dev/wp-content/themes/default/comments-popup.php0000674000106600010660000001104310770756771017733 0ustar <?php echo get_option('blogname'); ?> - Comments on <?php the_title(); ?>

    Comments

    RSS feed for comments on this post.

    ping_status) { ?>

    The URL to TrackBack this entry is:

    post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie echo(get_the_password_form()); } else { ?>
    1. by @

    No comments yet.

    comment_status) { ?>

    Leave a comment

    Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed:

    Logged in as . Log out »

    " />


    ID); ?>

    Sorry, the comment form is closed at this time.

    Powered by WordPress

    wp/dev/wp-content/themes/default/single.php0000674000106600010660000000503610774214461016220 0ustar

    Read the rest of this entry »

    '); ?> '

    Pages: ', 'after' => '

    ', 'next_or_number' => 'number')); ?> Tags: ', ', ', '

    '); ?>

    Sorry, no posts matched your criteria.

    wp/dev/wp-content/themes/default/screenshot.png0000674000106600010660000002456010275357122017112 0ustar PNG  IHDR,ExgAMA7tEXtSoftwareAdobe ImageReadyqe<PLTEYID`Qe8z̸㺶Ǻ]ت莳ùa^`Nh씚¤g˧ʳ簣zәzoýcMǾ줾}slóΤX~}FOсoj^lGddw&~Y3 LB~9sΙ%l/8 X lP9|,'@GTK1@MB)} P Yh7 ,x>S"<8_ X X/uˀe X_ퟝ`ík2`Օ``0`86`]?{0`rX/u𳳺aXW 'ts~g̅ |P<-O}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|&'?.{8h@f$+c1{uqknDAhY鸖 ,6[ZkJKdh&6ؔMFeUɥY$͉mW43fHR)fNůDYۀ|dS*YԸjQZܴ, Om$/~oSp=l. ,;:0Jx͔hLzT7{"Qjο`qՍfJ~ A5j&f{ $s%`^Kt<mFݠa>YY鋵JK~6n"#BL'FcZFUpX>pphq%'|oB){o7\MRSM_.j{Ze;ן^Vh҃#Rb:v15Tr f4XE[=m;bFroK45[N$mȠE* Y*P"m\UtHhqTM^B3}rnτ f$Kq̛Z2 @Mp2phqU"K~J|=K}wkh53rm;3ELj`Yk[.^Bp 389j?l5H2V٥[kW_5x05WSXXDlIdQD`vYc #Uְpª/<a*DqD~ !z=VR%.`\L<wGؐ/=z^wI;1 wkMs[/Z%٨޾dm-D\o*YɨWk8fG+ IHeUeؕ2?nQakX8` ^HUbX1C-G g\-blT̊' Q"1v#Sô-w}az۳\A][ef5?2h>o+tkџvN=Ӎ-z%צ2 4137sdqeϲ` #"[:20;h5ve5wKa RHeOktsH.Xbm; >xE4+]DJV[}IBG(?,Vstn ȲffY}d0^%(Qc[4!K=p6lTr*5ܪM5W~kuE٥i6!hfѰow)5Ef"Lgę%F8l+5["7,ٚF_G!t[Q3$;ԶMÙ-:LNh$e˲퓒gN_iŅ'0X:3ჹ_1MZ'l .yKg\WBO/ok/M>sWYz[]KCnUcP5Q{<5{T1٢x+ o5I{l_wQ#k-BHi7GU|I~#&1tXl'9+-IENDB`wp/dev/wp-content/themes/default/index.php0000674000106600010660000000241010674053123016032 0ustar

    Not Found

    Sorry, but you are looking for something that isn't here.

    wp/dev/wp-content/themes/default/archive.php0000674000106600010660000000460410757065041016357 0ustar

    Archive for the ‘’ Category

    Posts Tagged ‘

    Archive for

    Archive for

    Archive for

    Author Archive

    Blog Archives

    Not Found

    wp/dev/wp-content/themes/default/comments.php0000674000106600010660000000757411007425154016566 0ustar post_password)) { // if there's a password if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie ?>

    This post is password protected. Enter the password to view comments.

    to “

    1. id="comment-"> Says: comment_approved == '0') : ?> Your comment is awaiting moderation.
    comment_status) : ?>

    Comments are closed.

    comment_status) : ?>

    Leave a Reply

    You must be logged in to post a comment.

    Logged in as . Log out »

    />

    />

    ID); ?>
    wp/dev/wp-content/themes/default/header.php0000674000106600010660000000300311051135642016147 0ustar > <?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?>

    wp/dev/wp-content/themes/default/404.php0000674000106600010660000000025310166423606015240 0ustar

    Error 404 - Not Found

    wp/dev/wp-content/themes/default/links.php0000674000106600010660000000027510747434177016067 0ustar

    Links:

    wp/dev/wp-content/themes/default/search.php0000674000106600010660000000251210674053123016173 0ustar

    Search Results

    No posts found. Try a different search?

    wp/dev/wp-content/themes/default/sidebar.php0000674000106600010660000000612610653411214016340 0ustar wp/dev/wp-content/themes/classic/0000775000106600010660000000000011051167752014215 5ustar wp/dev/wp-content/themes/classic/style.css0000674000106600010660000001276711034775124016104 0ustar /* Theme Name: WordPress Classic Theme URI: http://wordpress.org/ Description: The original WordPress theme that graced versions 1.2.x and prior. Version: 1.5 Author: Dave Shea Tags: mantle color, variable width, two columns, widgets Default WordPress by Dave Shea || http://mezzoblue.com Modifications by Matthew Mullenweg || http://photomatt.net This is just a basic layout, with only the bare minimum defined. Please tweak this and make it your own. :) */ a { color: #675; } a img { border: none; } a:visited { color: #342; } a:hover { color: #9a8; } acronym, abbr { border-bottom: 1px dashed #333; } acronym, abbr, span.caps { font-size: 90%; letter-spacing: .07em; } acronym, abbr { cursor: help; } blockquote { border-left: 5px solid #ccc; margin-left: 1.5em; padding-left: 5px; } body { background: #fff; border: 2px solid #565; border-bottom: 1px solid #565; border-top: 3px solid #565; color: #000; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; margin: 0; padding: 0; } cite { font-size: 90%; font-style: normal; } h2 { border-bottom: 1px dotted #ccc; font: 95% "Times New Roman", Times, serif; letter-spacing: 0.2em; margin: 15px 0 2px 0; padding-bottom: 2px; } h3 { border-bottom: 1px dotted #eee; font-family: "Times New Roman", Times, serif; margin-top: 0; } ol#comments li p { font-size: 100%; } p, li, .feedback { font: 90%/175% 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; letter-spacing: -1px; } /* classes used by the_meta() */ ul.post-meta { list-style: none; } ul.post-meta span.post-meta-key { font-weight: bold; } .credit { background: #90a090; border-top: 3px double #aba; color: #fff; font-size: 11px; margin: 10px 0 0 0; padding: 3px; text-align: center; } .credit a:link, .credit a:hover { color: #fff; } .feedback { color: #ccc; text-align: right; clear: both; } .meta { font-size: .75em; } .meta li, ul.post-meta li { display: inline; } .meta ul { display: inline; list-style: none; margin: 0; padding: 0; } .meta, .meta a { color: #808080; font-weight: normal; letter-spacing: 0; } .storytitle { margin: 0; } .storytitle a { text-decoration: none; } #commentform #author, #commentform #email, #commentform #url, #commentform textarea { background: #fff; border: 1px solid #333; padding: .2em; } #commentform textarea { width: 100%; } #commentlist li ul { border-left: 1px solid #ddd; font-size: 110%; list-style-type: none; } #commentlist li .avatar { float: right; margin-right: 25px; border: 1px dotted #ccc; padding: 2px; } #content { margin: 30px 13em 0 3em; padding-right: 60px; } #header { background: #90a090; border-bottom: 3px double #aba; border-left: 1px solid #9a9; border-right: 1px solid #565; border-top: 1px solid #9a9; font: italic normal 230% 'Times New Roman', Times, serif; letter-spacing: 0.2em; margin: 0; padding: 15px 10px 15px 60px; } #header a { color: #fff; text-decoration: none; } #header a:hover { text-decoration: underline; } #menu { background: #fff; border-left: 1px dotted #ccc; border-top: 3px solid #e0e6e0; padding: 20px 0 10px 30px; position: absolute; right: 2px; top: 0; width: 11em; } #menu form { margin: 0 0 0 13px; } #menu input#s { width: 80%; background: #eee; border: 1px solid #999; color: #000; } #menu ul { color: #ccc; font-weight: bold; list-style-type: none; margin: 0; padding-left: 3px; text-transform: lowercase; } #menu ul li { font: italic normal 110% 'Times New Roman', Times, serif; letter-spacing: 0.1em; margin-top: 10px; padding-bottom: 2px; /*border-bottom: dotted 1px #ccc;*/ } #menu ul ul { font-variant: normal; font-weight: normal; line-height: 100%; list-style-type: none; margin: 0; padding: 0; text-align: left; } #menu ul ul li { border: 0; font: normal normal 12px/115% 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; letter-spacing: 0; margin-top: 0; padding: 0; padding-left: 12px; } #menu ul ul li a { color: #000; text-decoration: none; } #menu ul ul li a:hover { border-bottom: 1px solid #809080; } #menu ul ul ul.children { font-size: 142%; padding-left: 4px; } #wp-calendar { border: 1px solid #ddd; empty-cells: show; font-size: 14px; margin: 0; width: 90%; } #wp-calendar #next a { padding-right: 10px; text-align: right; } #wp-calendar #prev a { padding-left: 10px; text-align: left; } #wp-calendar a { display: block; text-decoration: none; } #wp-calendar a:hover { background: #e0e6e0; color: #333; } #wp-calendar caption { color: #999; font-size: 16px; text-align: left; } #wp-calendar td { color: #ccc; font: normal 12px 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; letter-spacing: normal; padding: 2px 0; text-align: center; } #wp-calendar td.pad:hover { background: #fff; } #wp-calendar td:hover, #wp-calendar #today { background: #eee; color: #bbb; } #wp-calendar th { font-style: normal; text-transform: capitalize; } /* Captions & aligment */ .aligncenter, div.aligncenter { display: block; margin-left: auto; margin-right: auto; } .alignleft { float: left; } .alignright { float: right; } .wp-caption { border: 1px solid #ddd; text-align: center; background-color: #f3f3f3; padding-top: 4px; margin: 10px; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } .wp-caption img { margin: 0; padding: 0; border: 0 none; } .wp-caption p.wp-caption-text { font-size: 11px; line-height: 17px; padding: 0 4px 5px; margin: 0; } /* End captions & aligment */ wp/dev/wp-content/themes/classic/rtl.css0000674000106600010660000000372510650453250015533 0ustar /* Based on Arabic (RTL) version of WordPress Classic theme, converted by Serdal (Serdal.com) */ #menu ul ul, #wp-calendar caption, #wp-calendar #prev a { text-align: right; } #wp-calendar #next a, .feedback { text-align: left; } blockquote { border-left: 0; border-right: 5px solid #ccc; margin-left: auto; margin-right: 1.5em; padding-left: 0; padding-right: 5px; } body { font-family: 'Geeza Pro', Tahoma, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; } h2 { font: 95% 'Al Bayan', 'Traditional Arabic', "Times New Roman", Times, serif; } p, li, .feedback { font: 90%/175% 'Geeza Pro', Tahoma, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; text-align: justify; } acronym, abbr, span.caps, h2, p, li, #header, #menu ul li, #menu ul ul li, #wp-calendar td, .feedback, .meta, .meta a { letter-spacing: normal; } #commentlist li ul { border-left: 0; border-right: 1px solid #ddd; } #content { margin: 30px 3em 0 13em; padding-right: 0; padding-left: 60px; } #header { border-left: solid 1px #9a9; border-right: solid 1px #565; font: normal normal 230% 'Al Bayan', 'Traditional Arabic', 'Times New Roman', Times, serif; padding: 15px 60px 15px 10px; } #menu { border-left: 0; border-right: 1px dotted #ccc; padding: 20px 30px 10px 0; right: auto; left: 2px; } #menu form { margin: 0 13px 0 0; } #menu ul { padding-left: 0; padding-right: 3px; } #menu ul li { font: normal normal 110% 'Geeza Pro', Tahoma, 'Times New Roman', Times, serif; } #menu ul ul li { font: normal normal 12px/115% 'Geeza Pro', Tahoma, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; padding-left: 0; padding-right: 12px; } #menu ul ul ul.children { padding-left: 0; padding-right: 4px; } #wp-calendar #next a { padding-right: 0; padding-left: 10px; } #wp-calendar #prev a { padding-left: 0; padding-right: 10px; } #wp-calendar td { font: normal normal 12px 'Geeza Pro', Tahoma, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; } wp/dev/wp-content/themes/classic/footer.php0000674000106600010660000000064310336742474016235 0ustar

    WordPress"), __("Powered by WordPress, state-of-the-art semantic personal publishing platform.")); ?>

    wp/dev/wp-content/themes/classic/functions.php0000674000106600010660000000036510616722622016742 0ustar '
  • ', 'after_widget' => '
  • ', 'before_title' => '', 'after_title' => '', )); ?> wp/dev/wp-content/themes/classic/comments-popup.php0000674000106600010660000001170610770756771017736 0ustar <?php echo get_option('blogname'); ?> - <?php echo sprintf(__("Comments on %s"), the_title('','',false)); ?>

    RSS feed for comments on this post."); ?>

    ping_status) { ?>

    URL to TrackBack this entry is:"); ?>

    post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $commentstatus->post_password) { // and it doesn't match the cookie echo(get_the_password_form()); } else { ?>
    1. @

    comment_status) { ?>

    HTML allowed:"); ?>

    '.$user_identity.''); ?>

    " />


    " />

    ID); ?>

    Powered by WordPress"),__("Powered by WordPress, state-of-the-art semantic personal publishing platform.")); ?>

    wp/dev/wp-content/themes/classic/screenshot.png0000674000106600010660000002033410275357122017102 0ustar PNG  IHDR,ExgAMA7tEXtSoftwareAdobe ImageReadyqe<`PLTE̮ȼЮ؝dacЭߣ򦠥~urxzwD IDATx]e J4_¤}w{;('Eq@xKK}:=R|.לseͻG`udoοR옹^tYNp4σp~?,-gKAQPOP@G-2. m׻$j:k7dzݣF٩Un?XGydݥ{Z&qa!Xݭ"3q{$w [sy-/G7;G[De5d/iO!Ҟ8]),UF;k^o "X.ݕ0wZD^=K>VW_w*ଗgCp޿k$ 6lO]%%ڵ@lQR(1U=] +z~sRG&>u/eԷC varHlg=)3^@w_Z?i?Kȫd QB$_5}ϵ]s!.ġha{;xσx+`1*[`!U\)Ԡv'QEG\E1]VewDZIR\HpoH.t\=5DꪫƏ4׫kS@uFXF2oX r+T]5e;]wnpp_#(b7|!XNw"V=R{GT `5&WRI0313/U)~X=j"!omaM6DR6j k8l6 AR, mUEThGzE 4ք,uW+hZ>BUO1Od.sҢ!%!q<M_\6MTـ~^PZJ&d_8ʖ8ELjaX!W߭ډN T<fٯzfqك-t3%]@>GA]IRLL,FDT'GB+@crAcggOvuuuuJRѱ+ER>j\D ):||< vըZ!+.9S#8'[6X>Xf929W[LQ5X?Xm4!6+eZ;qR! ՐI}@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pxɤy0VhcAezԈ4Ml9HgĬb!g爍؃ٵ#gτV2&L{1vz Y`qCREhD'&eM4lut'/5`x glTX.8[ V3`605R&|߷b/I$_uR\JyHm:/kA` w, MtNFC9S5W$;X/c +Y!@!HrIEG"! P>?&W͉6ծlsgSc۪ҷM0<\B%9@< ',''); ?>

    @

    wp/dev/wp-content/themes/classic/comments.php0000674000106600010660000000664710767575672016612 0ustar post_password) && $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) : ?>

    ">»

    1. @

    RSS feed for comments on this post.')); ?> URL'); ?>

    logged in to post a comment.'), get_option('siteurl')."/wp-login.php?redirect_to=".urlencode(get_permalink()));?>

    '.$user_identity.''); ?>

    ID); ?>

    wp/dev/wp-content/themes/classic/header.php0000674000106600010660000000225510705462161016160 0ustar > <?php bloginfo('name'); ?><?php wp_title(); ?>

    wp/dev/wp-content/themes/classic/sidebar.php0000674000106600010660000000344110603511416016332 0ustar wp/dev/wp-cron.php0000644000106600010660000000235111016305267011302 0ustar time() ) exit; update_option('doing_cron', time() + 30); $crons = _get_cron_array(); $keys = array_keys($crons); if (!is_array($crons) || $keys[0] > time()) return; foreach ($crons as $timestamp => $cronhooks) { if ($timestamp > time()) break; foreach ($cronhooks as $hook => $keys) { foreach ($keys as $key => $args) { $schedule = $args['schedule']; if ($schedule != false) { $new_args = array($timestamp, $schedule, $hook, $args['args']); call_user_func_array('wp_reschedule_event', $new_args); } wp_unschedule_event($timestamp, $hook, $args['args']); do_action_ref_array($hook, $args['args']); } } } update_option('doing_cron', 0); ?>wp/dev/wp-links-opml.php0000644000106600010660000000370211016305267012427 0ustar \n"; ?> Links for <?php echo attribute_escape(get_bloginfo('name', 'display').$cat_name); ?> GMT name); ?> term_id}"); foreach ((array) $bookmarks as $bookmark) { $title = attribute_escape(apply_filters('link_title', $bookmark->link_name)); ?> wp/downloads/0000755000106600010660000000000011153643546010426 5ustar wp/downloads/Patoski-book-award.pdf0000644000106600010660000166042511153643514014570 0ustar %PDF-1.0 1 0 obj << /Type /Catalog /Pages 2 0 R >> endobj 2 0 obj << /Type /Pages /Kids [ 3 0 R ] /Count 1 >> endobj 3 0 obj << /Type /Page /Parent 2 0 R /MediaBox [ 0 0 609 791 ] /Rotate 0 /Contents 4 0 R /Resources 6 0 R >> endobj 4 0 obj << /Length 5 0 R >> stream q 543 0 0 732 0 59 cm /Im1 Do Q endstream endobj 5 0 obj 36 endobj 6 0 obj << /ProcSet [/PDF /ImageC] /XObject << /Im1 7 0 R >> >> endobj 7 0 obj << /Type /XObject /Subtype /Image /Width 2261 /Height 3048 /ColorSpace /DeviceRGB /BitsPerComponent 8 /Length 482749 /Filter /DCTDecode >> stream JFIF,,C   (1#%(:3=<9387@H\N@DWE78PmQW_bghg>Mqypdx\egcC//cB8Bcccccccccccccccccccccccccccccccccccccccccccccccccc " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ? (()h )(JZ( ((Z(Z))h)hZ)2z-%޿:gс,fZJZJZ)()h()h()i(ZJ(()h((( )(JZ( ( JZJZJZJZ( ()h(((Z)(((Z( JZ( ))h)h ( J)h((( JZ(((J(((ZJ)h((JZJZ( ( ( ( JZ(((JZJZ()h ( ( JZJZ(()h )((Z(( ))h)h( (J)hZ(J(Z()h )(J( ( ( JZ()i)h)h ( ( ))h)h(((()h(((ZJ)h ( (((Z( (\6v c3sQkfv K9Up?Zʺ[ȵ5djc^{7YT@1k6]Nqd-̇L,z|V4yrkTd{#o^g: 'y]B/ɞuⵊ Tɞ_W6[$ֿ]i.MIQE`!i(?鱘!!)۲SK$q ¸n&vi.&m\21FBr\_ƶtM>+||>ВA]!kcx67~BlsssQėb63084nE8$5eiƒ1QQ"8UbHK2}x5ܟذ\\_a= S(p e$۷Fooc7y#Il'%گ_x*4gFG &0}JD쒩RQ=$`H K\|@l\Z>mc,Wv(d`AyEňZ)i*@ji)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0 k[N*\6|9zg/YG${,6:]K@M;[]$Yy?g>J.,sa8yyȭ{s#/7cӭⴷlq( k?]ΩYmy'AE_8vVM[ gmͿ`>}PZ )T͎Nzt]Iյm^ES!8tfHg6BIl'Vh旫隽բ4wDd%{ri|CӪ&K!rzd# uP!uu].{k ]ow5Zfج@!e, =8߭tx oT5摧u1tP

    %1$s spam for you since you first installed it.'), number_format_i18n($count) ); ?>

    '.__('You have no spam currently in the queue. Must be your lucky day. :)').'

    '; echo '