| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652 |
- <?php return array (
- 'resourceClass' => 'modDocument',
- 'resource' =>
- array (
- 'id' => 94,
- 'type' => 'document',
- 'contentType' => 'text/html',
- 'pagetitle' => 'Albrecht Soil Analysis',
- 'longtitle' => 'Albrecht Soil Analysis Reporting',
- 'description' => 'Dr. Albrecht saw a direct link between soil quality and food quality, drawing a direct connection between poor quality forage crops, and ill health in livestock. Use crop monitor online soil analysis to start the journey to better soil and crop quality.',
- 'alias' => 'albrecht-soil-analysis',
- 'alias_visible' => 1,
- 'link_attributes' => '',
- 'published' => 1,
- 'pub_date' => 0,
- 'unpub_date' => 0,
- 'parent' => 0,
- 'isfolder' => 0,
- 'introtext' => 'When you correct cation balance, you have addressed soil chemistry, which improves the physical structure of the soil.',
- 'content' => '<!-- Page Content -->
- <section id="about" class="py-5">
- <div class="container">
- <h2 class="text-success">Albrecht Soil Analysis</h2>
-
- <hr>
-
- <blockquote class="blockquote text-center">
- <p class="mb-0">The soil is the ‘<i>creative material</i>’ of most of the basic needs of life. Creation starts with a handful of dust.</p>
- <footer class="blockquote-footer">Dr. William A. Abrecht. <cite title="Source Title">University of Missouri</cite></footer>
- </blockquote>
-
- <hr>
-
- <div class="row card-deck">
- <div class="card border-success text-center mb-3">
- <div class="card-body">
- <h2 class="card-title text-center">Physical</h2>
- <i class="fas fa-atom fa-3x"></i>
- <p class="card-text">When you correct cation balance, you have addressed soil chemistry, which improves the physical structure of the soil.</p>
- </div>
- </div>
-
- <div class="card border-success text-center mb-3">
- <div class="card-body">
- <h2 class="card-title text-center">Chemical</h2>
- <i class="fas fa-flask fa-3x"></i>
- <p class="card-text">The correction of cation balance and the provision of minimum levels of micronutrients tkatesk care of the chemical part of soil productivity and health.</p>
- </div>
- </div>
-
- <div class="card border-success text-center mb-3">
- <div class="card-body">
- <h2 class="card-title text-center">Biological</h2>
- <i class="fas fa-bug fa-3x"></i>
- <p class="card-text">The essential understanding involves a recognition that the purpose of cation balancing is to stimulate soil biology, and much of the beneficial response relates to firing up this workforce</p>
- </div>
- </div>
- </div>
-
- <hr>
- </div>
- </section>
- <!-- Projects Section -->
- <section id="services" class="projects-section bg-light pt-2">
- <div class="container">
- [[!getResources?
- &parents=`[[*id]]`
- &level=`0`
- &includeTVs=`1`
- &processTVs=`1`
- &includeContent=`1`
- &tplFirst=`projectsSectionFIRST`
- &tpl=`projectsSectionEVEN`
- &tplOdd=`projectsSectionODD`
- &sortby=`FIELD(modResource.id, 95 )`
- &sortdir=`ASC`
- &limit=`0`
- ]]
- </div>
- </section>
-
- <section class="bg-dark text-light py-5" id="blog" >
- <div class="container">
- <p class="lead">
-
- </p>
- </div>
- </section>
- <section class="py-5" id="contact" >
- <div class="container">
- <p class="lead">
- Dr. Albrecht saw a direct link between soil quality and food quality, drawing direct connection between poor quality forage crops, and ill health in livestock.
- </p>
- </div>
- </section>
- <section class="bg-dark text-light py-5" id="login" >
- <div class="container">
- <p class="lead">
- Feed the soil to feed the plant is another vital concept of the Albrecht Model of soil building.
- </p>
- </div>
- </section>
- <section class="py-5" id="" >
- <div class="container">
- <p class="lead">
- Feed the soil to feed the plant is another vital concept of the Albrecht Model of soil building.
- </p>
- </div>
- </section>',
- 'richtext' => 0,
- 'template' => 13,
- 'menuindex' => 10,
- 'searchable' => 1,
- 'cacheable' => 1,
- 'createdby' => 1,
- 'createdon' => 1564350148,
- 'editedby' => 1,
- 'editedon' => 1566968689,
- 'deleted' => 0,
- 'deletedon' => 0,
- 'deletedby' => 0,
- 'publishedon' => 1564350120,
- 'publishedby' => 1,
- 'menutitle' => 'Soil Analysis',
- 'donthit' => 0,
- 'privateweb' => 0,
- 'privatemgr' => 0,
- 'content_dispo' => 0,
- 'hidemenu' => 1,
- 'class_key' => 'modDocument',
- 'context_key' => 'web',
- 'content_type' => 1,
- 'uri' => 'albrecht-soil-analysis.html',
- 'uri_override' => 0,
- 'hide_children_in_tree' => 0,
- 'show_in_tree' => 1,
- 'properties' => NULL,
- '_content' => '<!doctype html>
- <html lang="en">
- <head>
- <title>Albrecht Soil Analysis Reporting | Crop Monitor</title>
- <base href="[[!++site_url]]" >
- <meta charset="UTF-8" >
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" >
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
- <meta name="keywords" content="When you correct cation balance, you have addressed soil chemistry, which improves the physical structure of the soil." >
- <meta name="description" content="Dr. Albrecht saw a direct link between soil quality and food quality, drawing a direct connection between poor quality forage crops, and ill health in livestock. Use crop monitor online soil analysis to start the journey to better soil and crop quality." >
-
- <link rel="icon" href="client-assets/images/favicon.ico?v=2" type="image/x-icon" >
- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
- <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
- <script type="text/javascript" src="https://use.fontawesome.com/1e2844bb90.js"></script>
- <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" integrity="sha384-gfdkjb5BdAXd+lj+gudLWI+BXq4IuLW5IT+brZEZsLFm++aCMlF1V92rMkPaX4PP" crossorigin="anonymous" />
- <link rel="stylesheet" type="text/css" href="/client-assets/weather-icons/css/weather-icons.min.css?version=1.16" />
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/magnific-popup.css" />
- <!-- Custom styles for this template -->
- <link rel="stylesheet" href="client-assets/css/greyscale.css" >
-
- </header>
-
- <body>
-
- <style>
- .carousel-item {
- height: 65vh;
- min-height: 250px;
- background: no-repeat center center scroll;
- -webkit-background-size: cover;
- -moz-background-size: cover;
- -o-background-size: cover;
- background-size: cover;
- }
- .nav-link {
- /* font-size: 2em; */
- text-align: center;
- font-weight: bold;
- }
- </style>
-
- <!-- Navigation -->
- <nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top" id="mainNav">
- <div class="container">
- <a class="navbar-brand js-scroll-trigger" href="#">
- <img src="client-assets/images/favicon.ico" width="30" height="30" class="d-inline-block align-top" alt="">
- Crop monitor
- </a>
-
- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
- <span class="navbar-toggler-icon"></span>
- </button>
-
- <div class="collapse navbar-collapse" id="navbarResponsive">
-
- <form class="form-inline mx-auto justify-content-center d-none d-md-block">
- <button class="btn btn-sm btn-outline-success" type="button">Try a Albrecht Soil Analysis Reporting Free</button>
- </form>
-
- <ul class="navbar-nav ml-auto">
- <li class="nav-item">
- <a class="nav-link js-scroll-trigger" href="about.html">About</a>
- </li>
- <li class="nav-item">
- <a class="nav-link js-scroll-trigger" href="blog/">Blog</a>
- </li>
- <li class="nav-item">
- <a class="nav-link js-scroll-trigger" href="contact-us.html">Contact Us</a>
- </li>
- <li class="nav-item">
- <a class="nav-link js-scroll-trigger" href="login/">Login</a>
- </li>
- <div class="row">
- <li class="col pr-0 nav-item"><a class="nav-link text-dark" href="#"><i class="fab fa-facebook-f"></i></a></li>
- <li class="col px-0 nav-item"><a class="nav-link text-dark" href="#"><i class="fab fa-twitter"></i></a></li>
- <li class="col pl-0 nav-item"><a class="nav-link text-dark" href="#"><i class="fab fa-instagram"></i></a></li>
- </div>
- </ul>
- </div>
- </div>
- </nav>
- <header>
- <div id="carouselLandingPage" class="carousel slide" data-ride="carousel">
- <ol class="carousel-indicators">
- <li data-target="#carouselLandingPage" data-slide-to="0" class="active"></li>
- <li data-target="#carouselLandingPage" data-slide-to="1"></li>
- <li data-target="#carouselLandingPage" data-slide-to="2"></li>
- </ol>
- <div class="carousel-inner" role="listbox">
-
- [[!Gallery?
- &album=`Albrech Landing Page`
- &thumbTpl=`slideshow_landing_page`
- ]]
-
- <style>
- .slideOne {
- background-image: linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.25) ), url(\'client-assets/FredTemplate/images/work.png\'), url(\'client-assets/FredTemplate/images/g6.jpg\');
- background-size: cover, auto 300px;
- background-position: center, center right 25%;
- }
- .slideTwo {
- background-image: linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.25) ), url(\'client-assets/FredTemplate/images/work.png\'), url(\'client-assets/FredTemplate/images/g7.jpg\');
- background-size: cover, auto 300px;
- background-position: center, center right 25%;
- }
- .slideThree {
- background-image: linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.25) ), url(\'client-assets/FredTemplate/images/work.png\'), url(\'client-assets/FredTemplate/images/g3.jpg\');
- background-size: cover, auto 300px;
- background-position: center, center right 25%;
- }
- </style>
-
- <!-- Slide One - Set the background image for this slide in the line below -->
- <div class="carousel-item active slideOne" style=" ">
- <div class="carousel-caption text-left">
- <div class="row">
- <div class="col-md-9">
- <h2 class="text-bold">Albrecht Soil Analysis Reporting</h2>
- <p class="lead col-12 col-md-6 ">When you correct cation balance, you have addressed soil chemistry, which improves the physical structure of the soil.</p>
- <p class="col-12 col-md-6 font-italic d-none d-md-block">Dr. Albrecht saw a direct link between soil quality and food quality, drawing a direct connection between poor quality forage crops, and ill health in livestock. Use crop monitor online soil analysis to start the journey to better soil and crop quality.</p>
- <a href="#" class="btn btn-outline-success">Get a Free Soil Report now!</a>
- </div>
- <div class="col-md-3 d-none d-md-block align-middle">
- <!-- <img src="client-assets/FredTemplate/images/work.png" class="img-fluid mx-auto" alt="Responsive image"> -->
- </div>
- </div>
- </div>
- </div>
-
- <!-- Slide Two - Set the background image for this slide in the line below -->
- <div class="carousel-item slideTwo" style="">
- <div class="carousel-caption text-left">
- <div class="row">
- <div class="col-md-8">
- <h2 class="text-bold">Second Slide</h2>
- <p class="lead col-12 col-md-6 ">This is a description for the second slide.</p>
- <p class="col-12 col-md-6 font-italic d-none d-md-block"></p>
- <a href="#" class="btn btn-outline-success">Get a Free Soil Report now!</a>
- </div>
- <div class="col-md-4 d-none d-md-block">
- <!-- <img src="client-assets/FredTemplate/images/work.png" class="img-fluid mx-auto align-middle" alt="Responsive image"> -->
- </div>
- </div>
- </div>
- </div>
-
- <!-- Slide Three - Set the background image for this slide in the line below -->
- <div class="carousel-item slideThree" style="">
- <div class="carousel-caption text-left">
- <div class="row">
- <div class="col-md-8">
- <h2 class="text-bold">Third Slide</h2>
- <p class="lead col-12 col-md-6 ">This is a description for the third slide.</p>
- <p class="col-12 col-md-6 font-italic d-none d-md-block"></p>
- <a href="#" class="btn btn-outline-success">Get a Free Soil Report now!</a>
- </div>
- <div class="col-md-4 d-none d-md-block">
- <!-- <img src="client-assets/FredTemplate/images/work.png" class="img-fluid mx-auto align-middle" alt="Responsive image"> -->
- </div>
- </div>
- </div>
- </div>
- </div>
-
- <a class="carousel-control-prev" href="#carouselLandingPage" role="button" data-slide="prev">
- <span class="carousel-control-prev-icon" aria-hidden="true"></span>
- <span class="sr-only">Previous</span>
- </a>
- <a class="carousel-control-next" href="#carouselLandingPage" role="button" data-slide="next">
- <span class="carousel-control-next-icon" aria-hidden="true"></span>
- <span class="sr-only">Next</span>
- </a>
- </div>
- </header>
- <!-- Page Content -->
- <section id="about" class="py-5">
- <div class="container">
- <h2 class="text-success">Albrecht Soil Analysis</h2>
-
- <hr>
-
- <blockquote class="blockquote text-center">
- <p class="mb-0">The soil is the ‘<i>creative material</i>’ of most of the basic needs of life. Creation starts with a handful of dust.</p>
- <footer class="blockquote-footer">Dr. William A. Abrecht. <cite title="Source Title">University of Missouri</cite></footer>
- </blockquote>
-
- <hr>
-
- <div class="row card-deck">
- <div class="card border-success text-center mb-3">
- <div class="card-body">
- <h2 class="card-title text-center">Physical</h2>
- <i class="fas fa-atom fa-3x"></i>
- <p class="card-text">When you correct cation balance, you have addressed soil chemistry, which improves the physical structure of the soil.</p>
- </div>
- </div>
-
- <div class="card border-success text-center mb-3">
- <div class="card-body">
- <h2 class="card-title text-center">Chemical</h2>
- <i class="fas fa-flask fa-3x"></i>
- <p class="card-text">The correction of cation balance and the provision of minimum levels of micronutrients tkatesk care of the chemical part of soil productivity and health.</p>
- </div>
- </div>
-
- <div class="card border-success text-center mb-3">
- <div class="card-body">
- <h2 class="card-title text-center">Biological</h2>
- <i class="fas fa-bug fa-3x"></i>
- <p class="card-text">The essential understanding involves a recognition that the purpose of cation balancing is to stimulate soil biology, and much of the beneficial response relates to firing up this workforce</p>
- </div>
- </div>
- </div>
-
- <hr>
- </div>
- </section>
- <!-- Projects Section -->
- <section id="services" class="projects-section bg-light pt-2">
- <div class="container">
- [[!getResources?
- &parents=`94`
- &level=`0`
- &includeTVs=`1`
- &processTVs=`1`
- &includeContent=`1`
- &tplFirst=`projectsSectionFIRST`
- &tpl=`projectsSectionEVEN`
- &tplOdd=`projectsSectionODD`
- &sortby=`FIELD(modResource.id, 95 )`
- &sortdir=`ASC`
- &limit=`0`
- ]]
- </div>
- </section>
-
- <section class="bg-dark text-light py-5" id="blog" >
- <div class="container">
- <p class="lead">
-
- </p>
- </div>
- </section>
- <section class="py-5" id="contact" >
- <div class="container">
- <p class="lead">
- Dr. Albrecht saw a direct link between soil quality and food quality, drawing direct connection between poor quality forage crops, and ill health in livestock.
- </p>
- </div>
- </section>
- <section class="bg-dark text-light py-5" id="login" >
- <div class="container">
- <p class="lead">
- Feed the soil to feed the plant is another vital concept of the Albrecht Model of soil building.
- </p>
- </div>
- </section>
- <section class="py-5" id="" >
- <div class="container">
- <p class="lead">
- Feed the soil to feed the plant is another vital concept of the Albrecht Model of soil building.
- </p>
- </div>
- </section>
-
- <!-- Signup Section -->
- <section id="signup" class="signup-section">
- <div class="container">
- <div class="row">
- <div class="col-md-10 col-lg-8 mx-auto text-center">
- <i class="far fa-paper-plane fa-2x mb-2 text-white"></i>
- <h2 class="text-white mb-5">Subscribe to receive updates!</h2>
- [[!FormIt?
- &hooks=`MailChimpSubscribe`
- &validate=`email:email:required,name:required`
- &validationErrorMessage=`true`
- &clearFieldsOnSuccess=`1`
- &submitVar=`newsletter-submit`
- &mailchimpListId=`04e221f3bc`
- &mailchimpFields=`name=FNAME,email=EMAIL`
- &mailchimpSubscribeField=`newsletter`
- &mailchimpSubscribeFieldValue=`1`
- &successMessage=`Thankyou for subscribing`
- ]]
- <span>[[!+fi.successMessage:notempty=`<h2 class="text-white mb-5">[[!+fi.successMessage]]</h2>`]]
- [[!+fi.validation_error_message:notempty=`<h2 class="text-white mb-5">[[+errors]] [[!+fi.validation_error_message]]</h2>`]]</span>
- <form action="albrecht-soil-analysis.html#signup" method="post" class="form-inline d-flex">
- <input type="hidden" name="nospam" value="" />
- <input class="form-control flex-fill mr-0 mr-sm-2 mb-3 mb-sm-0" type="email" name="email" id="email" value="[[!+fi.email]]" placeholder="Email Address" >
- <input class="form-control flex-fill mr-0 mr-sm-2 mb-3 mb-sm-0" type="text" name="name" id="name" value="[[!+fi.name]]" placeholder="Full Name">
- <input type="submit" name="newsletter-submit" class="btn btn-success mx-auto" value="Subscribe" />
- </form>
-
- </div>
- </div>
- </div>
- </section>
- <!-- Contact Section -->
- <section id="contact" class="contact-section bg-black">
- <div class="container">
-
- <div class="row">
- <div class="col-md-4 mb-3 mb-md-0">
- <div class="card py-4 h-100">
- <div class="card-body text-center">
- <i class="fas fa-map-marked-alt text-primary mb-2"></i>
- <h4 class="text-uppercase m-0">Address</h4>
- <hr class="my-4">
- <div class="small text-black-50">34 Coplestone Street,<br> Scottsdale, Tasmania 7260</div>
- </div>
- </div>
- </div>
-
- <div class="col-md-4 mb-3 mb-md-0">
- <div class="card py-4 h-100">
- <div class="card-body text-center">
- <i class="fas fa-envelope text-primary mb-2"></i>
- <h4 class="text-uppercase m-0">Email</h4>
- <hr class="my-4">
- <div class="small text-black-50">
- <a href="#">enquiry@cropmonitor.info</a>
- </div>
- </div>
- </div>
- </div>
-
- <div class="col-md-4 mb-3 mb-md-0">
- <div class="card py-4 h-100">
- <div class="card-body text-center">
- <i class="fas fa-mobile-alt text-primary mb-2"></i>
- <h4 class="text-uppercase m-0">Phone</h4>
- <hr class="my-4">
- <div class="small text-black-50">0417 728 061</div>
- </div>
- </div>
- </div>
- </div>
-
- <div class="row">
- <div class="col mb-3 mt-3 mb-md-0">
- <div class="card py-4 h-100">
- <div class="card-body text-center">
- <i class="fas fa-mobile-alt text-primary mb-2"></i>
- <h4 class="text-uppercase m-0">Contact Us</h4>
- <hr class="my-4">
- [[!FormIt?
- &hooks=`spam,email`
- &submitVar=`enquiry-submit`
- &emailTpl=`CMenquiryEmailTpl`
- &emailTo=`enquiries@cropmonitor.info`
- &successMessage=`Thankyou for contacting us, we will be in touch soon.`
- &validationErrorMessage=`true`
- &validate=`nospam:blank,
- name:required,
- email:email:required,
- text:required:stripTags`
- ]]
- <span>
- [[!+fi.successMessage:notempty=`<div class="small text-black-50">[[!+fi.successMessage]]</div>`]]
- [[!+fi.validation_error_message:notempty=`<div class="small text-black-50">[[+errors]] [[!+fi.validation_error_message]]</div>`]]
- </span>
- <form action="albrecht-soil-analysis.html#contact" method="post" class="form-inline d-flex">
- <input type="hidden" name="nospam" value="" />
- <input class="form-control form-control-sm flex-fill mr-0 mr-sm-2 mb-3 mb-sm-0" type="email" name="email" id="email" value="[[!+fi.email]]" placeholder="Email Address" >
- <input class="form-control form-control-sm flex-fill mr-0 mr-sm-2 mb-3 mb-sm-0" type="text" name="name" id="name" value="[[!+fi.name]]" placeholder="Full Name">
- <textarea class="form-control form-control-sm flex-fill mr-0 mr-sm-2 mb-3 mb-sm-0" name="text" id="text" rows="1" value="[[!+fi.text]]" placeholder="Your enquiry is about...." ></textarea>
- <input type="submit" name="enquiry-submit" class="btn-sm btn btn-success" value="Submit" />
- </form>
- </div>
- </div>
- </div>
- </div>
-
- <!--
- <div class="social d-flex justify-content-center">
- <a href="#" class="mx-2">
- <i class="fab fa-youtube"></i>
- </a>
- <a href="#" class="mx-2">
- <i class="fab fa-facebook-f"></i>
- </a>
- <a href="#" class="mx-2">
- <i class="fab fa-linkedin"></i>
- </a>
- </div>
- -->
- </div>
- </section>
- <!-- Footer -->
- <footer class="footer bg-dark py-2 text-center text-white-50">
- <div class="container">
- <span>© 2005-2019 by Crop Monitor</span>. All Rights Reserved<a href="/"></a>
- </div>
- </footer>
-
- </body>
- <!-- jQuery first, then Popper.js, then Bootstrap JS -->
- <script type="text/javascript" src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script>
- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
- <script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
- <script type="text/javascript">
- addEventListener("load", function() {
- setTimeout(hideURLbar, 0);
- }, false);
- function hideURLbar(){
- window.scrollTo(0,1);
- }
- </script>
- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js" integrity="sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o" crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.js"></script>
- </html>',
- '_isForward' => false,
- ),
- 'contentType' =>
- array (
- 'id' => 1,
- 'name' => 'HTML',
- 'description' => 'HTML content',
- 'mime_type' => 'text/html',
- 'file_extensions' => '.html',
- 'headers' => NULL,
- 'binary' => 0,
- ),
- 'policyCache' =>
- array (
- ),
- 'elementCache' =>
- array (
- '[[*longtitle]]' => 'Albrecht Soil Analysis Reporting',
- '[[*introtext]]' => 'When you correct cation balance, you have addressed soil chemistry, which improves the physical structure of the soil.',
- '[[*description]]' => 'Dr. Albrecht saw a direct link between soil quality and food quality, drawing a direct connection between poor quality forage crops, and ill health in livestock. Use crop monitor online soil analysis to start the journey to better soil and crop quality.',
- '[[$dash-header]]' => '<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
- <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
- <script type="text/javascript" src="https://use.fontawesome.com/1e2844bb90.js"></script>
- <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" integrity="sha384-gfdkjb5BdAXd+lj+gudLWI+BXq4IuLW5IT+brZEZsLFm++aCMlF1V92rMkPaX4PP" crossorigin="anonymous" />
- <link rel="stylesheet" type="text/css" href="/client-assets/weather-icons/css/weather-icons.min.css?version=1.16" />
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/magnific-popup.css" />',
- '[[~18]]' => 'about.html',
- '[[~71]]' => 'blog/',
- '[[~17]]' => 'contact-us.html',
- '[[~4]]' => 'login/',
- '[[*id]]' => 94,
- '[[~94]]' => 'albrecht-soil-analysis.html',
- '[[SimpleCopyright? &startYear=`2005`]]' => '<span>© 2005-2019 by Crop Monitor</span>',
- '[[~1]]' => '/',
- '[[$dash-footer]]' => '<!-- jQuery first, then Popper.js, then Bootstrap JS -->
- <script type="text/javascript" src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script>
- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
- <script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
- <script type="text/javascript">
- addEventListener("load", function() {
- setTimeout(hideURLbar, 0);
- }, false);
- function hideURLbar(){
- window.scrollTo(0,1);
- }
- </script>
- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js" integrity="sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o" crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.js"></script>',
- ),
- 'sourceCache' =>
- array (
- 'modChunk' =>
- array (
- 'dash-header' =>
- array (
- 'fields' =>
- array (
- 'id' => 13,
- 'source' => 0,
- 'property_preprocess' => false,
- 'name' => 'dash-header',
- 'description' => '',
- 'editor_type' => 0,
- 'category' => 0,
- 'cache_type' => 0,
- 'snippet' => '<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
- <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
- <script type="text/javascript" src="https://use.fontawesome.com/1e2844bb90.js"></script>
- <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" integrity="sha384-gfdkjb5BdAXd+lj+gudLWI+BXq4IuLW5IT+brZEZsLFm++aCMlF1V92rMkPaX4PP" crossorigin="anonymous" />
- <link rel="stylesheet" type="text/css" href="/client-assets/weather-icons/css/weather-icons.min.css?version=1.16" />
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/magnific-popup.css" />',
- 'locked' => false,
- 'properties' =>
- array (
- ),
- 'static' => false,
- 'static_file' => '',
- 'content' => '<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
- <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
- <script type="text/javascript" src="https://use.fontawesome.com/1e2844bb90.js"></script>
- <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" integrity="sha384-gfdkjb5BdAXd+lj+gudLWI+BXq4IuLW5IT+brZEZsLFm++aCMlF1V92rMkPaX4PP" crossorigin="anonymous" />
- <link rel="stylesheet" type="text/css" href="/client-assets/weather-icons/css/weather-icons.min.css?version=1.16" />
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/magnific-popup.css" />',
- ),
- 'policies' =>
- array (
- 'web' =>
- array (
- ),
- ),
- 'source' =>
- array (
- ),
- ),
- 'sc_chunk' =>
- array (
- 'fields' =>
- array (
- 'id' => 24,
- 'source' => 1,
- 'property_preprocess' => false,
- 'name' => 'sc_chunk',
- 'description' => 'This chunk styles the year output',
- 'editor_type' => 0,
- 'category' => 4,
- 'cache_type' => 0,
- 'snippet' => '<span>© [[+output]] by [[++site_name]]</span>',
- 'locked' => false,
- 'properties' =>
- array (
- ),
- 'static' => false,
- 'static_file' => '',
- 'content' => '<span>© [[+output]] by [[++site_name]]</span>',
- ),
- 'policies' =>
- array (
- 'web' =>
- array (
- ),
- ),
- 'source' =>
- array (
- 'id' => 1,
- 'name' => 'Filesystem',
- 'description' => '',
- 'class_key' => 'sources.modFileMediaSource',
- 'properties' =>
- array (
- 'fred' =>
- array (
- 'name' => 'fred',
- 'desc' => '',
- 'type' => 'combo-boolean',
- 'options' =>
- array (
- ),
- 'value' => false,
- 'lexicon' => NULL,
- ),
- 'fredReadOnly' =>
- array (
- 'name' => 'fredReadOnly',
- 'desc' => '',
- 'type' => 'combo-boolean',
- 'options' =>
- array (
- ),
- 'value' => false,
- 'lexicon' => NULL,
- ),
- ),
- 'is_stream' => true,
- ),
- ),
- 'dash-footer' =>
- array (
- 'fields' =>
- array (
- 'id' => 15,
- 'source' => 0,
- 'property_preprocess' => false,
- 'name' => 'dash-footer',
- 'description' => '',
- 'editor_type' => 0,
- 'category' => 0,
- 'cache_type' => 0,
- 'snippet' => '<!-- jQuery first, then Popper.js, then Bootstrap JS -->
- <script type="text/javascript" src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script>
- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
- <script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
- <script type="text/javascript">
- addEventListener("load", function() {
- setTimeout(hideURLbar, 0);
- }, false);
- function hideURLbar(){
- window.scrollTo(0,1);
- }
- </script>
- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js" integrity="sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o" crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.js"></script>',
- 'locked' => false,
- 'properties' =>
- array (
- ),
- 'static' => false,
- 'static_file' => '',
- 'content' => '<!-- jQuery first, then Popper.js, then Bootstrap JS -->
- <script type="text/javascript" src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script>
- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
- <script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
- <script type="text/javascript">
- addEventListener("load", function() {
- setTimeout(hideURLbar, 0);
- }, false);
- function hideURLbar(){
- window.scrollTo(0,1);
- }
- </script>
- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js" integrity="sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o" crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.js"></script>',
- ),
- 'policies' =>
- array (
- 'web' =>
- array (
- ),
- ),
- 'source' =>
- array (
- ),
- ),
- ),
- 'modSnippet' =>
- array (
- 'SimpleCopyright' =>
- array (
- 'fields' =>
- array (
- 'id' => 12,
- 'source' => 1,
- 'property_preprocess' => false,
- 'name' => 'SimpleCopyright',
- 'description' => 'This Snippet returns the current year and can be called with a placeholder for the start year of the website.',
- 'editor_type' => 0,
- 'category' => 4,
- 'cache_type' => 0,
- 'snippet' => '/*
- * DESCRIPTION:
- * This snippet returns the current year
- * It is then styled with a chunk to output a copyright notice which you can adapt to fit your needs.
- * You can call this snippet with a startyear for your website.
- * If you use a start year it automatically changes when the year passes.
- * i.e. 2012 turns into 2012-2013
- *
- * PARAMETERS:
- * @ &startYear (string) optional. Default: Current Year
- * @ &separator (string) optional. Default: \'-\'
- * @ &static (bool) optional. Default: 0
- * @ &tpl (string) optional. Default: \'sc_chunk\'
- *
- * PLACEHOLDERS:
- * @ [[+output]]
- *
- * The usage defines \'2012\' as the \'current\' year purely for illustration purpose only.
- * This is obviously wrong in 2013 or up...
- *
- * USAGE:
- * // Outputs: "© 2012 by [[+site_name]]"
- * [[SimpleCopyright]]
- *
- * // Outputs: "© 2007-2012 by [[+site_name]]"
- * // After newyears eve it turns into 2012-2013 automatically
- * [[SimpleCopyright? &startYear=`2007`]]
- *
- * // Outputs: "© 2004 by [[+site_name]]".
- * // Always use \'static\' in conjunction with \'startYear\'.
- * // If you use \'static\' only it will ignore it\'s setting and resolve to the current year.
- * [[SimpleCopyright? &startYear=`2004` &static=`1`]]
- *
- * You can also set the separator just for fun...
- * It defaults to "-"
- *
- * This outputs "© 2007/2012"
- * [[SimpleCopyright? &startYear=`2007` &separator=`/`]]
- *
- */
- // Get the current year
- $currentYear = date(\'Y\');
- // Check for a starting year, separator, static & chunk
- $startYear = (string) $modx->getOption(\'startYear\', $scriptProperties);
- $separator = (string) $modx->getOption(\'separator\', $scriptProperties, \'-\');
- $static = (bool) $modx->getOption(\'static\', $scriptProperties, 0);
- $tpl = (string) $modx->getOption(\'tpl\', $scriptProperties, \'sc_chunk\');
- if($static&&!empty($startYear)){
- // is static : can be the future too
- $construct = $startYear;
- } elseif(!empty($startYear)) {
- // is semi dynamic : set with a starting year that never exceeds the future
- $construct = ($startYear>=$currentYear ? $currentYear : $startYear.$separator.$currentYear);
- } else {
- // is dynamic : changes with each year
- $construct = $currentYear;
- }
- // Get a chunk to style the output & check if it exists...
- $chunk = $modx->getObject(\'modChunk\',array(
- \'name\' => $tpl
- ));
- if (!$chunk){
- // If no chunk is found return error & write to log
- $modx->log(xPDO::LOG_LEVEL_ERROR, \'No chunk found!\');
- return \'No chunk found!\';
- } else {
- $outputString = $modx->getChunk($tpl,array(
- \'output\' => $construct
- ));
- }
-
- return $outputString;',
- 'locked' => false,
- 'properties' =>
- array (
- ),
- 'moduleguid' => '',
- 'static' => false,
- 'static_file' => '',
- 'content' => '/*
- * DESCRIPTION:
- * This snippet returns the current year
- * It is then styled with a chunk to output a copyright notice which you can adapt to fit your needs.
- * You can call this snippet with a startyear for your website.
- * If you use a start year it automatically changes when the year passes.
- * i.e. 2012 turns into 2012-2013
- *
- * PARAMETERS:
- * @ &startYear (string) optional. Default: Current Year
- * @ &separator (string) optional. Default: \'-\'
- * @ &static (bool) optional. Default: 0
- * @ &tpl (string) optional. Default: \'sc_chunk\'
- *
- * PLACEHOLDERS:
- * @ [[+output]]
- *
- * The usage defines \'2012\' as the \'current\' year purely for illustration purpose only.
- * This is obviously wrong in 2013 or up...
- *
- * USAGE:
- * // Outputs: "© 2012 by [[+site_name]]"
- * [[SimpleCopyright]]
- *
- * // Outputs: "© 2007-2012 by [[+site_name]]"
- * // After newyears eve it turns into 2012-2013 automatically
- * [[SimpleCopyright? &startYear=`2007`]]
- *
- * // Outputs: "© 2004 by [[+site_name]]".
- * // Always use \'static\' in conjunction with \'startYear\'.
- * // If you use \'static\' only it will ignore it\'s setting and resolve to the current year.
- * [[SimpleCopyright? &startYear=`2004` &static=`1`]]
- *
- * You can also set the separator just for fun...
- * It defaults to "-"
- *
- * This outputs "© 2007/2012"
- * [[SimpleCopyright? &startYear=`2007` &separator=`/`]]
- *
- */
- // Get the current year
- $currentYear = date(\'Y\');
- // Check for a starting year, separator, static & chunk
- $startYear = (string) $modx->getOption(\'startYear\', $scriptProperties);
- $separator = (string) $modx->getOption(\'separator\', $scriptProperties, \'-\');
- $static = (bool) $modx->getOption(\'static\', $scriptProperties, 0);
- $tpl = (string) $modx->getOption(\'tpl\', $scriptProperties, \'sc_chunk\');
- if($static&&!empty($startYear)){
- // is static : can be the future too
- $construct = $startYear;
- } elseif(!empty($startYear)) {
- // is semi dynamic : set with a starting year that never exceeds the future
- $construct = ($startYear>=$currentYear ? $currentYear : $startYear.$separator.$currentYear);
- } else {
- // is dynamic : changes with each year
- $construct = $currentYear;
- }
- // Get a chunk to style the output & check if it exists...
- $chunk = $modx->getObject(\'modChunk\',array(
- \'name\' => $tpl
- ));
- if (!$chunk){
- // If no chunk is found return error & write to log
- $modx->log(xPDO::LOG_LEVEL_ERROR, \'No chunk found!\');
- return \'No chunk found!\';
- } else {
- $outputString = $modx->getChunk($tpl,array(
- \'output\' => $construct
- ));
- }
-
- return $outputString;',
- ),
- 'policies' =>
- array (
- 'web' =>
- array (
- ),
- ),
- 'source' =>
- array (
- 'id' => 1,
- 'name' => 'Filesystem',
- 'description' => '',
- 'class_key' => 'sources.modFileMediaSource',
- 'properties' =>
- array (
- 'fred' =>
- array (
- 'name' => 'fred',
- 'desc' => '',
- 'type' => 'combo-boolean',
- 'options' =>
- array (
- ),
- 'value' => false,
- 'lexicon' => NULL,
- ),
- 'fredReadOnly' =>
- array (
- 'name' => 'fredReadOnly',
- 'desc' => '',
- 'type' => 'combo-boolean',
- 'options' =>
- array (
- ),
- 'value' => false,
- 'lexicon' => NULL,
- ),
- ),
- 'is_stream' => true,
- ),
- ),
- 'Gallery' =>
- array (
- 'fields' =>
- array (
- 'id' => 129,
- 'source' => 0,
- 'property_preprocess' => false,
- 'name' => 'Gallery',
- 'description' => '',
- 'editor_type' => 0,
- 'category' => 45,
- 'cache_type' => 0,
- 'snippet' => '/**
- * Gallery
- *
- * Copyright 2010-2012 by Shaun McCormick <shaun@modx.com>
- *
- * Gallery 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.
- *
- * Gallery 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
- * Gallery; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * @package gallery
- */
- /**
- * The main Gallery snippet.
- *
- * @var modX $modx
- * @var Gallery $gallery
- *
- * @package gallery
- */
- $gallery = $modx->getService(\'gallery\',\'Gallery\',$modx->getOption(\'gallery.core_path\',null,$modx->getOption(\'core_path\').\'components/gallery/\').\'model/gallery/\',$scriptProperties);
- if (!($gallery instanceof Gallery)) return \'\';
- $modx->lexicon->load(\'gallery:web\');
- /* check for REQUEST vars if property set */
- $imageGetParam = $modx->getOption(\'imageGetParam\',$scriptProperties,\'galItem\');
- $albumRequestVar = $modx->getOption(\'albumRequestVar\',$scriptProperties,\'galAlbum\');
- $tagRequestVar = $modx->getOption(\'tagRequestVar\',$scriptProperties,\'galTag\');
- if ($modx->getOption(\'checkForRequestAlbumVar\',$scriptProperties,true)) {
- if (!empty($_REQUEST[$albumRequestVar])) $scriptProperties[\'album\'] = $_REQUEST[$albumRequestVar];
- }
- if ($modx->getOption(\'checkForRequestTagVar\',$scriptProperties,true)) {
- if (!empty($_REQUEST[$tagRequestVar])) $scriptProperties[\'tag\'] = $_REQUEST[$tagRequestVar];
- }
- if (empty($scriptProperties[\'album\']) && empty($scriptProperties[\'tag\'])) return \'\';
- $data = $modx->call(\'galItem\',\'getList\',array(&$modx,$scriptProperties));
- $totalVar = $modx->getOption(\'totalVar\', $scriptProperties, \'total\');
- $modx->setPlaceholder($totalVar,$data[\'total\']);
- /* load plugins */
- $plugin = $modx->getOption(\'plugin\',$scriptProperties,\'\');
- if (!empty($plugin)) {
- $pluginPath = $modx->getOption(\'pluginPath\',$scriptProperties,\'\');
- if (empty($pluginPath)) {
- $pluginPath = $gallery->config[\'modelPath\'].\'gallery/plugins/\';
- }
- /** @var GalleryPlugin $plugin */
- if (($className = $modx->loadClass($plugin,$pluginPath,true,true))) {
- $plugin = new $className($gallery,$scriptProperties);
- $plugin->load();
- $scriptProperties = $plugin->adjustSettings($scriptProperties);
- } else {
- return $modx->lexicon(\'gallery.plugin_err_load\',array(\'name\' => $plugin,\'path\' => $pluginPath));
- }
- } else {
- if ($modx->getOption(\'useCss\',$scriptProperties,true)) {
- $modx->regClientCSS($gallery->config[\'cssUrl\'].\'web.css\');
- }
- }
- /* iterate */
- $imageProperties = $modx->getOption(\'imageProperties\',$scriptProperties,\'\');
- $imageProperties = !empty($imageProperties) ? $modx->fromJSON($imageProperties) : array();
- $imageProperties = array_merge(array(
- \'w\' => (int)$modx->getOption(\'imageWidth\',$scriptProperties,500),
- \'h\' => (int)$modx->getOption(\'imageHeight\',$scriptProperties,500),
- \'zc\' => (boolean)$modx->getOption(\'imageZoomCrop\',$scriptProperties,0),
- \'far\' => (string)$modx->getOption(\'imageFar\',$scriptProperties,false),
- \'q\' => (int)$modx->getOption(\'imageQuality\',$scriptProperties,90),
- ),$imageProperties);
- $thumbProperties = $modx->getOption(\'thumbProperties\',$scriptProperties,\'\');
- $thumbProperties = !empty($thumbProperties) ? $modx->fromJSON($thumbProperties) : array();
- $thumbProperties = array_merge(array(
- \'w\' => (int)$modx->getOption(\'thumbWidth\',$scriptProperties,100),
- \'h\' => (int)$modx->getOption(\'thumbHeight\',$scriptProperties,100),
- \'zc\' => (boolean)$modx->getOption(\'thumbZoomCrop\',$scriptProperties,1),
- \'far\' => (string)$modx->getOption(\'thumbFar\',$scriptProperties,\'C\'),
- \'q\' => (int)$modx->getOption(\'thumbQuality\',$scriptProperties,90),
- ),$thumbProperties);
- $idx = 0;
- $output = array();
- $filesUrl = $modx->call(\'galAlbum\',\'getFilesUrl\',array(&$modx));
- $filesPath = $modx->call(\'galAlbum\',\'getFilesPath\',array(&$modx));
- $itemCls = $modx->getOption(\'itemCls\',$scriptProperties,\'gal-item\');
- $imageAttributes = $modx->getOption(\'imageAttributes\',$scriptProperties,\'\');
- $linkAttributes = $modx->getOption(\'linkAttributes\',$scriptProperties,\'\');
- $linkToImage = $modx->getOption(\'linkToImage\',$scriptProperties,false);
- $activeCls = $modx->getOption(\'activeCls\',$scriptProperties,\'gal-item-active\');
- $highlightItem = $modx->getOption($imageGetParam,$_REQUEST,false);
- $defaultThumbTpl = $modx->getOption(\'thumbTpl\',$scriptProperties,\'galItemThumb\');
- /** @var galItem $item */
- if (!is_array($data)) return \'\';
- // prep for &thumbTpl_N
- $keys = array_keys($scriptProperties);
- $nthTpls = array();
- foreach($keys as $key) {
- $keyBits = $gallery->explodeAndClean($key, \'_\');
- if (isset($keyBits[0]) && $keyBits[0] === \'thumbTpl\') {
- if ($i = (int) $keyBits[1]) $nthTpls[$i] = $scriptProperties[$key];
- }
- }
- ksort($nthTpls);
- foreach ($data[\'items\'] as $item) {
- $itemArray = $item->toArray();
- $itemArray[\'idx\'] = $idx;
- $itemArray[\'cls\'] = $itemCls;
- if ($itemArray[\'id\'] == $highlightItem) {
- $itemArray[\'cls\'] .= \' \'.$activeCls;
- }
- $itemArray[\'filename\'] = basename($item->get(\'filename\'));
- $itemArray[\'image_absolute\'] = $item->get(\'base_url\').$filesUrl.$item->get(\'filename\');
- $itemArray[\'fileurl\'] = $itemArray[\'image_absolute\'];
- $itemArray[\'filepath\'] = $filesPath.$item->get(\'filename\');
- $itemArray[\'filesize\'] = $item->get(\'filesize\');
- $itemArray[\'thumbnail\'] = $item->get(\'thumbnail\',$thumbProperties);
- $itemArray[\'image\'] = $item->get(\'thumbnail\',$imageProperties);
- $itemArray[\'image_attributes\'] = $imageAttributes;
- $itemArray[\'link_attributes\'] = $linkAttributes;
- if (!empty($scriptProperties[\'album\'])) $itemArray[\'album\'] = $scriptProperties[\'album\'];
- if (!empty($scriptProperties[\'tag\'])) $itemArray[\'tag\'] = $scriptProperties[\'tag\'];
- $itemArray[\'linkToImage\'] = $linkToImage;
- $itemArray[\'url\'] = $item->get(\'url\');
- $itemArray[\'imageGetParam\'] = $imageGetParam;
- $itemArray[\'albumRequestVar\'] = $albumRequestVar;
- $itemArray[\'tagRequestVar\'] = $tagRequestVar;
- $itemArray[\'tag\'] = \'\';
- if ($plugin) {
- $plugin->renderItem($itemArray);
- }
- $thumbTpl = $defaultThumbTpl;
- if (isset($nthTpls[$idx])) {
- $thumbTpl = $nthTpls[$idx];
- } else {
- foreach ($nthTpls as $int => $tpl) {
- if ( ($idx % $int) === 0 ) $thumbTpl = $tpl;
- }
- }
- $output[] = $gallery->getChunk($thumbTpl,$itemArray);
- $idx++;
- }
- $output = implode("\\n",$output);
- /* if set, place in a container tpl */
- $containerTpl = $modx->getOption(\'containerTpl\',$scriptProperties,false);
- if (!empty($containerTpl)) {
- $ct = $gallery->getChunk($containerTpl,array(
- \'thumbnails\' => $output,
- \'album_name\' => $data[\'album\'][\'name\'],
- \'album_description\' => $data[\'album\'][\'description\'],
- \'album_year\' => isset($data[\'album\'][\'year\']) ? $data[\'album\'][\'year\'] : \'\',
- \'albumRequestVar\' => $albumRequestVar,
- \'albumId\' => $data[\'album\'][\'id\'],
- ));
- if (!empty($ct)) $output = $ct;
- }
- /* set to placeholders or output directly */
- $toPlaceholder = $modx->getOption(\'toPlaceholder\',$scriptProperties,false);
- if (!empty($toPlaceholder)) {
- $modx->toPlaceholders(array(
- $toPlaceholder => $output,
- $toPlaceholder.\'.id\' => $data[\'album\'][\'id\'],
- $toPlaceholder.\'.name\' => $data[\'album\'][\'name\'],
- $toPlaceholder.\'.year\' => isset($data[\'album\'][\'year\']) ? $data[\'album\'][\'year\'] : \'\',
- $toPlaceholder.\'.description\' => $data[\'album\'][\'description\'],
- $toPlaceholder.\'.total\' => $data[\'total\'],
- $toPlaceholder.\'.next\' => $data[\'album\'][\'id\'] + 1,
- $toPlaceholder.\'.prev\' => $data[\'album\'][\'id\'] - 1,
- ));
- } else {
- $placeholderPrefix = $modx->getOption(\'placeholderPrefix\',$scriptProperties,\'gallery.\');
- $modx->toPlaceholders(array(
- $placeholderPrefix.\'id\' => $data[\'album\'][\'id\'],
- $placeholderPrefix.\'name\' => $data[\'album\'][\'name\'],
- $placeholderPrefix.\'year\' => isset($data[\'album\'][\'year\']) ? $data[\'album\'][\'year\'] : \'\',
- $placeholderPrefix.\'description\' => $data[\'album\'][\'description\'],
- $placeholderPrefix.\'total\' => $data[\'total\'],
- $placeholderPrefix.\'next\' => $data[\'album\'][\'id\'] + 1,
- $placeholderPrefix.\'prev\' => $data[\'album\'][\'id\'] - 1,
- ));
- return $output;
- }
- return \'\';',
- 'locked' => false,
- 'properties' =>
- array (
- 'album' =>
- array (
- 'name' => 'album',
- 'desc' => 'gallery.album_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'Will load only items from this album. Can be either the name or ID of the Album.',
- 'area_trans' => '',
- ),
- 'tag' =>
- array (
- 'name' => 'tag',
- 'desc' => 'gallery.tag_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'Will load only items with this tag.',
- 'area_trans' => '',
- ),
- 'plugin' =>
- array (
- 'name' => 'plugin',
- 'desc' => 'gallery.plugin_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'The name of a plugin to use for front-end displaying. Please see the official docs for a list of available plugins.',
- 'area_trans' => '',
- ),
- 'pluginPath' =>
- array (
- 'name' => 'pluginPath',
- 'desc' => 'gallery.pluginpath_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'Could not load plugin "[[+name]]" from path: [[+path]]',
- 'area_trans' => '',
- ),
- 'thumbTpl' =>
- array (
- 'name' => 'thumbTpl',
- 'desc' => 'gallery.thumbtpl_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 'galItemThumb',
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'The Chunk to use as a tpl for each thumbnail.',
- 'area_trans' => '',
- ),
- 'containerTpl' =>
- array (
- 'name' => 'containerTpl',
- 'desc' => 'gallery.containertpl_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'An optional chunk to wrap the output in.',
- 'area_trans' => '',
- ),
- 'itemCls' =>
- array (
- 'name' => 'itemCls',
- 'desc' => 'gallery.itemcls_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 'gal-item',
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'The CSS class for each thumbnail.',
- 'area_trans' => '',
- ),
- 'activeCls' =>
- array (
- 'name' => 'activeCls',
- 'desc' => 'gallery.activecls_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 'gal-item-active',
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'The CSS class to add when the active item (the item specified in the GalleryItem snippet) is displayed.',
- 'area_trans' => '',
- ),
- 'toPlaceholder' =>
- array (
- 'name' => 'toPlaceholder',
- 'desc' => 'gallery.toplaceholder_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'If set, will set the output to a placeholder of this value, and the snippet call will output nothing.',
- 'area_trans' => '',
- ),
- 'thumbWidth' =>
- array (
- 'name' => 'thumbWidth',
- 'desc' => 'gallery.thumbwidth_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '100',
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'The width of the generated thumbnails, in pixels.',
- 'area_trans' => '',
- ),
- 'thumbHeight' =>
- array (
- 'name' => 'thumbHeight',
- 'desc' => 'gallery.thumbheight_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '100',
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'The height of the generated thumbnails, in pixels.',
- 'area_trans' => '',
- ),
- 'thumbZoomCrop' =>
- array (
- 'name' => 'thumbZoomCrop',
- 'desc' => 'gallery.thumbzoomcrop_desc',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => true,
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'Whether or not the thumbnail will be zoom-cropped.',
- 'area_trans' => '',
- ),
- 'thumbFar' =>
- array (
- 'name' => 'thumbFar',
- 'desc' => 'gallery.thumbfar_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 'C',
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'The "far" value for phpThumb for the thumbnail, for aspect ratio zooming.',
- 'area_trans' => '',
- ),
- 'thumbQuality' =>
- array (
- 'name' => 'thumbQuality',
- 'desc' => 'gallery.thumbquality_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 90,
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'The "q" value for phpThumb for the thumbnail, for quality.',
- 'area_trans' => '',
- ),
- 'thumbProperties' =>
- array (
- 'name' => 'thumbProperties',
- 'desc' => 'gallery.thumbproperties_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'A JSON object of parameters to pass to phpThumb as properties for the thumbnail.',
- 'area_trans' => '',
- ),
- 'linkToImage' =>
- array (
- 'name' => 'linkToImage',
- 'desc' => 'gallery.linktoimage_desc',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'If true, will link directly to the image. If false, will append GET parameters to the URL to load the image with the GalleryItem snippet.',
- 'area_trans' => '',
- ),
- 'imageGetParam' =>
- array (
- 'name' => 'imageGetParam',
- 'desc' => 'gallery.imagegetparam_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 'galItem',
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'The GET param to use when not linking directly to an image. Make sure this matches the getParam property in the GalleryItem snippet call.',
- 'area_trans' => '',
- ),
- 'imageWidth' =>
- array (
- 'name' => 'imageWidth',
- 'desc' => 'gallery.imagewidth_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 500,
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'If being used by a plugin, the width of the currently on-display image.',
- 'area_trans' => '',
- ),
- 'imageHeight' =>
- array (
- 'name' => 'imageHeight',
- 'desc' => 'gallery.imageheight_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 500,
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'If being used by a plugin, the height of the currently on-display image.',
- 'area_trans' => '',
- ),
- 'imageZoomCrop' =>
- array (
- 'name' => 'imageZoomCrop',
- 'desc' => 'gallery.imagezoomcrop_desc',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => false,
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'If being used by a plugin, whether or not the currently on-display image will be zoom-cropped.',
- 'area_trans' => '',
- ),
- 'imageFar' =>
- array (
- 'name' => 'imageFar',
- 'desc' => 'gallery.imagefar_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'The "far" value for phpThumb for the image, for aspect ratio zooming.',
- 'area_trans' => '',
- ),
- 'imageQuality' =>
- array (
- 'name' => 'imageQuality',
- 'desc' => 'gallery.imagequality_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 90,
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'The "q" value for phpThumb for the image, for quality.',
- 'area_trans' => '',
- ),
- 'imageProperties' =>
- array (
- 'name' => 'imageProperties',
- 'desc' => 'gallery.imageproperties_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'A JSON object of parameters to pass to phpThumb as properties for the image.',
- 'area_trans' => '',
- ),
- 'sort' =>
- array (
- 'name' => 'sort',
- 'desc' => 'gallery.sort_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 'rank',
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'The field to sort images by.',
- 'area_trans' => '',
- ),
- 'dir' =>
- array (
- 'name' => 'dir',
- 'desc' => 'gallery.dir_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 'ASC',
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'The direction to sort images by.',
- 'area_trans' => '',
- ),
- 'limit' =>
- array (
- 'name' => 'limit',
- 'desc' => 'gallery.limit_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 0,
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'If set to non-zero, will only show X number of items.',
- 'area_trans' => '',
- ),
- 'start' =>
- array (
- 'name' => 'start',
- 'desc' => 'gallery.start_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 0,
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'The index to start grabbing from when limiting the number of items. Similar to an SQL order by start clause.',
- 'area_trans' => '',
- ),
- 'showInactive' =>
- array (
- 'name' => 'showInactive',
- 'desc' => 'gallery.showinactive_desc',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => false,
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'If 1, will also display inactive images.',
- 'area_trans' => '',
- ),
- 'checkForRequestAlbumVar' =>
- array (
- 'name' => 'checkForRequestAlbumVar',
- 'desc' => 'gallery.checkforrequestalbumvar_desc',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => true,
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'If 1, if a REQUEST var of "album" is found, will use that as the album property for the snippet.',
- 'area_trans' => '',
- ),
- 'albumRequestVar' =>
- array (
- 'name' => 'albumRequestVar',
- 'desc' => 'gallery.albumrequestvar_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 'galAlbum',
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'If checkForRequestAlbumVar is set to true, will look for a REQUEST var with this name to select the album.',
- 'area_trans' => '',
- ),
- 'checkForRequestTagVar' =>
- array (
- 'name' => 'checkForRequestTagVar',
- 'desc' => 'gallery.checkforrequesttagvar_desc',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => true,
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'If 1, if a REQUEST var of "tag" is found, will use that as the tag property for the snippet.',
- 'area_trans' => '',
- ),
- 'tagRequestVar' =>
- array (
- 'name' => 'tagRequestVar',
- 'desc' => 'gallery.tagrequestvar_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 'galTag',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'If checkForRequestTagVar is set to true, will look for a REQUEST var with this name to select the tag.',
- 'area_trans' => '',
- ),
- 'useCss' =>
- array (
- 'name' => 'useCss',
- 'desc' => 'gallery.usecss_desc',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => true,
- 'lexicon' => 'gallery:properties',
- 'area' => '',
- 'desc_trans' => 'Whether or not to use the pre-provided CSS for the snippet.',
- 'area_trans' => '',
- ),
- ),
- 'moduleguid' => '',
- 'static' => false,
- 'static_file' => '',
- 'content' => '/**
- * Gallery
- *
- * Copyright 2010-2012 by Shaun McCormick <shaun@modx.com>
- *
- * Gallery 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.
- *
- * Gallery 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
- * Gallery; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * @package gallery
- */
- /**
- * The main Gallery snippet.
- *
- * @var modX $modx
- * @var Gallery $gallery
- *
- * @package gallery
- */
- $gallery = $modx->getService(\'gallery\',\'Gallery\',$modx->getOption(\'gallery.core_path\',null,$modx->getOption(\'core_path\').\'components/gallery/\').\'model/gallery/\',$scriptProperties);
- if (!($gallery instanceof Gallery)) return \'\';
- $modx->lexicon->load(\'gallery:web\');
- /* check for REQUEST vars if property set */
- $imageGetParam = $modx->getOption(\'imageGetParam\',$scriptProperties,\'galItem\');
- $albumRequestVar = $modx->getOption(\'albumRequestVar\',$scriptProperties,\'galAlbum\');
- $tagRequestVar = $modx->getOption(\'tagRequestVar\',$scriptProperties,\'galTag\');
- if ($modx->getOption(\'checkForRequestAlbumVar\',$scriptProperties,true)) {
- if (!empty($_REQUEST[$albumRequestVar])) $scriptProperties[\'album\'] = $_REQUEST[$albumRequestVar];
- }
- if ($modx->getOption(\'checkForRequestTagVar\',$scriptProperties,true)) {
- if (!empty($_REQUEST[$tagRequestVar])) $scriptProperties[\'tag\'] = $_REQUEST[$tagRequestVar];
- }
- if (empty($scriptProperties[\'album\']) && empty($scriptProperties[\'tag\'])) return \'\';
- $data = $modx->call(\'galItem\',\'getList\',array(&$modx,$scriptProperties));
- $totalVar = $modx->getOption(\'totalVar\', $scriptProperties, \'total\');
- $modx->setPlaceholder($totalVar,$data[\'total\']);
- /* load plugins */
- $plugin = $modx->getOption(\'plugin\',$scriptProperties,\'\');
- if (!empty($plugin)) {
- $pluginPath = $modx->getOption(\'pluginPath\',$scriptProperties,\'\');
- if (empty($pluginPath)) {
- $pluginPath = $gallery->config[\'modelPath\'].\'gallery/plugins/\';
- }
- /** @var GalleryPlugin $plugin */
- if (($className = $modx->loadClass($plugin,$pluginPath,true,true))) {
- $plugin = new $className($gallery,$scriptProperties);
- $plugin->load();
- $scriptProperties = $plugin->adjustSettings($scriptProperties);
- } else {
- return $modx->lexicon(\'gallery.plugin_err_load\',array(\'name\' => $plugin,\'path\' => $pluginPath));
- }
- } else {
- if ($modx->getOption(\'useCss\',$scriptProperties,true)) {
- $modx->regClientCSS($gallery->config[\'cssUrl\'].\'web.css\');
- }
- }
- /* iterate */
- $imageProperties = $modx->getOption(\'imageProperties\',$scriptProperties,\'\');
- $imageProperties = !empty($imageProperties) ? $modx->fromJSON($imageProperties) : array();
- $imageProperties = array_merge(array(
- \'w\' => (int)$modx->getOption(\'imageWidth\',$scriptProperties,500),
- \'h\' => (int)$modx->getOption(\'imageHeight\',$scriptProperties,500),
- \'zc\' => (boolean)$modx->getOption(\'imageZoomCrop\',$scriptProperties,0),
- \'far\' => (string)$modx->getOption(\'imageFar\',$scriptProperties,false),
- \'q\' => (int)$modx->getOption(\'imageQuality\',$scriptProperties,90),
- ),$imageProperties);
- $thumbProperties = $modx->getOption(\'thumbProperties\',$scriptProperties,\'\');
- $thumbProperties = !empty($thumbProperties) ? $modx->fromJSON($thumbProperties) : array();
- $thumbProperties = array_merge(array(
- \'w\' => (int)$modx->getOption(\'thumbWidth\',$scriptProperties,100),
- \'h\' => (int)$modx->getOption(\'thumbHeight\',$scriptProperties,100),
- \'zc\' => (boolean)$modx->getOption(\'thumbZoomCrop\',$scriptProperties,1),
- \'far\' => (string)$modx->getOption(\'thumbFar\',$scriptProperties,\'C\'),
- \'q\' => (int)$modx->getOption(\'thumbQuality\',$scriptProperties,90),
- ),$thumbProperties);
- $idx = 0;
- $output = array();
- $filesUrl = $modx->call(\'galAlbum\',\'getFilesUrl\',array(&$modx));
- $filesPath = $modx->call(\'galAlbum\',\'getFilesPath\',array(&$modx));
- $itemCls = $modx->getOption(\'itemCls\',$scriptProperties,\'gal-item\');
- $imageAttributes = $modx->getOption(\'imageAttributes\',$scriptProperties,\'\');
- $linkAttributes = $modx->getOption(\'linkAttributes\',$scriptProperties,\'\');
- $linkToImage = $modx->getOption(\'linkToImage\',$scriptProperties,false);
- $activeCls = $modx->getOption(\'activeCls\',$scriptProperties,\'gal-item-active\');
- $highlightItem = $modx->getOption($imageGetParam,$_REQUEST,false);
- $defaultThumbTpl = $modx->getOption(\'thumbTpl\',$scriptProperties,\'galItemThumb\');
- /** @var galItem $item */
- if (!is_array($data)) return \'\';
- // prep for &thumbTpl_N
- $keys = array_keys($scriptProperties);
- $nthTpls = array();
- foreach($keys as $key) {
- $keyBits = $gallery->explodeAndClean($key, \'_\');
- if (isset($keyBits[0]) && $keyBits[0] === \'thumbTpl\') {
- if ($i = (int) $keyBits[1]) $nthTpls[$i] = $scriptProperties[$key];
- }
- }
- ksort($nthTpls);
- foreach ($data[\'items\'] as $item) {
- $itemArray = $item->toArray();
- $itemArray[\'idx\'] = $idx;
- $itemArray[\'cls\'] = $itemCls;
- if ($itemArray[\'id\'] == $highlightItem) {
- $itemArray[\'cls\'] .= \' \'.$activeCls;
- }
- $itemArray[\'filename\'] = basename($item->get(\'filename\'));
- $itemArray[\'image_absolute\'] = $item->get(\'base_url\').$filesUrl.$item->get(\'filename\');
- $itemArray[\'fileurl\'] = $itemArray[\'image_absolute\'];
- $itemArray[\'filepath\'] = $filesPath.$item->get(\'filename\');
- $itemArray[\'filesize\'] = $item->get(\'filesize\');
- $itemArray[\'thumbnail\'] = $item->get(\'thumbnail\',$thumbProperties);
- $itemArray[\'image\'] = $item->get(\'thumbnail\',$imageProperties);
- $itemArray[\'image_attributes\'] = $imageAttributes;
- $itemArray[\'link_attributes\'] = $linkAttributes;
- if (!empty($scriptProperties[\'album\'])) $itemArray[\'album\'] = $scriptProperties[\'album\'];
- if (!empty($scriptProperties[\'tag\'])) $itemArray[\'tag\'] = $scriptProperties[\'tag\'];
- $itemArray[\'linkToImage\'] = $linkToImage;
- $itemArray[\'url\'] = $item->get(\'url\');
- $itemArray[\'imageGetParam\'] = $imageGetParam;
- $itemArray[\'albumRequestVar\'] = $albumRequestVar;
- $itemArray[\'tagRequestVar\'] = $tagRequestVar;
- $itemArray[\'tag\'] = \'\';
- if ($plugin) {
- $plugin->renderItem($itemArray);
- }
- $thumbTpl = $defaultThumbTpl;
- if (isset($nthTpls[$idx])) {
- $thumbTpl = $nthTpls[$idx];
- } else {
- foreach ($nthTpls as $int => $tpl) {
- if ( ($idx % $int) === 0 ) $thumbTpl = $tpl;
- }
- }
- $output[] = $gallery->getChunk($thumbTpl,$itemArray);
- $idx++;
- }
- $output = implode("\\n",$output);
- /* if set, place in a container tpl */
- $containerTpl = $modx->getOption(\'containerTpl\',$scriptProperties,false);
- if (!empty($containerTpl)) {
- $ct = $gallery->getChunk($containerTpl,array(
- \'thumbnails\' => $output,
- \'album_name\' => $data[\'album\'][\'name\'],
- \'album_description\' => $data[\'album\'][\'description\'],
- \'album_year\' => isset($data[\'album\'][\'year\']) ? $data[\'album\'][\'year\'] : \'\',
- \'albumRequestVar\' => $albumRequestVar,
- \'albumId\' => $data[\'album\'][\'id\'],
- ));
- if (!empty($ct)) $output = $ct;
- }
- /* set to placeholders or output directly */
- $toPlaceholder = $modx->getOption(\'toPlaceholder\',$scriptProperties,false);
- if (!empty($toPlaceholder)) {
- $modx->toPlaceholders(array(
- $toPlaceholder => $output,
- $toPlaceholder.\'.id\' => $data[\'album\'][\'id\'],
- $toPlaceholder.\'.name\' => $data[\'album\'][\'name\'],
- $toPlaceholder.\'.year\' => isset($data[\'album\'][\'year\']) ? $data[\'album\'][\'year\'] : \'\',
- $toPlaceholder.\'.description\' => $data[\'album\'][\'description\'],
- $toPlaceholder.\'.total\' => $data[\'total\'],
- $toPlaceholder.\'.next\' => $data[\'album\'][\'id\'] + 1,
- $toPlaceholder.\'.prev\' => $data[\'album\'][\'id\'] - 1,
- ));
- } else {
- $placeholderPrefix = $modx->getOption(\'placeholderPrefix\',$scriptProperties,\'gallery.\');
- $modx->toPlaceholders(array(
- $placeholderPrefix.\'id\' => $data[\'album\'][\'id\'],
- $placeholderPrefix.\'name\' => $data[\'album\'][\'name\'],
- $placeholderPrefix.\'year\' => isset($data[\'album\'][\'year\']) ? $data[\'album\'][\'year\'] : \'\',
- $placeholderPrefix.\'description\' => $data[\'album\'][\'description\'],
- $placeholderPrefix.\'total\' => $data[\'total\'],
- $placeholderPrefix.\'next\' => $data[\'album\'][\'id\'] + 1,
- $placeholderPrefix.\'prev\' => $data[\'album\'][\'id\'] - 1,
- ));
- return $output;
- }
- return \'\';',
- ),
- 'policies' =>
- array (
- 'web' =>
- array (
- ),
- ),
- 'source' =>
- array (
- ),
- ),
- 'getResources' =>
- array (
- 'fields' =>
- array (
- 'id' => 26,
- 'source' => 0,
- 'property_preprocess' => false,
- 'name' => 'getResources',
- 'description' => '<strong>1.6.1-pl</strong> A general purpose Resource listing and summarization snippet for MODX Revolution',
- 'editor_type' => 0,
- 'category' => 0,
- 'cache_type' => 0,
- 'snippet' => '/**
- * getResources
- *
- * A general purpose Resource listing and summarization snippet for MODX 2.x.
- *
- * @author Jason Coward
- * @copyright Copyright 2010-2013, Jason Coward
- *
- * TEMPLATES
- *
- * tpl - Name of a chunk serving as a resource template
- * [NOTE: if not provided, properties are dumped to output for each resource]
- *
- * tplOdd - (Opt) Name of a chunk serving as resource template for resources with an odd idx value
- * (see idx property)
- * tplFirst - (Opt) Name of a chunk serving as resource template for the first resource (see first
- * property)
- * tplLast - (Opt) Name of a chunk serving as resource template for the last resource (see last
- * property)
- * tpl_{n} - (Opt) Name of a chunk serving as resource template for the nth resource
- *
- * tplCondition - (Opt) Defines a field of the resource to evaluate against keys defined in the
- * conditionalTpls property. Must be a resource field; does not work with Template Variables.
- * conditionalTpls - (Opt) A JSON object defining a map of field values and the associated tpl to
- * use when the field defined by tplCondition matches the value. [NOTE: tplOdd, tplFirst, tplLast,
- * and tpl_{n} will take precedence over any defined conditionalTpls]
- *
- * tplWrapper - (Opt) Name of a chunk serving as a wrapper template for the output
- * [NOTE: Does not work with toSeparatePlaceholders]
- *
- * SELECTION
- *
- * parents - Comma-delimited list of ids serving as parents
- *
- * context - (Opt) Comma-delimited list of context keys to limit results by; if empty, contexts for all specified
- * parents will be used (all contexts if 0 is specified) [default=]
- *
- * depth - (Opt) Integer value indicating depth to search for resources from each parent [default=10]
- *
- * tvFilters - (Opt) Delimited-list of TemplateVar values to filter resources by. Supports two
- * delimiters and two value search formats. The first delimiter || represents a logical OR and the
- * primary grouping mechanism. Within each group you can provide a comma-delimited list of values.
- * These values can be either tied to a specific TemplateVar by name, e.g. myTV==value, or just the
- * value, indicating you are searching for the value in any TemplateVar tied to the Resource. An
- * example would be &tvFilters=`filter2==one,filter1==bar%||filter1==foo`
- * [NOTE: filtering by values uses a LIKE query and % is considered a wildcard.]
- * [NOTE: this only looks at the raw value set for specific Resource, i. e. there must be a value
- * specifically set for the Resource and it is not evaluated.]
- *
- * tvFiltersAndDelimiter - (Opt) Custom delimiter for logical AND, default \',\', in case you want to
- * match a literal comma in the tvFilters. E.g. &tvFiltersAndDelimiter=`&&`
- * &tvFilters=`filter1==foo,bar&&filter2==baz` [default=,]
- *
- * tvFiltersOrDelimiter - (Opt) Custom delimiter for logical OR, default \'||\', in case you want to
- * match a literal \'||\' in the tvFilters. E.g. &tvFiltersOrDelimiter=`|OR|`
- * &tvFilters=`filter1==foo||bar|OR|filter2==baz` [default=||]
- *
- * where - (Opt) A JSON expression of criteria to build any additional where clauses from. An example would be
- * &where=`{{"alias:LIKE":"foo%", "OR:alias:LIKE":"%bar"},{"OR:pagetitle:=":"foobar", "AND:description:=":"raboof"}}`
- *
- * sortby - (Opt) Field to sort by or a JSON array, e.g. {"publishedon":"ASC","createdon":"DESC"} [default=publishedon]
- * sortbyTV - (opt) A Template Variable name to sort by (if supplied, this precedes the sortby value) [default=]
- * sortbyTVType - (Opt) A data type to CAST a TV Value to in order to sort on it properly [default=string]
- * sortbyAlias - (Opt) Query alias for sortby field [default=]
- * sortbyEscaped - (Opt) Escapes the field name(s) specified in sortby [default=0]
- * sortdir - (Opt) Order which to sort by [default=DESC]
- * sortdirTV - (Opt) Order which to sort by a TV [default=DESC]
- * limit - (Opt) Limits the number of resources returned [default=5]
- * offset - (Opt) An offset of resources returned by the criteria to skip [default=0]
- * dbCacheFlag - (Opt) Controls caching of db queries; 0|false = do not cache result set; 1 = cache result set
- * according to cache settings, any other integer value = number of seconds to cache result set [default=0]
- *
- * OPTIONS
- *
- * includeContent - (Opt) Indicates if the content of each resource should be returned in the
- * results [default=0]
- * includeTVs - (Opt) Indicates if TemplateVar values should be included in the properties available
- * to each resource template [default=0]
- * includeTVList - (Opt) Limits the TemplateVars that are included if includeTVs is true to those specified
- * by name in a comma-delimited list [default=]
- * prepareTVs - (Opt) Prepares media-source dependent TemplateVar values [default=1]
- * prepareTVList - (Opt) Limits the TVs that are prepared to those specified by name in a comma-delimited
- * list [default=]
- * processTVs - (Opt) Indicates if TemplateVar values should be rendered as they would on the
- * resource being summarized [default=0]
- * processTVList - (opt) Limits the TemplateVars that are processed if included to those specified
- * by name in a comma-delimited list [default=]
- * tvPrefix - (Opt) The prefix for TemplateVar properties [default=tv.]
- * idx - (Opt) You can define the starting idx of the resources, which is an property that is
- * incremented as each resource is rendered [default=1]
- * first - (Opt) Define the idx which represents the first resource (see tplFirst) [default=1]
- * last - (Opt) Define the idx which represents the last resource (see tplLast) [default=# of
- * resources being summarized + first - 1]
- * outputSeparator - (Opt) An optional string to separate each tpl instance [default="\\n"]
- * wrapIfEmpty - (Opt) Indicates if the tplWrapper should be applied if the output is empty [default=0]
- *
- */
- $output = array();
- $outputSeparator = isset($outputSeparator) ? $outputSeparator : "\\n";
- /* set default properties */
- $tpl = !empty($tpl) ? $tpl : \'\';
- $includeContent = !empty($includeContent) ? true : false;
- $includeTVs = !empty($includeTVs) ? true : false;
- $includeTVList = !empty($includeTVList) ? explode(\',\', $includeTVList) : array();
- $processTVs = !empty($processTVs) ? true : false;
- $processTVList = !empty($processTVList) ? explode(\',\', $processTVList) : array();
- $prepareTVs = !empty($prepareTVs) ? true : false;
- $prepareTVList = !empty($prepareTVList) ? explode(\',\', $prepareTVList) : array();
- $tvPrefix = isset($tvPrefix) ? $tvPrefix : \'tv.\';
- $parents = (!empty($parents) || $parents === \'0\') ? explode(\',\', $parents) : array($modx->resource->get(\'id\'));
- array_walk($parents, \'trim\');
- $parents = array_unique($parents);
- $depth = isset($depth) ? (integer) $depth : 10;
- $tvFiltersOrDelimiter = isset($tvFiltersOrDelimiter) ? $tvFiltersOrDelimiter : \'||\';
- $tvFiltersAndDelimiter = isset($tvFiltersAndDelimiter) ? $tvFiltersAndDelimiter : \',\';
- $tvFilters = !empty($tvFilters) ? explode($tvFiltersOrDelimiter, $tvFilters) : array();
- $where = !empty($where) ? $modx->fromJSON($where) : array();
- $showUnpublished = !empty($showUnpublished) ? true : false;
- $showDeleted = !empty($showDeleted) ? true : false;
- $sortby = isset($sortby) ? $sortby : \'publishedon\';
- $sortbyTV = isset($sortbyTV) ? $sortbyTV : \'\';
- $sortbyAlias = isset($sortbyAlias) ? $sortbyAlias : \'modResource\';
- $sortbyEscaped = !empty($sortbyEscaped) ? true : false;
- $sortdir = isset($sortdir) ? $sortdir : \'DESC\';
- $sortdirTV = isset($sortdirTV) ? $sortdirTV : \'DESC\';
- $limit = isset($limit) ? (integer) $limit : 5;
- $offset = isset($offset) ? (integer) $offset : 0;
- $totalVar = !empty($totalVar) ? $totalVar : \'total\';
- $dbCacheFlag = !isset($dbCacheFlag) ? false : $dbCacheFlag;
- if (is_string($dbCacheFlag) || is_numeric($dbCacheFlag)) {
- if ($dbCacheFlag == \'0\') {
- $dbCacheFlag = false;
- } elseif ($dbCacheFlag == \'1\') {
- $dbCacheFlag = true;
- } else {
- $dbCacheFlag = (integer) $dbCacheFlag;
- }
- }
- /* multiple context support */
- $contextArray = array();
- $contextSpecified = false;
- if (!empty($context)) {
- $contextArray = explode(\',\',$context);
- array_walk($contextArray, \'trim\');
- $contexts = array();
- foreach ($contextArray as $ctx) {
- $contexts[] = $modx->quote($ctx);
- }
- $context = implode(\',\',$contexts);
- $contextSpecified = true;
- unset($contexts,$ctx);
- } else {
- $context = $modx->quote($modx->context->get(\'key\'));
- }
- $pcMap = array();
- $pcQuery = $modx->newQuery(\'modResource\', array(\'id:IN\' => $parents), $dbCacheFlag);
- $pcQuery->select(array(\'id\', \'context_key\'));
- if ($pcQuery->prepare() && $pcQuery->stmt->execute()) {
- foreach ($pcQuery->stmt->fetchAll(PDO::FETCH_ASSOC) as $pcRow) {
- $pcMap[(integer) $pcRow[\'id\']] = $pcRow[\'context_key\'];
- }
- }
- $children = array();
- $parentArray = array();
- foreach ($parents as $parent) {
- $parent = (integer) $parent;
- if ($parent === 0) {
- $pchildren = array();
- if ($contextSpecified) {
- foreach ($contextArray as $pCtx) {
- if (!in_array($pCtx, $contextArray)) {
- continue;
- }
- $options = $pCtx !== $modx->context->get(\'key\') ? array(\'context\' => $pCtx) : array();
- $pcchildren = $modx->getChildIds($parent, $depth, $options);
- if (!empty($pcchildren)) $pchildren = array_merge($pchildren, $pcchildren);
- }
- } else {
- $cQuery = $modx->newQuery(\'modContext\', array(\'key:!=\' => \'mgr\'));
- $cQuery->select(array(\'key\'));
- if ($cQuery->prepare() && $cQuery->stmt->execute()) {
- foreach ($cQuery->stmt->fetchAll(PDO::FETCH_COLUMN) as $pCtx) {
- $options = $pCtx !== $modx->context->get(\'key\') ? array(\'context\' => $pCtx) : array();
- $pcchildren = $modx->getChildIds($parent, $depth, $options);
- if (!empty($pcchildren)) $pchildren = array_merge($pchildren, $pcchildren);
- }
- }
- }
- $parentArray[] = $parent;
- } else {
- $pContext = array_key_exists($parent, $pcMap) ? $pcMap[$parent] : false;
- if ($debug) $modx->log(modX::LOG_LEVEL_ERROR, "context for {$parent} is {$pContext}");
- if ($pContext && $contextSpecified && !in_array($pContext, $contextArray, true)) {
- $parent = next($parents);
- continue;
- }
- $parentArray[] = $parent;
- $options = !empty($pContext) && $pContext !== $modx->context->get(\'key\') ? array(\'context\' => $pContext) : array();
- $pchildren = $modx->getChildIds($parent, $depth, $options);
- }
- if (!empty($pchildren)) $children = array_merge($children, $pchildren);
- $parent = next($parents);
- }
- $parents = array_merge($parentArray, $children);
- /* build query */
- $criteria = array("modResource.parent IN (" . implode(\',\', $parents) . ")");
- if ($contextSpecified) {
- $contextResourceTbl = $modx->getTableName(\'modContextResource\');
- $criteria[] = "(modResource.context_key IN ({$context}) OR EXISTS(SELECT 1 FROM {$contextResourceTbl} ctx WHERE ctx.resource = modResource.id AND ctx.context_key IN ({$context})))";
- }
- if (empty($showDeleted)) {
- $criteria[\'deleted\'] = \'0\';
- }
- if (empty($showUnpublished)) {
- $criteria[\'published\'] = \'1\';
- }
- if (empty($showHidden)) {
- $criteria[\'hidemenu\'] = \'0\';
- }
- if (!empty($hideContainers)) {
- $criteria[\'isfolder\'] = \'0\';
- }
- $criteria = $modx->newQuery(\'modResource\', $criteria);
- if (!empty($tvFilters)) {
- $tmplVarTbl = $modx->getTableName(\'modTemplateVar\');
- $tmplVarResourceTbl = $modx->getTableName(\'modTemplateVarResource\');
- $conditions = array();
- $operators = array(
- \'<=>\' => \'<=>\',
- \'===\' => \'=\',
- \'!==\' => \'!=\',
- \'<>\' => \'<>\',
- \'==\' => \'LIKE\',
- \'!=\' => \'NOT LIKE\',
- \'<<\' => \'<\',
- \'<=\' => \'<=\',
- \'=<\' => \'=<\',
- \'>>\' => \'>\',
- \'>=\' => \'>=\',
- \'=>\' => \'=>\'
- );
- foreach ($tvFilters as $fGroup => $tvFilter) {
- $filterGroup = array();
- $filters = explode($tvFiltersAndDelimiter, $tvFilter);
- $multiple = count($filters) > 0;
- foreach ($filters as $filter) {
- $operator = \'==\';
- $sqlOperator = \'LIKE\';
- foreach ($operators as $op => $opSymbol) {
- if (strpos($filter, $op, 1) !== false) {
- $operator = $op;
- $sqlOperator = $opSymbol;
- break;
- }
- }
- $tvValueField = \'tvr.value\';
- $tvDefaultField = \'tv.default_text\';
- $f = explode($operator, $filter);
- if (count($f) >= 2) {
- if (count($f) > 2) {
- $k = array_shift($f);
- $b = join($operator, $f);
- $f = array($k, $b);
- }
- $tvName = $modx->quote($f[0]);
- if (is_numeric($f[1]) && !in_array($sqlOperator, array(\'LIKE\', \'NOT LIKE\'))) {
- $tvValue = $f[1];
- if ($f[1] == (integer)$f[1]) {
- $tvValueField = "CAST({$tvValueField} AS SIGNED INTEGER)";
- $tvDefaultField = "CAST({$tvDefaultField} AS SIGNED INTEGER)";
- } else {
- $tvValueField = "CAST({$tvValueField} AS DECIMAL)";
- $tvDefaultField = "CAST({$tvDefaultField} AS DECIMAL)";
- }
- } else {
- $tvValue = $modx->quote($f[1]);
- }
- if ($multiple) {
- $filterGroup[] =
- "(EXISTS (SELECT 1 FROM {$tmplVarResourceTbl} tvr JOIN {$tmplVarTbl} tv ON {$tvValueField} {$sqlOperator} {$tvValue} AND tv.name = {$tvName} AND tv.id = tvr.tmplvarid WHERE tvr.contentid = modResource.id) " .
- "OR EXISTS (SELECT 1 FROM {$tmplVarTbl} tv WHERE tv.name = {$tvName} AND {$tvDefaultField} {$sqlOperator} {$tvValue} AND tv.id NOT IN (SELECT tmplvarid FROM {$tmplVarResourceTbl} WHERE contentid = modResource.id)) " .
- ")";
- } else {
- $filterGroup =
- "(EXISTS (SELECT 1 FROM {$tmplVarResourceTbl} tvr JOIN {$tmplVarTbl} tv ON {$tvValueField} {$sqlOperator} {$tvValue} AND tv.name = {$tvName} AND tv.id = tvr.tmplvarid WHERE tvr.contentid = modResource.id) " .
- "OR EXISTS (SELECT 1 FROM {$tmplVarTbl} tv WHERE tv.name = {$tvName} AND {$tvDefaultField} {$sqlOperator} {$tvValue} AND tv.id NOT IN (SELECT tmplvarid FROM {$tmplVarResourceTbl} WHERE contentid = modResource.id)) " .
- ")";
- }
- } elseif (count($f) == 1) {
- $tvValue = $modx->quote($f[0]);
- if ($multiple) {
- $filterGroup[] = "EXISTS (SELECT 1 FROM {$tmplVarResourceTbl} tvr JOIN {$tmplVarTbl} tv ON {$tvValueField} {$sqlOperator} {$tvValue} AND tv.id = tvr.tmplvarid WHERE tvr.contentid = modResource.id)";
- } else {
- $filterGroup = "EXISTS (SELECT 1 FROM {$tmplVarResourceTbl} tvr JOIN {$tmplVarTbl} tv ON {$tvValueField} {$sqlOperator} {$tvValue} AND tv.id = tvr.tmplvarid WHERE tvr.contentid = modResource.id)";
- }
- }
- }
- $conditions[] = $filterGroup;
- }
- if (!empty($conditions)) {
- $firstGroup = true;
- foreach ($conditions as $cGroup => $c) {
- if (is_array($c)) {
- $first = true;
- foreach ($c as $cond) {
- if ($first && !$firstGroup) {
- $criteria->condition($criteria->query[\'where\'][0][1], $cond, xPDOQuery::SQL_OR, null, $cGroup);
- } else {
- $criteria->condition($criteria->query[\'where\'][0][1], $cond, xPDOQuery::SQL_AND, null, $cGroup);
- }
- $first = false;
- }
- } else {
- $criteria->condition($criteria->query[\'where\'][0][1], $c, $firstGroup ? xPDOQuery::SQL_AND : xPDOQuery::SQL_OR, null, $cGroup);
- }
- $firstGroup = false;
- }
- }
- }
- /* include/exclude resources, via &resources=`123,-456` prop */
- if (!empty($resources)) {
- $resourceConditions = array();
- $resources = explode(\',\',$resources);
- $include = array();
- $exclude = array();
- foreach ($resources as $resource) {
- $resource = (int)$resource;
- if ($resource == 0) continue;
- if ($resource < 0) {
- $exclude[] = abs($resource);
- } else {
- $include[] = $resource;
- }
- }
- if (!empty($include)) {
- $criteria->where(array(\'OR:modResource.id:IN\' => $include), xPDOQuery::SQL_OR);
- }
- if (!empty($exclude)) {
- $criteria->where(array(\'modResource.id:NOT IN\' => $exclude), xPDOQuery::SQL_AND, null, 1);
- }
- }
- if (!empty($where)) {
- $criteria->where($where);
- }
- $total = $modx->getCount(\'modResource\', $criteria);
- $modx->setPlaceholder($totalVar, $total);
- $fields = array_keys($modx->getFields(\'modResource\'));
- if (empty($includeContent)) {
- $fields = array_diff($fields, array(\'content\'));
- }
- $columns = $includeContent ? $modx->getSelectColumns(\'modResource\', \'modResource\') : $modx->getSelectColumns(\'modResource\', \'modResource\', \'\', array(\'content\'), true);
- $criteria->select($columns);
- if (!empty($sortbyTV)) {
- $criteria->leftJoin(\'modTemplateVar\', \'tvDefault\', array(
- "tvDefault.name" => $sortbyTV
- ));
- $criteria->leftJoin(\'modTemplateVarResource\', \'tvSort\', array(
- "tvSort.contentid = modResource.id",
- "tvSort.tmplvarid = tvDefault.id"
- ));
- if (empty($sortbyTVType)) $sortbyTVType = \'string\';
- if ($modx->getOption(\'dbtype\') === \'mysql\') {
- switch ($sortbyTVType) {
- case \'integer\':
- $criteria->select("CAST(IFNULL(tvSort.value, tvDefault.default_text) AS SIGNED INTEGER) AS sortTV");
- break;
- case \'decimal\':
- $criteria->select("CAST(IFNULL(tvSort.value, tvDefault.default_text) AS DECIMAL) AS sortTV");
- break;
- case \'datetime\':
- $criteria->select("CAST(IFNULL(tvSort.value, tvDefault.default_text) AS DATETIME) AS sortTV");
- break;
- case \'string\':
- default:
- $criteria->select("IFNULL(tvSort.value, tvDefault.default_text) AS sortTV");
- break;
- }
- } elseif ($modx->getOption(\'dbtype\') === \'sqlsrv\') {
- switch ($sortbyTVType) {
- case \'integer\':
- $criteria->select("CAST(ISNULL(tvSort.value, tvDefault.default_text) AS BIGINT) AS sortTV");
- break;
- case \'decimal\':
- $criteria->select("CAST(ISNULL(tvSort.value, tvDefault.default_text) AS DECIMAL) AS sortTV");
- break;
- case \'datetime\':
- $criteria->select("CAST(ISNULL(tvSort.value, tvDefault.default_text) AS DATETIME) AS sortTV");
- break;
- case \'string\':
- default:
- $criteria->select("ISNULL(tvSort.value, tvDefault.default_text) AS sortTV");
- break;
- }
- }
- $criteria->sortby("sortTV", $sortdirTV);
- }
- if (!empty($sortby)) {
- if (strpos($sortby, \'{\') === 0) {
- $sorts = $modx->fromJSON($sortby);
- } else {
- $sorts = array($sortby => $sortdir);
- }
- if (is_array($sorts)) {
- while (list($sort, $dir) = each($sorts)) {
- if ($sortbyEscaped) $sort = $modx->escape($sort);
- if (!empty($sortbyAlias)) $sort = $modx->escape($sortbyAlias) . ".{$sort}";
- $criteria->sortby($sort, $dir);
- }
- }
- }
- if (!empty($limit)) $criteria->limit($limit, $offset);
- if (!empty($debug)) {
- $criteria->prepare();
- $modx->log(modX::LOG_LEVEL_ERROR, $criteria->toSQL());
- }
- $collection = $modx->getCollection(\'modResource\', $criteria, $dbCacheFlag);
- $idx = !empty($idx) || $idx === \'0\' ? (integer) $idx : 1;
- $first = empty($first) && $first !== \'0\' ? 1 : (integer) $first;
- $last = empty($last) ? (count($collection) + $idx - 1) : (integer) $last;
- /* include parseTpl */
- include_once $modx->getOption(\'getresources.core_path\',null,$modx->getOption(\'core_path\').\'components/getresources/\').\'include.parsetpl.php\';
- $templateVars = array();
- if (!empty($includeTVs) && !empty($includeTVList)) {
- $templateVars = $modx->getCollection(\'modTemplateVar\', array(\'name:IN\' => $includeTVList));
- }
- /** @var modResource $resource */
- foreach ($collection as $resourceId => $resource) {
- $tvs = array();
- if (!empty($includeTVs)) {
- if (empty($includeTVList)) {
- $templateVars = $resource->getMany(\'TemplateVars\');
- }
- /** @var modTemplateVar $templateVar */
- foreach ($templateVars as $tvId => $templateVar) {
- if (!empty($includeTVList) && !in_array($templateVar->get(\'name\'), $includeTVList)) continue;
- if ($processTVs && (empty($processTVList) || in_array($templateVar->get(\'name\'), $processTVList))) {
- $tvs[$tvPrefix . $templateVar->get(\'name\')] = $templateVar->renderOutput($resource->get(\'id\'));
- } else {
- $value = $templateVar->getValue($resource->get(\'id\'));
- if ($prepareTVs && method_exists($templateVar, \'prepareOutput\') && (empty($prepareTVList) || in_array($templateVar->get(\'name\'), $prepareTVList))) {
- $value = $templateVar->prepareOutput($value);
- }
- $tvs[$tvPrefix . $templateVar->get(\'name\')] = $value;
- }
- }
- }
- $odd = ($idx & 1);
- $properties = array_merge(
- $scriptProperties
- ,array(
- \'idx\' => $idx
- ,\'first\' => $first
- ,\'last\' => $last
- ,\'odd\' => $odd
- )
- ,$includeContent ? $resource->toArray() : $resource->get($fields)
- ,$tvs
- );
- $resourceTpl = false;
- if ($idx == $first && !empty($tplFirst)) {
- $resourceTpl = parseTpl($tplFirst, $properties);
- }
- if ($idx == $last && empty($resourceTpl) && !empty($tplLast)) {
- $resourceTpl = parseTpl($tplLast, $properties);
- }
- $tplidx = \'tpl_\' . $idx;
- if (empty($resourceTpl) && !empty($$tplidx)) {
- $resourceTpl = parseTpl($$tplidx, $properties);
- }
- if ($idx > 1 && empty($resourceTpl)) {
- $divisors = getDivisors($idx);
- if (!empty($divisors)) {
- foreach ($divisors as $divisor) {
- $tplnth = \'tpl_n\' . $divisor;
- if (!empty($$tplnth)) {
- $resourceTpl = parseTpl($$tplnth, $properties);
- if (!empty($resourceTpl)) {
- break;
- }
- }
- }
- }
- }
- if ($odd && empty($resourceTpl) && !empty($tplOdd)) {
- $resourceTpl = parseTpl($tplOdd, $properties);
- }
- if (!empty($tplCondition) && !empty($conditionalTpls) && empty($resourceTpl)) {
- $conTpls = $modx->fromJSON($conditionalTpls);
- $subject = $properties[$tplCondition];
- $tplOperator = !empty($tplOperator) ? $tplOperator : \'=\';
- $tplOperator = strtolower($tplOperator);
- $tplCon = \'\';
- foreach ($conTpls as $operand => $conditionalTpl) {
- switch ($tplOperator) {
- case \'!=\':
- case \'neq\':
- case \'not\':
- case \'isnot\':
- case \'isnt\':
- case \'unequal\':
- case \'notequal\':
- $tplCon = (($subject != $operand) ? $conditionalTpl : $tplCon);
- break;
- case \'<\':
- case \'lt\':
- case \'less\':
- case \'lessthan\':
- $tplCon = (($subject < $operand) ? $conditionalTpl : $tplCon);
- break;
- case \'>\':
- case \'gt\':
- case \'greater\':
- case \'greaterthan\':
- $tplCon = (($subject > $operand) ? $conditionalTpl : $tplCon);
- break;
- case \'<=\':
- case \'lte\':
- case \'lessthanequals\':
- case \'lessthanorequalto\':
- $tplCon = (($subject <= $operand) ? $conditionalTpl : $tplCon);
- break;
- case \'>=\':
- case \'gte\':
- case \'greaterthanequals\':
- case \'greaterthanequalto\':
- $tplCon = (($subject >= $operand) ? $conditionalTpl : $tplCon);
- break;
- case \'isempty\':
- case \'empty\':
- $tplCon = empty($subject) ? $conditionalTpl : $tplCon;
- break;
- case \'!empty\':
- case \'notempty\':
- case \'isnotempty\':
- $tplCon = !empty($subject) && $subject != \'\' ? $conditionalTpl : $tplCon;
- break;
- case \'isnull\':
- case \'null\':
- $tplCon = $subject == null || strtolower($subject) == \'null\' ? $conditionalTpl : $tplCon;
- break;
- case \'inarray\':
- case \'in_array\':
- case \'ia\':
- $operand = explode(\',\', $operand);
- $tplCon = in_array($subject, $operand) ? $conditionalTpl : $tplCon;
- break;
- case \'between\':
- case \'range\':
- case \'>=<\':
- case \'><\':
- $operand = explode(\',\', $operand);
- $tplCon = ($subject >= min($operand) && $subject <= max($operand)) ? $conditionalTpl : $tplCon;
- break;
- case \'==\':
- case \'=\':
- case \'eq\':
- case \'is\':
- case \'equal\':
- case \'equals\':
- case \'equalto\':
- default:
- $tplCon = (($subject == $operand) ? $conditionalTpl : $tplCon);
- break;
- }
- }
- if (!empty($tplCon)) {
- $resourceTpl = parseTpl($tplCon, $properties);
- }
- }
- if (!empty($tpl) && empty($resourceTpl)) {
- $resourceTpl = parseTpl($tpl, $properties);
- }
- if ($resourceTpl === false && !empty($debug)) {
- $chunk = $modx->newObject(\'modChunk\');
- $chunk->setCacheable(false);
- $output[]= $chunk->process(array(), \'<pre>\' . print_r($properties, true) .\'</pre>\');
- } else {
- $output[]= $resourceTpl;
- }
- $idx++;
- }
- /* output */
- $toSeparatePlaceholders = $modx->getOption(\'toSeparatePlaceholders\', $scriptProperties, false);
- if (!empty($toSeparatePlaceholders)) {
- $modx->setPlaceholders($output, $toSeparatePlaceholders);
- return \'\';
- }
- $output = implode($outputSeparator, $output);
- $tplWrapper = $modx->getOption(\'tplWrapper\', $scriptProperties, false);
- $wrapIfEmpty = $modx->getOption(\'wrapIfEmpty\', $scriptProperties, false);
- if (!empty($tplWrapper) && ($wrapIfEmpty || !empty($output))) {
- $output = parseTpl($tplWrapper, array_merge($scriptProperties, array(\'output\' => $output)));
- }
- $toPlaceholder = $modx->getOption(\'toPlaceholder\', $scriptProperties, false);
- if (!empty($toPlaceholder)) {
- $modx->setPlaceholder($toPlaceholder, $output);
- return \'\';
- }
- return $output;',
- 'locked' => false,
- 'properties' =>
- array (
- 'tpl' =>
- array (
- 'name' => 'tpl',
- 'desc' => 'Name of a chunk serving as a resource template. NOTE: if not provided, properties are dumped to output for each resource.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Name of a chunk serving as a resource template. NOTE: if not provided, properties are dumped to output for each resource.',
- 'area_trans' => '',
- ),
- 'tplOdd' =>
- array (
- 'name' => 'tplOdd',
- 'desc' => 'Name of a chunk serving as resource template for resources with an odd idx value (see idx property).',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Name of a chunk serving as resource template for resources with an odd idx value (see idx property).',
- 'area_trans' => '',
- ),
- 'tplFirst' =>
- array (
- 'name' => 'tplFirst',
- 'desc' => 'Name of a chunk serving as resource template for the first resource (see first property).',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Name of a chunk serving as resource template for the first resource (see first property).',
- 'area_trans' => '',
- ),
- 'tplLast' =>
- array (
- 'name' => 'tplLast',
- 'desc' => 'Name of a chunk serving as resource template for the last resource (see last property).',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Name of a chunk serving as resource template for the last resource (see last property).',
- 'area_trans' => '',
- ),
- 'tplWrapper' =>
- array (
- 'name' => 'tplWrapper',
- 'desc' => 'Name of a chunk serving as wrapper template for the Snippet output. This does not work with toSeparatePlaceholders.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Name of a chunk serving as wrapper template for the Snippet output. This does not work with toSeparatePlaceholders.',
- 'area_trans' => '',
- ),
- 'wrapIfEmpty' =>
- array (
- 'name' => 'wrapIfEmpty',
- 'desc' => 'Indicates if empty output should be wrapped by the tplWrapper, if specified. Defaults to false.',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => false,
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Indicates if empty output should be wrapped by the tplWrapper, if specified. Defaults to false.',
- 'area_trans' => '',
- ),
- 'sortby' =>
- array (
- 'name' => 'sortby',
- 'desc' => 'A field name to sort by or JSON object of field names and sortdir for each field, e.g. {"publishedon":"ASC","createdon":"DESC"}. Defaults to publishedon.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 'publishedon',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'A field name to sort by or JSON object of field names and sortdir for each field, e.g. {"publishedon":"ASC","createdon":"DESC"}. Defaults to publishedon.',
- 'area_trans' => '',
- ),
- 'sortbyTV' =>
- array (
- 'name' => 'sortbyTV',
- 'desc' => 'Name of a Template Variable to sort by. Defaults to empty string.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Name of a Template Variable to sort by. Defaults to empty string.',
- 'area_trans' => '',
- ),
- 'sortbyTVType' =>
- array (
- 'name' => 'sortbyTVType',
- 'desc' => 'An optional type to indicate how to sort on the Template Variable value.',
- 'type' => 'list',
- 'options' =>
- array (
- 0 =>
- array (
- 'text' => 'string',
- 'value' => 'string',
- 'name' => 'string',
- ),
- 1 =>
- array (
- 'text' => 'integer',
- 'value' => 'integer',
- 'name' => 'integer',
- ),
- 2 =>
- array (
- 'text' => 'decimal',
- 'value' => 'decimal',
- 'name' => 'decimal',
- ),
- 3 =>
- array (
- 'text' => 'datetime',
- 'value' => 'datetime',
- 'name' => 'datetime',
- ),
- ),
- 'value' => 'string',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'An optional type to indicate how to sort on the Template Variable value.',
- 'area_trans' => '',
- ),
- 'sortbyAlias' =>
- array (
- 'name' => 'sortbyAlias',
- 'desc' => 'Query alias for sortby field. Defaults to an empty string.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Query alias for sortby field. Defaults to an empty string.',
- 'area_trans' => '',
- ),
- 'sortbyEscaped' =>
- array (
- 'name' => 'sortbyEscaped',
- 'desc' => 'Determines if the field name specified in sortby should be escaped. Defaults to 0.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '0',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Determines if the field name specified in sortby should be escaped. Defaults to 0.',
- 'area_trans' => '',
- ),
- 'sortdir' =>
- array (
- 'name' => 'sortdir',
- 'desc' => 'Order which to sort by. Defaults to DESC.',
- 'type' => 'list',
- 'options' =>
- array (
- 0 =>
- array (
- 'text' => 'ASC',
- 'value' => 'ASC',
- 'name' => 'ASC',
- ),
- 1 =>
- array (
- 'text' => 'DESC',
- 'value' => 'DESC',
- 'name' => 'DESC',
- ),
- ),
- 'value' => 'DESC',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Order which to sort by. Defaults to DESC.',
- 'area_trans' => '',
- ),
- 'sortdirTV' =>
- array (
- 'name' => 'sortdirTV',
- 'desc' => 'Order which to sort a Template Variable by. Defaults to DESC.',
- 'type' => 'list',
- 'options' =>
- array (
- 0 =>
- array (
- 'text' => 'ASC',
- 'value' => 'ASC',
- 'name' => 'ASC',
- ),
- 1 =>
- array (
- 'text' => 'DESC',
- 'value' => 'DESC',
- 'name' => 'DESC',
- ),
- ),
- 'value' => 'DESC',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Order which to sort a Template Variable by. Defaults to DESC.',
- 'area_trans' => '',
- ),
- 'limit' =>
- array (
- 'name' => 'limit',
- 'desc' => 'Limits the number of resources returned. Defaults to 5.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '5',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Limits the number of resources returned. Defaults to 5.',
- 'area_trans' => '',
- ),
- 'offset' =>
- array (
- 'name' => 'offset',
- 'desc' => 'An offset of resources returned by the criteria to skip.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '0',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'An offset of resources returned by the criteria to skip.',
- 'area_trans' => '',
- ),
- 'tvFilters' =>
- array (
- 'name' => 'tvFilters',
- 'desc' => 'Delimited-list of TemplateVar values to filter resources by. Supports two delimiters and two value search formats. THe first delimiter || represents a logical OR and the primary grouping mechanism. Within each group you can provide a comma-delimited list of values. These values can be either tied to a specific TemplateVar by name, e.g. myTV==value, or just the value, indicating you are searching for the value in any TemplateVar tied to the Resource. An example would be &tvFilters=`filter2==one,filter1==bar%||filter1==foo`. <br />NOTE: filtering by values uses a LIKE query and % is considered a wildcard. <br />ANOTHER NOTE: This only looks at the raw value set for specific Resource, i. e. there must be a value specifically set for the Resource and it is not evaluated.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Delimited-list of TemplateVar values to filter resources by. Supports two delimiters and two value search formats. THe first delimiter || represents a logical OR and the primary grouping mechanism. Within each group you can provide a comma-delimited list of values. These values can be either tied to a specific TemplateVar by name, e.g. myTV==value, or just the value, indicating you are searching for the value in any TemplateVar tied to the Resource. An example would be &tvFilters=`filter2==one,filter1==bar%||filter1==foo`. <br />NOTE: filtering by values uses a LIKE query and % is considered a wildcard. <br />ANOTHER NOTE: This only looks at the raw value set for specific Resource, i. e. there must be a value specifically set for the Resource and it is not evaluated.',
- 'area_trans' => '',
- ),
- 'tvFiltersAndDelimiter' =>
- array (
- 'name' => 'tvFiltersAndDelimiter',
- 'desc' => 'The delimiter to use to separate logical AND expressions in tvFilters. Default is ,',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => ',',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'The delimiter to use to separate logical AND expressions in tvFilters. Default is ,',
- 'area_trans' => '',
- ),
- 'tvFiltersOrDelimiter' =>
- array (
- 'name' => 'tvFiltersOrDelimiter',
- 'desc' => 'The delimiter to use to separate logical OR expressions in tvFilters. Default is ||',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '||',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'The delimiter to use to separate logical OR expressions in tvFilters. Default is ||',
- 'area_trans' => '',
- ),
- 'depth' =>
- array (
- 'name' => 'depth',
- 'desc' => 'Integer value indicating depth to search for resources from each parent. Defaults to 10.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '10',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Integer value indicating depth to search for resources from each parent. Defaults to 10.',
- 'area_trans' => '',
- ),
- 'parents' =>
- array (
- 'name' => 'parents',
- 'desc' => 'Optional. Comma-delimited list of ids serving as parents.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Optional. Comma-delimited list of ids serving as parents.',
- 'area_trans' => '',
- ),
- 'includeContent' =>
- array (
- 'name' => 'includeContent',
- 'desc' => 'Indicates if the content of each resource should be returned in the results. Defaults to false.',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => false,
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Indicates if the content of each resource should be returned in the results. Defaults to false.',
- 'area_trans' => '',
- ),
- 'includeTVs' =>
- array (
- 'name' => 'includeTVs',
- 'desc' => 'Indicates if TemplateVar values should be included in the properties available to each resource template. Defaults to false.',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => false,
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Indicates if TemplateVar values should be included in the properties available to each resource template. Defaults to false.',
- 'area_trans' => '',
- ),
- 'includeTVList' =>
- array (
- 'name' => 'includeTVList',
- 'desc' => 'Limits included TVs to those specified as a comma-delimited list of TV names. Defaults to empty.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Limits included TVs to those specified as a comma-delimited list of TV names. Defaults to empty.',
- 'area_trans' => '',
- ),
- 'showHidden' =>
- array (
- 'name' => 'showHidden',
- 'desc' => 'Indicates if Resources that are hidden from menus should be shown. Defaults to false.',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => false,
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Indicates if Resources that are hidden from menus should be shown. Defaults to false.',
- 'area_trans' => '',
- ),
- 'showUnpublished' =>
- array (
- 'name' => 'showUnpublished',
- 'desc' => 'Indicates if Resources that are unpublished should be shown. Defaults to false.',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => false,
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Indicates if Resources that are unpublished should be shown. Defaults to false.',
- 'area_trans' => '',
- ),
- 'showDeleted' =>
- array (
- 'name' => 'showDeleted',
- 'desc' => 'Indicates if Resources that are deleted should be shown. Defaults to false.',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => false,
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Indicates if Resources that are deleted should be shown. Defaults to false.',
- 'area_trans' => '',
- ),
- 'resources' =>
- array (
- 'name' => 'resources',
- 'desc' => 'A comma-separated list of resource IDs to exclude or include. IDs with a - in front mean to exclude. Ex: 123,-456 means to include Resource 123, but always exclude Resource 456.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'A comma-separated list of resource IDs to exclude or include. IDs with a - in front mean to exclude. Ex: 123,-456 means to include Resource 123, but always exclude Resource 456.',
- 'area_trans' => '',
- ),
- 'processTVs' =>
- array (
- 'name' => 'processTVs',
- 'desc' => 'Indicates if TemplateVar values should be rendered as they would on the resource being summarized. Defaults to false.',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => false,
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Indicates if TemplateVar values should be rendered as they would on the resource being summarized. Defaults to false.',
- 'area_trans' => '',
- ),
- 'processTVList' =>
- array (
- 'name' => 'processTVList',
- 'desc' => 'Limits processed TVs to those specified as a comma-delimited list of TV names; note only includedTVs will be available for processing if specified. Defaults to empty.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Limits processed TVs to those specified as a comma-delimited list of TV names; note only includedTVs will be available for processing if specified. Defaults to empty.',
- 'area_trans' => '',
- ),
- 'prepareTVs' =>
- array (
- 'name' => 'prepareTVs',
- 'desc' => 'Indicates if TemplateVar values that are not processed fully should be prepared before being returned. Defaults to true.',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => true,
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Indicates if TemplateVar values that are not processed fully should be prepared before being returned. Defaults to true.',
- 'area_trans' => '',
- ),
- 'prepareTVList' =>
- array (
- 'name' => 'prepareTVList',
- 'desc' => 'Limits prepared TVs to those specified as a comma-delimited list of TV names; note only includedTVs will be available for preparing if specified. Defaults to empty.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Limits prepared TVs to those specified as a comma-delimited list of TV names; note only includedTVs will be available for preparing if specified. Defaults to empty.',
- 'area_trans' => '',
- ),
- 'tvPrefix' =>
- array (
- 'name' => 'tvPrefix',
- 'desc' => 'The prefix for TemplateVar properties. Defaults to: tv.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 'tv.',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'The prefix for TemplateVar properties. Defaults to: tv.',
- 'area_trans' => '',
- ),
- 'idx' =>
- array (
- 'name' => 'idx',
- 'desc' => 'You can define the starting idx of the resources, which is an property that is incremented as each resource is rendered.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'You can define the starting idx of the resources, which is an property that is incremented as each resource is rendered.',
- 'area_trans' => '',
- ),
- 'first' =>
- array (
- 'name' => 'first',
- 'desc' => 'Define the idx which represents the first resource (see tplFirst). Defaults to 1.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Define the idx which represents the first resource (see tplFirst). Defaults to 1.',
- 'area_trans' => '',
- ),
- 'last' =>
- array (
- 'name' => 'last',
- 'desc' => 'Define the idx which represents the last resource (see tplLast). Defaults to the number of resources being summarized + first - 1',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Define the idx which represents the last resource (see tplLast). Defaults to the number of resources being summarized + first - 1',
- 'area_trans' => '',
- ),
- 'toPlaceholder' =>
- array (
- 'name' => 'toPlaceholder',
- 'desc' => 'If set, will assign the result to this placeholder instead of outputting it directly.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'If set, will assign the result to this placeholder instead of outputting it directly.',
- 'area_trans' => '',
- ),
- 'toSeparatePlaceholders' =>
- array (
- 'name' => 'toSeparatePlaceholders',
- 'desc' => 'If set, will assign EACH result to a separate placeholder named by this param suffixed with a sequential number (starting from 0).',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'If set, will assign EACH result to a separate placeholder named by this param suffixed with a sequential number (starting from 0).',
- 'area_trans' => '',
- ),
- 'debug' =>
- array (
- 'name' => 'debug',
- 'desc' => 'If true, will send the SQL query to the MODX log. Defaults to false.',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => false,
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'If true, will send the SQL query to the MODX log. Defaults to false.',
- 'area_trans' => '',
- ),
- 'where' =>
- array (
- 'name' => 'where',
- 'desc' => 'A JSON expression of criteria to build any additional where clauses from, e.g. &where=`{{"alias:LIKE":"foo%", "OR:alias:LIKE":"%bar"},{"OR:pagetitle:=":"foobar", "AND:description:=":"raboof"}}`',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'A JSON expression of criteria to build any additional where clauses from, e.g. &where=`{{"alias:LIKE":"foo%", "OR:alias:LIKE":"%bar"},{"OR:pagetitle:=":"foobar", "AND:description:=":"raboof"}}`',
- 'area_trans' => '',
- ),
- 'dbCacheFlag' =>
- array (
- 'name' => 'dbCacheFlag',
- 'desc' => 'Determines how result sets are cached if cache_db is enabled in MODX. 0|false = do not cache result set; 1 = cache result set according to cache settings, any other integer value = number of seconds to cache result set',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '0',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'Determines how result sets are cached if cache_db is enabled in MODX. 0|false = do not cache result set; 1 = cache result set according to cache settings, any other integer value = number of seconds to cache result set',
- 'area_trans' => '',
- ),
- 'context' =>
- array (
- 'name' => 'context',
- 'desc' => 'A comma-delimited list of context keys for limiting results. Default is empty, i.e. do not limit results by context.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'A comma-delimited list of context keys for limiting results. Default is empty, i.e. do not limit results by context.',
- 'area_trans' => '',
- ),
- 'tplCondition' =>
- array (
- 'name' => 'tplCondition',
- 'desc' => 'A condition to compare against the conditionalTpls property to map Resources to different tpls based on custom conditional logic.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'A condition to compare against the conditionalTpls property to map Resources to different tpls based on custom conditional logic.',
- 'area_trans' => '',
- ),
- 'tplOperator' =>
- array (
- 'name' => 'tplOperator',
- 'desc' => 'An optional operator to use for the tplCondition when comparing against the conditionalTpls operands. Default is == (equals).',
- 'type' => 'list',
- 'options' =>
- array (
- 0 =>
- array (
- 'text' => 'is equal to',
- 'value' => '==',
- 'name' => 'is equal to',
- ),
- 1 =>
- array (
- 'text' => 'is not equal to',
- 'value' => '!=',
- 'name' => 'is not equal to',
- ),
- 2 =>
- array (
- 'text' => 'less than',
- 'value' => '<',
- 'name' => 'less than',
- ),
- 3 =>
- array (
- 'text' => 'less than or equal to',
- 'value' => '<=',
- 'name' => 'less than or equal to',
- ),
- 4 =>
- array (
- 'text' => 'greater than or equal to',
- 'value' => '>=',
- 'name' => 'greater than or equal to',
- ),
- 5 =>
- array (
- 'text' => 'is empty',
- 'value' => 'empty',
- 'name' => 'is empty',
- ),
- 6 =>
- array (
- 'text' => 'is not empty',
- 'value' => '!empty',
- 'name' => 'is not empty',
- ),
- 7 =>
- array (
- 'text' => 'is null',
- 'value' => 'null',
- 'name' => 'is null',
- ),
- 8 =>
- array (
- 'text' => 'is in array',
- 'value' => 'inarray',
- 'name' => 'is in array',
- ),
- 9 =>
- array (
- 'text' => 'is between',
- 'value' => 'between',
- 'name' => 'is between',
- ),
- ),
- 'value' => '==',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'An optional operator to use for the tplCondition when comparing against the conditionalTpls operands. Default is == (equals).',
- 'area_trans' => '',
- ),
- 'conditionalTpls' =>
- array (
- 'name' => 'conditionalTpls',
- 'desc' => 'A JSON map of conditional operands and tpls to compare against the tplCondition property using the specified tplOperator.',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => NULL,
- 'area' => '',
- 'desc_trans' => 'A JSON map of conditional operands and tpls to compare against the tplCondition property using the specified tplOperator.',
- 'area_trans' => '',
- ),
- ),
- 'moduleguid' => '',
- 'static' => false,
- 'static_file' => '',
- 'content' => '/**
- * getResources
- *
- * A general purpose Resource listing and summarization snippet for MODX 2.x.
- *
- * @author Jason Coward
- * @copyright Copyright 2010-2013, Jason Coward
- *
- * TEMPLATES
- *
- * tpl - Name of a chunk serving as a resource template
- * [NOTE: if not provided, properties are dumped to output for each resource]
- *
- * tplOdd - (Opt) Name of a chunk serving as resource template for resources with an odd idx value
- * (see idx property)
- * tplFirst - (Opt) Name of a chunk serving as resource template for the first resource (see first
- * property)
- * tplLast - (Opt) Name of a chunk serving as resource template for the last resource (see last
- * property)
- * tpl_{n} - (Opt) Name of a chunk serving as resource template for the nth resource
- *
- * tplCondition - (Opt) Defines a field of the resource to evaluate against keys defined in the
- * conditionalTpls property. Must be a resource field; does not work with Template Variables.
- * conditionalTpls - (Opt) A JSON object defining a map of field values and the associated tpl to
- * use when the field defined by tplCondition matches the value. [NOTE: tplOdd, tplFirst, tplLast,
- * and tpl_{n} will take precedence over any defined conditionalTpls]
- *
- * tplWrapper - (Opt) Name of a chunk serving as a wrapper template for the output
- * [NOTE: Does not work with toSeparatePlaceholders]
- *
- * SELECTION
- *
- * parents - Comma-delimited list of ids serving as parents
- *
- * context - (Opt) Comma-delimited list of context keys to limit results by; if empty, contexts for all specified
- * parents will be used (all contexts if 0 is specified) [default=]
- *
- * depth - (Opt) Integer value indicating depth to search for resources from each parent [default=10]
- *
- * tvFilters - (Opt) Delimited-list of TemplateVar values to filter resources by. Supports two
- * delimiters and two value search formats. The first delimiter || represents a logical OR and the
- * primary grouping mechanism. Within each group you can provide a comma-delimited list of values.
- * These values can be either tied to a specific TemplateVar by name, e.g. myTV==value, or just the
- * value, indicating you are searching for the value in any TemplateVar tied to the Resource. An
- * example would be &tvFilters=`filter2==one,filter1==bar%||filter1==foo`
- * [NOTE: filtering by values uses a LIKE query and % is considered a wildcard.]
- * [NOTE: this only looks at the raw value set for specific Resource, i. e. there must be a value
- * specifically set for the Resource and it is not evaluated.]
- *
- * tvFiltersAndDelimiter - (Opt) Custom delimiter for logical AND, default \',\', in case you want to
- * match a literal comma in the tvFilters. E.g. &tvFiltersAndDelimiter=`&&`
- * &tvFilters=`filter1==foo,bar&&filter2==baz` [default=,]
- *
- * tvFiltersOrDelimiter - (Opt) Custom delimiter for logical OR, default \'||\', in case you want to
- * match a literal \'||\' in the tvFilters. E.g. &tvFiltersOrDelimiter=`|OR|`
- * &tvFilters=`filter1==foo||bar|OR|filter2==baz` [default=||]
- *
- * where - (Opt) A JSON expression of criteria to build any additional where clauses from. An example would be
- * &where=`{{"alias:LIKE":"foo%", "OR:alias:LIKE":"%bar"},{"OR:pagetitle:=":"foobar", "AND:description:=":"raboof"}}`
- *
- * sortby - (Opt) Field to sort by or a JSON array, e.g. {"publishedon":"ASC","createdon":"DESC"} [default=publishedon]
- * sortbyTV - (opt) A Template Variable name to sort by (if supplied, this precedes the sortby value) [default=]
- * sortbyTVType - (Opt) A data type to CAST a TV Value to in order to sort on it properly [default=string]
- * sortbyAlias - (Opt) Query alias for sortby field [default=]
- * sortbyEscaped - (Opt) Escapes the field name(s) specified in sortby [default=0]
- * sortdir - (Opt) Order which to sort by [default=DESC]
- * sortdirTV - (Opt) Order which to sort by a TV [default=DESC]
- * limit - (Opt) Limits the number of resources returned [default=5]
- * offset - (Opt) An offset of resources returned by the criteria to skip [default=0]
- * dbCacheFlag - (Opt) Controls caching of db queries; 0|false = do not cache result set; 1 = cache result set
- * according to cache settings, any other integer value = number of seconds to cache result set [default=0]
- *
- * OPTIONS
- *
- * includeContent - (Opt) Indicates if the content of each resource should be returned in the
- * results [default=0]
- * includeTVs - (Opt) Indicates if TemplateVar values should be included in the properties available
- * to each resource template [default=0]
- * includeTVList - (Opt) Limits the TemplateVars that are included if includeTVs is true to those specified
- * by name in a comma-delimited list [default=]
- * prepareTVs - (Opt) Prepares media-source dependent TemplateVar values [default=1]
- * prepareTVList - (Opt) Limits the TVs that are prepared to those specified by name in a comma-delimited
- * list [default=]
- * processTVs - (Opt) Indicates if TemplateVar values should be rendered as they would on the
- * resource being summarized [default=0]
- * processTVList - (opt) Limits the TemplateVars that are processed if included to those specified
- * by name in a comma-delimited list [default=]
- * tvPrefix - (Opt) The prefix for TemplateVar properties [default=tv.]
- * idx - (Opt) You can define the starting idx of the resources, which is an property that is
- * incremented as each resource is rendered [default=1]
- * first - (Opt) Define the idx which represents the first resource (see tplFirst) [default=1]
- * last - (Opt) Define the idx which represents the last resource (see tplLast) [default=# of
- * resources being summarized + first - 1]
- * outputSeparator - (Opt) An optional string to separate each tpl instance [default="\\n"]
- * wrapIfEmpty - (Opt) Indicates if the tplWrapper should be applied if the output is empty [default=0]
- *
- */
- $output = array();
- $outputSeparator = isset($outputSeparator) ? $outputSeparator : "\\n";
- /* set default properties */
- $tpl = !empty($tpl) ? $tpl : \'\';
- $includeContent = !empty($includeContent) ? true : false;
- $includeTVs = !empty($includeTVs) ? true : false;
- $includeTVList = !empty($includeTVList) ? explode(\',\', $includeTVList) : array();
- $processTVs = !empty($processTVs) ? true : false;
- $processTVList = !empty($processTVList) ? explode(\',\', $processTVList) : array();
- $prepareTVs = !empty($prepareTVs) ? true : false;
- $prepareTVList = !empty($prepareTVList) ? explode(\',\', $prepareTVList) : array();
- $tvPrefix = isset($tvPrefix) ? $tvPrefix : \'tv.\';
- $parents = (!empty($parents) || $parents === \'0\') ? explode(\',\', $parents) : array($modx->resource->get(\'id\'));
- array_walk($parents, \'trim\');
- $parents = array_unique($parents);
- $depth = isset($depth) ? (integer) $depth : 10;
- $tvFiltersOrDelimiter = isset($tvFiltersOrDelimiter) ? $tvFiltersOrDelimiter : \'||\';
- $tvFiltersAndDelimiter = isset($tvFiltersAndDelimiter) ? $tvFiltersAndDelimiter : \',\';
- $tvFilters = !empty($tvFilters) ? explode($tvFiltersOrDelimiter, $tvFilters) : array();
- $where = !empty($where) ? $modx->fromJSON($where) : array();
- $showUnpublished = !empty($showUnpublished) ? true : false;
- $showDeleted = !empty($showDeleted) ? true : false;
- $sortby = isset($sortby) ? $sortby : \'publishedon\';
- $sortbyTV = isset($sortbyTV) ? $sortbyTV : \'\';
- $sortbyAlias = isset($sortbyAlias) ? $sortbyAlias : \'modResource\';
- $sortbyEscaped = !empty($sortbyEscaped) ? true : false;
- $sortdir = isset($sortdir) ? $sortdir : \'DESC\';
- $sortdirTV = isset($sortdirTV) ? $sortdirTV : \'DESC\';
- $limit = isset($limit) ? (integer) $limit : 5;
- $offset = isset($offset) ? (integer) $offset : 0;
- $totalVar = !empty($totalVar) ? $totalVar : \'total\';
- $dbCacheFlag = !isset($dbCacheFlag) ? false : $dbCacheFlag;
- if (is_string($dbCacheFlag) || is_numeric($dbCacheFlag)) {
- if ($dbCacheFlag == \'0\') {
- $dbCacheFlag = false;
- } elseif ($dbCacheFlag == \'1\') {
- $dbCacheFlag = true;
- } else {
- $dbCacheFlag = (integer) $dbCacheFlag;
- }
- }
- /* multiple context support */
- $contextArray = array();
- $contextSpecified = false;
- if (!empty($context)) {
- $contextArray = explode(\',\',$context);
- array_walk($contextArray, \'trim\');
- $contexts = array();
- foreach ($contextArray as $ctx) {
- $contexts[] = $modx->quote($ctx);
- }
- $context = implode(\',\',$contexts);
- $contextSpecified = true;
- unset($contexts,$ctx);
- } else {
- $context = $modx->quote($modx->context->get(\'key\'));
- }
- $pcMap = array();
- $pcQuery = $modx->newQuery(\'modResource\', array(\'id:IN\' => $parents), $dbCacheFlag);
- $pcQuery->select(array(\'id\', \'context_key\'));
- if ($pcQuery->prepare() && $pcQuery->stmt->execute()) {
- foreach ($pcQuery->stmt->fetchAll(PDO::FETCH_ASSOC) as $pcRow) {
- $pcMap[(integer) $pcRow[\'id\']] = $pcRow[\'context_key\'];
- }
- }
- $children = array();
- $parentArray = array();
- foreach ($parents as $parent) {
- $parent = (integer) $parent;
- if ($parent === 0) {
- $pchildren = array();
- if ($contextSpecified) {
- foreach ($contextArray as $pCtx) {
- if (!in_array($pCtx, $contextArray)) {
- continue;
- }
- $options = $pCtx !== $modx->context->get(\'key\') ? array(\'context\' => $pCtx) : array();
- $pcchildren = $modx->getChildIds($parent, $depth, $options);
- if (!empty($pcchildren)) $pchildren = array_merge($pchildren, $pcchildren);
- }
- } else {
- $cQuery = $modx->newQuery(\'modContext\', array(\'key:!=\' => \'mgr\'));
- $cQuery->select(array(\'key\'));
- if ($cQuery->prepare() && $cQuery->stmt->execute()) {
- foreach ($cQuery->stmt->fetchAll(PDO::FETCH_COLUMN) as $pCtx) {
- $options = $pCtx !== $modx->context->get(\'key\') ? array(\'context\' => $pCtx) : array();
- $pcchildren = $modx->getChildIds($parent, $depth, $options);
- if (!empty($pcchildren)) $pchildren = array_merge($pchildren, $pcchildren);
- }
- }
- }
- $parentArray[] = $parent;
- } else {
- $pContext = array_key_exists($parent, $pcMap) ? $pcMap[$parent] : false;
- if ($debug) $modx->log(modX::LOG_LEVEL_ERROR, "context for {$parent} is {$pContext}");
- if ($pContext && $contextSpecified && !in_array($pContext, $contextArray, true)) {
- $parent = next($parents);
- continue;
- }
- $parentArray[] = $parent;
- $options = !empty($pContext) && $pContext !== $modx->context->get(\'key\') ? array(\'context\' => $pContext) : array();
- $pchildren = $modx->getChildIds($parent, $depth, $options);
- }
- if (!empty($pchildren)) $children = array_merge($children, $pchildren);
- $parent = next($parents);
- }
- $parents = array_merge($parentArray, $children);
- /* build query */
- $criteria = array("modResource.parent IN (" . implode(\',\', $parents) . ")");
- if ($contextSpecified) {
- $contextResourceTbl = $modx->getTableName(\'modContextResource\');
- $criteria[] = "(modResource.context_key IN ({$context}) OR EXISTS(SELECT 1 FROM {$contextResourceTbl} ctx WHERE ctx.resource = modResource.id AND ctx.context_key IN ({$context})))";
- }
- if (empty($showDeleted)) {
- $criteria[\'deleted\'] = \'0\';
- }
- if (empty($showUnpublished)) {
- $criteria[\'published\'] = \'1\';
- }
- if (empty($showHidden)) {
- $criteria[\'hidemenu\'] = \'0\';
- }
- if (!empty($hideContainers)) {
- $criteria[\'isfolder\'] = \'0\';
- }
- $criteria = $modx->newQuery(\'modResource\', $criteria);
- if (!empty($tvFilters)) {
- $tmplVarTbl = $modx->getTableName(\'modTemplateVar\');
- $tmplVarResourceTbl = $modx->getTableName(\'modTemplateVarResource\');
- $conditions = array();
- $operators = array(
- \'<=>\' => \'<=>\',
- \'===\' => \'=\',
- \'!==\' => \'!=\',
- \'<>\' => \'<>\',
- \'==\' => \'LIKE\',
- \'!=\' => \'NOT LIKE\',
- \'<<\' => \'<\',
- \'<=\' => \'<=\',
- \'=<\' => \'=<\',
- \'>>\' => \'>\',
- \'>=\' => \'>=\',
- \'=>\' => \'=>\'
- );
- foreach ($tvFilters as $fGroup => $tvFilter) {
- $filterGroup = array();
- $filters = explode($tvFiltersAndDelimiter, $tvFilter);
- $multiple = count($filters) > 0;
- foreach ($filters as $filter) {
- $operator = \'==\';
- $sqlOperator = \'LIKE\';
- foreach ($operators as $op => $opSymbol) {
- if (strpos($filter, $op, 1) !== false) {
- $operator = $op;
- $sqlOperator = $opSymbol;
- break;
- }
- }
- $tvValueField = \'tvr.value\';
- $tvDefaultField = \'tv.default_text\';
- $f = explode($operator, $filter);
- if (count($f) >= 2) {
- if (count($f) > 2) {
- $k = array_shift($f);
- $b = join($operator, $f);
- $f = array($k, $b);
- }
- $tvName = $modx->quote($f[0]);
- if (is_numeric($f[1]) && !in_array($sqlOperator, array(\'LIKE\', \'NOT LIKE\'))) {
- $tvValue = $f[1];
- if ($f[1] == (integer)$f[1]) {
- $tvValueField = "CAST({$tvValueField} AS SIGNED INTEGER)";
- $tvDefaultField = "CAST({$tvDefaultField} AS SIGNED INTEGER)";
- } else {
- $tvValueField = "CAST({$tvValueField} AS DECIMAL)";
- $tvDefaultField = "CAST({$tvDefaultField} AS DECIMAL)";
- }
- } else {
- $tvValue = $modx->quote($f[1]);
- }
- if ($multiple) {
- $filterGroup[] =
- "(EXISTS (SELECT 1 FROM {$tmplVarResourceTbl} tvr JOIN {$tmplVarTbl} tv ON {$tvValueField} {$sqlOperator} {$tvValue} AND tv.name = {$tvName} AND tv.id = tvr.tmplvarid WHERE tvr.contentid = modResource.id) " .
- "OR EXISTS (SELECT 1 FROM {$tmplVarTbl} tv WHERE tv.name = {$tvName} AND {$tvDefaultField} {$sqlOperator} {$tvValue} AND tv.id NOT IN (SELECT tmplvarid FROM {$tmplVarResourceTbl} WHERE contentid = modResource.id)) " .
- ")";
- } else {
- $filterGroup =
- "(EXISTS (SELECT 1 FROM {$tmplVarResourceTbl} tvr JOIN {$tmplVarTbl} tv ON {$tvValueField} {$sqlOperator} {$tvValue} AND tv.name = {$tvName} AND tv.id = tvr.tmplvarid WHERE tvr.contentid = modResource.id) " .
- "OR EXISTS (SELECT 1 FROM {$tmplVarTbl} tv WHERE tv.name = {$tvName} AND {$tvDefaultField} {$sqlOperator} {$tvValue} AND tv.id NOT IN (SELECT tmplvarid FROM {$tmplVarResourceTbl} WHERE contentid = modResource.id)) " .
- ")";
- }
- } elseif (count($f) == 1) {
- $tvValue = $modx->quote($f[0]);
- if ($multiple) {
- $filterGroup[] = "EXISTS (SELECT 1 FROM {$tmplVarResourceTbl} tvr JOIN {$tmplVarTbl} tv ON {$tvValueField} {$sqlOperator} {$tvValue} AND tv.id = tvr.tmplvarid WHERE tvr.contentid = modResource.id)";
- } else {
- $filterGroup = "EXISTS (SELECT 1 FROM {$tmplVarResourceTbl} tvr JOIN {$tmplVarTbl} tv ON {$tvValueField} {$sqlOperator} {$tvValue} AND tv.id = tvr.tmplvarid WHERE tvr.contentid = modResource.id)";
- }
- }
- }
- $conditions[] = $filterGroup;
- }
- if (!empty($conditions)) {
- $firstGroup = true;
- foreach ($conditions as $cGroup => $c) {
- if (is_array($c)) {
- $first = true;
- foreach ($c as $cond) {
- if ($first && !$firstGroup) {
- $criteria->condition($criteria->query[\'where\'][0][1], $cond, xPDOQuery::SQL_OR, null, $cGroup);
- } else {
- $criteria->condition($criteria->query[\'where\'][0][1], $cond, xPDOQuery::SQL_AND, null, $cGroup);
- }
- $first = false;
- }
- } else {
- $criteria->condition($criteria->query[\'where\'][0][1], $c, $firstGroup ? xPDOQuery::SQL_AND : xPDOQuery::SQL_OR, null, $cGroup);
- }
- $firstGroup = false;
- }
- }
- }
- /* include/exclude resources, via &resources=`123,-456` prop */
- if (!empty($resources)) {
- $resourceConditions = array();
- $resources = explode(\',\',$resources);
- $include = array();
- $exclude = array();
- foreach ($resources as $resource) {
- $resource = (int)$resource;
- if ($resource == 0) continue;
- if ($resource < 0) {
- $exclude[] = abs($resource);
- } else {
- $include[] = $resource;
- }
- }
- if (!empty($include)) {
- $criteria->where(array(\'OR:modResource.id:IN\' => $include), xPDOQuery::SQL_OR);
- }
- if (!empty($exclude)) {
- $criteria->where(array(\'modResource.id:NOT IN\' => $exclude), xPDOQuery::SQL_AND, null, 1);
- }
- }
- if (!empty($where)) {
- $criteria->where($where);
- }
- $total = $modx->getCount(\'modResource\', $criteria);
- $modx->setPlaceholder($totalVar, $total);
- $fields = array_keys($modx->getFields(\'modResource\'));
- if (empty($includeContent)) {
- $fields = array_diff($fields, array(\'content\'));
- }
- $columns = $includeContent ? $modx->getSelectColumns(\'modResource\', \'modResource\') : $modx->getSelectColumns(\'modResource\', \'modResource\', \'\', array(\'content\'), true);
- $criteria->select($columns);
- if (!empty($sortbyTV)) {
- $criteria->leftJoin(\'modTemplateVar\', \'tvDefault\', array(
- "tvDefault.name" => $sortbyTV
- ));
- $criteria->leftJoin(\'modTemplateVarResource\', \'tvSort\', array(
- "tvSort.contentid = modResource.id",
- "tvSort.tmplvarid = tvDefault.id"
- ));
- if (empty($sortbyTVType)) $sortbyTVType = \'string\';
- if ($modx->getOption(\'dbtype\') === \'mysql\') {
- switch ($sortbyTVType) {
- case \'integer\':
- $criteria->select("CAST(IFNULL(tvSort.value, tvDefault.default_text) AS SIGNED INTEGER) AS sortTV");
- break;
- case \'decimal\':
- $criteria->select("CAST(IFNULL(tvSort.value, tvDefault.default_text) AS DECIMAL) AS sortTV");
- break;
- case \'datetime\':
- $criteria->select("CAST(IFNULL(tvSort.value, tvDefault.default_text) AS DATETIME) AS sortTV");
- break;
- case \'string\':
- default:
- $criteria->select("IFNULL(tvSort.value, tvDefault.default_text) AS sortTV");
- break;
- }
- } elseif ($modx->getOption(\'dbtype\') === \'sqlsrv\') {
- switch ($sortbyTVType) {
- case \'integer\':
- $criteria->select("CAST(ISNULL(tvSort.value, tvDefault.default_text) AS BIGINT) AS sortTV");
- break;
- case \'decimal\':
- $criteria->select("CAST(ISNULL(tvSort.value, tvDefault.default_text) AS DECIMAL) AS sortTV");
- break;
- case \'datetime\':
- $criteria->select("CAST(ISNULL(tvSort.value, tvDefault.default_text) AS DATETIME) AS sortTV");
- break;
- case \'string\':
- default:
- $criteria->select("ISNULL(tvSort.value, tvDefault.default_text) AS sortTV");
- break;
- }
- }
- $criteria->sortby("sortTV", $sortdirTV);
- }
- if (!empty($sortby)) {
- if (strpos($sortby, \'{\') === 0) {
- $sorts = $modx->fromJSON($sortby);
- } else {
- $sorts = array($sortby => $sortdir);
- }
- if (is_array($sorts)) {
- while (list($sort, $dir) = each($sorts)) {
- if ($sortbyEscaped) $sort = $modx->escape($sort);
- if (!empty($sortbyAlias)) $sort = $modx->escape($sortbyAlias) . ".{$sort}";
- $criteria->sortby($sort, $dir);
- }
- }
- }
- if (!empty($limit)) $criteria->limit($limit, $offset);
- if (!empty($debug)) {
- $criteria->prepare();
- $modx->log(modX::LOG_LEVEL_ERROR, $criteria->toSQL());
- }
- $collection = $modx->getCollection(\'modResource\', $criteria, $dbCacheFlag);
- $idx = !empty($idx) || $idx === \'0\' ? (integer) $idx : 1;
- $first = empty($first) && $first !== \'0\' ? 1 : (integer) $first;
- $last = empty($last) ? (count($collection) + $idx - 1) : (integer) $last;
- /* include parseTpl */
- include_once $modx->getOption(\'getresources.core_path\',null,$modx->getOption(\'core_path\').\'components/getresources/\').\'include.parsetpl.php\';
- $templateVars = array();
- if (!empty($includeTVs) && !empty($includeTVList)) {
- $templateVars = $modx->getCollection(\'modTemplateVar\', array(\'name:IN\' => $includeTVList));
- }
- /** @var modResource $resource */
- foreach ($collection as $resourceId => $resource) {
- $tvs = array();
- if (!empty($includeTVs)) {
- if (empty($includeTVList)) {
- $templateVars = $resource->getMany(\'TemplateVars\');
- }
- /** @var modTemplateVar $templateVar */
- foreach ($templateVars as $tvId => $templateVar) {
- if (!empty($includeTVList) && !in_array($templateVar->get(\'name\'), $includeTVList)) continue;
- if ($processTVs && (empty($processTVList) || in_array($templateVar->get(\'name\'), $processTVList))) {
- $tvs[$tvPrefix . $templateVar->get(\'name\')] = $templateVar->renderOutput($resource->get(\'id\'));
- } else {
- $value = $templateVar->getValue($resource->get(\'id\'));
- if ($prepareTVs && method_exists($templateVar, \'prepareOutput\') && (empty($prepareTVList) || in_array($templateVar->get(\'name\'), $prepareTVList))) {
- $value = $templateVar->prepareOutput($value);
- }
- $tvs[$tvPrefix . $templateVar->get(\'name\')] = $value;
- }
- }
- }
- $odd = ($idx & 1);
- $properties = array_merge(
- $scriptProperties
- ,array(
- \'idx\' => $idx
- ,\'first\' => $first
- ,\'last\' => $last
- ,\'odd\' => $odd
- )
- ,$includeContent ? $resource->toArray() : $resource->get($fields)
- ,$tvs
- );
- $resourceTpl = false;
- if ($idx == $first && !empty($tplFirst)) {
- $resourceTpl = parseTpl($tplFirst, $properties);
- }
- if ($idx == $last && empty($resourceTpl) && !empty($tplLast)) {
- $resourceTpl = parseTpl($tplLast, $properties);
- }
- $tplidx = \'tpl_\' . $idx;
- if (empty($resourceTpl) && !empty($$tplidx)) {
- $resourceTpl = parseTpl($$tplidx, $properties);
- }
- if ($idx > 1 && empty($resourceTpl)) {
- $divisors = getDivisors($idx);
- if (!empty($divisors)) {
- foreach ($divisors as $divisor) {
- $tplnth = \'tpl_n\' . $divisor;
- if (!empty($$tplnth)) {
- $resourceTpl = parseTpl($$tplnth, $properties);
- if (!empty($resourceTpl)) {
- break;
- }
- }
- }
- }
- }
- if ($odd && empty($resourceTpl) && !empty($tplOdd)) {
- $resourceTpl = parseTpl($tplOdd, $properties);
- }
- if (!empty($tplCondition) && !empty($conditionalTpls) && empty($resourceTpl)) {
- $conTpls = $modx->fromJSON($conditionalTpls);
- $subject = $properties[$tplCondition];
- $tplOperator = !empty($tplOperator) ? $tplOperator : \'=\';
- $tplOperator = strtolower($tplOperator);
- $tplCon = \'\';
- foreach ($conTpls as $operand => $conditionalTpl) {
- switch ($tplOperator) {
- case \'!=\':
- case \'neq\':
- case \'not\':
- case \'isnot\':
- case \'isnt\':
- case \'unequal\':
- case \'notequal\':
- $tplCon = (($subject != $operand) ? $conditionalTpl : $tplCon);
- break;
- case \'<\':
- case \'lt\':
- case \'less\':
- case \'lessthan\':
- $tplCon = (($subject < $operand) ? $conditionalTpl : $tplCon);
- break;
- case \'>\':
- case \'gt\':
- case \'greater\':
- case \'greaterthan\':
- $tplCon = (($subject > $operand) ? $conditionalTpl : $tplCon);
- break;
- case \'<=\':
- case \'lte\':
- case \'lessthanequals\':
- case \'lessthanorequalto\':
- $tplCon = (($subject <= $operand) ? $conditionalTpl : $tplCon);
- break;
- case \'>=\':
- case \'gte\':
- case \'greaterthanequals\':
- case \'greaterthanequalto\':
- $tplCon = (($subject >= $operand) ? $conditionalTpl : $tplCon);
- break;
- case \'isempty\':
- case \'empty\':
- $tplCon = empty($subject) ? $conditionalTpl : $tplCon;
- break;
- case \'!empty\':
- case \'notempty\':
- case \'isnotempty\':
- $tplCon = !empty($subject) && $subject != \'\' ? $conditionalTpl : $tplCon;
- break;
- case \'isnull\':
- case \'null\':
- $tplCon = $subject == null || strtolower($subject) == \'null\' ? $conditionalTpl : $tplCon;
- break;
- case \'inarray\':
- case \'in_array\':
- case \'ia\':
- $operand = explode(\',\', $operand);
- $tplCon = in_array($subject, $operand) ? $conditionalTpl : $tplCon;
- break;
- case \'between\':
- case \'range\':
- case \'>=<\':
- case \'><\':
- $operand = explode(\',\', $operand);
- $tplCon = ($subject >= min($operand) && $subject <= max($operand)) ? $conditionalTpl : $tplCon;
- break;
- case \'==\':
- case \'=\':
- case \'eq\':
- case \'is\':
- case \'equal\':
- case \'equals\':
- case \'equalto\':
- default:
- $tplCon = (($subject == $operand) ? $conditionalTpl : $tplCon);
- break;
- }
- }
- if (!empty($tplCon)) {
- $resourceTpl = parseTpl($tplCon, $properties);
- }
- }
- if (!empty($tpl) && empty($resourceTpl)) {
- $resourceTpl = parseTpl($tpl, $properties);
- }
- if ($resourceTpl === false && !empty($debug)) {
- $chunk = $modx->newObject(\'modChunk\');
- $chunk->setCacheable(false);
- $output[]= $chunk->process(array(), \'<pre>\' . print_r($properties, true) .\'</pre>\');
- } else {
- $output[]= $resourceTpl;
- }
- $idx++;
- }
- /* output */
- $toSeparatePlaceholders = $modx->getOption(\'toSeparatePlaceholders\', $scriptProperties, false);
- if (!empty($toSeparatePlaceholders)) {
- $modx->setPlaceholders($output, $toSeparatePlaceholders);
- return \'\';
- }
- $output = implode($outputSeparator, $output);
- $tplWrapper = $modx->getOption(\'tplWrapper\', $scriptProperties, false);
- $wrapIfEmpty = $modx->getOption(\'wrapIfEmpty\', $scriptProperties, false);
- if (!empty($tplWrapper) && ($wrapIfEmpty || !empty($output))) {
- $output = parseTpl($tplWrapper, array_merge($scriptProperties, array(\'output\' => $output)));
- }
- $toPlaceholder = $modx->getOption(\'toPlaceholder\', $scriptProperties, false);
- if (!empty($toPlaceholder)) {
- $modx->setPlaceholder($toPlaceholder, $output);
- return \'\';
- }
- return $output;',
- ),
- 'policies' =>
- array (
- 'web' =>
- array (
- ),
- ),
- 'source' =>
- array (
- ),
- ),
- 'FormIt' =>
- array (
- 'fields' =>
- array (
- 'id' => 16,
- 'source' => 0,
- 'property_preprocess' => false,
- 'name' => 'FormIt',
- 'description' => 'A dynamic form processing snippet.',
- 'editor_type' => 0,
- 'category' => 8,
- 'cache_type' => 0,
- 'snippet' => '/**
- * FormIt
- *
- * Copyright 2009-2012 by Shaun McCormick <shaun@modx.com>
- *
- * FormIt 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.
- *
- * FormIt 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
- * FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- * Suite 330, Boston, MA 02111-1307 USA
- *
- * @package formit
- */
- /**
- * FormIt
- *
- * A dynamic form processing Snippet for MODx Revolution.
- *
- * @var modX $modx
- * @var array $scriptProperties
- *
- * @package formit
- */
- $modelPath = $modx->getOption(
- \'formit.core_path\',
- null,
- $modx->getOption(\'core_path\', null, MODX_CORE_PATH) . \'components/formit/\'
- ) . \'model/formit/\';
- $modx->loadClass(\'FormIt\', $modelPath, true, true);
- $fi = new FormIt($modx, $scriptProperties);
- $fi->initialize($modx->context->get(\'key\'));
- $fi->loadRequest();
- $fields = $fi->request->prepare();
- return $fi->request->handle($fields);',
- 'locked' => false,
- 'properties' =>
- array (
- 'hooks' =>
- array (
- 'name' => 'hooks',
- 'desc' => 'prop_formit.hooks_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'What scripts to fire, if any, after the form passes validation. This can be a comma-separated list of hooks, and if the first fails, the proceeding ones will not fire. A hook can also be a Snippet name that will execute that Snippet.',
- 'area_trans' => '',
- ),
- 'preHooks' =>
- array (
- 'name' => 'preHooks',
- 'desc' => 'prop_formit.prehooks_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'What scripts to fire, if any, once the form loads. You can pre-set form fields via $scriptProperties[`hook`]->fields[`fieldname`]. This can be a comma-separated list of hooks, and if the first fails, the proceeding ones will not fire. A hook can also be a Snippet name that will execute that Snippet.',
- 'area_trans' => '',
- ),
- 'submitVar' =>
- array (
- 'name' => 'submitVar',
- 'desc' => 'prop_formit.submitvar_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'If set, will not begin form processing if this POST variable is not passed.',
- 'area_trans' => '',
- ),
- 'validate' =>
- array (
- 'name' => 'validate',
- 'desc' => 'prop_formit.validate_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'A comma-separated list of fields to validate, with each field name as name:validator (eg: username:required,email:required). Validators can also be chained, like email:email:required. This property can be specified on multiple lines.',
- 'area_trans' => '',
- ),
- 'errTpl' =>
- array (
- 'name' => 'errTpl',
- 'desc' => 'prop_formit.errtpl_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '<span class="error">[[+error]]</span>',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'The wrapper template for error messages.',
- 'area_trans' => '',
- ),
- 'validationErrorMessage' =>
- array (
- 'name' => 'validationErrorMessage',
- 'desc' => 'prop_formit.validationerrormessage_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '<p class="error">A form validation error occurred. Please check the values you have entered.</p>',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'A general error message to set to a placeholder if validation fails. Can contain [[+errors]] if you want to display a list of all errors at the top.',
- 'area_trans' => '',
- ),
- 'validationErrorBulkTpl' =>
- array (
- 'name' => 'validationErrorBulkTpl',
- 'desc' => 'prop_formit.validationerrorbulktpl_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '<li>[[+error]]</li>',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'HTML tpl that is used for each individual error in the generic validation error message value.',
- 'area_trans' => '',
- ),
- 'trimValuesBeforeValidation' =>
- array (
- 'name' => 'trimValuesBeforeValidation',
- 'desc' => 'prop_formit.trimvaluesdeforevalidation_desc',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => true,
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'Whether or not to trim spaces from the beginning and end of values before attempting validation. Defaults to true.',
- 'area_trans' => '',
- ),
- 'customValidators' =>
- array (
- 'name' => 'customValidators',
- 'desc' => 'prop_formit.customvalidators_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'A comma-separated list of custom validator names (snippets) you plan to use in this form. They must be explicitly stated here, or they will not be run.',
- 'area_trans' => '',
- ),
- 'clearFieldsOnSuccess' =>
- array (
- 'name' => 'clearFieldsOnSuccess',
- 'desc' => 'prop_formit.clearfieldsonsuccess_desc',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => true,
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'If true, will clear the fields on a successful form submission that does not redirect.',
- 'area_trans' => '',
- ),
- 'successMessage' =>
- array (
- 'name' => 'successMessage',
- 'desc' => 'prop_formit.successmessage_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'If set, will set this a placeholder with the name of the value of the property &successMessagePlaceholder, which defaults to `fi.successMessage`.',
- 'area_trans' => '',
- ),
- 'successMessagePlaceholder' =>
- array (
- 'name' => 'successMessagePlaceholder',
- 'desc' => 'prop_formit.successmessageplaceholder_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 'fi.successMessage',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'The placeholder to set the success message to.',
- 'area_trans' => '',
- ),
- 'store' =>
- array (
- 'name' => 'store',
- 'desc' => 'prop_formit.store_desc',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => false,
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'If true, will store the data in the cache for retrieval using the FormItRetriever snippet.',
- 'area_trans' => '',
- ),
- 'placeholderPrefix' =>
- array (
- 'name' => 'placeholderPrefix',
- 'desc' => 'prop_formit.placeholderprefix_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 'fi.',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'The prefix to use for all placeholders set by FormIt for fields. Defaults to `fi.`',
- 'area_trans' => '',
- ),
- 'storeTime' =>
- array (
- 'name' => 'storeTime',
- 'desc' => 'prop_formit.storetime_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '300',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'If `store` is set to true, this specifies the number of seconds to store the data from the form submission. Defaults to five minutes.',
- 'area_trans' => '',
- ),
- 'storeLocation' =>
- array (
- 'name' => 'storeLocation',
- 'desc' => 'prop_formit.storelocation_desc',
- 'type' => 'list',
- 'options' =>
- array (
- 0 =>
- array (
- 'value' => 'cache',
- 'text' => 'formit.opt_cache',
- 'name' => 'MODX Cache',
- ),
- 1 =>
- array (
- 'value' => 'session',
- 'text' => 'formit.opt_session',
- 'name' => 'Session',
- ),
- ),
- 'value' => 'cache',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'If `store` is set to true, this specifies the cache location of the data from the form submission. Defaults to MODX cache.',
- 'area_trans' => '',
- ),
- 'allowFiles' =>
- array (
- 'name' => 'allowFiles',
- 'desc' => 'prop_formit.allowfiles_desc',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => true,
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'If set to 0, will prevent files from being submitted on the form.',
- 'area_trans' => '',
- ),
- 'spamEmailFields' =>
- array (
- 'name' => 'spamEmailFields',
- 'desc' => 'prop_formit.spamemailfields_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 'email',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'If `spam` is set as a hook, a comma-separated list of fields containing emails to check spam against.',
- 'area_trans' => '',
- ),
- 'spamCheckIp' =>
- array (
- 'name' => 'spamCheckIp',
- 'desc' => 'prop_formit.spamcheckip_desc',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => false,
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'If `spam` is set as a hook, and this is true, will check the IP as well.',
- 'area_trans' => '',
- ),
- 'recaptchaJs' =>
- array (
- 'name' => 'recaptchaJs',
- 'desc' => 'prop_formit.recaptchajs_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '{}',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'If `recaptcha` is set as a hook, this can be a JSON object that will be set to the JS RecaptchaOptions variable, which configures options for reCaptcha.',
- 'area_trans' => '',
- ),
- 'recaptchaTheme' =>
- array (
- 'name' => 'recaptchaTheme',
- 'desc' => 'prop_formit.recaptchatheme_desc',
- 'type' => 'list',
- 'options' =>
- array (
- 0 =>
- array (
- 'value' => 'red',
- 'text' => 'formit.opt_red',
- 'name' => 'Red',
- ),
- 1 =>
- array (
- 'value' => 'white',
- 'text' => 'formit.opt_white',
- 'name' => 'White',
- ),
- 2 =>
- array (
- 'value' => 'clean',
- 'text' => 'formit.opt_clean',
- 'name' => 'Clean',
- ),
- 3 =>
- array (
- 'value' => 'blackglass',
- 'text' => 'formit.opt_blackglass',
- 'name' => 'Black Glass',
- ),
- ),
- 'value' => 'clean',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'If `recaptcha` is set as a hook, this will select a theme for the reCaptcha widget.',
- 'area_trans' => '',
- ),
- 'redirectTo' =>
- array (
- 'name' => 'redirectTo',
- 'desc' => 'prop_formit.redirectto_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'If `redirect` is set as a hook, this must specify the Resource ID to redirect to.',
- 'area_trans' => '',
- ),
- 'redirectParams' =>
- array (
- 'name' => 'redirectParams',
- 'desc' => 'prop_formit.redirectparams_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'A JSON array of parameters to pass to the redirect hook that will be passed when redirecting.',
- 'area_trans' => '',
- ),
- 'emailTo' =>
- array (
- 'name' => 'emailTo',
- 'desc' => 'prop_formit.emailto_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'If `email` is set as a hook, then this specifies the email(s) to send the email to. Can be a comma-separated list of email addresses.',
- 'area_trans' => '',
- ),
- 'emailToName' =>
- array (
- 'name' => 'emailToName',
- 'desc' => 'prop_formit.emailtoname_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailTo` property.',
- 'area_trans' => '',
- ),
- 'emailFrom' =>
- array (
- 'name' => 'emailFrom',
- 'desc' => 'prop_formit.emailfrom_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'Optional. If `email` is set as a hook, and this is set, will specify the From: address for the email. If not set, will first look for an `email` form field. If none is found, will default to the `emailsender` system setting.',
- 'area_trans' => '',
- ),
- 'emailFromName' =>
- array (
- 'name' => 'emailFromName',
- 'desc' => 'prop_formit.emailfromname_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'Optional. If `email` is set as a hook, and this is set, will specify the From: name for the email.',
- 'area_trans' => '',
- ),
- 'emailReplyTo' =>
- array (
- 'name' => 'emailReplyTo',
- 'desc' => 'prop_formit.emailreplyto_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'Optional. If `email` is set as a hook, and this is set, will specify the Reply-To: address for the email.',
- 'area_trans' => '',
- ),
- 'emailReplyToName' =>
- array (
- 'name' => 'emailReplyToName',
- 'desc' => 'prop_formit.emailreplytoname_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'Optional. If `email` is set as a hook, and this is set, will specify the Reply-To: name for the email.',
- 'area_trans' => '',
- ),
- 'emailCC' =>
- array (
- 'name' => 'emailCC',
- 'desc' => 'prop_formit.emailcc_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'If `email` is set as a hook, then this specifies the email(s) to send the email to as a CC. Can be a comma-separated list of email addresses.',
- 'area_trans' => '',
- ),
- 'emailCCName' =>
- array (
- 'name' => 'emailCCName',
- 'desc' => 'prop_formit.emailccname_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailCC` property.',
- 'area_trans' => '',
- ),
- 'emailBCC' =>
- array (
- 'name' => 'emailBCC',
- 'desc' => 'prop_formit.emailbcc_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'If `email` is set as a hook, then this specifies the email(s) to send the email to as a BCC. Can be a comma-separated list of email addresses.',
- 'area_trans' => '',
- ),
- 'emailBCCName' =>
- array (
- 'name' => 'emailBCCName',
- 'desc' => 'prop_formit.emailbccname_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailBCC` property.',
- 'area_trans' => '',
- ),
- 'emailReturnPath' =>
- array (
- 'name' => 'emailReturnPath',
- 'desc' => 'prop_formit.emailreturnpath_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'Optional. If `email` is set as a hook, and this is set, will specify the Return-path: address for the email. If not set, will take the value of `emailFrom` property.',
- 'area_trans' => '',
- ),
- 'emailSubject' =>
- array (
- 'name' => 'emailSubject',
- 'desc' => 'prop_formit.emailsubject_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'If `email` is set as a hook, this is required as a subject line for the email.',
- 'area_trans' => '',
- ),
- 'emailUseFieldForSubject' =>
- array (
- 'name' => 'emailUseFieldForSubject',
- 'desc' => 'prop_formit.emailusefieldforsubject_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'If the field `subject` is passed into the form, if this is true, it will use the field content for the subject line of the email.',
- 'area_trans' => '',
- ),
- 'emailHtml' =>
- array (
- 'name' => 'emailHtml',
- 'desc' => 'prop_formit.emailhtml_desc',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => true,
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'Optional. If `email` is set as a hook, this toggles HTML emails or not. Defaults to true.',
- 'area_trans' => '',
- ),
- 'emailConvertNewlines' =>
- array (
- 'name' => 'emailConvertNewlines',
- 'desc' => 'prop_formit.emailconvertnewlines_desc',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => false,
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'If true and emailHtml is set to 1, will convert newlines to BR tags in the email.',
- 'area_trans' => '',
- ),
- 'emailMultiWrapper' =>
- array (
- 'name' => 'emailMultiWrapper',
- 'desc' => 'prop_formit.emailmultiwrapper_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '[[+value]]',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'Will wrap each item in a collection of fields sent via checkboxes/multi-selects. Defaults to just the value.',
- 'area_trans' => '',
- ),
- 'emailMultiSeparator' =>
- array (
- 'name' => 'emailMultiSeparator',
- 'desc' => 'prop_formit.emailmultiseparator_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'The default separator for collections of items sent through checkboxes/multi-selects. Defaults to a newline.',
- 'area_trans' => '',
- ),
- 'fiarTpl' =>
- array (
- 'name' => 'fiarTpl',
- 'desc' => 'prop_formit.fiartpl_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'prop_formit.fiartpl_desc',
- 'area_trans' => '',
- ),
- 'fiarToField' =>
- array (
- 'name' => 'fiarToField',
- 'desc' => 'prop_formit.fiartofield_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 'email',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'prop_formit.fiartofield_desc',
- 'area_trans' => '',
- ),
- 'fiarSubject' =>
- array (
- 'name' => 'fiarSubject',
- 'desc' => 'prop_formit.fiarsubject_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '[[++site_name]] Auto-Responder',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'prop_formit.fiarsubject_desc',
- 'area_trans' => '',
- ),
- 'fiarFrom' =>
- array (
- 'name' => 'fiarFrom',
- 'desc' => 'prop_formit.fiarfrom_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'prop_formit.fiarfrom_desc',
- 'area_trans' => '',
- ),
- 'fiarFromName' =>
- array (
- 'name' => 'fiarFromName',
- 'desc' => 'prop_formit.fiarfromname_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'prop_formit.fiarfromname_desc',
- 'area_trans' => '',
- ),
- 'fiarReplyTo' =>
- array (
- 'name' => 'fiarReplyTo',
- 'desc' => 'prop_formit.fiarreplyto_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'prop_formit.fiarreplyto_desc',
- 'area_trans' => '',
- ),
- 'fiarReplyToName' =>
- array (
- 'name' => 'fiarReplyToName',
- 'desc' => 'prop_formit.fiarreplytoname_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'prop_formit.fiarreplytoname_desc',
- 'area_trans' => '',
- ),
- 'fiarCC' =>
- array (
- 'name' => 'fiarCC',
- 'desc' => 'prop_formit.fiarcc_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'prop_formit.fiarcc_desc',
- 'area_trans' => '',
- ),
- 'fiarCCName' =>
- array (
- 'name' => 'fiarCCName',
- 'desc' => 'prop_fiar.fiarccname_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'Optional. If `FormItAutoResponder` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailCC` property.',
- 'area_trans' => '',
- ),
- 'fiarBCC' =>
- array (
- 'name' => 'fiarBCC',
- 'desc' => 'prop_formit.fiarbcc_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'prop_formit.fiarbcc_desc',
- 'area_trans' => '',
- ),
- 'fiarBCCName' =>
- array (
- 'name' => 'fiarBCCName',
- 'desc' => 'prop_formit.fiarbccname_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'prop_formit.fiarbccname_desc',
- 'area_trans' => '',
- ),
- 'fiarHtml' =>
- array (
- 'name' => 'fiarHtml',
- 'desc' => 'prop_formit.fiarhtml_desc',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => true,
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'prop_formit.fiarhtml_desc',
- 'area_trans' => '',
- ),
- 'mathMinRange' =>
- array (
- 'name' => 'mathMinRange',
- 'desc' => 'prop_formit.mathminrange_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '10',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'prop_formit.mathminrange_desc',
- 'area_trans' => '',
- ),
- 'mathMaxRange' =>
- array (
- 'name' => 'mathMaxRange',
- 'desc' => 'prop_formit.mathmaxrange_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => '100',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'prop_formit.mathmaxrange_desc',
- 'area_trans' => '',
- ),
- 'mathField' =>
- array (
- 'name' => 'mathField',
- 'desc' => 'prop_formit.mathfield_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 'math',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'prop_formit.mathfield_desc',
- 'area_trans' => '',
- ),
- 'mathOp1Field' =>
- array (
- 'name' => 'mathOp1Field',
- 'desc' => 'prop_formit.mathop1field_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 'op1',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'prop_formit.mathop1field_desc',
- 'area_trans' => '',
- ),
- 'mathOp2Field' =>
- array (
- 'name' => 'mathOp2Field',
- 'desc' => 'prop_formit.mathop2field_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 'op2',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'prop_formit.mathop2field_desc',
- 'area_trans' => '',
- ),
- 'mathOperatorField' =>
- array (
- 'name' => 'mathOperatorField',
- 'desc' => 'prop_formit.mathoperatorfield_desc',
- 'type' => 'textfield',
- 'options' => '',
- 'value' => 'operator',
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'prop_formit.mathoperatorfield_desc',
- 'area_trans' => '',
- ),
- 'saveTmpFiles' =>
- array (
- 'name' => 'saveTmpFiles',
- 'desc' => 'prop_formit.savetmpfiles_desc',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => false,
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'If set to 1, FormIt will store submitted files in a temporary folder.',
- 'area_trans' => '',
- ),
- 'attachFilesToEmail' =>
- array (
- 'name' => 'attachFilesToEmail',
- 'desc' => 'prop_formit.attachfiles_desc',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => true,
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'If true, FormIt will add all file fields as attachments in the email.',
- 'area_trans' => '',
- ),
- 'storeAttachments' =>
- array (
- 'name' => 'storeAttachments',
- 'desc' => 'prop_formit.store_attachments_desc',
- 'type' => 'combo-boolean',
- 'options' => '',
- 'value' => false,
- 'lexicon' => 'formit:properties',
- 'area' => '',
- 'desc_trans' => 'prop_formit.store_attachments_desc',
- 'area_trans' => '',
- ),
- ),
- 'moduleguid' => '',
- 'static' => false,
- 'static_file' => '',
- 'content' => '/**
- * FormIt
- *
- * Copyright 2009-2012 by Shaun McCormick <shaun@modx.com>
- *
- * FormIt 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.
- *
- * FormIt 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
- * FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
- * Suite 330, Boston, MA 02111-1307 USA
- *
- * @package formit
- */
- /**
- * FormIt
- *
- * A dynamic form processing Snippet for MODx Revolution.
- *
- * @var modX $modx
- * @var array $scriptProperties
- *
- * @package formit
- */
- $modelPath = $modx->getOption(
- \'formit.core_path\',
- null,
- $modx->getOption(\'core_path\', null, MODX_CORE_PATH) . \'components/formit/\'
- ) . \'model/formit/\';
- $modx->loadClass(\'FormIt\', $modelPath, true, true);
- $fi = new FormIt($modx, $scriptProperties);
- $fi->initialize($modx->context->get(\'key\'));
- $fi->loadRequest();
- $fields = $fi->request->prepare();
- return $fi->request->handle($fields);',
- ),
- 'policies' =>
- array (
- 'web' =>
- array (
- ),
- ),
- 'source' =>
- array (
- ),
- ),
- ),
- 'modTemplateVar' =>
- array (
- ),
- ),
- );
|