preserved.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625
  1. <?php return array (
  2. '0708810684b0d8dfb4ca61dfcdabc601' =>
  3. array (
  4. 'criteria' =>
  5. array (
  6. 'name' => 'collections',
  7. ),
  8. 'object' =>
  9. array (
  10. 'name' => 'collections',
  11. 'path' => '{core_path}components/collections/',
  12. 'assets_path' => '{assets_path}components/collections/',
  13. ),
  14. ),
  15. 'aad2a63500239d7790c75677c227edc1' =>
  16. array (
  17. 'criteria' =>
  18. array (
  19. 'key' => 'collections.mgr_date_format',
  20. ),
  21. 'object' =>
  22. array (
  23. 'key' => 'collections.mgr_date_format',
  24. 'value' => 'M d',
  25. 'xtype' => 'textfield',
  26. 'namespace' => 'collections',
  27. 'area' => 'manager',
  28. 'editedon' => NULL,
  29. ),
  30. ),
  31. '5a455e8670b070529ab1c7a573c90114' =>
  32. array (
  33. 'criteria' =>
  34. array (
  35. 'key' => 'collections.mgr_time_format',
  36. ),
  37. 'object' =>
  38. array (
  39. 'key' => 'collections.mgr_time_format',
  40. 'value' => 'g:i a',
  41. 'xtype' => 'textfield',
  42. 'namespace' => 'collections',
  43. 'area' => 'manager',
  44. 'editedon' => NULL,
  45. ),
  46. ),
  47. '3f6862afe49a827795e7b31be0a0c67c' =>
  48. array (
  49. 'criteria' =>
  50. array (
  51. 'key' => 'collections.mgr_datetime_format',
  52. ),
  53. 'object' =>
  54. array (
  55. 'key' => 'collections.mgr_datetime_format',
  56. 'value' => 'M d, g:i a',
  57. 'xtype' => 'textfield',
  58. 'namespace' => 'collections',
  59. 'area' => 'manager',
  60. 'editedon' => NULL,
  61. ),
  62. ),
  63. '232385fa305ae5cdc6a96fb3d2909c6a' =>
  64. array (
  65. 'criteria' =>
  66. array (
  67. 'key' => 'collections.user_js',
  68. ),
  69. 'object' =>
  70. array (
  71. 'key' => 'collections.user_js',
  72. 'value' => '',
  73. 'xtype' => 'textfield',
  74. 'namespace' => 'collections',
  75. 'area' => 'manager',
  76. 'editedon' => NULL,
  77. ),
  78. ),
  79. 'a7c7cf0b23e424fa9585e48c0f6afa6e' =>
  80. array (
  81. 'criteria' =>
  82. array (
  83. 'key' => 'collections.user_css',
  84. ),
  85. 'object' =>
  86. array (
  87. 'key' => 'collections.user_css',
  88. 'value' => '',
  89. 'xtype' => 'textfield',
  90. 'namespace' => 'collections',
  91. 'area' => 'manager',
  92. 'editedon' => NULL,
  93. ),
  94. ),
  95. 'be74cd2a752dc07bff6e1ac1b7c93406' =>
  96. array (
  97. 'criteria' =>
  98. array (
  99. 'key' => 'mgr_tree_icon_collectioncontainer',
  100. ),
  101. 'object' =>
  102. array (
  103. 'key' => 'mgr_tree_icon_collectioncontainer',
  104. 'value' => 'collectioncontainer',
  105. 'xtype' => 'textfield',
  106. 'namespace' => 'collections',
  107. 'area' => 'manager',
  108. 'editedon' => NULL,
  109. ),
  110. ),
  111. '6a3e80509677bdae76fdafc3091e6e26' =>
  112. array (
  113. 'criteria' =>
  114. array (
  115. 'key' => 'mgr_tree_icon_selectioncontainer',
  116. ),
  117. 'object' =>
  118. array (
  119. 'key' => 'mgr_tree_icon_selectioncontainer',
  120. 'value' => 'selectioncontainer',
  121. 'xtype' => 'textfield',
  122. 'namespace' => 'collections',
  123. 'area' => 'manager',
  124. 'editedon' => NULL,
  125. ),
  126. ),
  127. '8dbe2c3f67d75333fe279d9218ac68ec' =>
  128. array (
  129. 'criteria' =>
  130. array (
  131. 'key' => 'collections.renderer_image_path',
  132. ),
  133. 'object' =>
  134. array (
  135. 'key' => 'collections.renderer_image_path',
  136. 'value' => '',
  137. 'xtype' => 'textfield',
  138. 'namespace' => 'collections',
  139. 'area' => 'manager',
  140. 'editedon' => NULL,
  141. ),
  142. ),
  143. '2ffc3c36ef3478886700dc3abb0cbb99' =>
  144. array (
  145. 'criteria' =>
  146. array (
  147. 'key' => 'collections.tree_tbar_collection',
  148. ),
  149. 'object' =>
  150. array (
  151. 'key' => 'collections.tree_tbar_collection',
  152. 'value' => '0',
  153. 'xtype' => 'combo-boolean',
  154. 'namespace' => 'collections',
  155. 'area' => 'manager',
  156. 'editedon' => NULL,
  157. ),
  158. ),
  159. '992bcbfd0667130e2eb5b535cc4dc940' =>
  160. array (
  161. 'criteria' =>
  162. array (
  163. 'key' => 'collections.tree_tbar_selection',
  164. ),
  165. 'object' =>
  166. array (
  167. 'key' => 'collections.tree_tbar_selection',
  168. 'value' => '0',
  169. 'xtype' => 'combo-boolean',
  170. 'namespace' => 'collections',
  171. 'area' => 'manager',
  172. 'editedon' => NULL,
  173. ),
  174. ),
  175. '302f6cda26f4f09c033e654f12559081' =>
  176. array (
  177. 'criteria' =>
  178. array (
  179. 'category' => 'Collections',
  180. ),
  181. 'object' =>
  182. array (
  183. 'id' => 32,
  184. 'parent' => 0,
  185. 'category' => 'Collections',
  186. 'rank' => 0,
  187. ),
  188. ),
  189. '048aa13f988a5ff3f4a24867381d57e8' =>
  190. array (
  191. 'criteria' =>
  192. array (
  193. 'name' => 'getSelections',
  194. ),
  195. 'object' =>
  196. array (
  197. 'id' => 96,
  198. 'source' => 0,
  199. 'property_preprocess' => 0,
  200. 'name' => 'getSelections',
  201. 'description' => '',
  202. 'editor_type' => 0,
  203. 'category' => 32,
  204. 'cache_type' => 0,
  205. 'snippet' => '/**
  206. * getSelections
  207. *
  208. * DESCRIPTION
  209. *
  210. * This snippet is a helper for getResources call.
  211. * It will allows you to select all linked resources under specific Selection with a usage of getResources snippet.
  212. * Returns distinct list of linked Resources for given Selections
  213. *
  214. * getResources are required
  215. *
  216. * PROPERTIES:
  217. *
  218. * &sortdir string optional Direction of sorting by linked resource\'s menuindex. Default: ASC
  219. * &selections string optional Comma separated list of Selection IDs for which should be retrieved linked resources. Default: empty string
  220. * &getResourcesSnippet string optional Name of getResources snippet. Default: getResources
  221. * &excludeResources string optional Comma separated list of Resources to exclude, even though they are in the Selection
  222. *
  223. * USAGE:
  224. *
  225. * [[getSelections? &selections=`1` &tpl=`rowTpl`]]
  226. * [[getSelections? &selections=`1` &tpl=`rowTpl` &sortby=`RAND()`]]
  227. *
  228. * @var modX $modx
  229. * @var array $scriptProperties
  230. */
  231. $corePath = $modx->getOption(\'collections.core_path\', null, $modx->getOption(\'core_path\', null, MODX_CORE_PATH) . \'components/collections/\');
  232. /** @var Collections $collections */
  233. $collections = $modx->getService(
  234. \'collections\',
  235. \'Collections\',
  236. $corePath . \'model/collections/\',
  237. array(
  238. \'core_path\' => $corePath
  239. )
  240. );
  241. if (!($collections instanceof Collections)) return \'\';
  242. $getResourcesSnippet = $modx->getOption(\'getResourcesSnippet\', $scriptProperties, \'getResources\');
  243. $getResourcesExists = $modx->getCount(\'modSnippet\', array(\'name\' => $getResourcesSnippet));
  244. if ($getResourcesExists == 0) return \'getResources not found\';
  245. $sortDir = strtolower($modx->getOption(\'sortdir\', $scriptProperties, \'asc\'));
  246. $selections = $modx->getOption(\'selections\', $scriptProperties, \'\');
  247. $sortBy = $modx->getOption(\'sortby\', $scriptProperties, \'\');
  248. $selections = $collections->explodeAndClean($selections);
  249. if ($sortDir != \'asc\') {
  250. $sortDir = \'desc\';
  251. }
  252. $linkedResourcesQuery = $modx->newQuery(\'CollectionSelection\');
  253. if (!empty($selections)) {
  254. $linkedResourcesQuery->where(array(
  255. \'collection:IN\' => $selections
  256. ));
  257. }
  258. if ($sortBy == \'\') {
  259. $linkedResourcesQuery->sortby(\'menuindex\', $sortDir);
  260. }
  261. $linkedResourcesQuery->select(array(
  262. \'resource\' => \'DISTINCT(resource)\'
  263. ));
  264. $linkedResourcesQuery->prepare();
  265. $linkedResourcesQuery->stmt->execute();
  266. $linkedResources = $linkedResourcesQuery->stmt->fetchAll(PDO::FETCH_COLUMN, 0);
  267. $excludedResources = $modx->getOption(\'excludeResources\', $scriptProperties, \'\');
  268. $excludedResources = $collections->explodeAndClean($excludedResources);
  269. if (!empty($excludedResources)) {
  270. $linkedResources = array_diff($linkedResources, $excludedResources);
  271. }
  272. $linkedResources = implode(\',\', $linkedResources);
  273. $properties = $scriptProperties;
  274. unset($properties[\'selections\']);
  275. $properties[\'resources\'] = $linkedResources;
  276. $properties[\'parents\'] = ($properties[\'getResourcesSnippet\'] == \'pdoResources\') ? 0 : -1;
  277. if ($sortBy == \'\') {
  278. $properties[\'sortby\'] = \'FIELD(modResource.id, \' . $linkedResources . \' )\';
  279. $properties[\'sortdir\'] = \'asc\';
  280. }
  281. return $modx->runSnippet($getResourcesSnippet, $properties);',
  282. 'locked' => 0,
  283. 'properties' => 'a:0:{}',
  284. 'moduleguid' => '',
  285. 'static' => 0,
  286. 'static_file' => '',
  287. 'content' => '/**
  288. * getSelections
  289. *
  290. * DESCRIPTION
  291. *
  292. * This snippet is a helper for getResources call.
  293. * It will allows you to select all linked resources under specific Selection with a usage of getResources snippet.
  294. * Returns distinct list of linked Resources for given Selections
  295. *
  296. * getResources are required
  297. *
  298. * PROPERTIES:
  299. *
  300. * &sortdir string optional Direction of sorting by linked resource\'s menuindex. Default: ASC
  301. * &selections string optional Comma separated list of Selection IDs for which should be retrieved linked resources. Default: empty string
  302. * &getResourcesSnippet string optional Name of getResources snippet. Default: getResources
  303. * &excludeResources string optional Comma separated list of Resources to exclude, even though they are in the Selection
  304. *
  305. * USAGE:
  306. *
  307. * [[getSelections? &selections=`1` &tpl=`rowTpl`]]
  308. * [[getSelections? &selections=`1` &tpl=`rowTpl` &sortby=`RAND()`]]
  309. *
  310. * @var modX $modx
  311. * @var array $scriptProperties
  312. */
  313. $corePath = $modx->getOption(\'collections.core_path\', null, $modx->getOption(\'core_path\', null, MODX_CORE_PATH) . \'components/collections/\');
  314. /** @var Collections $collections */
  315. $collections = $modx->getService(
  316. \'collections\',
  317. \'Collections\',
  318. $corePath . \'model/collections/\',
  319. array(
  320. \'core_path\' => $corePath
  321. )
  322. );
  323. if (!($collections instanceof Collections)) return \'\';
  324. $getResourcesSnippet = $modx->getOption(\'getResourcesSnippet\', $scriptProperties, \'getResources\');
  325. $getResourcesExists = $modx->getCount(\'modSnippet\', array(\'name\' => $getResourcesSnippet));
  326. if ($getResourcesExists == 0) return \'getResources not found\';
  327. $sortDir = strtolower($modx->getOption(\'sortdir\', $scriptProperties, \'asc\'));
  328. $selections = $modx->getOption(\'selections\', $scriptProperties, \'\');
  329. $sortBy = $modx->getOption(\'sortby\', $scriptProperties, \'\');
  330. $selections = $collections->explodeAndClean($selections);
  331. if ($sortDir != \'asc\') {
  332. $sortDir = \'desc\';
  333. }
  334. $linkedResourcesQuery = $modx->newQuery(\'CollectionSelection\');
  335. if (!empty($selections)) {
  336. $linkedResourcesQuery->where(array(
  337. \'collection:IN\' => $selections
  338. ));
  339. }
  340. if ($sortBy == \'\') {
  341. $linkedResourcesQuery->sortby(\'menuindex\', $sortDir);
  342. }
  343. $linkedResourcesQuery->select(array(
  344. \'resource\' => \'DISTINCT(resource)\'
  345. ));
  346. $linkedResourcesQuery->prepare();
  347. $linkedResourcesQuery->stmt->execute();
  348. $linkedResources = $linkedResourcesQuery->stmt->fetchAll(PDO::FETCH_COLUMN, 0);
  349. $excludedResources = $modx->getOption(\'excludeResources\', $scriptProperties, \'\');
  350. $excludedResources = $collections->explodeAndClean($excludedResources);
  351. if (!empty($excludedResources)) {
  352. $linkedResources = array_diff($linkedResources, $excludedResources);
  353. }
  354. $linkedResources = implode(\',\', $linkedResources);
  355. $properties = $scriptProperties;
  356. unset($properties[\'selections\']);
  357. $properties[\'resources\'] = $linkedResources;
  358. $properties[\'parents\'] = ($properties[\'getResourcesSnippet\'] == \'pdoResources\') ? 0 : -1;
  359. if ($sortBy == \'\') {
  360. $properties[\'sortby\'] = \'FIELD(modResource.id, \' . $linkedResources . \' )\';
  361. $properties[\'sortdir\'] = \'asc\';
  362. }
  363. return $modx->runSnippet($getResourcesSnippet, $properties);',
  364. ),
  365. ),
  366. '2145756bb9a563e66aa9b1aff8303b07' =>
  367. array (
  368. 'criteria' =>
  369. array (
  370. 'name' => 'Collections',
  371. ),
  372. 'object' =>
  373. array (
  374. 'id' => 17,
  375. 'source' => 0,
  376. 'property_preprocess' => 0,
  377. 'name' => 'Collections',
  378. 'description' => '',
  379. 'editor_type' => 0,
  380. 'category' => 32,
  381. 'cache_type' => 0,
  382. 'plugincode' => '/**
  383. * Collections
  384. *
  385. * DESCRIPTION
  386. *
  387. * This plugin inject JS to handle proper working of close buttons in Resource\'s panel (OnDocFormPrerender)
  388. * This plugin handles setting proper show_in_tree parameter (OnBeforeDocFormSave, OnResourceSort)
  389. *
  390. * @var modX $modx
  391. * @var array $scriptProperties
  392. */
  393. $corePath = $modx->getOption(\'collections.core_path\', null, $modx->getOption(\'core_path\', null, MODX_CORE_PATH) . \'components/collections/\');
  394. /** @var Collections $collections */
  395. $collections = $modx->getService(
  396. \'collections\',
  397. \'Collections\',
  398. $corePath . \'model/collections/\',
  399. array(
  400. \'core_path\' => $corePath
  401. )
  402. );
  403. $className = \'Collections\' . $modx->event->name;
  404. $modx->loadClass(\'CollectionsPlugin\', $collections->getOption(\'modelPath\') . \'collections/events/\', true, true);
  405. $modx->loadClass($className, $collections->getOption(\'modelPath\') . \'collections/events/\', true, true);
  406. if (class_exists($className)) {
  407. /** @var CollectionsPlugin $handler */
  408. $handler = new $className($modx, $scriptProperties);
  409. $handler->run();
  410. }
  411. return;',
  412. 'locked' => 0,
  413. 'properties' => 'a:0:{}',
  414. 'disabled' => 0,
  415. 'moduleguid' => '',
  416. 'static' => 0,
  417. 'static_file' => '',
  418. 'content' => '/**
  419. * Collections
  420. *
  421. * DESCRIPTION
  422. *
  423. * This plugin inject JS to handle proper working of close buttons in Resource\'s panel (OnDocFormPrerender)
  424. * This plugin handles setting proper show_in_tree parameter (OnBeforeDocFormSave, OnResourceSort)
  425. *
  426. * @var modX $modx
  427. * @var array $scriptProperties
  428. */
  429. $corePath = $modx->getOption(\'collections.core_path\', null, $modx->getOption(\'core_path\', null, MODX_CORE_PATH) . \'components/collections/\');
  430. /** @var Collections $collections */
  431. $collections = $modx->getService(
  432. \'collections\',
  433. \'Collections\',
  434. $corePath . \'model/collections/\',
  435. array(
  436. \'core_path\' => $corePath
  437. )
  438. );
  439. $className = \'Collections\' . $modx->event->name;
  440. $modx->loadClass(\'CollectionsPlugin\', $collections->getOption(\'modelPath\') . \'collections/events/\', true, true);
  441. $modx->loadClass($className, $collections->getOption(\'modelPath\') . \'collections/events/\', true, true);
  442. if (class_exists($className)) {
  443. /** @var CollectionsPlugin $handler */
  444. $handler = new $className($modx, $scriptProperties);
  445. $handler->run();
  446. }
  447. return;',
  448. ),
  449. ),
  450. 'afe424f721a00b87314f0dbc32519e20' =>
  451. array (
  452. 'criteria' =>
  453. array (
  454. 'pluginid' => 17,
  455. 'event' => 'OnManagerPageInit',
  456. ),
  457. 'object' =>
  458. array (
  459. 'pluginid' => 17,
  460. 'event' => 'OnManagerPageInit',
  461. 'priority' => 0,
  462. 'propertyset' => 0,
  463. ),
  464. ),
  465. '106a976fb2a14b8fab9221dce87002c4' =>
  466. array (
  467. 'criteria' =>
  468. array (
  469. 'pluginid' => 17,
  470. 'event' => 'OnBeforeDocFormSave',
  471. ),
  472. 'object' =>
  473. array (
  474. 'pluginid' => 17,
  475. 'event' => 'OnBeforeDocFormSave',
  476. 'priority' => 0,
  477. 'propertyset' => 0,
  478. ),
  479. ),
  480. 'dc445129469bce5e7bf7daf78ddfae49' =>
  481. array (
  482. 'criteria' =>
  483. array (
  484. 'pluginid' => 17,
  485. 'event' => 'OnResourceBeforeSort',
  486. ),
  487. 'object' =>
  488. array (
  489. 'pluginid' => 17,
  490. 'event' => 'OnResourceBeforeSort',
  491. 'priority' => 0,
  492. 'propertyset' => 0,
  493. ),
  494. ),
  495. '4d4512be49843c80ffb444664b2f41b3' =>
  496. array (
  497. 'criteria' =>
  498. array (
  499. 'pluginid' => 17,
  500. 'event' => 'OnDocFormPrerender',
  501. ),
  502. 'object' =>
  503. array (
  504. 'pluginid' => 17,
  505. 'event' => 'OnDocFormPrerender',
  506. 'priority' => 0,
  507. 'propertyset' => 0,
  508. ),
  509. ),
  510. '3897b9d914514cee2a9ea021645c0476' =>
  511. array (
  512. 'criteria' =>
  513. array (
  514. 'pluginid' => 17,
  515. 'event' => 'OnBeforeEmptyTrash',
  516. ),
  517. 'object' =>
  518. array (
  519. 'pluginid' => 17,
  520. 'event' => 'OnBeforeEmptyTrash',
  521. 'priority' => 0,
  522. 'propertyset' => 0,
  523. ),
  524. ),
  525. '2627a7fe9062e2a304ca44e114c4d941' =>
  526. array (
  527. 'criteria' =>
  528. array (
  529. 'pluginid' => 17,
  530. 'event' => 'OnDocFormRender',
  531. ),
  532. 'object' =>
  533. array (
  534. 'pluginid' => 17,
  535. 'event' => 'OnDocFormRender',
  536. 'priority' => 0,
  537. 'propertyset' => 0,
  538. ),
  539. ),
  540. '6a7a051612062f31f7a1f06e587e1daf' =>
  541. array (
  542. 'criteria' =>
  543. array (
  544. 'pluginid' => 17,
  545. 'event' => 'OnManagerPageBeforeRender',
  546. ),
  547. 'object' =>
  548. array (
  549. 'pluginid' => 17,
  550. 'event' => 'OnManagerPageBeforeRender',
  551. 'priority' => 0,
  552. 'propertyset' => 0,
  553. ),
  554. ),
  555. 'd461bf4226f6b1cd27d91bbe108fb396' =>
  556. array (
  557. 'criteria' =>
  558. array (
  559. 'text' => 'collections.menu.collection_templates',
  560. ),
  561. 'object' =>
  562. array (
  563. 'text' => 'collections.menu.collection_templates',
  564. 'parent' => 'components',
  565. 'action' => '5',
  566. 'description' => 'collections.menu.collection_templates_desc',
  567. 'icon' => '',
  568. 'menuindex' => 0,
  569. 'params' => '',
  570. 'handler' => '',
  571. 'permissions' => '',
  572. 'namespace' => 'core',
  573. ),
  574. ),
  575. );