Server : Apache System : Linux indy02.toastserver.com 3.10.0-962.3.2.lve1.5.85.el7.x86_64 #1 SMP Thu Apr 18 15:18:36 UTC 2024 x86_64 User : palandch ( 1163) PHP Version : 7.1.33 Disable Function : NONE Directory : /home/palandch/www/core/packages/if-1.1.1-pl/modSnippet/ |
<?php return array ( 'unique_key' => 'name', 'preserve_keys' => false, 'update_object' => true, 'namespace' => 'if', 'resolve' => array ( 0 => array ( 'type' => 'file', 'body' => '{"source":"if-1.1.1-pl\\/modSnippet\\/cb4a96476ee4adfdd684c6da1da53d62\\/0\\/","target":"return MODX_CORE_PATH . \'components\\/\';","name":"if"}', ), ), 'validate' => NULL, 'vehicle_package' => 'transport', 'vehicle_class' => 'xPDOObjectVehicle', 'guid' => 'ea63c7f9189ad8564cf2dccabf8badb0', 'package' => 'modx', 'class' => 'modSnippet', 'signature' => 'cb4a96476ee4adfdd684c6da1da53d62', 'native_key' => 0, 'object' => '{"id":0,"source":0,"property_preprocess":0,"name":"If","description":"Simple if (conditional) snippet","editor_type":0,"category":0,"cache_type":0,"snippet":"\\/**\\n * If\\n *\\n * Copyright 2009-2010 by Jason Coward <jason@modx.com> and Shaun McCormick\\n * <shaun@modx.com>\\n *\\n * If is free software; you can redistribute it and\\/or modify it under the terms\\n * of the GNU General Public License as published by the Free Software\\n * Foundation; either version 2 of the License, or (at your option) any later\\n * version.\\n *\\n * If is distributed in the hope that it will be useful, but WITHOUT ANY\\n * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\\n * A PARTICULAR PURPOSE. See the GNU General Public License for more details.\\n *\\n * You should have received a copy of the GNU General Public License along with\\n * If; if not, write to the Free Software Foundation, Inc., 59 Temple Place,\\n * Suite 330, Boston, MA 02111-1307 USA\\n *\\n * @package if\\n *\\/\\n\\/**\\n * Simple if (conditional) snippet\\n *\\n * @package if\\n *\\/\\nif (!empty($debug)) {\\n print_r($scriptProperties);\\n if (!empty($die)) die();\\n}\\n$modx->parser->processElementTags(\'\',$subject,true,true);\\n\\n$output = \'\';\\n$operator = !empty($operator) ? $operator : \'\';\\n$operand = !isset($operand) ? \'\' : $operand;\\nif (isset($subject)) {\\n if (!empty($operator)) {\\n $operator = strtolower($operator);\\n switch ($operator) {\\n case \'!=\':\\n case \'neq\':\\n case \'not\':\\n case \'isnot\':\\n case \'isnt\':\\n case \'unequal\':\\n case \'notequal\':\\n $output = (($subject != $operand) ? $then : (isset($else) ? $else : \'\'));\\n break;\\n case \'<\':\\n case \'lt\':\\n case \'less\':\\n case \'lessthan\':\\n $output = (($subject < $operand) ? $then : (isset($else) ? $else : \'\'));\\n break;\\n case \'>\':\\n case \'gt\':\\n case \'greater\':\\n case \'greaterthan\':\\n $output = (($subject > $operand) ? $then : (isset($else) ? $else : \'\'));\\n break;\\n case \'<=\':\\n case \'lte\':\\n case \'lessthanequals\':\\n case \'lessthanorequalto\':\\n $output = (($subject <= $operand) ? $then : (isset($else) ? $else : \'\'));\\n break;\\n case \'>=\':\\n case \'gte\':\\n case \'greaterthanequals\':\\n case \'greaterthanequalto\':\\n $output = (($subject >= $operand) ? $then : (isset($else) ? $else : \'\'));\\n break;\\n case \'isempty\':\\n case \'empty\':\\n $output = empty($subject) ? $then : (isset($else) ? $else : \'\');\\n break;\\n case \'!empty\':\\n case \'notempty\':\\n case \'isnotempty\':\\n $output = !empty($subject) && $subject != \'\' ? $then : (isset($else) ? $else : \'\');\\n break;\\n case \'isnull\':\\n case \'null\':\\n $output = $subject == null || strtolower($subject) == \'null\' ? $then : (isset($else) ? $else : \'\');\\n break;\\n case \'inarray\':\\n case \'in_array\':\\n case \'ia\':\\n $operand = explode(\',\',$operand);\\n $output = in_array($subject,$operand) ? $then : (isset($else) ? $else : \'\');\\n break;\\n case \'==\':\\n case \'=\':\\n case \'eq\':\\n case \'is\':\\n case \'equal\':\\n case \'equals\':\\n case \'equalto\':\\n default:\\n $output = (($subject == $operand) ? $then : (isset($else) ? $else : \'\'));\\n break;\\n }\\n }\\n}\\nif (!empty($debug)) { var_dump($output); }\\nunset($subject);\\nreturn $output;","locked":0,"properties":"a:6:{s:7:\\"subject\\";a:7:{s:4:\\"name\\";s:7:\\"subject\\";s:4:\\"desc\\";s:24:\\"The data being affected.\\";s:4:\\"type\\";s:9:\\"textfield\\";s:7:\\"options\\";s:0:\\"\\";s:5:\\"value\\";s:0:\\"\\";s:7:\\"lexicon\\";N;s:4:\\"area\\";s:0:\\"\\";}s:8:\\"operator\\";a:7:{s:4:\\"name\\";s:8:\\"operator\\";s:4:\\"desc\\";s:24:\\"The type of conditional.\\";s:4:\\"type\\";s:4:\\"list\\";s:7:\\"options\\";a:10:{i:0;a:2:{s:5:\\"value\\";s:2:\\"EQ\\";s:4:\\"text\\";s:2:\\"EQ\\";}i:1;a:2:{s:5:\\"value\\";s:3:\\"NEQ\\";s:4:\\"text\\";s:3:\\"NEQ\\";}i:2;a:2:{s:5:\\"value\\";s:2:\\"LT\\";s:4:\\"text\\";s:2:\\"LT\\";}i:3;a:2:{s:5:\\"value\\";s:2:\\"GT\\";s:4:\\"text\\";s:2:\\"GT\\";}i:4;a:2:{s:5:\\"value\\";s:3:\\"LTE\\";s:4:\\"text\\";s:3:\\"LTE\\";}i:5;a:2:{s:5:\\"value\\";s:2:\\"GT\\";s:4:\\"text\\";s:3:\\"GTE\\";}i:6;a:2:{s:5:\\"value\\";s:5:\\"EMPTY\\";s:4:\\"text\\";s:5:\\"EMPTY\\";}i:7;a:2:{s:5:\\"value\\";s:8:\\"NOTEMPTY\\";s:4:\\"text\\";s:8:\\"NOTEMPTY\\";}i:8;a:2:{s:5:\\"value\\";s:6:\\"ISNULL\\";s:4:\\"text\\";s:6:\\"ISNULL\\";}i:9;a:2:{s:5:\\"value\\";s:7:\\"inarray\\";s:4:\\"text\\";s:7:\\"INARRAY\\";}}s:5:\\"value\\";s:2:\\"EQ\\";s:7:\\"lexicon\\";N;s:4:\\"area\\";s:0:\\"\\";}s:7:\\"operand\\";a:7:{s:4:\\"name\\";s:7:\\"operand\\";s:4:\\"desc\\";s:62:\\"When comparing to the subject, this is the data to compare to.\\";s:4:\\"type\\";s:9:\\"textfield\\";s:7:\\"options\\";s:0:\\"\\";s:5:\\"value\\";s:0:\\"\\";s:7:\\"lexicon\\";N;s:4:\\"area\\";s:0:\\"\\";}s:4:\\"then\\";a:7:{s:4:\\"name\\";s:4:\\"then\\";s:4:\\"desc\\";s:43:\\"If conditional was successful, output this.\\";s:4:\\"type\\";s:9:\\"textfield\\";s:7:\\"options\\";s:0:\\"\\";s:5:\\"value\\";s:0:\\"\\";s:7:\\"lexicon\\";N;s:4:\\"area\\";s:0:\\"\\";}s:4:\\"else\\";a:7:{s:4:\\"name\\";s:4:\\"else\\";s:4:\\"desc\\";s:45:\\"If conditional was unsuccessful, output this.\\";s:4:\\"type\\";s:9:\\"textfield\\";s:7:\\"options\\";s:0:\\"\\";s:5:\\"value\\";s:0:\\"\\";s:7:\\"lexicon\\";N;s:4:\\"area\\";s:0:\\"\\";}s:5:\\"debug\\";a:7:{s:4:\\"name\\";s:5:\\"debug\\";s:4:\\"desc\\";s:92:\\"Will output the parameters passed in, as well as the end output. Leave off when not testing.\\";s:4:\\"type\\";s:13:\\"combo-boolean\\";s:7:\\"options\\";s:0:\\"\\";s:5:\\"value\\";b:0;s:7:\\"lexicon\\";N;s:4:\\"area\\";s:0:\\"\\";}}","moduleguid":"","static":0,"static_file":"","content":"\\/**\\n * If\\n *\\n * Copyright 2009-2010 by Jason Coward <jason@modx.com> and Shaun McCormick\\n * <shaun@modx.com>\\n *\\n * If is free software; you can redistribute it and\\/or modify it under the terms\\n * of the GNU General Public License as published by the Free Software\\n * Foundation; either version 2 of the License, or (at your option) any later\\n * version.\\n *\\n * If is distributed in the hope that it will be useful, but WITHOUT ANY\\n * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\\n * A PARTICULAR PURPOSE. See the GNU General Public License for more details.\\n *\\n * You should have received a copy of the GNU General Public License along with\\n * If; if not, write to the Free Software Foundation, Inc., 59 Temple Place,\\n * Suite 330, Boston, MA 02111-1307 USA\\n *\\n * @package if\\n *\\/\\n\\/**\\n * Simple if (conditional) snippet\\n *\\n * @package if\\n *\\/\\nif (!empty($debug)) {\\n print_r($scriptProperties);\\n if (!empty($die)) die();\\n}\\n$modx->parser->processElementTags(\'\',$subject,true,true);\\n\\n$output = \'\';\\n$operator = !empty($operator) ? $operator : \'\';\\n$operand = !isset($operand) ? \'\' : $operand;\\nif (isset($subject)) {\\n if (!empty($operator)) {\\n $operator = strtolower($operator);\\n switch ($operator) {\\n case \'!=\':\\n case \'neq\':\\n case \'not\':\\n case \'isnot\':\\n case \'isnt\':\\n case \'unequal\':\\n case \'notequal\':\\n $output = (($subject != $operand) ? $then : (isset($else) ? $else : \'\'));\\n break;\\n case \'<\':\\n case \'lt\':\\n case \'less\':\\n case \'lessthan\':\\n $output = (($subject < $operand) ? $then : (isset($else) ? $else : \'\'));\\n break;\\n case \'>\':\\n case \'gt\':\\n case \'greater\':\\n case \'greaterthan\':\\n $output = (($subject > $operand) ? $then : (isset($else) ? $else : \'\'));\\n break;\\n case \'<=\':\\n case \'lte\':\\n case \'lessthanequals\':\\n case \'lessthanorequalto\':\\n $output = (($subject <= $operand) ? $then : (isset($else) ? $else : \'\'));\\n break;\\n case \'>=\':\\n case \'gte\':\\n case \'greaterthanequals\':\\n case \'greaterthanequalto\':\\n $output = (($subject >= $operand) ? $then : (isset($else) ? $else : \'\'));\\n break;\\n case \'isempty\':\\n case \'empty\':\\n $output = empty($subject) ? $then : (isset($else) ? $else : \'\');\\n break;\\n case \'!empty\':\\n case \'notempty\':\\n case \'isnotempty\':\\n $output = !empty($subject) && $subject != \'\' ? $then : (isset($else) ? $else : \'\');\\n break;\\n case \'isnull\':\\n case \'null\':\\n $output = $subject == null || strtolower($subject) == \'null\' ? $then : (isset($else) ? $else : \'\');\\n break;\\n case \'inarray\':\\n case \'in_array\':\\n case \'ia\':\\n $operand = explode(\',\',$operand);\\n $output = in_array($subject,$operand) ? $then : (isset($else) ? $else : \'\');\\n break;\\n case \'==\':\\n case \'=\':\\n case \'eq\':\\n case \'is\':\\n case \'equal\':\\n case \'equals\':\\n case \'equalto\':\\n default:\\n $output = (($subject == $operand) ? $then : (isset($else) ? $else : \'\'));\\n break;\\n }\\n }\\n}\\nif (!empty($debug)) { var_dump($output); }\\nunset($subject);\\nreturn $output;"}', );