Commits vergleichen

...

307 Commits

Autor SHA1 Nachricht Datum
o.pinke f8ac1fe90d add missing function and doc comments 2024-04-22 15:50:14 +02:00
o.pinke bdabf086af recode of functions.api.images.php 2024-04-22 15:41:18 +02:00
o.pinke 7dbcb40790 cleanup 2024-04-22 15:40:17 +02:00
o.pinke 95444fed6a new file doc block 2024-04-22 15:05:07 +02:00
o.pinke 8e3c1d979b php8 updates 2024-04-22 15:04:37 +02:00
o.pinke 92181aba97 fix upload delete 2024-04-12 20:35:30 +02:00
o.pinke 4d65fba9dc undo PHP8 fixes 2024-04-12 20:32:40 +02:00
o.pinke a8f68477fa PHP8 fixes 2024-04-12 20:28:17 +02:00
o.pinke 1e898500d3 PHP8 fixes 2024-04-12 20:24:33 +02:00
o.pinke ca841298f4 PHP8 fix fatal error 2024-04-11 15:33:48 +02:00
Ortwin Pinke 28b037b0a5 Merge pull request 'feature/make-logrotation-switchable-#9' (#50) from feature/make-logrotation-switchable-#9 into develop
Reviewed-on: #50
2024-03-12 18:26:55 +00:00
o.pinke 12a87f3f4d delete unused log classes 2024-03-12 19:20:06 +01:00
o.pinke 754c174e9d use new log class 2024-03-12 19:19:19 +01:00
o.pinke 24ba3bdb26 add custom settings 2024-03-12 19:05:19 +01:00
o.pinke 8c693ec00c remove deprecation call 2024-03-12 19:04:59 +01:00
o.pinke cfeb2c7bc3 remove var dump 2024-03-12 18:02:50 +01:00
o.pinke cb89e4477b optimize code 2024-03-12 16:13:38 +01:00
o.pinke a6ee04a0bb add log class usage for cronjobs 2024-03-12 15:59:57 +01:00
o.pinke 910d246945 remove functions for older php versions 2024-03-12 15:59:14 +01:00
o.pinke 3be4baf751 fix return type 2024-03-12 09:42:02 +01:00
o.pinke 96b264defa recode for PHP 8 2024-03-12 09:36:48 +01:00
o.pinke 1eb4c86d57 add functionality 2024-03-12 09:24:04 +01:00
o.pinke e99363f44a update autoloader 2024-03-12 08:48:10 +01:00
o.pinke ed6b5569fd new exceptions and handler for log writer file 2024-03-11 15:47:48 +01:00
o.pinke a34f26177e fix for german umlaute 2024-03-11 15:33:21 +01:00
o.pinke ea2fbc499a init new log writer stuff psr-4 compatible 2024-03-11 15:29:03 +01:00
o.pinke 824e1f1625 init exception handling 2024-03-11 15:28:14 +01:00
o.pinke 9adbbdd164 fix typing and doc 2024-03-11 15:27:47 +01:00
o.pinke 9d5af6dc52 gitadmin 2024-03-11 13:52:17 +01:00
o.pinke bbf4fe66b2 idea settings 2024-03-11 13:51:03 +01:00
Ortwin Pinke 1f807f13ef .idea/workspace.xml gelöscht 2024-03-11 12:43:22 +00:00
o.pinke df76ce462a set default for param 2024-03-05 16:28:04 +01:00
o.pinke 33e941aecf recode 2024-02-26 10:20:31 +01:00
Ortwin Pinke 1419bbf701 .idea 2023-10-24 13:27:01 +02:00
Ortwin Pinke b185332a35 composer stuff 2023-10-24 13:26:10 +02:00
o.pinke 6b98e3a4f5 update readme 2023-10-17 11:51:11 +02:00
Ortwin Pinke 1c94d40e04 Merge pull request 'Increase develop-branch to PHP8' (#47) from dev_php82 into develop
Reviewed-on: #47
2023-10-16 16:08:58 +00:00
o.pinke f016933445 Merge branch 'develop' into dev_php82
# Conflicts:
#	.idea/php.xml
#	.idea/phpunit.xml
#	README.md
#	conlite/plugins/cl-mod-rewrite
#	setup/lib/defines.php
2023-10-16 18:07:44 +02:00
o.pinke 3a71ed5cf1 composer 2023-10-16 18:07:02 +02:00
o.pinke 12e58c78ef Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	.idea/php.xml
#	.idea/vcs.xml
2023-10-16 18:02:31 +02:00
Ortwin Pinke 449cc39cdc Merge pull request 'add frontend path to template generation' (#46) from bugfix/missing-template-#43 into develop
Reviewed-on: #46
2023-10-14 15:05:34 +00:00
o.pinke 23538e80bb #43 - fixed 2023-10-14 17:03:16 +02:00
o.pinke 8987db8e69 ide conf 2023-10-12 15:18:03 +02:00
o.pinke c883bd2060 config defines.php for 2.1.3 2023-10-12 14:55:33 +02:00
o.pinke 4debd1559b fix typo 2023-10-12 14:45:11 +02:00
o.pinke 63fb94db39 cleanup README.md 2023-10-12 14:44:25 +02:00
o.pinke a397b65fcd rm netbeans project 2023-10-11 18:02:07 +02:00
o.pinke 71e13f626e gdlib fixes 2023-10-11 17:49:33 +02:00
o.pinke 2c999a7048 composer 2023-10-11 17:33:01 +02:00
Ortwin Pinke 6a28bd3eaf Merge pull request 'feature/recode-genericdb-php8' (#44) from feature/recode-genericdb-php8 into dev_php82
Reviewed-on: #44
2023-10-11 15:29:53 +00:00
o.pinke dfdbecba7e settings 2023-10-11 17:25:50 +02:00
o.pinke 95d401cb1e composer 2023-10-11 17:25:13 +02:00
o.pinke 9d2f901385 settings 2023-10-11 17:23:33 +02:00
o.pinke 881a247635 settings 2023-10-11 17:13:28 +02:00
Ortwin Pinke 5b8e93788b idea files (?) 2023-07-27 19:12:05 +02:00
Ortwin Pinke 10a1832a5a add twig template engine 2023-07-27 19:10:37 +02:00
Ortwin Pinke 764991d239 fix not saving javascript in code 2023-07-27 19:04:46 +02:00
Ortwin Pinke 8c65d7a755 add error variable 2023-07-27 16:10:28 +02:00
Ortwin Pinke 9d934b81f9 fix path for http check config 2023-07-27 16:09:35 +02:00
Ortwin Pinke 68bcdc4c1d fix add new language 2023-07-22 18:35:31 +02:00
Ortwin Pinke 8f8553996e fix add new client 2023-07-22 18:19:42 +02:00
Ortwin Pinke 60c61a86f9 use new genericdb with composer autoload 2023-07-22 17:44:00 +02:00
o.pinke ccff65a4e9 optimize rector by using conlite autoloader 2023-07-19 18:43:26 +02:00
o.pinke a96777d29c fix PHP8 2023-07-19 18:33:52 +02:00
o.pinke a8926c1723 PHP 8 updates and fixes 2023-07-19 15:33:17 +02:00
o.pinke 513e575a41 fix missing return statement 2023-07-18 22:13:15 +02:00
o.pinke 53e6a7a47f fix use statements 2023-07-18 22:11:37 +02:00
o.pinke 8ec4add782 add new psr-4 optimized html class files WIP 2023-07-18 22:10:00 +02:00
o.pinke 01255ad980 new rector conf and checked files 2023-07-18 22:09:07 +02:00
o.pinke c9eaa03cd0 remove old genericdb 2023-07-18 22:08:28 +02:00
o.pinke 5ccdc05e6b fix errors with new genericdb 2023-07-18 22:08:17 +02:00
o.pinke 613c95ad70 remove old genericdb 2023-07-18 22:07:47 +02:00
o.pinke 210091ad9b add new genericdb optimized for PHP8+ 2023-07-18 22:07:14 +02:00
o.pinke 680b5bad71 fix php8 errors 2023-07-07 13:48:07 +02:00
o.pinke 35fe2dd066 toggle to PSR-4 for ConLite 2023-07-06 20:18:52 +02:00
o.pinke 727cad0e1e toggle sort direction of user plugins 2023-07-04 20:17:03 +02:00
o.pinke 28acb7f004 use html5 datetime field 2023-07-04 20:04:48 +02:00
o.pinke 0b20d638f6 fix and closes #42 2023-07-04 20:00:39 +02:00
o.pinke dd79ad7e59 add todo 2023-07-04 17:19:57 +02:00
o.pinke 05327f3518 fix typos, regenerate composer files 2023-07-04 17:18:12 +02:00
o.pinke 46c1c1c3c3 fix typo and typehint 2023-07-04 17:09:34 +02:00
o.pinke 0de29ea0b6 gitadmin 2023-07-04 16:37:19 +02:00
Ortwin Pinke 2e386d7c41 add log path 2023-06-15 20:44:01 +02:00
Ortwin Pinke 70b845ca58 fixes setup php 8.2 'new installation' 2023-05-30 10:51:44 +02:00
Ortwin Pinke 4b69f07b8f fixes setup php 8.2 'new installation' 2023-05-30 09:46:38 +02:00
Ortwin Pinke 41c69d53fe fixed missing images in setup
fixed php8 errors
2023-05-30 06:28:22 +02:00
Ortwin Pinke 629983db56 add default vendor folder 2023-05-05 19:33:04 +02:00
Ortwin Pinke 8798c805f6 add globals 2023-05-05 09:20:09 +02:00
Ortwin Pinke d491725779 fixes php8 2023-05-05 09:17:38 +02:00
o.pinke d589909e87 fix #38 2023-04-26 16:05:52 +02:00
o.pinke 8909189c91 gitadmin 2023-04-26 14:52:05 +02:00
o.pinke cf0eecefb4 gitadmin 2023-04-26 14:44:46 +02:00
o.pinke 12637e8f24 gitadmin 2023-04-25 21:27:14 +02:00
o.pinke 88cfcbd342 updates for php8 2023-04-25 19:54:58 +02:00
o.pinke 068c042318 Merge remote-tracking branch 'origin/dev_php82' into dev_php82
# Conflicts:
#	.gitignore
#	.idea/modules.xml
#	.idea/php.xml
#	.idea/phpunit.xml
#	.idea/vcs.xml
#	composer.json
#	composer.lock
#	conlite/external/autoload.php
#	conlite/external/composer/autoload_classmap.php
#	conlite/external/composer/autoload_psr4.php
#	conlite/external/composer/autoload_static.php
#	conlite/external/composer/installed.json
#	conlite/external/composer/installed.php
#	conlite/external/composer/platform_check.php
#	conlite/external/phpmailer/phpmailer/VERSION
#	conlite/external/phpmailer/phpmailer/composer.json
#	conlite/external/phpmailer/phpmailer/get_oauth_token.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ar.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-az.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ba.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-be.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-bg.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ca.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-cs.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-da.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-de.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-el.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-eo.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-es.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-et.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-fa.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-fi.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-fo.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-fr.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-gl.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-he.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-hr.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-hu.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-hy.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-id.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-it.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ja.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ka.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ko.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-lt.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-lv.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ms.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-nb.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-nl.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-pl.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-pt.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ro.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ru.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-sk.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-sl.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-sr.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-sv.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-tr.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-uk.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-vi.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-zh.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php
#	conlite/external/phpmailer/phpmailer/src/SMTP.php
2023-04-25 19:12:49 +02:00
o.pinke a54fbde1c3 gitadmin 2023-04-25 19:10:42 +02:00
o.pinke 82dca3c1e2 add rector.php 2023-04-25 19:07:47 +02:00
o.pinke 57db5e9fde move composer vendor folder 2023-04-25 19:05:32 +02:00
o.pinke aa34d49978 fixed readme file 2023-04-17 20:20:59 +02:00
Ortwin Pinke b438f15708 fixes php8 2023-04-07 19:50:44 +02:00
Ortwin Pinke fcda0a460b composer update 2023-04-07 18:32:06 +02:00
Ortwin Pinke 219d52f739 composer update 2023-04-07 18:18:28 +02:00
Ortwin Pinke bf4c753342 add .idea file 2023-04-07 18:15:15 +02:00
Ortwin Pinke 1a3475b305 add .idea file 2023-04-07 18:15:06 +02:00
Ortwin Pinke 903dbf8d42 composer updates, add .idea folder 2023-04-07 18:14:09 +02:00
o.pinke 625c6ab405 fixed wrong date expression for published 2023-03-03 11:07:06 +01:00
o.pinke 7ecf03870a fixed js error 2023-03-03 10:37:53 +01:00
o.pinke fc6ea7746d handle empty or nulled content 2023-03-03 09:02:11 +01:00
o.pinke 606f48500f fix PHP8 errors 2023-03-03 08:52:50 +01:00
o.pinke 85d3f956e8 fix PHP8 errors 2023-03-02 19:45:37 +01:00
o.pinke dfcc174626 fix get_file with PHP 8 2023-02-23 12:53:23 +01:00
o.pinke 7c69afa326 temporary fix for inuse message if a module is
used for body tag in layout
2023-02-22 20:10:59 +01:00
o.pinke 6729446154 bugfixes search and keywords generation 2023-02-22 15:34:23 +01:00
o.pinke 434b483fac set flags to php8.1 standard 2023-02-21 15:33:03 +01:00
o.pinke fa3c96b94d param with type|null 2023-02-21 13:23:36 +01:00
o.pinke 7638a62ace always string in $sCode 2023-02-19 10:41:40 +01:00
o.pinke 1ff067d615 always string in $sCode 2023-02-19 10:39:09 +01:00
o.pinke 90dbc01650 always string in $sCode 2023-02-19 10:30:38 +01:00
o.pinke 33dcc58748 always return string 2023-02-19 10:00:57 +01:00
o.pinke 4aba95edd1 fix PHP8 errors 2023-02-17 15:38:31 +01:00
o.pinke b199edaf8e gitadmin 2023-02-17 15:18:01 +01:00
o.pinke 6847130805 add new methods, cleanup, PHP8 fixes 2023-02-17 15:17:20 +01:00
o.pinke 44382f8da0 increase CL version 2023-02-17 15:14:57 +01:00
o.pinke 965c7054f4 increase CL version 2023-02-17 15:14:30 +01:00
o.pinke 97a3370258 remove pear stuff, fix php8.x issues 2023-02-17 15:13:58 +01:00
o.pinke 9367766e7d remove old php5 support 2023-02-17 15:10:36 +01:00
o.pinke d1528111e2 add default to option var;
typo
2023-02-15 11:58:35 +01:00
o.pinke 106f003bfa bugfix variable 2023-02-15 11:56:45 +01:00
o.pinke 6f0385f4ba bugfixes HTML-Elements and cHTML 2023-02-12 12:59:50 +01:00
o.pinke 0589fd287e fixed bug with empty description 2023-02-10 11:55:27 +01:00
o.pinke c0e250a21f fixed bug with empty description 2023-02-10 11:52:16 +01:00
o.pinke efa03003be fixed bug with empty file information array 2023-02-10 11:45:26 +01:00
o.pinke d3e73bfe0a add utf8_encode to out filter of item class; 2023-02-10 11:43:45 +01:00
o.pinke af5bf9be94 gitadmin: add ignore 2023-02-10 11:06:45 +01:00
o.pinke 3f15c205a0 remove end tag php 2023-02-10 11:03:53 +01:00
o.pinke 7ca3bf10bb recode wrapper functions;
fixed encoding problems in mod translate;
change handling for encoding and charset in page widget
2023-02-10 10:57:30 +01:00
o.pinke 34d2c9ca2a setup: add local defines file 2023-02-09 08:11:56 +01:00
o.pinke 3d1a930809 Merge origin/dev_php82 into dev_php82 2023-02-06 11:51:21 +01:00
o.pinke a919480ca7 gitadmin 2023-02-06 11:48:16 +01:00
o.pinke 106f7bbcff Merge remote-tracking branch 'origin/dev_php8' into dev_php82
Conflicts:
	conlite/classes/class.xmlparser.php
	conlite/classes/contenido/class.module.php
	data/config/production/config.autoloader.php
2023-02-06 11:39:37 +01:00
o.pinke 81638e9b7e gitadmin 2023-02-05 05:43:06 +01:00
o.pinke d9a191eeab rename xmlparser 2023-02-05 05:37:11 +01:00
o.pinke 9b6a6268f0 rename xmlparser 2023-02-05 05:36:53 +01:00
Ortwin Pinke aa22765927 replace deprecated function 2022-12-20 20:00:10 +01:00
Ortwin Pinke ba6d871ec0 replace deprecated utf8_decode() 2022-12-20 19:54:19 +01:00
Ortwin Pinke b66c6fcf71 fix deprecations 2022-12-20 19:43:48 +01:00
Ortwin Pinke ec6c0cb788 fix deprecations 2022-12-20 19:42:45 +01:00
Ortwin Pinke 135238dc01 fix deprecations 2022-12-20 19:39:42 +01:00
Ortwin Pinke 0a4330bbf0 change visibility of class var 2022-12-20 19:37:30 +01:00
Ortwin Pinke e7077870e3 change visibility of class var 2022-12-20 19:36:01 +01:00
Ortwin Pinke 1fea4e1eac fix deprecations 2022-12-20 19:32:53 +01:00
Ortwin Pinke 5f1af41450 fix deprecations 2022-12-16 18:37:03 +01:00
Ortwin Pinke 58b47350e1 fix deprecations 2022-12-16 18:31:12 +01:00
Ortwin Pinke 10f55120eb fix deprecations 2022-12-16 18:29:44 +01:00
Ortwin Pinke 102acd14f5 set max php to 8.3 2022-12-16 18:24:29 +01:00
Ortwin Pinke f6c043ed76 fixed error missing html common in setup 2022-11-21 22:08:35 +01:00
Ortwin Pinke 53bd5fabf9 composer stuff 2022-11-21 21:09:22 +01:00
Ortwin Pinke 0c3b125735 composer updates 2022-11-21 21:08:37 +01:00
Ortwin Pinke a4241a0681 composer stuff 2022-11-21 21:06:51 +01:00
Ortwin Pinke fd21c77299 Merge pull request 'merge dev_php8' (#33) from dev_php8 into develop
Reviewed-on: #33
2022-11-21 19:45:29 +00:00
Ortwin Pinke 7d3d3b7cbb fix and close #32 2022-11-21 20:42:40 +01:00
Ortwin Pinke 82f6517398 recode for PHP 8.x 2022-11-21 20:37:19 +01:00
Ortwin Pinke b409ba0915 simple depencies check 2022-11-21 18:59:16 +01:00
Ortwin Pinke 5863b1e5e9 gitadmin 2022-11-21 18:42:43 +01:00
Ortwin Pinke 823022cb0a change info array 2022-11-21 18:26:56 +01:00
o.pinke b6ca65ede8 fixes for exec and imagemagick 2022-11-11 19:46:41 +01:00
Ortwin Pinke 9bd6e1805b Merge origin/dev_php8 into dev_php8
Conflicts:
	conlite/external/composer/installed.php
	conlite/plugins/cl-mod-rewrite
2022-10-26 19:41:36 +02:00
Ortwin Pinke 0f7310a6f5 git admin 2022-10-26 19:38:53 +02:00
Ortwin Pinke 9c71c7e48e add files external frontend 2022-10-26 19:15:12 +02:00
Ortwin Pinke 823796a768 fix php warnings with PHP8 2022-10-26 18:49:45 +02:00
Ortwin Pinke 10725d7234 modify mod modFileEdit 2022-10-25 20:28:00 +02:00
Ortwin Pinke 6a150745dd Merge pull request 'Merge latest PHP8 changes to develop' (#31) from dev_php8 into develop
Reviewed-on: #31
2022-05-23 17:18:43 +00:00
o.pinke ad3edca025 fixed #29 2022-05-23 19:07:57 +02:00
o.pinke d482a362af fixed #29 2022-05-23 18:49:34 +02:00
o.pinke 50553924d4 fixing PHP 8.1 errors 2022-05-17 20:00:37 +02:00
o.pinke 8a06c55f75 Merge origin/develop into dev_php8
Conflicts:
	README.md
	conlite/includes/startup.php
	setup/lib/defines.php
2022-05-17 16:05:29 +02:00
o.pinke 1c01dca90a fixes while checking backend on php 7.4 2022-05-17 15:57:15 +02:00
o.pinke 59cb72faef fix missing subnav 2022-05-17 13:40:34 +02:00
o.pinke 10380f8a9e hint for ConLite environment settings in htaccess 2022-05-16 18:33:26 +02:00
o.pinke af38d921c3 change vendor files to fit php version
increase conlite version to 2.1.3
close #24
2022-04-08 19:56:49 +02:00
Ortwin Pinke 1ad477e427 Merge branch 'dev_php8' of https://oldperl@gitport.de/ConLite/ConLite.git into dev_php8 2022-04-06 16:55:50 +02:00
Ortwin Pinke 461305119c gitadmin 2022-04-06 16:55:01 +02:00
o.pinke 100c60cc23 fixed warning and deprecated errors 2022-04-03 15:33:34 +02:00
o.pinke b2f7798eee fixed warning and deprecated errors 2022-04-03 15:33:21 +02:00
o.pinke f46d4fea20 git admin 2022-04-03 15:25:54 +02:00
o.pinke 47e3333a90 deleted 2022-04-03 15:22:10 +02:00
o.pinke bbad0ba0ab git admin 2022-04-03 15:21:26 +02:00
o.pinke 4fd28abfb2 fixed warning and deprecated errors 2022-04-03 15:18:45 +02:00
o.pinke 885eec3df0 fixed warning and deprecated errors 2022-04-03 15:17:52 +02:00
o.pinke f0aaecbded change settings for error_reporting 2022-03-11 18:32:43 +01:00
o.pinke 9aaecb27cd Merge branch 'dev_php8' of https://oldperl@gitport.de/ConLite/ConLite.git into dev_php8 2022-03-04 18:17:51 +01:00
o.pinke 0233aead87 htaccess env 2022-03-04 18:17:39 +01:00
Ortwin Pinke d4a59c7504 fixes PHP 8.1 2022-03-04 16:26:44 +01:00
Ortwin Pinke 52153f1199 fixes PHP 8.1 2022-03-04 16:22:59 +01:00
Ortwin Pinke 7b5301b75c fixes PHP 8.1 2022-01-27 21:58:47 +01:00
Ortwin Pinke a122b67aa4 add doc tags 2022-01-27 21:25:30 +01:00
Ortwin Pinke 04741dd66f fix 'Array Offset on value of type int' PHP 8 2022-01-27 21:22:55 +01:00
Ortwin Pinke f6f95929dd remove error control operator 2022-01-27 20:30:44 +01:00
Ortwin Pinke 56013aa610 fixes PHP 8.1 2022-01-27 19:56:19 +01:00
o.pinke 4ff23df02e fixing PHP 8.1 errors 2022-01-27 17:54:20 +01:00
o.pinke 4b8c93b9ee change CL version to 2.2.0 beta 2021-12-16 18:49:55 +01:00
o.pinke ebcabff316 fix phpversion check
set new phpversion limits
2021-12-16 14:32:07 +01:00
o.pinke 0a7adbf0db add submodul 2021-12-07 10:28:21 +01:00
o.pinke 007afbc4f9 remove all phpmailer entries as phpmailer now uses composer autoload 2021-12-06 16:04:43 +01:00
o.pinke 6093e0a2c1 add phpmailer using composer 2021-12-06 15:58:10 +01:00
o.pinke 3b151533a3 remove all phpmailer instances 2021-12-06 15:49:19 +01:00
o.pinke 9f7db302d8 git admin 2021-12-06 15:42:18 +01:00
o.pinke 0639611682 git admin 2021-12-06 15:37:25 +01:00
o.pinke ff178faf83 git admin 2021-12-06 15:36:31 +01:00
o.pinke 1123b91eb2 feat: Create submodule CL newsletter 2021-12-06 15:28:07 +01:00
o.pinke 566585c559 feat: Create submodule CL content-allocation 2021-12-06 15:25:49 +01:00
o.pinke ce604ed05a updates composer 2021-12-06 15:20:11 +01:00
o.pinke 85a5027880 feat: Create submodule CL mod-rewrite 2021-12-06 15:05:12 +01:00
Ortwin Pinke eea9100b3e composer: update phpmailer 2021-12-05 14:22:28 +01:00
o.pinke 2bb8aa3f6d add submodules 2021-11-23 14:25:20 +01:00
o.pinke 2ee0a49edd remove wrong submodule 2021-11-23 14:21:10 +01:00
o.pinke 50d0eb41d9 delete external plugins
add submodules
2021-11-23 14:18:03 +01:00
o.pinke 797bc023fe gitadmin 2021-11-23 14:11:55 +01:00
o.pinke 62aae45545 Merge origin/develop into develop 2021-11-23 12:57:04 +01:00
o.pinke 5a6dd07786 git admin 2021-10-28 16:10:43 +02:00
o.pinke 05eea0967a add environment stuff to frontend with fallback to old config.php 2021-10-28 16:10:29 +02:00
o.pinke 2682a4d1c7 add environment stuff to frontend with fallback to old config.php 2021-10-28 16:09:28 +02:00
Ortwin Pinke ad6b0f5bb5 „README.md“ ändern 2021-10-17 17:34:55 +00:00
o.pinke 60d3296537 git admin 2021-08-23 16:03:19 +02:00
o.pinke 7791ce27ee init classfile and add to autoloader 2021-08-23 16:03:19 +02:00
o.pinke 6c93d0cdce add new class cGuiPage to Autoloader 2021-08-23 16:03:18 +02:00
o.pinke 7724016e9c add fancytree js, recode overview in js-area using fancytree
first steps to new class clFileList to build different directory tree views
2021-08-23 16:03:18 +02:00
Ortwin Pinke 6a2da6de31 rm magic quote func 2021-08-18 14:37:03 +02:00
Ortwin Pinke b40fe3b47f addslashes to code 2021-08-18 14:07:07 +02:00
Ortwin Pinke 5c046c2509 rm magic quote func 2021-08-18 14:00:49 +02:00
Ortwin Pinke 4094a4ee3e add composer stuff and first libs 2021-08-18 12:59:52 +02:00
o.pinke 5c9e15e23c Merge commit 'f4e430ea102c1346e33262d7e1e2f270dab32916' as 'conlite/plugins/cl-mod-rewrite' 2021-08-17 19:08:31 +02:00
o.pinke f4e430ea10 Squashed 'conlite/plugins/cl-mod-rewrite/' content from commit 3217b73
git-subtree-dir: conlite/plugins/cl-mod-rewrite
git-subtree-split: 3217b73d08e1b76193f02d2d912134320ef40bfe
2021-08-17 19:08:31 +02:00
o.pinke 298d413cc5 Merge commit '1de173c80a85f3fce9eedf8230178abe5bfced58' as 'conlite/plugins/cl-content-allocation' 2021-08-17 19:07:35 +02:00
o.pinke 1de173c80a Squashed 'conlite/plugins/cl-content-allocation/' content from commit 9fab054
git-subtree-dir: conlite/plugins/cl-content-allocation
git-subtree-split: 9fab0549299f5a17d8b242f3aaa13cdfe83c90d5
2021-08-17 19:07:35 +02:00
o.pinke aa9ea82dc3 Merge commit '4f08cfd3ca94f2044365ae0894dc051f24b701c7' as 'conlite/plugins/cl-workflow' 2021-08-17 19:00:07 +02:00
o.pinke 4f08cfd3ca Squashed 'conlite/plugins/cl-workflow/' content from commit e8b0c80
git-subtree-dir: conlite/plugins/cl-workflow
git-subtree-split: e8b0c809216306f362968ad70151bffd9ac75bf7
2021-08-17 19:00:07 +02:00
o.pinke e266e09211 rm submodules 2021-08-17 18:58:39 +02:00
o.pinke 6634599274 add plugin content-allocation as gitmodule 2021-08-17 16:00:40 +02:00
o.pinke dbfaadfffc add gitmodules 2021-08-17 15:20:58 +02:00
o.pinke c0909ffb2d additional modifications for #15 2021-06-21 14:43:19 +02:00
o.pinke 603ce348eb fixed and close #15 2021-06-11 08:34:24 +02:00
o.pinke 8278e52a89 fixed and close #22 2021-06-08 13:02:52 +02:00
o.pinke dbaaa6ffa5 little fixes and git admin 2021-05-23 11:17:02 +02:00
o.pinke a7f1f3edb4 fixed error messages and wrong error log 2021-05-21 19:32:51 +02:00
o.pinke 0aac19b33d fixed and close #21 2021-05-21 18:50:54 +02:00
o.pinke 158c67510d git admin 2021-05-17 18:59:41 +02:00
o.pinke cdd67213a1 git admin 2021-05-17 18:57:03 +02:00
o.pinke 82b01004a9 fixed inuse issue 2021-05-14 16:45:23 +02:00
o.pinke 95e81b5ba5 include con functions 2021-05-10 17:40:39 +02:00
o.pinke fa533e3bcd Merge branch 'hotfix/issue#16' into develop 2021-05-06 12:59:55 +02:00
o.pinke 219628ee0d fix and close #16 2021-05-06 12:59:46 +02:00
o.pinke 0e0c5d3510 Merge branch 'hotfix/issue#15' into develop 2021-05-06 11:31:42 +02:00
o.pinke ac7dd3022d Merge branch 'hotfix/issue#15' 2021-05-06 11:31:41 +02:00
o.pinke 199de592eb fix and close #15 2021-05-06 11:31:33 +02:00
o.pinke 00b0b3b67d git admin 2021-04-26 19:23:33 +02:00
o.pinke a7d1e055aa Merge branch 'hotfix/issue#1' 2021-04-26 16:56:37 +02:00
o.pinke 8083abb8fe Merge branch 'hotfix/issue#1' into develop 2021-04-26 16:56:37 +02:00
o.pinke 83140b5f51 fixed and closed #1 2021-04-26 16:56:28 +02:00
o.pinke f2327b51db Merge branch 'release/ConLite_2.1.2' 2021-04-26 14:01:59 +02:00
o.pinke 01ffbf785e update readme for release v2.1.2 2021-04-26 13:38:24 +02:00
o.pinke 0942f07f06 Merge branch 'develop' of https://oldperl@gitport.de/ConLite/ConLite.git into develop
Conflicts:
	.gitignore
	conlite/plugins/.gitignore
	data/config/.gitignore
2021-04-26 13:33:24 +02:00
o.pinke 2d2558a199 set version to 2.1.2 for release 2021-04-26 13:28:47 +02:00
o.pinke 0a23db55e1 fix and close #7 2021-04-26 13:27:48 +02:00
o.pinke b3347f612a git admin 2021-04-26 13:15:06 +02:00
o.pinke bbb87c92f4 git admin 2021-04-26 13:12:50 +02:00
o.pinke 3b0a89d5b4 git admin 2021-04-26 13:06:11 +02:00
o.pinke a13c1cac64 git admin 2021-04-22 13:19:40 +02:00
o.pinke c342abfef4 git admin 2021-04-22 13:14:37 +02:00
o.pinke c4fa8aae5b phpdoc changes for api generation 2021-01-26 19:41:21 +01:00
o.pinke 586188c2cc fix php 8.0 errors in backend 2021-01-12 19:46:45 +01:00
o.pinke b3f4d9ee27 fix php8.0 errors and issue #10 2021-01-11 19:41:20 +01:00
o.pinke 850925905d fix php8.0 errors 2021-01-08 17:31:21 +01:00
Ortwin Pinke 9869d34708 „README.md“ ändern 2021-01-08 15:28:09 +00:00
Ortwin Pinke db26073993 „README.md“ ändern 2021-01-08 15:27:08 +00:00
Ortwin Pinke c28cc44add „README.md“ ändern 2021-01-08 15:26:44 +00:00
o.pinke b3e921255c Merge branch 'develop' of https://oldperl@gitport.de/ConLite/ConLite.git into develop
Conflicts:
	.gitignore
	setup/lib/defines.php
	setup/lib/startup.php
2021-01-08 16:19:18 +01:00
o.pinke 45868611b3 git admin 2021-01-08 16:06:01 +01:00
o.pinke 1a8f717d7b new folders 2021-01-08 15:54:03 +01:00
Ortwin Pinke 54120783ed fix #5, add default htaccess from mod_rewrite plugin 2020-12-13 13:43:03 +01:00
Ortwin Pinke 14458789af ignore local config 2020-12-13 10:45:06 +01:00
o.pinke 88986de7bd new range for PHP 2020-09-02 10:10:13 +02:00
o.pinke b6fcfc7f13 PHP 7.4 fixes 2020-09-01 15:23:56 +02:00
o.pinke 0feff6b9f5 git admin; phpdoc 2020-09-01 13:01:23 +02:00
o.pinke b99a1c3d79 git admin 2020-08-25 15:11:00 +02:00
o.pinke c6f30d0089 generated new locale files 2020-08-20 16:38:25 +02:00
o.pinke cadebebe0d fixed typo 2020-08-10 19:35:52 +02:00
o.pinke 851e64a777 git admin 2020-07-24 19:33:41 +02:00
o.pinke 5ecb425a04 edit new readme, delete the old one 2020-07-24 17:15:50 +02:00
o.pinke 12f2b57951 clean up; git admin; add phpdoc config; fix setup bug 2020-07-07 13:14:29 +02:00
o.pinke d2ccd7c3a9 clean up 2020-07-07 13:13:19 +02:00
o.pinke a7bab04278 git admin 2020-07-06 17:34:05 +02:00
o.pinke e9254c3662 change order of column in main_nav 2020-06-10 13:08:53 +02:00
o.pinke 4bf94ddd9c add string class from 4.10 to CL 2020-06-10 13:06:27 +02:00
o.pinke e626c18419 optimize url builder of mod_rewrite plugin; add string class from 4.10 to CL 2020-06-10 13:05:45 +02:00
o.pinke 1a827f255b remove plugin tables from setup 2020-03-20 11:46:46 +01:00
o.pinke f83140718d remove cronjob files and add gitignore 2020-02-19 22:01:57 +01:00
o.pinke f6bd3e0b22 re add pluginmanager 2020-02-19 21:58:47 +01:00
o.pinke 811e68fede add needed empty folders with .gitignore 2020-02-19 16:34:08 +01:00
o.pinke 2eb250aa35 init NB 2020-02-19 16:06:31 +01:00
Oldperl 7d8bc5f674
Delete spider-it.functions.inc.php 2020-02-15 14:04:42 +01:00
Oldperl 8a43617725
Delete .directory 2020-02-15 14:02:52 +01:00
Oldperl e8126b3d51
Create .htaccess 2020-02-15 13:59:55 +01:00
Oldperl 1fcf7144ec
Create README.md 2020-02-15 13:55:55 +01:00
Oldperl 18d8bcda99 optimize sql stuff 2020-02-15 12:48:23 +00:00
Oldperl 43a53c704c updates for PHP 7.3; remove old plugins; setup data without demo and adding plugins; increase CL-version to 2.1.1 2019-12-28 11:25:38 +00:00
Oldperl 529d9c96f0 updates for PHP 7.3; remove old plugins; setup data without demo and adding plugins; increase CL-version to 2.1.1 2019-12-28 11:25:35 +00:00
1179 geänderte Dateien mit 106400 neuen und 108156 gelöschten Zeilen

5
.gitattributes vendored Normale Datei
Datei anzeigen

@ -0,0 +1,5 @@
.gitattributes export-ignore
.gitignore export-ignore
.project export-ignore
/nbproject export-ignore
phpdoc.dist.xml export-ignore

26
.gitignore vendored Normale Datei
Datei anzeigen

@ -0,0 +1,26 @@
/nbproject/private/
/.idea/workspace.xml
/data/config/production/config.php
/_dev/
/conlite/plugins/pluginmanager/_src
/.project
/_api/
/cl-releasetool
/data/config/production/config.local.php
/cms/data/modules/up-download/
/cms/captcha/
!/cms/data/modules/
/cms/data/modules/*
!/cms/data/layouts/
/cms/data/layouts/*
/conlite/includes/include.style_edit_form_1.php
/cms/config.local.php
/cms/dflip/
/cms/js/firstlevel/
/conlite/external/**/.git
/conlite/logs/debug.log
/cms/data/config/production/config.mod_rewrite.php
/cms/data/config/production/config.local.php
/cms/cache/*
composer.phar
/conlite/vendor/

6
.gitmodules vendored Normale Datei
Datei anzeigen

@ -0,0 +1,6 @@
[submodule "conlite/plugins/cl-newsletter"]
path = conlite/plugins/cl-newsletter
url = https://gitport.de/ConLite/cl-newsletter.git
[submodule "conlite/plugins/cl-content-allocation"]
path = conlite/plugins/cl-content-allocation
url = https://gitport.de/ConLite/cl-content-allocation.git

Datei anzeigen

@ -1,59 +1,65 @@
################################################################################
# ConLite AMR plugin simple rewrite rules set.
#
# Contains few easy to handle rewrite rules.
#
# @version 1.0.0
# @author Ortwin Pinke <ortwin.pinke@php-backoffice.de>
# @author Murat Purc <murat@purc.de>
# @copyright 2019 ConLite Team
# @link http://www.conlite.org
#
# Versions before 1.0 copyright 4fb, author Murat Purc
#
# $Id$
################################################################################
<IfModule mod_rewrite.c>
# Enable rewrite engine
RewriteEngine on
# Specify a base URL-path for the rules
RewriteBase /cms
# Catch some common exploits in query string to get rid of them
# NOTE: Conditions to prevent protocols (ftp, http[s]) in query string could
# be a disadvantage in some cases
RewriteCond %{QUERY_STRING} contenido_path=.*$ [NC,OR]
RewriteCond %{QUERY_STRING} cfg\[path\]=.*$ [NC,OR]
RewriteCond %{QUERY_STRING} _PHPLIB\[libdir\]=.*$ [NC,OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} ftp://.*$ [NC,OR]
RewriteCond %{QUERY_STRING} http[s]*://.*$ [NC]
RewriteRule ^.* - [F,L] # all matching conditions from above will end in nirvana
# Rewrite request to root to front_content.php
RewriteRule ^$ front_content.php [QSA,L]
# Exclude following request from rewriting
# tests for favicon.ico, valid symlinks (-s), not empty files (-l) and folders (-d)
RewriteCond %{REQUEST_URI} ^/favicon.ico$ [OR]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# Pass other requests to front_content.php
RewriteRule ^.*$ front_content.php [QSA,NC,L]
</IfModule>
# Some rules to compress files.
# NOTE: Following settings are not mod rewrite specific, but enabling mod_deflate
# for some file types can help to reduce bandwith.
<IfModule mod_deflate.c>
<FilesMatch "\.(js|css|html|htm|php|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
################################################################################
# ConLite AMR plugin simple rewrite rules set.
#
# Contains few easy to handle rewrite rules.
#
# @version 1.0.0
# @author Ortwin Pinke <ortwin.pinke@php-backoffice.de>
# @author Murat Purc <murat@purc.de>
# @copyright 2019 ConLite Team
# @link http://www.conlite.org
#
# Versions before 1.0 copyright 4fb, author Murat Purc
#
# $Id: htaccess_simple.txt 145 2019-10-25 16:00:47Z oldperl $
################################################################################
# easily set this enviroment variable to the config you want to use
# add a config folder with the same name in data/config and cms/data/config
# and use your custom config for development
#SetEnv CONLITE_ENVIRONMENT develop
<IfModule mod_rewrite.c>
# Enable rewrite engine
RewriteEngine on
# Specify a base URL-path for the rules
RewriteBase /cms
# Catch some common exploits in query string to get rid of them
# NOTE: Conditions to prevent protocols (ftp, http[s]) in query string could
# be a disadvantage in some cases
RewriteCond %{QUERY_STRING} contenido_path=.*$ [NC,OR]
RewriteCond %{QUERY_STRING} cfg\[path\]=.*$ [NC,OR]
RewriteCond %{QUERY_STRING} _PHPLIB\[libdir\]=.*$ [NC,OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} ftp://.*$ [NC,OR]
RewriteCond %{QUERY_STRING} http[s]*://.*$ [NC]
RewriteRule ^.* - [F,L,DPI] # all matching conditions from above will end in nirvana
# Rewrite request to root to front_content.php
RewriteRule ^$ front_content.php [QSA,L]
# Exclude following request from rewriting
# tests for favicon.ico, valid symlinks (-s), not empty files (-l) and folders (-d)
RewriteCond %{REQUEST_URI} ^/favicon.ico$ [OR]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L,DPI]
# Pass other requests to front_content.php
RewriteRule ^.*$ front_content.php [QSA,NC,L]
</IfModule>
# Some rules to compress files.
# NOTE: Following settings are not mod rewrite specific, but enabling mod_deflate
# for some file types can help to reduce bandwith.
<IfModule mod_deflate.c>
<FilesMatch "\.(js|css|html|htm|php|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>

8
.idea/.gitignore vendored Normale Datei
Datei anzeigen

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

64
.idea/ConLite.iml Normale Datei
Datei anzeigen

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/conlite/external" isTestSource="false" packagePrefix="Conlite\External\" />
<sourceFolder url="file://$MODULE_DIR$/conlite/external/endroid/qr-code/src" isTestSource="false" packagePrefix="Endroid\QrCode\" />
<sourceFolder url="file://$MODULE_DIR$/conlite/external/endroid/qr-code/tests" isTestSource="true" packagePrefix="Endroid\QrCode\Tests\" />
<sourceFolder url="file://$MODULE_DIR$/conlite/external/endroid/qr-code/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/conlite/external/phpmailer/phpmailer/src" isTestSource="false" packagePrefix="PHPMailer\PHPMailer\" />
<sourceFolder url="file://$MODULE_DIR$/conlite/external/phpmailer/phpmailer/test" isTestSource="true" packagePrefix="PHPMailer\Test\" />
<sourceFolder url="file://$MODULE_DIR$/conlite/external/phpmailer/phpmailer/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/composer" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/edit_area/images" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/edit_area/langs" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/edit_area/plugins" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/edit_area/reg_syntax" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/cache" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/css" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/data" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/images" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/includes" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/js" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/logs" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/templates" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/upload" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/myclabs/deep-copy" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/nikic/php-parser" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phar-io/manifest" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phar-io/version" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpmailer/phpmailer" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpqrcode/bindings" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpqrcode/tools" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpstan/phpstan" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpunit/php-code-coverage" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpunit/php-file-iterator" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpunit/php-invoker" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpunit/php-text-template" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpunit/php-timer" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpunit/phpunit" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/rector/rector" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/cli-parser" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/code-unit" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/code-unit-reverse-lookup" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/comparator" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/complexity" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/diff" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/environment" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/exporter" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/global-state" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/lines-of-code" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/object-enumerator" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/object-reflector" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/recursion-context" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/type" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/version" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/theseer/tokenizer" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/wysiwyg/tinymce3" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/GitLink.xml Normale Datei
Datei anzeigen

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="uk.co.ben_gibson.git.link.SettingsState">
<option name="host" value="e0f86390-1091-4871-8aeb-f534fbc99cf0" />
</component>
</project>

24
.idea/clphp8.iml Normale Datei
Datei anzeigen

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/conlite/external/endroid/qr-code/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/conlite/external/phpmailer/phpmailer/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/conlite/classes" isTestSource="false" packagePrefix="ConLite\" />
<excludeFolder url="file://$MODULE_DIR$/conlite/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/conlite/vendor/phpmailer/phpmailer" />
<excludeFolder url="file://$MODULE_DIR$/conlite/vendor/phpstan/phpstan" />
<excludeFolder url="file://$MODULE_DIR$/conlite/vendor/rector/rector" />
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpmailer/phpmailer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-ctype" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" />
<excludeFolder url="file://$MODULE_DIR$/vendor/twig/twig" />
<excludeFolder url="file://$MODULE_DIR$/conlite/plugins/de.ortwinpinke.soccer_betting_game/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/conlite/plugins/de.ortwinpinke.soccer_betting_game/vendor/rinvex/countries" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

27
.idea/codeception.xml Normale Datei
Datei anzeigen

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Codeception">
<option name="configurations">
<list>
<Configuration>
<option name="path" value="$PROJECT_DIR$/tests" />
</Configuration>
<Configuration>
<option name="path" value="$PROJECT_DIR$/tests" />
</Configuration>
<Configuration>
<option name="path" value="$PROJECT_DIR$/tests" />
</Configuration>
<Configuration>
<option name="path" value="$PROJECT_DIR$/tests" />
</Configuration>
<Configuration>
<option name="path" value="$PROJECT_DIR$/tests" />
</Configuration>
<Configuration>
<option name="path" value="$PROJECT_DIR$/tests" />
</Configuration>
</list>
</option>
</component>
</project>

12
.idea/dataSources.xml Normale Datei
Datei anzeigen

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="dev_clphp74@localhost" uuid="e4a121a5-564c-40f5-b527-e0a343539f90">
<driver-ref>mariadb</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.mariadb.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mariadb://localhost:3306/dev_clphp74</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

4
.idea/deployment.xml Normale Datei
Datei anzeigen

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData" serverName="clphp8" />
</project>

8
.idea/modules.xml Normale Datei
Datei anzeigen

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/clphp8.iml" filepath="$PROJECT_DIR$/.idea/clphp8.iml" />
</modules>
</component>
</project>

49
.idea/php.xml Normale Datei
Datei anzeigen

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MessDetectorOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PHPCSFixerOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PHPCodeSnifferOptionsConfiguration">
<option name="highlightLevel" value="WARNING" />
<option name="transferred" value="true" />
</component>
<component name="PhpIncludePathManager">
<include_path>
<path value="$PROJECT_DIR$/conlite/external/phpqrcode/bindings" />
<path value="$PROJECT_DIR$/conlite/external/phpqrcode/tools" />
<path value="$PROJECT_DIR$/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/phpmailer/phpmailer" />
<path value="$PROJECT_DIR$/vendor/twig/twig" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
<path value="$PROJECT_DIR$/conlite/vendor/phpmailer/phpmailer" />
<path value="$PROJECT_DIR$/conlite/vendor/composer" />
<path value="$PROJECT_DIR$/conlite/vendor/rector/rector" />
<path value="$PROJECT_DIR$/conlite/vendor/phpstan/phpstan" />
<path value="$PROJECT_DIR$/conlite/plugins/de.ortwinpinke.soccer_betting_game/vendor/composer" />
<path value="$PROJECT_DIR$/conlite/plugins/de.ortwinpinke.soccer_betting_game/vendor/rinvex/countries" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="8.0">
<option name="suggestChangeDefaultLanguageLevel" value="false" />
</component>
<component name="PhpStan">
<PhpStan_settings>
<PhpStanConfiguration tool_path="$PROJECT_DIR$/conlite/external/bin/phpstan" />
</PhpStan_settings>
</component>
<component name="PhpStanOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PhpUnit">
<phpunit_settings>
<PhpUnitSettings custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" />
</phpunit_settings>
</component>
<component name="PsalmOptionsConfiguration">
<option name="transferred" value="true" />
</component>
</project>

25
.idea/phpspec.xml Normale Datei
Datei anzeigen

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PHPSpec">
<suites>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
</suites>
</component>
</project>

12
.idea/phpunit.xml Normale Datei
Datei anzeigen

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PHPUnit">
<option name="directories">
<list>
<option value="$PROJECT_DIR$/conlite/external/endroid/qr-code/tests" />
<option value="$PROJECT_DIR$/conlite/external/phpmailer/phpmailer/tests" />
<option value="$PROJECT_DIR$/tests" />
</list>
</option>
</component>
</project>

9
.idea/vcs.xml Normale Datei
Datei anzeigen

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$/conlite/plugins/cl-content-allocation" vcs="Git" />
<mapping directory="$PROJECT_DIR$/conlite/plugins/cl-mod-rewrite" vcs="Git" />
<mapping directory="$PROJECT_DIR$/conlite/plugins/cl-newsletter" vcs="Git" />
</component>
</project>

87
README.md Normale Datei
Datei anzeigen

@ -0,0 +1,87 @@
This is the readme file for **ConLite 3.0.0**
Any help you need you may find by visiting the following links.
* CL-Portal [https://conlite.org](https://conlite.org)
* CL-Forum [http://forum.conlite.org](http://forum.conlite.org)
* CL-Bugtracker [https://gitport.de/ConLite/ConLite/issues](https://gitport.de/ConLite/ConLite/issues)
* CL-API-Doc [https://api.conlite.org/CL3_0_0](https://api.conlite.org/CL3_0_0)
### !!! Attention !!!
We tried to fix all known bugs of Contenido 4.8 and earlier but cannot give any garanties for that. So use
it on your own risk. If you find any bug or have any idea to enhance ConLite, feel free to visit our
bugtracker at [https://gitport.de/ConLite/ConLite/issues](https://gitport.de/ConLite/ConLite/issues)
Any help and ideas are welcome :)
### Mini FAQ
#### What is ConLite?
CL (short for ConLite) is dedicated to close the gap between Contenido 4.8 and the version 4.10.
In downloadable 4.8.20 (and former 4.8.15) are still a lot of bugs and some missing feautures and
enhancements so one cannot use the version without problems. Our goal is to give you a bugfixed and
really stable version of Contenido till the 4.9 or 4.10 is stable. By the way, there are still a lot of big sides
build with 4.8.x out there where upgrading to 4.10.x is not possible or cost a lot of money.
#### Why i have to use ConLite?
You don't have to, but feel free to do it. ConLite will show you an easier way to upgrade step by step to Contenido
4.10. The new version of Contenido has a lot of changes, so you have to do a lot of work
with modules or custom plugins to adapt them to the new version. That's not what ConLite does nor will
do in the future. ConLite will do changes step by step, or better version by version to adapt your
4.8.x or higher installation to work with the new 4.9 of Contenido. And ConLite will try to give you a
stable and bugfixed Content-Management-System in the future.
#### Who are the people behind ConLite?
The Team behind the CL-version are some well known guys from CONTENIDO-forum, working since many years with
and within CONTENIDO core or coding modules and plugins for CONTENIDO.
And we love CONTENIDO :)
### Copyright
The copyright for the code of CONTENIDO still remains to 4fb and the named coders for all codes coming
from 4.8.15 and/or from svn- or git-repository of CONTENDIO.
All ads, enhancements or new parts, coded by the CL-Team are copyright by their named coders or
by CL-Team and conlite.org.
### Know Bugs
FS#25 - Collision with pre-installed AMR after Migration
!!! Attention !!!
If you want to upgrade with an installed AMR-plugin, uninstall AMR before upgrade.
We will include a fix for that in one of the next versions of CL
### History / Changelog
**ConLite 2.1.3**
**ConLite 2.1.2**
**ConLite 2.1.1**
**ConLite 2.1.0**
* see [https://gitport.de/ConLite/ConLite/milestones](https://gitport.de/ConLite/ConLite/milestones)
**ConLite 2.0**
**ConLite 1.0**
* old svn history lost
**CONTENIDO 4.8.16 CL**
* 20 Bug Report genericdb: urlencode() expects parameter 1 to be string ...
* 16 Enhancement RSS-Reader austauschen/überarbeiten
* 31 Optimization Test CL installation with newest PHP and SQL on XAMPP
* 3 Bug Report Genericdb caching not working
* 37 Bug Report Upgrade: valid_from and valid_to fields are set to NULL
* 33 Bug Report Missing include.subnav_blank.php
* 22 Bug Report Modul xhtml which is not choosable in modularea
* 10 Optimization Generate API-Doc
* 34 Bug Report Error when searching article with no criteria
* 24 Bug Report No reset of subnavigation if a layout is deleted
* 15 Optimization Add CL readme file
* 13 Bug Report FEUser-Plugins valide_to and valide_from saving wrong t ...
* 9 Enhancement Check all translations (i18n)
* 8 Bug Report adapt genericdb from 4.8.17 CL
* 5 Bug Report Buttontranslations missing or wrong

Datei anzeigen

@ -1,78 +0,0 @@
$Id$
----------------------------------------------------------------------------------------------------
This is the readme file for ConLite 2.1
Any help you need you may find by visiting the following links.
CL-Portal http//conlite.org
CL-Forum http://forum.conlite.org
CL-Bugtracker http://bugs.conlite.org
CL-API-Doc http://conlite.conrepo.org/api/4.8.16CL
!!! Attention !!!
We tried to fix all known bugs of 4.8.15 and earlier but cannot give any garanties for that. So use
it on your own risk. If you find any bug or have any idea to enhance ConLite, feel free to visit our
bugtracker and register at http://bugs.conlite.org
Any help and ideas are welcome :)
** Mini FAQ **
What is ConLite (-Edition) of CONTENIDO?
CL (short for ConLite) is dedicated to close the gap between CONTENIDO 4.8.15 and the version 4.9.
In downloadable 4.8.20 (and former 4.8.15) are still a lot of bugs and some missing feautures and
enhancements so one cannot use the version without problems. Our goal is to give you a bugfixed and
really stable version of CONTENIDO till the 4.9 is stable. By the way, there are still a lot of big sides
build with 4.8.x out there where upgrading to 4.9.x is not possible or cost a lot of money.
Why i have to use ConLite?
You don't have to, but feel free to do it. ConLite will show you an easier way to upgrade to CONTENIDO
4.9. The new version of CONTENIDO will have a lot of changes, so you have to do a lot of work
with modules or custom plugins to adapt them to the new version. That's not what ConLite does nor will
do in the future. ConLite will do changes step by step, or better version by version to adapt your
4.8.15 or higher installation to work with the new 4.9 of CONTENIDO. And ConLite will try to give you a
stable and bugfixed CONTENIDO 4.8.x in the future.
Who are the people behind ConLite?
The Team behind the CL-version are some well known guys from CONTENIDO-forum, working since many years with
and within CONTENIDO core or coding modules and plugins for CONTENIDO.
And we love CONTENIDO :)
** Copyright **
The copyright for the code of CONTENIDO still remains to 4fb and the named coders for all codes coming
from 4.8.15 and/or from svn-repository of CONTENDIO.
All ads, enhancements or new parts, coded by the CL-Team are copyright by their named coders or
by CL-Team and conlite.org.
** Know Bugs **
FS#25 - Collision with pre-installed AMR after Migration
!!! Attention !!!
If you want to upgrade with an installed AMR-plugin, uninstall AMR before upgrade.
We will include a fix for that in one of the next versions of CL
** History / Changelog **
ConLite 1.0
CONTENIDO 4.8.16 CL
20 Bug Report genericdb: urlencode() expects parameter 1 to be string ...
16 Enhancement RSS-Reader austauschen/überarbeiten
31 Optimization Test CL installation with newest PHP and SQL on XAMPP
3 Bug Report Genericdb caching not working
37 Bug Report Upgrade: valid_from and valid_to fields are set to NULL
33 Bug Report Missing include.subnav_blank.php
22 Bug Report Modul xhtml which is not choosable in modularea
10 Optimization Generate API-Doc
34 Bug Report Error when searching article with no criteria
24 Bug Report No reset of subnavigation if a layout is deleted
15 Optimization Add CL readme file
13 Bug Report FEUser-Plugins valide_to and valide_from saving wrong t ...
9 Enhancement Check all translations (i18n)
8 Bug Report adapt genericdb from 4.8.17 CL
5 Bug Report Buttontranslations missing or wrong

Datei-Diff unterdrückt, da er zu groß ist Diff laden

2
cms/data/config/.gitignore vendored Normale Datei
Datei anzeigen

@ -0,0 +1,2 @@
/local
/localhost

1
cms/data/config/production/.gitignore vendored Normale Datei
Datei anzeigen

@ -0,0 +1 @@
/config.mod_rewrite.php

19
cms/environment.php Normale Datei
Datei anzeigen

@ -0,0 +1,19 @@
<?php
// Load environment config file
$configEnv = str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . '/data/config/config.environment.php';
if (file_exists($configEnv)) {
include_once($configEnv);
}
if (!defined('CL_ENVIRONMENT')) {
if (getenv('CONLITE_ENVIRONMENT')) {
define('CL_ENVIRONMENT', getenv('CONLITE_ENVIRONMENT'));
} if (getenv('CONTENIDO_ENVIRONMENT')) {
define('CL_ENVIRONMENT', getenv('CONTENIDO_ENVIRONMENT'));
} else {
define('CL_ENVIRONMENT', 'production');
}
}
//echo CL_ENVIRONMENT;

Datei-Diff unterdrückt, da er zu groß ist Diff laden

1
cms/includes/.gitignore vendored Normale Datei
Datei anzeigen

@ -0,0 +1 @@
/class.input.helper.php

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -24,9 +24,10 @@ if (!defined('CON_FRAMEWORK')) {
// create Navigation array for one level
function createNavigationArray($start_id, $db) {
global $user, $cfg, $client, $lang, $auth;
global $cfg, $client, $lang, $auth;
$navigation = array();
$groups = [];
$navigation = [];
$FrontendPermissionCollection = new FrontendPermissionCollection;
// SECURITY-FIX
@ -61,7 +62,6 @@ function createNavigationArray($start_id, $db) {
$FrontendGroupMemberCollection->setWhere("idfrontenduser", $auth->auth['uid']);
$FrontendGroupMemberCollection->query();
$groups = array();
while ($member = $FrontendGroupMemberCollection->next()) {
$groups[] = $member->get("idfrontendgroup");
}
@ -74,10 +74,12 @@ function createNavigationArray($start_id, $db) {
}
}
if ($visible) {
$navigation[$cat_id] = array("idcat" => $cat_id,
$navigation[$cat_id] = [
"idcat" => $cat_id,
"name" => $db->f("name"),
"target" => '_self', # you can not call getTarget($cat_id, &$db) at this point with the same db instance!
"public" => $db->f("public"));
"target" => '_self',
"public" => $db->f("public"),
];
}
} // end while
@ -197,7 +199,7 @@ function getLevel($catid, &$db) {
* Return path of a given category up to a certain level
*/
function getCategoryPath($cat_id, $level, $reverse = true, &$db) {
$root_path = array();
$root_path = [];
array_push($root_path, $cat_id);
@ -222,12 +224,13 @@ function getCategoryPath($cat_id, $level, $reverse = true, &$db) {
* Return location string of a given category
*/
function getLocationString($iStartCat, $level, $seperator, $sLinkStyleClass, $sTextStyleClass, $fullweblink = false, $reverse = true, $mod_rewrite = true, $db) {
$aLocation = [];
global $sess, $cfgClient, $client;
$aCatPath = getCategoryPath($iStartCat, $level, $reverse, $db);
if (is_array($aCatPath) AND count($aCatPath) > 0) {
$aLocation = array();
$aLocation = [];
foreach ($aCatPath as $value) {
if (!$fullweblink) {
if ($mod_rewrite == true) {
@ -265,6 +268,7 @@ function getLocationString($iStartCat, $level, $seperator, $sLinkStyleClass, $sT
*/
function getSubTree($idcat_start, $db) {
global $client, $cfg;
$deeper_cats = [];
// SECURITY-FIX
$sql = "SELECT
@ -299,6 +303,7 @@ function getSubTree($idcat_start, $db) {
function getTeaserDeeperCategories($iIdcat, $db) {
global $client, $cfg, $lang;
$deeper_cats = [];
// SECURITY-FIX
$sql = "SELECT
@ -345,6 +350,7 @@ function getTeaserDeeperCategories($iIdcat, $db) {
*/
function getProtectedSubTree($idcat_start, $db) {
global $client, $cfg, $lang;
$deeper_cats = [];
// SECURITY-FIX
$sql = "SELECT
@ -416,10 +422,8 @@ function getCategoryName($cat_id, &$db) {
// get direct subcategories of a given category
function getSubCategories($parent_id, $db) {
$subcategories = array();
global $cfg, $client, $lang;
$subcategories = [];
// SECURITY-FIX
$sql = "SELECT
@ -453,11 +457,8 @@ function getSubCategories($parent_id, $db) {
// get direct subcategories with protected categories
function getProtectedSubCategories($parent_id, $db) {
$subcategories = array();
unset($subcategories);
global $cfg, $client, $lang;
$subcategories = [];
// SECURITY-FIX
$sql = "SELECT
@ -488,23 +489,18 @@ function getProtectedSubCategories($parent_id, $db) {
// end function
function checkCatPermission($idcatlang, $public) {
#Check if current user has permissions to access cat
global $auth;
$groups = [];
$oDB = new DB_ConLite();
$FrontendPermissionCollection = new FrontendPermissionCollection;
$FrontendPermissionCollection = new FrontendPermissionCollection();
$visible = false;
if ($public != 0) {
$visible = true;
$groups = array();
} elseif (($auth->auth['uid'] != '') && ($auth->auth['uid'] != 'nobody')) {
$FrontendGroupMemberCollection = new FrontendGroupMemberCollection;
$FrontendGroupMemberCollection->setWhere("idfrontenduser", $auth->auth['uid']);
$FrontendGroupMemberCollection->query();
$groups = array();
while ($member = $FrontendGroupMemberCollection->next()) {
$groups[] = $member->get("idfrontendgroup");
}
@ -518,4 +514,4 @@ function checkCatPermission($idcatlang, $public) {
}
return $visible;
}
}

Datei anzeigen

@ -1,859 +0,0 @@
<?php
/*
* Project:
* Spider IT Deutschland ConLite and Contenido Extensions
*
* Description:
* File with useful helper functions
*
* Requirements:
* @con_php_req 5
*
* @package Frontend
* @author René Mansveld <R.Mansveld@Spider-IT.de>
* @copyright Spider IT Deutschland <www.Spider-IT.de>
* @license MIT <http://en.wikipedia.org/wiki/MIT_License> <http://de.wikipedia.org/wiki/MIT-Lizenz>
* (see below)
* @link http://www.Spider-IT.de
* @link http://www.conlite.org
* @link http://www.contenido.org
*
* @file spider-it.functions.inc.php
* @version 1.2
* @date 2012-11-21
*
* {@internal
* created 2012-09-14
* modified 2012-10-10
* modified 2012-10-14
* modified 2012-10-22
* modified 2012-10-24
* modified 2012-10-30
* modified 2012-11-21
*
* $Id$:
* }
*
*/
/*
* Copyright (c) 2012 Spider IT Deutschland
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*
* Hiermit wird unentgeltlich, jeder Person, die eine Kopie der Software und der zugehörigen Dokumentationen (die
* "Software") erhält, die Erlaubnis erteilt, sie uneingeschränkt zu benutzen, inklusive und ohne Ausnahme, dem
* Recht, sie zu verwenden, kopieren, ändern, fusionieren, verlegen, verbreiten, unterlizenzieren und/oder zu
* verkaufen, und Personen, die diese Software erhalten, diese Rechte zu geben, unter den folgenden Bedingungen:
*
* Der obige Urheberrechtsvermerk und dieser Erlaubnisvermerk sind in allen Kopien oder Teilkopien der Software
* beizulegen.
*
* DIE SOFTWARE WIRD OHNE JEDE AUSDRÜCKLICHE ODER IMPLIZIERTE GARANTIE BEREITGESTELLT, EINSCHLIESSLICH DER GARANTIE
* ZUR BENUTZUNG FÜR DEN VORGESEHENEN ODER EINEM BESTIMMTEN ZWECK SOWIE JEGLICHER RECHTSVERLETZUNG, JEDOCH NICHT
* DARAUF BESCHRÄNKT. IN KEINEM FALL SIND DIE AUTOREN ODER COPYRIGHTINHABER FÜR JEGLICHEN SCHADEN ODER SONSTIGE
* ANSPRÜCHE HAFTBAR ZU MACHEN, OB INFOLGE DER ERFÜLLUNG EINES VERTRAGES, EINES DELIKTES ODER ANDERS IM ZUSAMMENHANG
* MIT DER SOFTWARE ODER SONSTIGER VERWENDUNG DER SOFTWARE ENTSTANDEN.
*/
# Functions in this file:
# debug()
# sitCascadedArraySort()
# sitConvertCmykJpgToSrgbJpg()
# sitExplodeAssociative()
# sitExplodeCascading()
# sitExplodeLines()
# sitGetFilesInDirectory()
# sitGetImageDescription()
# sitGetRemoteContentToFile()
# sitGetSubdirs()
# sitImgScale()
# sitMoveAllUploadFiles()
# sitSafeStringEscape()
# sitSendHtmlMail()
# sitSetClientProperty()
# sitTeaserText()
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
# debug()
#
# Zeigt Debugging-Informationen auf der Webseite
#
# Parameter:
# $value - Der anzuzeigende Wert
# $type - Der Typ des Wertes (optional)
# Möglichkeiten:
# '' - Text / Array / Object
# 'sql' - SQL-Anweisungen (Aufruf sollte nach $db->query() erfolgen)
#
# Der Wert wird aufbereitet per echo auf der Webseite
# ausgegeben, wobei die Funktion selbstständig zwischen
# einzelnen Werte, Arrays und Objekte unterscheidet.
# Der 2. Parameter $type dient besondere Fälle, wie z.B.
# 'sql' für SQL-Anweisungen, welche dann individuell
# aufbereitet werden.
function debug($value, $type = '') {
global $db, $debug;
if ($debug) {
echo '<div style="font-size: 14px;">';
switch (strtolower($type)) {
case 'sql':
echo '<pre style="margin-top: 0px;">' . str_replace(array(str_repeat(chr(32), 4), chr(9)), '', $value) . '</pre>Records: ' . intval(@$db->num_rows());
break;
default:
if (is_array($value)) {
echo '<pre>'; var_dump($value); echo '</pre>';
} elseif (is_object($value)) {
echo 'Object:<pre style="margin-top: 0px;">'; var_dump($value); echo '</pre>';
} else {
echo $value;
}
break;
}
echo '</div>';
}
}
# sitCascadedArraySort()
#
# Sortiert ein kaskadiertes Array nach Spalten
#
# Parameter:
# Zu sortierendes Array
# Liste aus Feldnamen, Sortierarten und Sortierrichtungen (siehe
# array_multisort, de.php.net/manual/de/function.array-multisort.php)
#
# Sortiert ein mehrdimentionales Array nach den angegebenen Spalten
# nach den vorgegebenen Sortierarten und -richtungen (je Spalte anzugeben)
# Beispiel:
# $x = sitCascadedArraySort($x, 'Name', SORT_STRING, SORT_ASC, 'Vorname', SORT_STRING, SORT_ASC);
function sitCascadedArraySort() {
$args = func_get_args();
$marray = array_shift($args);
if (count($marray)) {
$msortline = 'return(array_multisort(';
foreach ($args as $arg) {
$i ++;
if (is_string($arg)) {
foreach ($marray as $row) {
$sortarr[$i][] = $row[$arg];
}
} else {
$sortarr[$i] = $arg;
}
$msortline .= '$sortarr['.$i.'],';
}
$msortline .= '$marray));';
eval($msortline);
}
return $marray;
}
# sitConvertCmykJpgToSrgbJpg()
#
# Wandelt JPG-Bilder mit CMYK Farbprofil in sRGB Farbprofil um
#
# Parameter:
# $path - Kompletter Pfad zum Bild
#
# Da der Internet Explorer keine JPG-Bilder (.jpg / .jpeg) mit CMYK Farbprofil
# darstellen kann, müssen diese Bilder in das sRGB Farbprofil (für das Web)
# umgewandelt werden. Diese Funktion prüft das Bild und wandelt es ggf. um.
function sitConvertCmykJpgToSrgbJpg($path) {
if ((strtolower(substr($path, -4)) == '.jpg') || (strtolower(substr($path, -5)) == '.jpeg')) {
exec('identify -verbose ' . $path . ' >' . $path . '.txt');
$tmp = file($path . '.txt');
unlink($path . '.txt');
for ($i = 0, $n = count($tmp); $i < $n; $i ++) {
$a = explode(':', $tmp[$i]);
if (trim($a[0]) == 'Colorspace') {
if (strpos($a[1], 'RGB') === false) {
# Bild ist in CMYK
exec('convert ' . $path . ' -profile sRGB.icc -colorspace sRGB ' . $path . '.jpg');
unlink($path);
rename($path . '.jpg', $path);
}
break;
}
}
}
}
# sitExplodeAssociative()
#
# Zerlegt eine Zeichenfolge in ein assoziatives Array.
#
# Parameter:
# $delimiter - Array mit Trennzeichen zum Zerlegen der Zeichenfolge
# $string - Zu zerlegende Zeichenfolge
#
# Das erste Trennzeichen bildet das Array, das zweite Trennzeichen
# splittet auf Key und Value.
function sitExplodeAssociative($delimiters = array(), $string = '') {
$tmp = explode($delimiters[0], $string);
$ret = array();
for ($i = 0, $n = count($tmp); $i < $n; $i ++) {
$t = explode($delimiters[1], $tmp[$i]);
$ret[$t[0]] = $t[1];
}
return $ret;
}
# sitExplodeCascading()
#
# Zerlegt eine Zeichenfolge in ein kaskadiertes Array.
#
# Parameter:
# $delimiter - Array mit Trennzeichen zum Zerlegen der Zeichenfolge
# $string - Zu zerlegende Zeichenfolge
#
# Das erste Trennzeichen bildet das Hauptarray, jedes weitere
# Trennzeichen darin ein Unterarray (mehrere Ebenen).
function sitExplodeCascading($delimiters = array(), $string = '') {
$tmp = explode($delimiters[0], $string);
array_shift($delimiters);
for ($i = 0, $n = count($tmp); $i < $n; $i ++) {
$tmp[$i] = sitMultipleExplode($delimiters, $tmp[$i]);
}
return $tmp;
}
# sitExplodeLines()
#
# Zerlegt einen Text in einzelnen Zeilen
#
# Parameter:
# $string - Zu zerlegende Zeichenfolge
#
# Zerlegt den Text unabhängig der Zeilenumbruchart in ein Array
# mit den einzelnen Zeilen.
function sitExplodeLines($string) {
return explode("\n", str_replace("\r\n", "\n", $string));
}
# sitGetFilesInDirectory()
#
# Liest Dateien in ein Verzeichnis
#
# Parameter:
# $path - Kompletter Pfad des zu lesenden Verzeichnisses
# $filter - Filter für gefundenen Dateien (optional)
# $sort - Sortierreihenfolge (optional)
#
# Liest die Dateien in ein Verzeichnis und filtert und sortiert diese bei Bedarf.
# $filter kann ein Array mit mehrere Filter sein, z.B. array('*.jp*g', '*.gif', '*.png').
# $sort kann 'asc', 'desc', SORT_ASC oder SORT_DESC sein, oder weggelassen werden.
function sitGetFilesInDirectory($path, $filter = '*', $sort = '') {
define('FNM_CASEFOLD', 16);
$aFiles = array();
if (is_dir($path)) {
if (!is_array($filter)) {
$filter = array($filter);
}
if ($oDir = opendir($path)) {
while (($sFile = readdir($oDir)) !== false) {
if (is_dir($path . $sFile)) {
continue;
} else {
for ($i = 0, $n = count($filter); $i < $n; $i ++) {
if (fnmatch($filter[$i], $sFile, FNM_CASEFOLD)) {
$aFiles[] = $sFile;
break;
}
}
}
}
closedir($oDir);
if (strlen($sort)) {
sort($aFiles, SORT_STRING);
if (($sort == 'desc') || ($sort == SORT_DESC)) {
$aFiles = array_reverse($aFiles);
}
}
}
}
return $aFiles;
}
# sitGetImageDescription()
#
# Liest die Bildbeschreibung aus der Datenbank
#
# Parameter:
# $idupl - ID des Bildeintrags in der Datenbank
#
# Liest die zum Bild gehörenden Beschreibung entweder aus der Tabelle ..._upl_meta
# oder (falls leer) aus der Tabelle ..._upl und liefert diese zurück.
function sitGetImageDescription($idupl) {
global $db, $cfg;
$sDesc = '';
$sql = 'SELECT description
FROM ' . $cfg['tab']['upl_meta'] . '
WHERE (idupl=' . $idupl . ')';
$db->query($sql);
if ($db->next_record()) {
$sDesc = urldecode(str_replace(array('%0D%0A', '%0D', '%0A'), '<br />', $db->f('description')));
}
if (strlen(trim($sDesc)) == 0) {
$sql = 'SELECT description
FROM ' . $cfg['tab']['upl'] . '
WHERE (idupl=' . $idupl . ')';
$db->query($sql);
if ($db->next_record()) {
$sDesc = $db->f('description');
}
}
return $sDesc;
}
# sitGetRemoteContentToFile()
#
# Holt entfernten Inhalt ab und speichert diesen lokal
#
# Parameter:
# $url - Die Adresse von wo der Inhalt geholt werden soll
# $file - Die Datei in der gespeichert werden soll (inkl. Pfad)
# $errno - Die Fehlernummer (Rückgabe)
# $errmsg - Die Fehlerbeschreibung (Rückgabe)
#
# Die Daten (Webseite, Bild, Feed usw) werden per cURL geholt,
# wobei Weiterleitungen gefolgt werden.
# Diese Methode ist unabhängig von allow_url_fopen und verarbeitet
# auch Anfragen per https (SSL).
function sitGetRemoteContentToFile($url, $file, $errno, $errmsg) {
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // don't return headers
CURLOPT_FOLLOWLOCATION => true, // follow redirects
CURLOPT_ENCODING => "", // handle compressed
CURLOPT_USERAGENT => "spider", // who am i
CURLOPT_AUTOREFERER => true, // set referer on redirect
CURLOPT_CONNECTTIMEOUT => 10, // timeout on connect
CURLOPT_TIMEOUT => 10, // timeout on response
CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
);
$ch = curl_init($url);
curl_setopt_array($ch, $options);
$content = curl_exec($ch);
$errno = curl_errno($ch);
$errmsg = curl_error($ch);
$header = curl_getinfo($ch);
curl_close($ch);
if (($errno == 0) && ($header['http_code'] == 200)) {
# Content in Datei speichern
if ($fp = fopen($file, 'w')) {
fputs($fp, $content);
fclose($fp);
return true;
} else {
$errno = -1;
$errmsg = 'Can\'t write to file ' . $file;
return false;
}
} else {
return false;
}
}
# sitGetSubdirs()
#
# Listet Unterverzeichnisse eines Verzeichnisses
#
# Parameter:
# $dir - Übergeordnetes Verzeichnis
# $levels - Anzahl Ebenen an Unterverzeichnisse die mit aufgelistet werden sollen
# $__dirs - interner Parameter für Rekursion
#
# Listet die Unterverzeichnisse eines Verzeichnisses inkl. aller Unterverzeichnisse
# bis zu der angegebenen Anzahl an Ebenen (die Tiefe).
function sitGetSubdirs($dir, $levels = 1, $__dirs = array()) {
$a = array();
$p = opendir($dir);
while (($s = readdir($p)) !== false) {
if (($s == '.') || ($s == '..')) {
continue;
}
if (is_dir($dir . ((substr($dir, -1) == '/') ? '' : '/') . $s)) {
$a[] = $dir . ((substr($dir, -1) == '/') ? '' : '/') . $s . '/';
}
}
closedir($p);
sort($a, SORT_STRING);
for ($i = 0; $i < count($a); $i ++) {
$__dirs[] = $a[$i];
if ($levels > 1) {
$__dirs = sitGetSubdirs($a[$i], ($levels - 1), $__dirs);
}
}
return $__dirs;
}
# sitImgScale()
#
# Skaliert oder zoomt ein Bild auch mit Transparenz
#
# Parameter:
# $img - Pfad und Dateiname der Originaldatei relativ zum Mandantenverzeichnis
# $maxX - Maximale Breite des neuen Bildes
# $maxY - Maximale Höhe des neuen Bildes
# $crop - Bild darf beschnitten werden (optional)
# $expand - Bild darf vergrößert werden
# $cacheTime - Ältere Version nutzen oder überschreiben
# $wantHQ - Bild soll in hoher Qualität sein
# $quality - Qualität bei JPG und GIF
# $keepType - Dateityp beibehalten
# $fixedSize - Zielbild wird auf angegebene Größe erstellt und transparent (GIF und PNG) gefüllt
# $fixedBG - Bei $fixedSize und JPG wird dies die Hintergrundfarbe des umgebenden Bereichs
#
# Erstellt im cache Verzeichnis eine skalierte Version des Originalbildes
# wie auch die Con-Funktion capiImgScale(), aber behält Transparenz in GIF
# und PNG Bilder bei. Der zusätzliche Parameter $fixedSize ermöglicht es,
# das Zielbild mit fixe Abmessungen zu erstellen und das skalierte Bild
# darin zu zentrieren, wobei der umgebenden Bereich bei GIF und PNG Bilder
# transparent, bei JPG Bilder mit der in $fixedBG angegebenen Farbe gefüllt
# wird. Ist $fixedBG nicht angegeben, wird weiß (#FFF) angenommen.
function sitImgScale($img, $maxX = 0, $maxY = 0, $crop = false, $expand = false, $cacheTime = 10, $wantHQ = true, $quality = 75, $keepType = false, $fixedSize = false, $fixedBG = 'FFFFFF') {
global $cfgClient, $client, $lang;
if (($maxX <= 0) && ($maxY <= 0)) {
return false;
}
# Cache
$md5 = capiImgScaleGetMD5CacheFile($img, $maxX, $maxY, $crop, $expand);
list($oWidth, $oHeight, $oType) = @getimagesize($cfgClient[$client]['path']['frontend'] . $img);
switch ($oType) {
case IMAGETYPE_GIF:
$cfileName = $md5 . '.gif';
break;
case IMAGETYPE_JPEG:
if ($keepType) {
$cfileName = $md5 . '.jpg';
} else {
$cfileName = $md5 . '.png';
}
break;
case IMAGETYPE_PNG:
$cfileName = $md5 . '.png';
break;
default:
return false;
}
$cacheFile = $cfgClient[$client]['path']['frontend'] . 'cache/' . $cfileName;
$webFile = $cfgClient[$client]['path']['htmlpath'] . 'cache/' . $cfileName;
if (file_exists($cacheFile)) {
if ($cacheTime == 0) {
# Datei läuft nicht ab, also direkt ausgeben
return $webFile;
} elseif ((filemtime($cacheFile) + (60 * $cacheTime)) < time()) {
# Datei ist abgelaufen
unlink($cacheFile);
} else {
# Datei ist noch nicht abgelaufen
return $webFile;
}
}
# Bild neu aufbauen
$nLeft = 0;
$nTop = 0;
$nWidth = 0;
$nHeight = 0;
if ($fixedSize) {
$iWidth = $maxX;
$iHeight = $maxY;
# Abmessung und Position in neues Bild berechnen
if (($oWidth > $maxX) || ($oHeight > $maxY) || ($expand)) {
# Bild ist größer oder soll vergrößert werden
if ($crop) {
$faktor = max($maxX / $oWidth, $maxY / $oHeight);
} else {
$faktor = min($maxX / $oWidth, $maxY / $oHeight);
}
if ($faktor == ($maxX / $oWidth)) {
$nLeft = 0;
$nWidth = $maxX;
$nHeight = floor($oHeight * $faktor);
$nTop = floor(($maxY - $nHeight) / 2);
} else {
$nTop = 0;
$nHeight = $maxY;
$nWidth = floor($oWidth * $faktor);
$nLeft = floor(($maxX - $nWidth) / 2);
}
} else {
$nLeft = floor(($maxX - $oWidth) / 2);
$nTop = floor(($maxY / $oHeight) / 2);
$nWidth = $oWidth;
$nHeight = $oHeight;
}
} else {
# Abmessung des neuen Bildes berechnen
if (($oWidth > $maxX) || ($oHeight > $maxY) || ($expand)) {
if ($crop) {
$faktor = max($maxX / $oWidth, $maxY / $oHeight);
} else {
$faktor = min($maxX / $oWidth, $maxY / $oHeight);
}
if ($faktor == ($maxX / $oWidth)) {
$nWidth = $maxX;
$nHeight = floor($oHeight * $faktor);
$iWidth = $maxX;
$iHeight = (($nHeight > $maxY) ? $maxY : $nHeight);
$nTop = (($nHeight > $maxY) ? floor(($maxY - $nHeight) / 2) : 0);
} else {
$nHeight = $maxY;
$nWidth = floor($oWidth * $faktor);
$iHeight = $maxY;
$iWidth = (($nWidth > $maxX) ? $maxX : $nWidth);
$nLeft = (($nWidth > $maxX) ? floor(($maxX - $nWidth) / 2) : 0);
}
} else {
# Bild ist kleiner und soll nicht vergrößert werden
$iWidth = $nWidth = $oWidth;
$iHeight = $nHeight = $oHeight;
}
}
# Bild einlesen
switch ($oType) {
case IMAGETYPE_GIF:
$image = imagecreatefromgif($img);
break;
case IMAGETYPE_JPEG:
$image = imagecreatefromjpeg($img);
break;
case IMAGETYPE_PNG:
$image = imagecreatefrompng($img);
break;
default:
return false;
}
# Neues Bild erzeugen und Hintergrundfarbe einstellen
$nImage = imagecreatetruecolor($iWidth, $iHeight);
if (($oType == IMAGETYPE_GIF) || ($oType == IMAGETYPE_PNG)) {
$transIdx = imagecolortransparent($image);
if ($transIdx >= 0) {
# Es gibt eine transparente Farbe (GIF oder PNG8)
$transColor = imagecolorsforindex($image, $transIdx);
$transIdx = imagecolorallocate($nImage, $transColor['red'], $transColor['green'], $transColor['blue']);
imagefill($nImage, 0, 0, $transIdx);
imagecolortransparent($nImage, $transIdx);
} elseif ($oType == IMAGETYPE_PNG) {
# Ein PNG24 kriegt ein transparenter Hintergrund per Alpha-Kanal
imagealphablending($nImage, false);
$oColor = imagecolorallocatealpha($nImage, 0, 0, 0, 127);
imagefill($nImage, 0, 0, $oColor);
imagesavealpha($nImage, true);
}
} else {
$debug = 1;
if ($keepType) {
# Andere Bilder (JPG) kriegen eine Hintergrundfarbe
$oColor = imagecolorallocate($nImage, hexdec(substr($fixedBG, 0, 2)), hexdec(substr($fixedBG, 2, 2)), hexdec(substr($fixedBG, 4, 2)));
#debug('imagecolorallocate($nImage, ' . hexdec(substr($fixedBG, 0, 2)) . ', ' . hexdec(substr($fixedBG, 2, 2)) . ', ' . hexdec(substr($fixedBG, 4, 2)) . ') = ' . $oColor);
# imagefill($nImage, 0, 0, $oColor);
imagefilledrectangle($nImage, 0, 0, $iWidth, $iHeight, $oColor);
} else {
# JPG-Bilder werden in PNG24 umgewandelt
$oType = IMAGETYPE_PNG;
imagealphablending($nImage, false);
$oColor = imagecolorallocatealpha($nImage, 0, 0, 0, 127);
# imagefill($nImage, 0, 0, $oColor);
imagefilledRectangle($nImage, 0, 0, $iWidth, $iHeight, $oColor);
imagesavealpha($nImage, true);
}
}
# Das Originalbild skaliert hinein kopieren
imagecopyresampled($nImage, $image, $nLeft, $nTop, 0, 0, $nWidth, $nHeight, $oWidth, $oHeight);
# Das neue Bild speichern
switch ($oType) {
case IMAGETYPE_GIF:
imagegif($nImage, $cacheFile);
break;
case IMAGETYPE_JPEG:
imagejpeg($nImage, $cacheFile);
break;
case IMAGETYPE_PNG:
imagepng($nImage, $cacheFile);
break;
}
# Aufräumen
imagedestroy($image);
imagedestroy($nImage);
# Pfad zurück liefern
return $webFile;
}
# sitMoveAllUploadFiles()
#
# Verschiebt alle Dateien eines Verzeichnisses
#
# Parameter:
# $source - Quellverzeichnis
# $dest - Zielverzeichnis
#
# Verschiebt alle Dateien eines Verzeichnisses im Upload-Bereich (unter /upload/)
# und passt die Einträge in der Datenbank entsprechend an.
function sitMoveAllUploadFiles($source, $dest) {
global $cfgClient, $client, $db, $cfg;
$source .= ((substr($source, -1) == '/') ? '' : '/');
$dest .= ((substr($dest, -1) == '/') ? '' : '/');
$a = array();
$p = opendir($cfgClient[$client]['upl']['path'] . $source);
while (($s = readdir($p)) !== false) {
if (is_dir($cfgClient[$client]['upl']['path'] . $source . $s)) {
continue;
} elseif (strlen($s) > 2) {
$a[] = $s;
}
}
for ($i = 0, $n = count($a); $i < $n; $i ++) {
rename($cfgClient[$client]['upl']['path'] . $source . $a[$i], $cfgClient[$client]['upl']['path'] . $dest . $a[$i]);
$sql = 'UPDATE ' . $cfg['tab']['upl'] . '
SET dirname = "' . $dest . '"
WHERE ((dirname="' . $source . '")
AND (filename="' . $a[$i] . '"))';
$db->query($sql);
}
}
# sitSafeStringEscape()
#
# Escaped eine Zeichenfolge für SQL-Anweisungen
#
# Parameter:
# $string - Zu escapenden Zeichenfolge
#
# Escaped eine Zeichenfolge so, dass diese sicher in die Datenbank eingetragen
# werden kann.
function sitSafeStringEscape($string) {
$escapeCount = 0;
$targetString = '';
for($offset = 0; $offset < strlen($string); $offset ++) {
switch ($c = $string{$offset}) {
case "'":
if ($escapeCount % 2 == 0) {
$targetString .= "\\";
}
$escapeCount = 0;
$targetString .= $c;
break;
case '"':
if ($escapeCount % 2 == 0) {
$targetString .= "\\";
}
$escapeCount = 0;
$targetString .= $c;
break;
case '\\':
$escapeCount ++ ;
$targetString .= $c;
break;
default:
$escapeCount = 0;
$targetString .= $c;
}
}
return $targetString;
}
# sitSendHtmlMail()
#
# Sendet eine HTML-Mail mit HTML- und Textteil
#
# Parameter:
# $html - HTML-Teil der Mail
# $subject - Betreffzeile der Mail
# $receipients - Array von Empfänger ('name' und 'email', mehrere möglich)
# $attachments - Dateipfad oder Array von Dateipfade für Anhänge (optional)
# $sname - Absendername (optional)
# $smail - Absenderadresse (optional)
# $mailer - Versandmethode ('mail' / 'qmail' / 'sendmail' / 'smtp') (optional)
# $sserver - SMTP-Server Adresse (optional)
# $slogin - SMTP Login (optional)
# $spass - SMTP Passwort (optional)
# $sport - SMTP Port (optional)
#
# Sendet eine HTML-Mail mit HTML- und Textteil an einen oder mehrere Empfänger
# mit keinen oder mehrere Anhänge und liefert den Erfolgsstatus zurück.
# Die Angaben zum Absender und den Mailer werden, sofern sie nicht mit angegeben
# sind, aus den Mandanten- bzw. Systemeinstellungen ausgelesen.
# - email - absende-name
# - email - absender-email
# - email - mailer
# - email - smtp-server
# - email - smtp-login
# - email - smtp-passwort
# - email - smtp-port - 25
# Die Empfänger werden als Array aus Name(n) und Email-Adresse(n) übergeben.
# Beispiel 1: array('name' => 'xyz', 'email' => 'xyz@abc.de');
# Beispiel 2: array(array('name' => 'xyz', 'email' => 'xyz@abc.de'), array('name'...
function sitSendHtmlMail($html, $subject, $receipients, $attachments = '', $sname = '', $smail = '', $mailer = '', $sserver = '', $slogin = '', $spass = '', $sport = '') {
# Eingaben ergänzen
if (!is_array($attachments)) {
$attachments = array($attachments);
}
$sname = ((strlen($sname)) ? $sname : getEffectiveSetting('email', 'absender-name'));
$smail = ((strlen($smail)) ? $smail : getEffectiveSetting('email', 'absender-email'));
if (strlen($sname) == 0) {
$sname = $smail;
}
$mailer = strtolower(((strlen($mailer)) ? $mailer : getEffectiveSetting('email', 'mailer')));
if (strlen($mailer) == 0) {
$mailer = 'mail';
}
if ($mailer == 'smtp') {
$sserver = ((strlen($sserver)) ? $sserver : getEffectiveSetting('email', 'smtp-server'));
$slogin = ((strlen($slogin)) ? $slogin : getEffectiveSetting('email', 'smtp-login'));
$spass = ((strlen($spass)) ? $spass : getEffectiveSetting('email', 'smtp-passwort'));
$sport = intval(((strlen($sport)) ? $sport : getEffectiveSetting('email', 'smtp-port')));
if ($sport == 0) {
$sport = 25;
}
}
# Prüfen, ob genügend Angaben vorliegen
if ((strlen($html) == 0) || (strlen($subject) == 0)) {
return false;
}
if ((!is_array($receipients)) || ((strlen($receipients['email']) == 0) && (strlen($receipients[0]['email']) == 0))) {
return false;
}
if (strlen($smail) == 0) {
return false;
}
if (($mailer == 'smtp') && ((strlen($sserver) == 0) || (strlen($slogin) == 0) || (strlen($spass) == 0))) {
return false;
}
# Mail aufbereiten und versenden
$oMail = new PHPMailer();
$oMail->IsHTML(true);
$oMail->Mailer = $mailer;
if ($mailer == 'smtp') {
$oMail->SMTPAuth = true;
$oMail->Host = $sserver;
$oMail->Port = $sport;
$oMail->Username = $slogin;
$oMail->Password = $spass;
}
$oMail->Subject = $subject;
$oMail->From = $smail;
$oMail->FromName = $sname;
if (is_array($receipients[0])) {
for ($i = 0, $n = count($receipients); $i < $n; $i ++) {
if (strlen($receipients[$i]['email'])) {
$oMail->AddAddress($receipients[$i]['email'], ((strlen($receipients[$i]['name'])) ? $receipients[$i]['name'] : $receipients[$i]['email']));
}
}
} else {
$oMail->AddAddress($receipients['email'], ((strlen($receipients['name'])) ? $receipients['name'] : $receipients['email']));
}
$oMail->Body = $html;
# Nur-Text-Bereich -->
$sMsg = substr($html, strpos($html, '<body'));
$sMsg = str_replace(array("\n", '</p>', '<br />', '<br>'), array('', "</p>\n\n", "\n", "\n"), $sMsg);
$sMsg = trim(strip_tags($sMsg));
$sMsg = explode("\n", $sMsg);
for ($i = 0, $n = count($sMsg); $i < $n; $i ++) {
$sMsg[$i] = trim($sMsg[$i]);
}
$sMsg = implode("\n", $sMsg);
$sMsg = html_entity_decode($sMsg);
$sMsg = capiStrReplaceDiacritics($sMsg);
# <-- Nur-Text-Bereich
$oMail->AltBody = $sMsg;
for ($i = 0, $n = count($attachments); $i < $n; $i ++) {
if (is_file($attachments[$i])) {
$oMail->AddAttachment($attachments[$i]);
}
}
$oMail->WordWrap = 76;
return $oMail->Send();
}
# sitSetClientProperty()
#
# Speichert eine Mandanteneinstellung
#
# Parameter:
# $type - Typ des Entrags (Text)
# $name - Name des Eintrags
# $value - Wert des Eintrags (Text)
#
# Speichert ein Eintrag in den Mandanteneinstellungen, überschreibt dabei
# eine gleichnamige vorhandene Einstellung.
function sitSetClientProperty($type, $name, $value) {
global $client, $cfg;
if ((strlen($type)) && (strlen($name))) {
$type = sitSafeStringEscape($type);
$name = sitSafeStringEscape($name);
$value = sitSafeStringEscape($value);
$db = new DB_Contenido();
$sql = 'SELECT value
FROM ' . $cfg['tab']['properties'] . '
WHERE ((idclient=' . $client . ')
AND (itemtype="clientsetting")
AND (type="' . $type . '")
AND (name="' . $name . '"))';
$db->query($sql);
if ($db->next_record()) {
$sql = 'UPDATE ' . $cfg['tab']['properties'] . '
SET value = "' . $value . '",
modified = "' . date('Y-m-d H:i:n') . '",
modifiedby = "' . $auth->auth['uid'] . '"
WHERE ((idclient=' . $client . ')
AND (itemtype="clientsetting")
AND (type="' . $type . '")
AND (name="' . $name . '"))';
} else {
$sql = 'INSERT INTO ' . $cfg['tab']['properties'] . ' (idclient, itemtype, itemid, type, name, value, author, created, modified, modifiedby)
VALUES (' . $client . ', "clientsetting", 1, "' . $type . '", "' . $name . '", "' . $value . '", "' . $auth->auth['uid'] . '", "' . date('Y-m-d H:i:n') . '", "' . date('Y-m-d H:i:n') . '", "' . $auth->auth['uid'] . '")';
}
$db->query($sql);
}
}
# sitTeaserText()
#
# Teasert einen Text an
#
# Parameter:
# $text - Zu teasernden Text
# $maxlength - Maximale Länge des Textes
#
# Der Text wird auf die maximale Anzahl Zeichen gekürzt, wobei der Schnitt nicht
# mitten im Wort erfolgt, sondern davor.
# Zuvor werden aus dem Text noch alle HTML-Tags entfernt.
# Wenn der Text gekürzt wird (nur wenn der Text länger als der maximalen Anzahl
# Zeichen ist), wird ein HTML-Zeichen &hellip; (...) angehängt.
function sitTeaserText($text, $maxlength) {
$sText1 = strip_tags(str_replace(array("\r\n", "\n"), ' ', $text));
$sText2 = capiStrTrimAfterWord($sText1, intval($maxlength));
if (strlen($sText2) < strlen($sText1)) {
$sText2 .= '&hellip;';
}
return $sText2;
}
?>

Datei anzeigen

@ -1,294 +1,294 @@
/* Cookies Directive - The rewrite. Now a jQuery plugin
* Version: 2.0.1
* Author: Ollie Phillips
* 24 October 2013
*/
;(function($) {
$.cookiesDirective = function(options) {
// Default Cookies Directive Settings
var settings = $.extend({
//Options
explicitConsent: true,
position: 'top',
duration: 10,
limit: 0,
message: null,
cookieScripts: null,
privacyPolicyUri: 'privacy.html',
inlineAction: false,
scriptWrapper: function(){},
// Styling
fontFamily: 'helvetica',
fontColor: '#FFFFFF',
fontSize: '13px',
backgroundColor: '#000000',
backgroundOpacity: '80',
linkColor: '#CA0000',
// Messages
multipleCookieScriptBeginningLabel: ' We use ',
and: ' and ',
multipleCookieScriptEndLabel: ' scripts, which all set cookies. ',
singleCookieScriptBeginningLabel: ' We use a ',
singleCookieScriptEndLabel: ' script which sets cookies.',
explicitCookieDeletionWarning: 'You may delete and block all cookies from this site, but parts of the site will not work.',
explicitFindOutMore: 'To find out more about cookies on this website, see our',
privacyPolicyLinkText: ' privacy policy',
explicitCheckboxLabel: 'You must tick the "I accept cookies from this site" box to accept',
explicitCookieAcceptanceLabel: 'I accept cookies from this site',
explicitCookieAcceptButtonText: 'Continue',
impliedDisclosureText: ' More details can be found in our',
impliedSubmitText: 'Do not show this message again',
}, options);
// Perform consent checks
if(!getCookie('cookiesDirective')) {
if(settings.limit > 0) {
// Display limit in force, record the view
if(!getCookie('cookiesDisclosureCount')) {
setCookie('cookiesDisclosureCount',1,1);
} else {
var disclosureCount = getCookie('cookiesDisclosureCount');
disclosureCount ++;
setCookie('cookiesDisclosureCount',disclosureCount,1);
}
// Have we reached the display limit, if not make disclosure
if(settings.limit >= getCookie('cookiesDisclosureCount')) {
disclosure(settings);
}
} else {
// No display limit
disclosure(settings);
}
// If we don't require explicit consent, load up our script wrapping function
if(!settings.explicitConsent) {
settings.scriptWrapper.call();
}
} else {
// Cookies accepted, load script wrapping function
settings.scriptWrapper.call();
}
};
// Used to load external javascript files into the DOM
$.cookiesDirective.loadScript = function(options) {
var settings = $.extend({
uri: '',
appendTo: 'body'
}, options);
var elementId = String(settings.appendTo);
var sA = document.createElement("script");
sA.src = settings.uri;
sA.type = "text/javascript";
sA.onload = sA.onreadystatechange = function() {
if ((!sA.readyState || sA.readyState == "loaded" || sA.readyState == "complete")) {
return;
}
}
switch(settings.appendTo) {
case 'head':
$('head').append(sA);
break;
case 'body':
$('body').append(sA);
break;
default:
$('#' + elementId).append(sA);
}
}
// Helper scripts
// Get cookie
var getCookie = function(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
// Set cookie
var setCookie = function(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
// Detect IE < 9
var checkIE = function(){
var version;
if (navigator.appName == 'Microsoft Internet Explorer') {
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null) {
version = parseFloat(RegExp.$1);
}
if (version <= 8.0) {
return true;
} else {
if(version == 9.0) {
if(document.compatMode == "BackCompat") {
// IE9 in quirks mode won't run the script properly, set to emulate IE8
var mA = document.createElement("meta");
mA.content = "IE=EmulateIE8";
document.getElementsByTagName('head')[0].appendChild(mA);
return true;
} else {
return false;
}
}
return false;
}
} else {
return false;
}
}
// Disclosure routines
var disclosure = function(options) {
var settings = options;
settings.css = 'fixed';
// IE 9 and lower has issues with position:fixed, either out the box or in compatibility mode - fix that
if(checkIE()) {
settings.position = 'top';
settings.css = 'absolute';
}
// Any cookie setting scripts to disclose
var scriptsDisclosure = '';
if (settings.cookieScripts) {
var scripts = settings.cookieScripts.split(',');
var scriptsCount = scripts.length;
var scriptDisclosureTxt = '';
if(scriptsCount>1) {
for(var t=0; t < scriptsCount - 1; t++) {
scriptDisclosureTxt += scripts[t] + ', ';
}
scriptsDisclosure = settings.multipleCookieScriptBeginningLabel + scriptDisclosureTxt.substring(0, scriptDisclosureTxt.length - 2) + settings.and + scripts[scriptsCount - 1] + settings.multipleCookieScriptEndLabel;
} else {
scriptsDisclosure = setting.singleCookieScriptBeginningLabel + scripts[0] + settings.singleCookieScriptEndLabel;
}
}
// Create overlay, vary the disclosure based on explicit/implied consent
// Set our disclosure/message if one not supplied
var html = '';
html += '<div id="epd">';
html += '<div id="cookiesdirective" style="position:'+ settings.css +';'+ settings.position + ':-300px;left:0px;width:100%;'
html += 'height:auto;background:' + settings.backgroundColor + ';opacity:.' + settings.backgroundOpacity + ';';
html += '-ms-filter: “alpha(opacity=' + settings.backgroundOpacity + ')”; filter: alpha(opacity=' + settings.backgroundOpacity + ');';
html += '-khtml-opacity: .' + settings.backgroundOpacity + '; -moz-opacity: .' + settings.backgroundOpacity + ';';
html += 'color:' + settings.fontColor + ';font-family:' + settings.fontFamily + ';font-size:' + settings.fontSize + ';';
html += 'text-align:center;z-index:1000;">';
html += '<div style="position:relative;height:auto;width:90%;padding:10px;margin-left:auto;margin-right:auto;">';
if(!settings.message) {
if(settings.explicitConsent) {
// Explicit consent message
settings.message = 'This site uses cookies. Some of the cookies we ';
settings.message += 'use are essential for parts of the site to operate and have already been set.';
} else {
// Implied consent message
settings.message = 'We have placed cookies on your computer to help make this website better.';
}
}
html += settings.message;
// Build the rest of the disclosure for implied and explicit consent
if(settings.explicitConsent) {
// Explicit consent disclosure
html += scriptsDisclosure + settings.explicitCookieDeletionWarning;
html += settings.explicitFindOutMore + '<a style="color:'+ settings.linkColor + ';font-weight:bold;';
html += 'font-family:' + settings.fontFamily + ';font-size:' + settings.fontSize + ';" href="'+ settings.privacyPolicyUri + '">'+ settings.privacyPolicyLinkText +'</a>.';
html += '<div id="epdnotick" style="color:#ca0000;display:none;margin:2px;"><span style="background:#cecece;padding:2px;">' + settings.explicitCheckboxLabel + '</span></div>'
html += '<div style="margin-top:5px;';
if(settings.inlineAction) {
html += 'display:inline-block;margin-left:5px';
}
html += '">' + settings.explicitCookieAcceptanceLabel + '<input type="checkbox" name="epdagree" id="epdagree" />&nbsp;';
html += '<input type="submit" name="explicitsubmit" id="explicitsubmit" value="' + settings.explicitCookieAcceptButtonText + '"/><br/></div></div>';
} else {
// Implied consent disclosure
html += scriptsDisclosure + settings.impliedDisclosureText + ' <a style="color:'+ settings.linkColor + ';';
html += 'font-weight:bold;font-family:' + settings.fontFamily + ';font-size:' + settings.fontSize + ';" href="'+ settings.privacyPolicyUri + '">' + settings.privacyPolicyLinkText + '</a>.';
html += '<div style="margin-top:5px;';
if(settings.inlineAction) {
html += 'display:inline-block;margin-left:5px';
}
html += '"><input type="submit" name="impliedsubmit" id="impliedsubmit" value="' + settings.impliedSubmitText + '"/></div></div>';
}
html += '</div></div>';
$('body').append(html);
// Serve the disclosure, and be smarter about branching
var dp = settings.position.toLowerCase();
if(dp != 'top' && dp!= 'bottom') {
dp = 'top';
}
var opts = new Array();
if(dp == 'top') {
opts['in'] = {'top':'0'};
opts['out'] = {'top':'-300'};
} else {
opts['in'] = {'bottom':'0'};
opts['out'] = {'bottom':'-300'};
}
// Start animation
$('#cookiesdirective').animate(opts['in'], 1000, function() {
// Set event handlers depending on type of disclosure
if(settings.explicitConsent) {
// Explicit, need to check a box and click a button
$('#explicitsubmit').click(function() {
if($('#epdagree').is(':checked')) {
// Set a cookie to prevent this being displayed again
setCookie('cookiesDirective',1,365);
// Close the overlay
$('#cookiesdirective').animate(opts['out'],1000,function() {
// Remove the elements from the DOM and reload page
$('#cookiesdirective').remove();
location.reload(true);
});
} else {
// We need the box checked we want "explicit consent", display message
$('#epdnotick').css('display', 'block');
}
});
} else {
// Implied consent, just a button to close it
$('#impliedsubmit').click(function() {
// Set a cookie to prevent this being displayed again
setCookie('cookiesDirective',1,365);
// Close the overlay
$('#cookiesdirective').animate(opts['out'],1000,function() {
// Remove the elements from the DOM and reload page
$('#cookiesdirective').remove();
});
});
}
// Set a timer to remove the warning after 'settings.duration' seconds
setTimeout(function(){
$('#cookiesdirective').animate({
opacity:'0'
},2000, function(){
$('#cookiesdirective').css(dp,'-300px');
});
}, settings.duration * 1000);
});
}
})(jQuery);
/* Cookies Directive - The rewrite. Now a jQuery plugin
* Version: 2.0.1
* Author: Ollie Phillips test
* 24 October 2013
*/
;(function($) {
$.cookiesDirective = function(options) {
// Default Cookies Directive Settings
var settings = $.extend({
//Options
explicitConsent: true,
position: 'top',
duration: 10,
limit: 0,
message: null,
cookieScripts: null,
privacyPolicyUri: 'privacy.html',
inlineAction: false,
scriptWrapper: function(){},
// Styling
fontFamily: 'helvetica',
fontColor: '#FFFFFF',
fontSize: '13px',
backgroundColor: '#000000',
backgroundOpacity: '80',
linkColor: '#CA0000',
// Messages
multipleCookieScriptBeginningLabel: ' We use ',
and: ' and ',
multipleCookieScriptEndLabel: ' scripts, which all set cookies. ',
singleCookieScriptBeginningLabel: ' We use a ',
singleCookieScriptEndLabel: ' script which sets cookies.',
explicitCookieDeletionWarning: 'You may delete and block all cookies from this site, but parts of the site will not work.',
explicitFindOutMore: 'To find out more about cookies on this website, see our',
privacyPolicyLinkText: ' privacy policy',
explicitCheckboxLabel: 'You must tick the "I accept cookies from this site" box to accept',
explicitCookieAcceptanceLabel: 'I accept cookies from this site',
explicitCookieAcceptButtonText: 'Continue',
impliedDisclosureText: ' More details can be found in our',
impliedSubmitText: 'Do not show this message again',
}, options);
// Perform consent checks
if(!getCookie('cookiesDirective')) {
if(settings.limit > 0) {
// Display limit in force, record the view
if(!getCookie('cookiesDisclosureCount')) {
setCookie('cookiesDisclosureCount',1,1);
} else {
var disclosureCount = getCookie('cookiesDisclosureCount');
disclosureCount ++;
setCookie('cookiesDisclosureCount',disclosureCount,1);
}
// Have we reached the display limit, if not make disclosure
if(settings.limit >= getCookie('cookiesDisclosureCount')) {
disclosure(settings);
}
} else {
// No display limit
disclosure(settings);
}
// If we don't require explicit consent, load up our script wrapping function
if(!settings.explicitConsent) {
settings.scriptWrapper.call();
}
} else {
// Cookies accepted, load script wrapping function
settings.scriptWrapper.call();
}
};
// Used to load external javascript files into the DOM
$.cookiesDirective.loadScript = function(options) {
var settings = $.extend({
uri: '',
appendTo: 'body'
}, options);
var elementId = String(settings.appendTo);
var sA = document.createElement("script");
sA.src = settings.uri;
sA.type = "text/javascript";
sA.onload = sA.onreadystatechange = function() {
if ((!sA.readyState || sA.readyState == "loaded" || sA.readyState == "complete")) {
return;
}
}
switch(settings.appendTo) {
case 'head':
$('head').append(sA);
break;
case 'body':
$('body').append(sA);
break;
default:
$('#' + elementId).append(sA);
}
}
// Helper scripts
// Get cookie
var getCookie = function(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
// Set cookie
var setCookie = function(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
// Detect IE < 9
var checkIE = function(){
var version;
if (navigator.appName == 'Microsoft Internet Explorer') {
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null) {
version = parseFloat(RegExp.$1);
}
if (version <= 8.0) {
return true;
} else {
if(version == 9.0) {
if(document.compatMode == "BackCompat") {
// IE9 in quirks mode won't run the script properly, set to emulate IE8
var mA = document.createElement("meta");
mA.content = "IE=EmulateIE8";
document.getElementsByTagName('head')[0].appendChild(mA);
return true;
} else {
return false;
}
}
return false;
}
} else {
return false;
}
}
// Disclosure routines
var disclosure = function(options) {
var settings = options;
settings.css = 'fixed';
// IE 9 and lower has issues with position:fixed, either out the box or in compatibility mode - fix that
if(checkIE()) {
settings.position = 'top';
settings.css = 'absolute';
}
// Any cookie setting scripts to disclose
var scriptsDisclosure = '';
if (settings.cookieScripts) {
var scripts = settings.cookieScripts.split(',');
var scriptsCount = scripts.length;
var scriptDisclosureTxt = '';
if(scriptsCount>1) {
for(var t=0; t < scriptsCount - 1; t++) {
scriptDisclosureTxt += scripts[t] + ', ';
}
scriptsDisclosure = settings.multipleCookieScriptBeginningLabel + scriptDisclosureTxt.substring(0, scriptDisclosureTxt.length - 2) + settings.and + scripts[scriptsCount - 1] + settings.multipleCookieScriptEndLabel;
} else {
scriptsDisclosure = setting.singleCookieScriptBeginningLabel + scripts[0] + settings.singleCookieScriptEndLabel;
}
}
// Create overlay, vary the disclosure based on explicit/implied consent
// Set our disclosure/message if one not supplied
var html = '';
html += '<div id="epd">';
html += '<div id="cookiesdirective" style="position:'+ settings.css +';'+ settings.position + ':-300px;left:0px;width:100%;'
html += 'height:auto;background:' + settings.backgroundColor + ';opacity:.' + settings.backgroundOpacity + ';';
html += '-ms-filter: “alpha(opacity=' + settings.backgroundOpacity + ')”; filter: alpha(opacity=' + settings.backgroundOpacity + ');';
html += '-khtml-opacity: .' + settings.backgroundOpacity + '; -moz-opacity: .' + settings.backgroundOpacity + ';';
html += 'color:' + settings.fontColor + ';font-family:' + settings.fontFamily + ';font-size:' + settings.fontSize + ';';
html += 'text-align:center;z-index:1000;">';
html += '<div style="position:relative;height:auto;width:90%;padding:10px;margin-left:auto;margin-right:auto;">';
if(!settings.message) {
if(settings.explicitConsent) {
// Explicit consent message
settings.message = 'This site uses cookies. Some of the cookies we ';
settings.message += 'use are essential for parts of the site to operate and have already been set.';
} else {
// Implied consent message
settings.message = 'We have placed cookies on your computer to help make this website better.';
}
}
html += settings.message;
// Build the rest of the disclosure for implied and explicit consent
if(settings.explicitConsent) {
// Explicit consent disclosure
html += scriptsDisclosure + settings.explicitCookieDeletionWarning;
html += settings.explicitFindOutMore + '<a style="color:'+ settings.linkColor + ';font-weight:bold;';
html += 'font-family:' + settings.fontFamily + ';font-size:' + settings.fontSize + ';" href="'+ settings.privacyPolicyUri + '">'+ settings.privacyPolicyLinkText +'</a>.';
html += '<div id="epdnotick" style="color:#ca0000;display:none;margin:2px;"><span style="background:#cecece;padding:2px;">' + settings.explicitCheckboxLabel + '</span></div>'
html += '<div style="margin-top:5px;';
if(settings.inlineAction) {
html += 'display:inline-block;margin-left:5px';
}
html += '">' + settings.explicitCookieAcceptanceLabel + '<input type="checkbox" name="epdagree" id="epdagree" />&nbsp;';
html += '<input type="submit" name="explicitsubmit" id="explicitsubmit" value="' + settings.explicitCookieAcceptButtonText + '"/><br/></div></div>';
} else {
// Implied consent disclosure
html += scriptsDisclosure + settings.impliedDisclosureText + ' <a style="color:'+ settings.linkColor + ';';
html += 'font-weight:bold;font-family:' + settings.fontFamily + ';font-size:' + settings.fontSize + ';" href="'+ settings.privacyPolicyUri + '">' + settings.privacyPolicyLinkText + '</a>.';
html += '<div style="margin-top:5px;';
if(settings.inlineAction) {
html += 'display:inline-block;margin-left:5px';
}
html += '"><input type="submit" name="impliedsubmit" id="impliedsubmit" value="' + settings.impliedSubmitText + '"/></div></div>';
}
html += '</div></div>';
$('body').append(html);
// Serve the disclosure, and be smarter about branching
var dp = settings.position.toLowerCase();
if(dp != 'top' && dp!= 'bottom') {
dp = 'top';
}
var opts = new Array();
if(dp == 'top') {
opts['in'] = {'top':'0'};
opts['out'] = {'top':'-300'};
} else {
opts['in'] = {'bottom':'0'};
opts['out'] = {'bottom':'-300'};
}
// Start animation
$('#cookiesdirective').animate(opts['in'], 1000, function() {
// Set event handlers depending on type of disclosure
if(settings.explicitConsent) {
// Explicit, need to check a box and click a button
$('#explicitsubmit').click(function() {
if($('#epdagree').is(':checked')) {
// Set a cookie to prevent this being displayed again
setCookie('cookiesDirective',1,365);
// Close the overlay
$('#cookiesdirective').animate(opts['out'],1000,function() {
// Remove the elements from the DOM and reload page
$('#cookiesdirective').remove();
location.reload(true);
});
} else {
// We need the box checked we want "explicit consent", display message
$('#epdnotick').css('display', 'block');
}
});
} else {
// Implied consent, just a button to close it
$('#impliedsubmit').click(function() {
// Set a cookie to prevent this being displayed again
setCookie('cookiesDirective',1,365);
// Close the overlay
$('#cookiesdirective').animate(opts['out'],1000,function() {
// Remove the elements from the DOM and reload page
$('#cookiesdirective').remove();
});
});
}
// Set a timer to remove the warning after 'settings.duration' seconds
setTimeout(function(){
$('#cookiesdirective').animate({
opacity:'0'
},2000, function(){
$('#cookiesdirective').css(dp,'-300px');
});
}, settings.duration * 1000);
});
}
})(jQuery);

Datei anzeigen

@ -1,18 +1,18 @@
<!-- developer design for file list -->
<h3>{TITLE}</h3>
<!--
Possible place holders for entries:
FILELINK, FILENAME, FILEEXTENSION, FILESIZE, FILESIZE_UNIT,
FILECREATIONDATE, FILEMODIFYDATE, FILEDIRCTORY,
FILEMETA_DESCRIPTION, FILEMETA_KEYWORDS, FILEMETA_MEDIANAME,
FILEMETA_INTERNAL_NOTICE, FILEMETA_COPYRIGHT
-->
<!-- BEGIN:BLOCK -->
<div style="float: left;margin-bottom: 20px;width:47%;padding-right:5px">
<b><a href="{FILELINK}">{FILENAME}</a></b> ({FILEEXTENSION})<br />
<span style="color: rgb(170, 170, 170);">{LABEL_FILESIZE}</span> {FILESIZE} {FILESIZE_UNIT}<br />
<span style="color: rgb(170, 170, 170);">{LABEL_UPLOAD_DATE}</span> {FILECREATIONDATE}<br />
{FILEMETA_DESCRIPTION}
</div>
<!-- END:BLOCK -->
<!-- developer design for file list test -->
<h3>{TITLE}</h3>
<!--
Possible place holders for entries:
FILELINK, FILENAME, FILEEXTENSION, FILESIZE, FILESIZE_UNIT,
FILECREATIONDATE, FILEMODIFYDATE, FILEDIRCTORY,
FILEMETA_DESCRIPTION, FILEMETA_KEYWORDS, FILEMETA_MEDIANAME,
FILEMETA_INTERNAL_NOTICE, FILEMETA_COPYRIGHT
-->
<!-- BEGIN:BLOCK -->
<div style="float: left;margin-bottom: 20px;width:47%;padding-right:5px">
<b><a href="{FILELINK}">{FILENAME}</a></b> ({FILEEXTENSION})<br />
<span style="color: rgb(170, 170, 170);">{LABEL_FILESIZE}</span> {FILESIZE} {FILESIZE_UNIT}<br />
<span style="color: rgb(170, 170, 170);">{LABEL_UPLOAD_DATE}</span> {FILECREATIONDATE}<br />
{FILEMETA_DESCRIPTION}
</div>
<!-- END:BLOCK -->
<br style="clear:both" />

6
cms/upload/.gitignore vendored Normale Datei
Datei anzeigen

@ -0,0 +1,6 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
!/Flexslider
!/Gallery

4
cms/version/css/.gitignore vendored Normale Datei
Datei anzeigen

@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

4
cms/version/js/.gitignore vendored Normale Datei
Datei anzeigen

@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

4
cms/version/layout/.gitignore vendored Normale Datei
Datei anzeigen

@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

4
cms/version/module/.gitignore vendored Normale Datei
Datei anzeigen

@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

4
cms/version/templates/.gitignore vendored Normale Datei
Datei anzeigen

@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

26
composer.json Normale Datei
Datei anzeigen

@ -0,0 +1,26 @@
{
"name": "org.conlite/conlite",
"description": "ConLite vendor libs",
"license": "GPL-3.0-or-later",
"authors": [
{
"name": "oldperl",
"email": "ortwin.pinke@php-backoffice.de"
}
],
"require": {
"php": "^8.0",
"phpmailer/phpmailer": "v6.8.0",
"twig/twig": "^3.0"
},
"require-dev": {
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.0",
"rector/rector": "^0.15"
},
"autoload": {
"psr-4": {
"ConLite\\": "conlite/classes"
}
}
}

2074
composer.lock generiert Normale Datei

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -92,6 +92,10 @@ class DB_Sql extends DB_Sql_Abstract {
return null;
}
// PHP 8.1 fix
$driver = new mysqli_driver();
$driver->report_mode = MYSQLI_REPORT_OFF;
$dbh = mysqli_init();
//print_r($dbh);
if (!$dbh) {
@ -123,7 +127,7 @@ class DB_Sql extends DB_Sql_Abstract {
$aCon['socket'] = null;
}
if (!isset($aCon['flags'])) {
$aCon['flags'] = null;
$aCon['flags'] = MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT;
}
if (!isset($aCon['database'])) {
$aCon['database'] = null;
@ -134,10 +138,10 @@ class DB_Sql extends DB_Sql_Abstract {
);
if (isset($aCon['charset'])) {
@mysqli_set_charset($dbh, $aCon['charset']);
if (!empty($aCon['charset'])) {
mysqli_set_charset($dbh, $aCon['charset']);
} else {
@mysqli_set_charset($dbh, 'utf8');
mysqli_set_charset($dbh, 'utf8');
}
//echo mysqli_character_set_name($dbh);
@ -181,7 +185,8 @@ class DB_Sql extends DB_Sql_Abstract {
/**
* @see DB_Sql_Abstract::next_record()
*/
public function next_record() {
public function next_record(): bool|int
{
if (!$this->Query_ID instanceof mysqli_result) {
return false;
}
@ -326,30 +331,30 @@ class DB_Sql extends DB_Sql_Abstract {
}
/**
* @see DB_Sql_Abstract::_metaData()
* * Due to compatibility problems with Table we changed the behavior
* of metadata();
* depending on $full, metadata returns the following values:
*
* - full is false (default):
* $result[]:
* [0]["table"] table name
* [0]["name"] field name
* [0]["type"] field type
* [0]["len"] field length
* [0]["flags"] field flags
*
* - full is true
* $result[]:
* ["num_fields"] number of metadata records
* [0]["table"] table name
* [0]["name"] field name
* [0]["type"] field type
* [0]["len"] field length
* [0]["flags"] field flags
* ["meta"][field name] index of field named "field name"
* This last one could be used if you have a field name, but no index.
* Test: if (isset($result['meta']['myfield'])) { ...
* @see DB_Sql_Abstract::_metaData()
* * Due to compatibility problems with Table we changed the behavior
* of metadata();
* depending on $full, metadata returns the following values:
*
* - full is false (default):
* $result[]:
* [0]["table"] table name
* [0]["name"] field name
* [0]["type"] field type
* [0]["len"] field length
* [0]["flags"] field flags
*
* - full is true
* $result[]:
* ["num_fields"] number of metadata records
* [0]["table"] table name
* [0]["name"] field name
* [0]["type"] field type
* [0]["len"] field length
* [0]["flags"] field flags
* ["meta"][field name] index of field named "field name"
* This last one could be used if you have a field name, but no index.
* Test: if (isset($result['meta']['myfield'])) { ...
*/
protected function _metaData($table = '', $full = false) {
$count = 0;
@ -392,7 +397,7 @@ class DB_Sql extends DB_Sql_Abstract {
$count = 0;
while ($finfo = $id->fetch_field()) {
//rint_r($finfo);
//rint_r($finfo);
$res[$count]['table'] = $finfo->table;
$res[$count]['name'] = $finfo->name;
$res[$count]['type'] = $this->_aDataTypes[$finfo->type];
@ -420,10 +425,13 @@ class DB_Sql extends DB_Sql_Abstract {
* @see DB_Sql_Abstract::escape()
*/
public function escape($sString) {
if(is_null($sString)) {
$sString = '';
}
$sResult = '';
if (is_resource($this->Link_ID) || $this->connect()) {
$sResult = mysqli_real_escape_string($this->Link_ID, $sString);
};
}
return $sResult;
}
@ -440,7 +448,7 @@ class DB_Sql extends DB_Sql_Abstract {
$return[$i]['table_name'] = $info[0];
$return[$i]['tablespace_name'] = $this->Database;
$return[$i]['database'] = $this->Database;
$i ++;
$i++;
}
mysqli_free_result($h);

Datei anzeigen

@ -41,6 +41,7 @@ if (!defined('CON_FRAMEWORK')) {
* DB-class for all DB handling
*/
class DB_ConLite extends DB_Sql {
protected bool $NoRecord;
/**
* Constructor of database class.
@ -58,13 +59,13 @@ class DB_ConLite extends DB_Sql {
* - $options['enableProfiling'] (bool) Optional, flag to enable profiling
* @return void
*/
public function __construct(array $options = array()) {
public function __construct(array $options = []) {
global $cachemeta;
parent::__construct($options);
if (!is_array($cachemeta)) {
$cachemeta = array();
$cachemeta = [];
}
// TODO check this out
@ -79,16 +80,20 @@ class DB_ConLite extends DB_Sql {
/**
* Fetches the next recordset from result set
*
* @param bool
* @deprecated since ConLite 2.3
*/
public function next_record() {
global $cCurrentModule;
// FIXME For what reason is NoRecord used???
$this->NoRecord = false;
public function next_record(): bool|int
{
return $this->nextRecord();
}
public function nextRecord(): bool|int
{
$currentModule = cRegistry::getCurrentModule();
if (!$this->Query_ID) {
$this->NoRecord = true;
if ($cCurrentModule > 0) {
$this->halt("next_record called with no query pending in Module ID $cCurrentModule.");
if ($currentModule > 0) {
$this->halt("next_record called with no query pending in Module ID $currentModule.");
} else {
$this->halt("next_record called with no query pending.");
}
@ -108,7 +113,7 @@ class DB_ConLite extends DB_Sql {
*/
public function copyResultToArray($sTable = '') {
$aValues = array();
$aValues = [];
$aMetadata = $this->metadata($sTable);
@ -131,17 +136,8 @@ class DB_ConLite extends DB_Sql {
*
* @deprecated since version 2.0.0, use DB_ConLite instead
*/
class DB_Contenido extends DB_ConLite {
/**
*
* @deprecated since version 2.0.0
* @param array $options
*/
public function __construct(array $options = array()) {
parent::__construct($options);
}
class DB_Contenido extends DB_ConLite
{
}
class Contenido_CT_Sql extends CT_Sql {
@ -175,17 +171,12 @@ class Contenido_CT_Sql extends CT_Sql {
* @param string $id The session id (hash)
* @param string $name Name of the session
* @param string $str The value to store
* @return bool
*/
public function ac_store($id, $name, $str) {
switch ($this->encoding_mode) {
case 'slashes':
$str = addslashes($name . ':' . $str);
break;
case 'base64':
default:
$str = base64_encode($name . ':' . $str);
}
public function ac_store($id, $name, $str): bool {
$str = match ($this->encoding_mode) {
'slashes' => addslashes($name . ':' . $str),
default => base64_encode($name . ':' . $str),
};
$name = addslashes($name);
$now = date('YmdHis', time());
@ -194,7 +185,7 @@ class Contenido_CT_Sql extends CT_Sql {
"REPLACE INTO %s (sid, name, val, changed) VALUES ('%s', '%s', '%s', '%s')", $this->database_table, $id, $name, $str, $now
);
return ($this->db->query($iquery)) ? true : false;
return (bool) $this->db->query($iquery);
}
}
@ -279,14 +270,12 @@ class Contenido_CT_Shm extends CT_Shm {
class Contenido_CT_Session extends CT_Session {
public function __construct() {
$this->ac_start(array(
$this->ac_start([
'namespace' => 'contenido_ct_session_ns',
'session.hash_function' => '1', // use sha-1 function
'session.hash_bits_per_character' => '5', // and set 5 character to achieve 32 chars
# 'session.save_path' => 'your path',
# 'session.name' => 'your session name',
# 'session.gc_maxlifetime' => 'your lifetime in seconds',
));
'session.hash_function' => '1',
// use sha-1 function
'session.hash_bits_per_character' => '5',
]);
}
}
@ -320,8 +309,8 @@ class Contenido_Session extends Session {
}
public function delete() {
$oCol = new InUseCollection();
$oCol->removeSessionMarks($this->id);
$inUseCollection = new InUseCollection();
$inUseCollection->removeSessionMarks($this->id);
parent::delete();
}
@ -435,6 +424,8 @@ class Contenido_Challenge_Auth extends Auth {
}
public function auth_validatelogin() {
$pass = null;
$uid = null;
global $username, $password, $challenge, $response, $timestamp;
if ($password == '') {
@ -522,7 +513,7 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
public function auth_loglogin($uid) {
global $cfg, $client, $lang, $auth, $sess, $saveLoginTime;
$perm = new Contenido_Perm();
$contenidoPerm = new Contenido_Perm();
$timestamp = date('Y-m-d H:i:s');
$idcatart = '0';
@ -539,7 +530,7 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
$iTmpClient = $this->db->f('idclient');
$iTmpLang = $this->db->f('idlang');
if ($perm->have_perm_client_lang($iTmpClient, $iTmpLang)) {
if ($contenidoPerm->have_perm_client_lang($iTmpClient, $iTmpLang)) {
$client = $iTmpClient;
$lang = $iTmpLang;
$bFound = true;
@ -564,7 +555,7 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
return;
}
$idaction = $perm->getIDForAction('login');
$idaction = $contenidoPerm->getIDForAction('login');
$lastentry = $this->db->nextid($cfg['tab']['actionlog']);
$sql = "INSERT INTO
@ -584,9 +575,12 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
}
public function auth_validatelogin() {
$uid = null;
$perm = null;
$pass = null;
global $username, $password, $challenge, $response, $formtimestamp, $auth_handlers;
$gperm = array();
$gperm = [];
if ($password == '') {
return false;
@ -621,11 +615,9 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
$pass = $this->db->f('password'); ## Password is stored as a md5 hash
$bInMaintenance = false;
if ($sMaintenanceMode == 'enabled') {
#sysadmins are allowed to login every time
if (!preg_match('/sysadmin/', $perm)) {
$bInMaintenance = true;
}
#sysadmins are allowed to login every time
if ($sMaintenanceMode == 'enabled' && !preg_match('/sysadmin/', $perm)) {
$bInMaintenance = true;
}
if ($bInMaintenance) {
@ -634,14 +626,11 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
unset($pass);
}
if (is_array($auth_handlers) && !$bInMaintenance) {
if (array_key_exists($pass, $auth_handlers)) {
$success = call_user_func($auth_handlers[$pass], $username, $password);
if ($success) {
$uid = md5($username);
$pass = md5($password);
}
if (is_array($auth_handlers) && !$bInMaintenance && array_key_exists($pass, $auth_handlers)) {
$success = call_user_func($auth_handlers[$pass], $username, $password);
if ($success) {
$uid = md5($username);
$pass = md5($password);
}
}
}
@ -663,9 +652,7 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
$gperm[] = $this->db->f('perms');
}
if (is_array($gperm)) {
$perm = implode(',', $gperm);
}
$perm = implode(',', $gperm);
if ($response == '') { ## True when JS is disabled
if (md5($password) != $pass) { ## md5 hash for non-JavaScript browsers
@ -717,8 +704,6 @@ class Contenido_Frontend_Challenge_Crypt_Auth extends Auth {
global $password;
if ($password == '') {
/* Stay as nobody when an empty password is passed */
$uid = $this->auth['uname'] = $this->auth['uid'] = 'nobody';
return false;
}
@ -735,13 +720,18 @@ class Contenido_Frontend_Challenge_Crypt_Auth extends Auth {
}
public function auth_validatelogin() {
$perm = null;
$gperm = [];
$pass = null;
global $username, $password, $challenge, $response, $auth_handlers, $client;
$client = (int) $client;
if (isset($username)) {
$this->auth['uname'] = $username; ## This provides access for 'loginform.ihtml'
} else if ($this->nobody) { ## provides for 'default login cancel'
$this->auth['uname'] = $username;
## This provides access for 'loginform.ihtml'
} elseif ($this->nobody) {
## provides for 'default login cancel'
$uid = $this->auth['uname'] = $this->auth['uid'] = 'nobody';
return $uid;
}
@ -767,13 +757,11 @@ class Contenido_Frontend_Challenge_Crypt_Auth extends Auth {
$perm = $this->db->f('perms');
$pass = $this->db->f('password'); ## Password is stored as a md5 hash
if (is_array($auth_handlers)) {
if (array_key_exists($pass, $auth_handlers)) {
$success = call_user_func($auth_handlers[$pass], $username, $password);
if ($success) {
$uid = md5($username);
$pass = md5($password);
}
if (is_array($auth_handlers) && array_key_exists($pass, $auth_handlers)) {
$success = call_user_func($auth_handlers[$pass], $username, $password);
if ($success) {
$uid = md5($username);
$pass = md5($password);
}
}
}
@ -795,9 +783,7 @@ class Contenido_Frontend_Challenge_Crypt_Auth extends Auth {
$gperm[] = $this->db->f('perms');
}
if (is_array($gperm)) {
$perm = implode(',', $gperm);
}
$perm = implode(',', $gperm);
}
}
@ -836,16 +822,16 @@ function register_auth_handler($aHandlers) {
global $auth_handlers;
if (!is_array($auth_handlers)) {
$auth_handlers = array();
$auth_handlers = [];
}
if (!is_array($aHandlers)) {
$aHandlers = Array($aHandlers);
$aHandlers = [$aHandlers];
}
foreach ($aHandlers as $sHandler) {
if (!in_array($sHandler, $auth_handlers)) {
$auth_handlers[md5($sHandler)] = $sHandler;
foreach ($aHandlers as $aHandler) {
if (!in_array($aHandler, $auth_handlers)) {
$auth_handlers[md5($aHandler)] = $aHandler;
}
}
}

Datei anzeigen

@ -232,8 +232,8 @@ class Contenido_Perm {
return true;
} elseif ($item_rights[$area] != "noright") {
$groupsForUser = $this->getGroupsForUser($auth->auth[uid]);
$groupsForUser[] = $auth->auth[uid];
$groupsForUser = $this->getGroupsForUser($auth->auth['uid']);
$groupsForUser[] = $auth->auth['uid'];
$tmp_userstring = implode("','", $groupsForUser);
@ -596,8 +596,8 @@ class Contenido_Perm {
}
} elseif ($item_rights[$value] != "noright") {
$groupsForUser = $this->getGroupsForUser($auth->auth[uid]);
$groupsForUser[] = $auth->auth[uid];
$groupsForUser = $this->getGroupsForUser($auth->auth['uid']);
$groupsForUser[] = $auth->auth['uid'];
//else search for rights for this user in this area
$sql = "SELECT

Datei anzeigen

@ -35,8 +35,8 @@ if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
$_PHPLIB = array();
$_PHPLIB['libdir'] = str_replace ('\\', '/', dirname(__FILE__) . '/');
$_PHPLIB = [];
$_PHPLIB['libdir'] = str_replace ('\\', '/', __DIR__ . '/');
global $cfg;

Datei anzeigen

@ -318,12 +318,12 @@ class cSession {
break;
case "object":
## $$var is an object. Enumerate the slots and serialize them.
eval("\$k = \$${var}->classname; \$l = reset(\$${var}->persistent_slots);");
eval("\$k = \${$var}->classname; \$l = reset(\${$var}->persistent_slots);");
$str.="\$$var = new $k; ";
while ($l) {
## Structural recursion.
$this->serialize($var . "->" . $l, $str);
eval("\$l = next(\$${var}->persistent_slots);");
eval("\$l = next(\${$var}->persistent_slots);");
}
break;

Datei anzeigen

@ -1,4 +0,0 @@
[Dolphin]
Timestamp=2016,9,20,14,42,23
Version=3
ViewMode=1

Datei anzeigen

@ -330,13 +330,9 @@ if( sizeof($_GET) == 0 && isset($_POST['save_search']) )
// STORED SEARCH HAS BEEN CALLED
elseif( sizeof($_GET) > 0)
{
$itemtypeReq = $_GET['itemtype'];
$itemidReq = $_GET['itemid'];
// Do we have the request parameters we need to fetch search values of stored search ?
if( (isset($itemtypeReq) && strlen($itemtypeReq)>0) &&
(isset($itemidReq) && strlen($itemidReq)>0)
)
{
$itemtypeReq = (isset($itemtypeReq))?$_GET['itemtype']:'';
$itemidReq = (isset($itemidReq))?$_GET['itemid']:'';
if(strlen($itemtypeReq) > 0 && strlen($itemidReq) > 0) {
$searchResults = getSearchResults($itemidReq, $itemtypeReq);
$sSearchStr_tmp = $searchResults[$save_title];
$iSearchID_tmp = $searchResults[$save_id];
@ -403,13 +399,13 @@ if ($iSearchID_tmp > 0) {
}
// Date
if ($sSearchStrDateType_tmp != 'n/a') {
if (($sSearchStrDateFromDay_tmp > 0) && ($sSearchStrDateFromMonth_tmp > 0) && ($sSearchStrDateFromYear_tmp > 0)) {
if (!empty($sSearchStrDateFromDay_tmp) && !empty($sSearchStrDateFromMonth_tmp) && !empty($sSearchStrDateFromYear_tmp)) {
$sSearchStrDateFrom = $sSearchStrDateFromYear_tmp.'-'.$sSearchStrDateFromMonth_tmp.'-'.$sSearchStrDateFromDay_tmp.' 00:00:00';
} else {
$sSearchStrDateFrom = '';
}
if (($sSearchStrDateToDay_tmp > 0) && ($sSearchStrDateToMonth_tmp > 0) && ($sSearchStrDateToYear_tmp > 0)) {
if (!empty($sSearchStrDateToDay_tmp) && !empty($sSearchStrDateToMonth_tmp) && !empty($sSearchStrDateToYear_tmp)) {
$sSearchStrDateTo = $sSearchStrDateToYear_tmp.'-'.$sSearchStrDateToMonth_tmp.'-'.$sSearchStrDateToDay_tmp.' 23:59:59';
} else {
$sSearchStrDateTo = '';
@ -559,8 +555,8 @@ if (empty($where) || $iAffectedRows <= 0) {
#Check rights per cat
if (!$check_rights) {
//hotfix timo trautmann 2008-12-10 also check rights in associated groups
$aGroupsForUser = $perm->getGroupsForUser($auth->auth[uid]);
$aGroupsForUser[] = $auth->auth[uid];
$aGroupsForUser = $perm->getGroupsForUser($auth->auth['uid']);
$aGroupsForUser[] = $auth->auth['uid'];
$sTmpUserString = implode("','", $aGroupsForUser);
#Check if any rights are applied to current user or his groups
@ -623,7 +619,9 @@ if (empty($where) || $iAffectedRows <= 0) {
// fuer den ersten gefundenen Artikel die Werte fuer CategoryID und TemplateID merken
if ($i == 0) {
$iIDCat = $idcat;
$iIDTpl = $idtpl;
if(!empty($idtpl)) {
$iIDTpl = $idtpl;
}
}
/* Funktion zum umwandeln in Startartikel/normale Artikel*/
@ -637,8 +635,10 @@ if (empty($where) || $iAffectedRows <= 0) {
}
} else {
if( $startidartlang == $idartlang ) {
$sFlagTitle = i18n('Flag as normal article');
$makeStartarticle = "<td nowrap=\"nowrap\" class=\"bordercell\"><img src=\"images/isstart1.gif\" border=\"0\" title=\"{$sFlagTitle}\" alt=\"{$sFlagTitle}\"></td>";
} else {
$sFlagTitle = i18n('Flag as start article');
$makeStartarticle = "<td nowrap=\"nowrap\" class=\"bordercell\"><img src=\"images/isstart0.gif\" border=\"0\" title=\"{$sFlagTitle}\" alt=\"{$sFlagTitle}\"></td>";
}
}
@ -703,7 +703,7 @@ if (empty($where) || $iAffectedRows <= 0) {
}
if ($perm->have_perm_area_action_item("con", "con_deleteart",$idcat)) {
$delete = "<a href=\"javascript://\" onclick=\"box.confirm(&quot;$sDeleteArticle&quot;, &quot;$sDeleteArticleQuestion:<br><br><b>$db->f('title')</b>&quot;, &quot;deleteArticle($idart,$idcat)&quot;)\" title=\"$sDeleteArticle\"><img src=\"images/delete.gif\" title=\"$sDeleteArticle\" alt=\"$sDeleteArticle\" border=\"0\"></a>";
$delete = "<a href=\"javascript://\" onclick=\"box.confirm(&quot;$sDeleteArticle&quot;, &quot;$sDeleteArticleQuestion:<br><br><b>".$db->f('title')."</b>&quot;, &quot;deleteArticle($idart,$idcat)&quot;)\" title=\"$sDeleteArticle\"><img src=\"images/delete.gif\" title=\"$sDeleteArticle\" alt=\"$sDeleteArticle\" border=\"0\"></a>";
}else {
$delete = "";
}
@ -717,8 +717,6 @@ if (empty($where) || $iAffectedRows <= 0) {
<td nowrap=\"nowrap\" class=\"bordercell\">$sTemplateName</td>
<td nowrap=\"nowrap\" class=\"bordercell\">
<a id=\"m1\" onclick=\"javascript:window.open('main.php?subject=$todoListeSubject&amp;area=todo&amp;frame=1&amp;itemtype=idart&amp;itemid=$idart&amp;contenido=$sSession', 'todo', 'scrollbars=yes, height=300, width=550');\" alt=\"$sReminder\" title=\"$sReminder\" href=\"#\"><img id=\"m2\" style=\"padding-left: 2px; padding-right: 2px;\" alt=\"$sReminder\" src=\"images/but_setreminder.gif\" border=\"0\"></a>
$properties
$tplconfig
$duplicate
$delete
</td>
@ -746,7 +744,7 @@ if (empty($where) || $iAffectedRows <= 0) {
# Save Search Parameters
###########################
if($bHit && sizeof($_GET) == 0 && isset($_POST) ) {
if(!empty($bHit) && sizeof($_GET) == 0 && isset($_POST) ) {
// Build form with hidden fields that contain all search parameters to be stored using generic db
$searchForm = '<form id="save_search" target="right_bottom" method="post" action="backend_search.php">';
// Meta for Contenido

Datei anzeigen

@ -0,0 +1,8 @@
<?php
namespace ConLite\Exceptions;
class Exception extends \Exception
{
}

Datei anzeigen

@ -0,0 +1,8 @@
<?php
namespace ConLite\Exceptions;
class FileNotFoundException extends RuntimeException
{
}

Datei anzeigen

@ -0,0 +1,8 @@
<?php
namespace ConLite\Exceptions;
class InvalidArgumentException extends LogicException
{
}

Datei anzeigen

@ -0,0 +1,8 @@
<?php
namespace ConLite\Exceptions;
class LogicException extends Exception
{
}

Datei anzeigen

@ -0,0 +1,8 @@
<?php
namespace ConLite\Exceptions;
class RuntimeException extends Exception
{
}

Datei anzeigen

@ -0,0 +1,8 @@
<?php
namespace ConLite\Frontend\Navigation;
class FrontendNavigation
{
}

Datei anzeigen

@ -0,0 +1,29 @@
<?php
namespace ConLite\GenericDb\Driver;
class GenericDbDriver
{
public $_sEncoding;
public $_oItemClassInstance;
public function setEncoding($sEncoding)
{
$this->_sEncoding = $sEncoding;
}
public function setItemClassInstance($oInstance)
{
$this->_oItemClassInstance = $oInstance;
}
public function buildJoinQuery($destinationTable, $destinationClass, $destinationPrimaryKey, $sourceClass, $primaryKey)
{
}
public function buildOperator($sField, $sOperator, $sRestriction)
{
}
}

Datei anzeigen

@ -1,51 +1,32 @@
<?php
/**
* Project:
* Contenido Content Management System
*
* Description:
* MySQL Driver for GenericDB
*
* Requirements:
* @con_php_req 5.0
*
*
* @package Contenido Backend classes
* @version 1.12
* @author Bjoern Behrens
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*
* {@internal
* created 2006-05-10
* modified 2008-05-23 Added Debug_DevNull and Debug_VisibleAdv
*
* $Id$
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
namespace ConLite\GenericDb\Driver\MySql;
class gdbMySQL extends gdbDriver {
use cCharacterConverter;
use ConLite\GenericDb\Driver\GenericDbDriver;
use Contenido_Security;
function buildJoinQuery($destinationTable, $destinationClass, $destinationPrimaryKey, $sourceClass, $primaryKey) {
class GenericDbDriverMySql extends GenericDbDriver
{
public $_oItemClassInstance;
public $_sEncoding;
function buildJoinQuery($destinationTable, $destinationClass, $destinationPrimaryKey, $sourceClass, $primaryKey)
{
// Build a regular LEFT JOIN
$field = "$destinationClass.$destinationPrimaryKey";
$tables = "";
$join = "LEFT JOIN $destinationTable AS $destinationClass ON " .
Contenido_Security::toString($sourceClass . "." . $primaryKey) . " = " .
Contenido_Security::toString($destinationClass . "." . $primaryKey);
Contenido_Security::toString($sourceClass . "." . $primaryKey) . " = " .
Contenido_Security::toString($destinationClass . "." . $primaryKey);
$where = "";
return array("field" => $field, "table" => $tables, "join" => $join, "where" => $where);
return ["field" => $field, "table" => $tables, "join" => $join, "where" => $where];
}
function buildOperator($sField, $sOperator, $sRestriction) {
function buildOperator($sField, $sOperator, $sRestriction)
{
$sOperator = strtolower($sOperator);
$sWhereStatement = "";
@ -88,14 +69,14 @@ class gdbMySQL extends gdbDriver {
$GLOBALS["_cCharTable"] = new cCharacterConverter;
}
$aliasSearch = array();
$aliasSearch = [];
$metaCharacters = array("*", "[", "]", "^", '$', "\\", "*", "'", '"', '+');
$metaCharacters = ["*", "[", "]", "^", '$', "\\", "*", "'", '"', '+'];
for ($i = 0; $i < strlen($sRestriction); $i ++) {
for ($i = 0; $i < strlen($sRestriction); $i++) {
$char = substr($sRestriction, $i, 1);
$aliases = array();
$aliases = [];
$aliases = array_merge($aliases, $GLOBALS["_cCharTable"]->fetchDiacriticCharactersForNormalizedChar($this->_sEncoding, $char));
$normalizedChars = $GLOBALS["_cCharTable"]->fetchNormalizedCharsForDiacriticCharacter($this->_sEncoding, $char);
@ -106,9 +87,9 @@ class gdbMySQL extends gdbDriver {
$aliases = array_merge($aliases, $normalizedChars);
if (count($aliases) > 0) {
if ($aliases !== []) {
$aliases[] = $char;
$allAliases = array();
$allAliases = [];
foreach ($aliases as $alias) {
$alias1 = $this->_oItemClassInstance->_inFilter($alias);
@ -119,8 +100,7 @@ class gdbMySQL extends gdbDriver {
$allAliases = array_unique($allAliases);
$aliasSearch[] = "(" . implode("|", $allAliases) . ")";
} else {
$addChars = array();
$addChars = [];
if (in_array($char, $metaCharacters)) {
@ -131,11 +111,7 @@ class gdbMySQL extends gdbDriver {
$vChar = $this->_oItemClassInstance->_inFilter($char);
if ($char != $vChar) {
if (in_array($vChar, $metaCharacters)) {
$addChars[] = "\\\\" . $vChar;
} else {
$addChars[] = $vChar;
}
$addChars[] = in_array($vChar, $metaCharacters) ? "\\\\" . $vChar : $vChar;
}
}
@ -144,7 +120,7 @@ class gdbMySQL extends gdbDriver {
}
$restriction = "'" . implode("", $aliasSearch) . "'";
$sWhereStatement = implode(" ", array($sField, "REGEXP", $restriction));
$sWhereStatement = implode(" ", [$sField, "REGEXP", $restriction]);
break;
case "fulltext":
@ -152,9 +128,9 @@ class gdbMySQL extends gdbDriver {
break;
case "in":
if (is_array($sRestriction)) {
$items = array();
$items = [];
foreach ($sRestriction as $key => $sRestrictionItem) {
foreach ($sRestriction as $sRestrictionItem) {
$items[] = "'" . $this->_oItemClassInstance->_inFilter($sRestrictionItem) . "'";
}
@ -163,14 +139,14 @@ class gdbMySQL extends gdbDriver {
$sRestriction = "'" . $sRestriction . "'";
}
$sWhereStatement = implode(" ", array($sField, "IN (", $sRestriction, ")"));
$sWhereStatement = implode(" ", [$sField, "IN (", $sRestriction, ")"]);
break;
case "notin":
if (is_array($sRestriction)) {
$items = array();
$items = [];
foreach ($sRestriction as $key => $sRestrictionItem) {
$items[] = "'" . $this->_oItemClassInstance->_inFilter($sRestrictionItem) . "'";
foreach ($sRestriction as $Restriction) {
$items[] = "'" . $this->_oItemClassInstance->_inFilter($Restriction) . "'";
}
$sRestriction = implode(", ", $items);
@ -178,17 +154,15 @@ class gdbMySQL extends gdbDriver {
$sRestriction = "'" . $sRestriction . "'";
}
$sWhereStatement = implode(" ", array($sField, "NOT IN (", $sRestriction, ")"));
$sWhereStatement = implode(" ", [$sField, "NOT IN (", $sRestriction, ")"]);
break;
default :
$sRestriction = "'" . $this->_oItemClassInstance->_inFilter($sRestriction) . "'";
$sWhereStatement = implode(" ", array($sField, $sOperator, $sRestriction));
$sWhereStatement = implode(" ", [$sField, $sOperator, $sRestriction]);
}
return $sWhereStatement;
}
}
?>
}

Datei anzeigen

@ -0,0 +1,515 @@
<?php
namespace ConLite\GenericDb;
use stdClass;
abstract class Item extends ItemBaseAbstract
{
/**
* @var string
*/
public $_lastSQL;
/**
* Storage of the source table to use for the user informations
* @var array
*/
public $values;
/**
* Storage of the fields which were modified, where the keys are the
* fieldnames and the values just simple booleans.
* @var array
*/
protected $modifiedValues;
/**
* Stores the old primary key, just in case somebody wants to change it
* @var string
*/
protected $oldPrimaryKey;
/**
* List of funcion names of the filters used when data is stored to the db.
* @var array
*/
protected $_arrInFilters = ['urlencode', 'clHtmlSpecialChars', 'addslashes'];
/**
* List of funcion names of the filtersused when data is retrieved from the db
* @var array
*/
protected $_arrOutFilters = ['stripslashes', 'htmldecode', 'urldecode'];
/**
* Class name of meta object
* @var string
*/
protected $_metaObject;
/**
* Constructor function
*
* @param string $sTable The table to use as information source
* @param string $sPrimaryKey The primary key to use
* @param int $iLifetime
*/
public function __construct($sTable = '', $sPrimaryKey = '', $iLifetime = 10)
{
parent::__construct($sTable, $sPrimaryKey, get_parent_class($this), $iLifetime);
}
function __destruct()
{
//print_r(self::$_oCache);
}
/**
* Loads an item by colum/field from the database.
*
* @param string $sField Specifies the field
* @param mixed $mValue Specifies the value
* @param bool $bSafe Use inFilter or not
* @return bool True if the load was successful
*/
public function loadBy($sField, mixed $mValue, $bSafe = true): bool
{
if ($bSafe) {
$mValue = $this->_inFilter($mValue);
}
if ($sField === $this->primaryKey) {
$aRecordSet = self::$_oCache->getItem($this->table . "_" . $mValue);
} else {
$aRecordSet = self::$_oCache->getItemByProperty($this->table . "_" . $sField, $mValue);
}
if ($aRecordSet) {
// entry in cache found, load entry from cache
$this->loadByRecordSet($aRecordSet);
return true;
}
// SQL-Statement to select by field
$sql = sprintf("SELECT * FROM `%s` WHERE %s = '%s'", $this->table, $sField, $mValue);
//$sql = $this->db->prepare($sql, $this->table, $sField, $mValue);
// Query the database
$this->db->query($sql);
$this->_lastSQL = $sql;
if ($this->db->num_rows() > 1) {
$sMsg = "Tried to load a single line with field $sField and value $mValue from "
. $this->table . " but found more than one row";
cWarning(__FILE__, __LINE__, $sMsg);
}
// Advance to the next record, return false if nothing found
if (!$this->db->next_record()) {
return false;
}
$this->loadByRecordSet($this->db->toArray());
return true;
}
/**
* Loads an item by passed where clause from the database.
* This function is expensive, since it executes allways a query to the database
* to retrieve the primary key, even if the record set is aleady cached.
* NOTE: Passed value has to be escaped before. This will not be done by this function.
*
* @param string $sWhere The where clause like 'idart = 123 AND idlang = 1'
* @return bool True if the load was successful
*/
protected function _loadByWhereClause($sWhere)
{
// SQL-Statement to select by whee clause
$sql = sprintf("SELECT %s AS pk FROM `%s` WHERE ", $this->primaryKey, $this->table) . $sWhere;
//$sql = $this->db->prepare($sql, $this->primaryKey, $this->table);
// Query the database
$this->db->query($sql);
$this->_lastSQL = $sql;
if ($this->db->num_rows() > 1) {
$sMsg = "Tried to load a single line with where clause '" . $sWhere . "' from "
. $this->table . " but found more than one row";
cWarning(__FILE__, __LINE__, $sMsg);
}
// Advance to the next record, return false if nothing found
if (!$this->db->next_record()) {
return false;
}
$id = $this->db->f('pk');
return $this->loadByPrimaryKey($id);
}
/**
* Loads an item by ID from the database.
*
* @param string $mValue Specifies the primary key value
* @return bool True if the load was successful
*/
public function loadByPrimaryKey($mValue)
{
$bSuccess = $this->loadBy($this->primaryKey, $mValue);
if (($bSuccess == true) && method_exists($this, '_onLoad')) {
$this->_onLoad();
}
return $bSuccess;
}
/**
* Loads an item by it's recordset.
*
* @param array $aRecordSet The recordset of the item
*/
public function loadByRecordSet(array $aRecordSet)
{
$this->values = $aRecordSet;
$this->oldPrimaryKey = $this->values[$this->primaryKey];
$this->virgin = false;
self::$_oCache->addItem($this->table . "_" . $this->oldPrimaryKey, $this->values);
}
/**
* Checks if a the item is already loaded.
* @return boolean
*/
public function isLoaded()
{
return !$this->virgin;
}
/**
* Function which is called whenever an item is loaded.
* Inherited classes should override this function if desired.
*
* @return void
*/
protected function _onLoad()
{
}
/**
* Gets the value of a specific field.
*
* @param string $sField Specifies the field to retrieve
* @return mixed Value of the field
*/
public function getField($sField)
{
if ($this->virgin == true) {
$this->lasterror = 'No item loaded';
return false;
}
return $this->_outFilter($this->values[$sField]);
}
/**
* Wrapper for getField (less to type).
*
* @param string $sField Specifies the field to retrieve
* @return mixed Value of the field
*/
public function get($sField)
{
return $this->getField($sField);
}
/**
* Sets the value of a specific field.
*
* @param string $sField Field name
* @param string $mValue Value to set
* @param bool $bSafe Flag to run defined inFilter on passed value
*/
public function setField($sField, $mValue, $bSafe = true): bool
{
if ($this->virgin == true) {
$this->lasterror = 'No item loaded';
return false;
}
$this->modifiedValues[$sField] = true;
if ($sField == $this->primaryKey) {
$this->oldPrimaryKey = $this->values[$sField];
}
$this->values[$sField] = $bSafe == true ? $this->_inFilter($mValue) : $mValue;
return true;
}
/**
* Shortcut to setField.
*
* @param string $sField Field name
* @param string $mValue Value to set
* @param bool $bSafe Flag to run defined inFilter on passed value
*/
public function set($sField, $mValue, $bSafe = true)
{
return $this->setField($sField, $mValue, $bSafe);
}
/**
* Stores the loaded and modified item to the database.
*
* @return bool
*/
public function store()
{
if (!$this->isLoaded()) {
$this->lasterror = 'No item loaded';
return false;
}
$sql = 'UPDATE `' . $this->table . '` SET ';
$first = true;
if (!is_array($this->modifiedValues)) {
return true;
}
foreach (array_keys($this->modifiedValues) as $key) {
if ($first == true) {
$sql .= "`$key` = '" . $this->values[$key] . "'";
$first = false;
} else {
$sql .= ", `$key` = '" . $this->values[$key] . "'";
}
}
$sql .= " WHERE " . $this->primaryKey . " = '" . $this->oldPrimaryKey . "'";
$this->db->query($sql);
$this->_lastSQL = $sql;
if ($this->db->affected_rows() > 0) {
self::$_oCache->addItem($this->table . "_" . $this->oldPrimaryKey, $this->values);
}
return $this->db->affected_rows() >= 1;
}
/**
* Returns current item data as an assoziative array.
*/
public function toArray(): array|false
{
if ($this->virgin == true) {
$this->lasterror = 'No item loaded';
return false;
}
$aReturn = [];
foreach (array_keys($this->values) as $field) {
$aReturn[$field] = $this->getField($field);
}
return $aReturn;
}
/**
* Returns current item data as an object.
*/
public function toObject(): stdClass|false
{
$return = $this->toArray();
return (false !== $return) ? (object)$return : $return;
}
/**
* Sets a custom property.
*
* @param string $sType Specifies the type
* @param string $sName Specifies the name
* @param mixed $mValue Specifies the value
* @return bool
*/
public function setProperty($sType, $sName, mixed $mValue)
{
// If this object wasn't loaded before, return false
if ($this->virgin == true) {
$this->lasterror = 'No item loaded';
return false;
}
// Set the value
$oProperties = $this->_getPropertiesCollectionInstance();
return $oProperties->setValue(
$this->primaryKey, $this->get($this->primaryKey), $sType, $sName, $mValue
);
}
/**
* Returns a custom property.
*
* @param string $sType Specifies the type
* @param string $sName Specifies the name
* @return mixed Value of the given property or false
*/
public function getProperty($sType, $sName)
{
// If this object wasn't loaded before, return false
if ($this->virgin == true) {
$this->lasterror = 'No item loaded';
return false;
}
// Return the value
$oProperties = $this->_getPropertiesCollectionInstance();
return $oProperties->getValue(
$this->primaryKey, $this->get($this->primaryKey), $sType, $sName
);
}
/**
* Deletes a custom property.
*
* @param string $sType Specifies the type
* @param string $sName Specifies the name
* @return bool
*/
public function deleteProperty($sType, $sName)
{
// If this object wasn't loaded before, return false
if ($this->virgin == true) {
$this->lasterror = 'No item loaded';
return false;
}
// Delete the value
$oProperties = $this->_getPropertiesCollectionInstance();
return $oProperties->deleteValue(
$this->primaryKey, $this->get($this->primaryKey), $sType, $sName
);
}
/**
* Deletes a custom property by its id.
*
* @param int $idprop Id of property
* @return bool
*/
public function deletePropertyById($idprop)
{
$oProperties = $this->_getPropertiesCollectionInstance();
return $oProperties->delete($idprop);
}
/**
* Deletes the current item
*
* @return void
*/
// Method doesn't work, remove in future versions
// function delete()
// {
// $this->_collectionInstance->delete($item->get($this->primaryKey));
//}
/**
* Define the filter functions used when data is being stored or retrieved
* from the database.
*
* Examples:
* <pre>
* $obj->setFilters(array('addslashes'), array('stripslashes'));
* $obj->setFilters(array('htmlencode', 'addslashes'), array('stripslashes', 'htmlencode'));
* </pre>
*
* @param array $aInFilters Array with function names
* @param array $aOutFilters Array with function names
*
* @return void
*/
public function setFilters($aInFilters = [], $aOutFilters = [])
{
$this->_arrInFilters = $aInFilters;
$this->_arrOutFilters = $aOutFilters;
}
/**
* Filters the passed data using the functions defines in the _arrInFilters array.
*
* @param mixed $mData Data to filter
* @return mixed Filtered data
* @see setFilters
*
* @todo This method is used from public scope, but it should be protected
*
*/
public function _inFilter(mixed $mData)
{
if (is_numeric($mData) || is_array($mData)) {
return $mData;
}
if (is_null($mData)) {
$mData = '';
}
foreach ($this->_arrInFilters as $_arrInFilter) {
if (function_exists($_arrInFilter)) {
$mData = $_arrInFilter($mData);
}
}
return $mData;
}
/**
* Filters the passed data using the functions defines in the _arrOutFilters array.
*
* @param mixed $mData Data to filter
* @return mixed Filtered data
* @see setFilters
*
*/
protected function _outFilter(mixed $mData)
{
if (is_numeric($mData))
return $mData;
foreach ($this->_arrOutFilters as $_arrOutFilter) {
if (function_exists($_arrOutFilter)) {
$mData = $_arrOutFilter($mData);
}
}
return $mData;
}
protected function _setMetaObject($sObjectName)
{
$this->_metaObject = $sObjectName;
}
public function getMetaObject()
{
global $_metaObjectCache;
if (!is_array($_metaObjectCache)) {
$_metaObjectCache = [];
}
$sClassName = $this->_metaObject;
$qclassname = strtolower($sClassName);
if (array_key_exists($qclassname, $_metaObjectCache) && is_object($_metaObjectCache[$qclassname])) {
if (strtolower($_metaObjectCache[$qclassname]::class) === $qclassname) {
$_metaObjectCache[$qclassname]->setPayloadObject($this);
return $_metaObjectCache[$qclassname];
}
}
if (class_exists($sClassName)) {
$_metaObjectCache[$qclassname] = new $sClassName($this);
return $_metaObjectCache[$qclassname];
}
}
}

Datei anzeigen

@ -1,12 +1,16 @@
<?php
/**
*
*/
namespace ConLite\GenericDb;
// security check
defined('CON_FRAMEWORK') or die('Illegal call');
abstract class cItemBaseAbstract {
use DB_ConLite;
use PropertyCollection;
abstract class ItemBaseAbstract
{
/**
* Database instance, contains the database object
@ -29,9 +33,9 @@ abstract class cItemBaseAbstract {
/**
* Item cache instance
* @var Contenido_ItemCache
* @var ItemCache
*/
protected static $_oCache;
protected static ItemCache $_oCache;
/**
* GenericDB settings, see $cfg['sql']
@ -85,17 +89,17 @@ abstract class cItemBaseAbstract {
* @var string
*/
protected $_className;
protected $_bDebug;
/**
* Sets some common properties
*
* @param string $sTable Name of table
* @param string $sPrimaryKey Primary key of table
* @param string $sClassName Name of parent class
* @param int $iLifetime Lifetime of the object in seconds (NOT USED!)
* @throws Contenido_ItemException If table name or primary key is not set
* @param string $sTable Name of table
* @param string $sPrimaryKey Primary key of table
* @param string $sClassName Name of parent class
* @param int $iLifetime Lifetime of the object in seconds (NOT USED!)
* @throws ItemException
*/
protected function __construct($sTable, $sPrimaryKey, $sClassName, $iLifetime = 10) {
global $cfg;
@ -104,17 +108,17 @@ abstract class cItemBaseAbstract {
if ($sTable == '') {
$sMsg = "$sClassName: No table specified. Inherited classes *need* to set a table";
throw new Contenido_ItemException($sMsg);
throw new ItemException($sMsg);
} elseif ($sPrimaryKey == '') {
$sMsg = "No primary key specified. Inherited classes *need* to set a primary key";
throw new Contenido_ItemException($sMsg);
throw new ItemException($sMsg);
}
$this->_settings = $cfg['sql'];
// instanciate caching
$aCacheOpt = (isset($this->_settings['cache'])) ? $this->_settings['cache'] : array();
self::$_oCache = cItemCache::getInstance($sTable, $aCacheOpt);
self::$_oCache = ItemCache::getInstance($sTable, $aCacheOpt);
$this->table = $sTable;
$this->primaryKey = $sPrimaryKey;
@ -159,6 +163,4 @@ abstract class cItemBaseAbstract {
return $this->properties;
}
}
?>
}

Datei anzeigen

@ -1,30 +1,25 @@
<?php
/**
*
*/
namespace ConLite\GenericDb;
// security check
defined('CON_FRAMEWORK') or die('Illegal call');
class cItemCache {
class ItemCache
{
/**
* List of self instances (Contenido_ItemCache)
* @var array
*/
protected static $_oInstances = array();
protected static $_oInstances = [];
/**
* Assoziative cache array
* @var array
*/
protected $_aItemsCache = array();
/**
* Table name for current instance
* @var string
*/
protected $_sTable = '';
protected $_aItemsCache = [];
/**
* Max number of items to cache
@ -41,18 +36,17 @@ class cItemCache {
/**
* Contructor of Contenido_ItemCache
* @param string $sTable Table name
* @param string $_sTable Table name
* @param array $aOptions Options array as follows:
* - $aOptions['max_items_to_cache'] = (int) Number of items to cache
* - $aOptions['enable'] = (bool) Flag to enable caching
*/
protected function __construct($sTable, array $aOptions = array()) {
$this->_sTable = $sTable;
protected function __construct(protected $_sTable, array $aOptions = []) {
if (isset($aOptions['max_items_to_cache']) && (int) $aOptions['max_items_to_cache'] > 0) {
$this->_iMaxItemsToCache = (int) $aOptions['max_items_to_cache'];
}
if (isset($aOptions['enable']) && is_bool($aOptions['enable'])) {
$this->_bEnable = (bool) $aOptions['enable'];
$this->_bEnable = $aOptions['enable'];
}
if (isset($_GET['frame']) && is_numeric($_GET['frame'])) {
@ -62,13 +56,6 @@ class cItemCache {
}
}
/**
* Prevent cloning
*/
protected function __clone() {
}
/**
* Returns item cache instance, creates it, if not done before.
* Works as a singleton for one specific table.
@ -78,7 +65,7 @@ class cItemCache {
* - $aOptions['max_items_to_cache'] = (int) Number of items to cache
* - $aOptions['enable'] = (bool) Flag to enable caching
*/
public static function getInstance($sTable, array $aOptions = array()) {
public static function getInstance($sTable, array $aOptions = []) {
if (!isset(self::$_oInstances[$sTable])) {
self::$_oInstances[$sTable] = new self($sTable, $aOptions);
}
@ -96,11 +83,8 @@ class cItemCache {
/**
* Returns existing entry from cache by it's id.
*
* @param mixed $mId
* @return array|null
*/
public function getItem($mId) {
public function getItem(mixed $mId): ?array {
if (!$this->_bEnable) {
return null;
}
@ -114,19 +98,15 @@ class cItemCache {
/**
* Returns existing entry from cache by matching propery value.
*
* @param mixed $mProperty
* @param mixed $mValue
* @return array|null
*/
public function getItemByProperty($mProperty, $mValue) {
public function getItemByProperty(mixed $mProperty, mixed $mValue): ?array {
if (!$this->_bEnable) {
return null;
}
// loop thru all cached entries and try to find a entry by it's property
if (is_array($this->_aItemsCache[$this->_iFrame]) && count($this->_aItemsCache[$this->_iFrame]) > 0) {
foreach ($this->_aItemsCache[$this->_iFrame] as $id => $aEntry) {
if (is_array($this->_aItemsCache[$this->_iFrame]) && $this->_aItemsCache[$this->_iFrame] !== []) {
foreach ($this->_aItemsCache[$this->_iFrame] as $aEntry) {
if (isset($aEntry[$mProperty]) && $aEntry[$mProperty] == $mValue) {
return $aEntry;
}
@ -139,28 +119,23 @@ class cItemCache {
* Returns existing entry from cache by matching properties and their values.
*
* @param array $aProperties Assoziative key value pairs
* @return array|null
*/
public function getItemByProperties(array $aProperties) {
public function getItemByProperties(array $aProperties): ?array {
if (!$this->_bEnable) {
return null;
}
// loop thru all cached entries and try to find a entry by it's property
foreach ($this->_aItemsCache as $id => $aEntry) {
foreach ($this->_aItemsCache as $_aItemCache) {
$mFound = null;
foreach ($aProperties as $key => $value) {
if (isset($aEntry[$key]) && $aEntry[$key] == $value) {
if (null === $mFound) {
$mFound = true;
}
if (isset($_aItemCache[$key]) && $_aItemCache[$key] == $value) {
$mFound = true;
} else {
$mFound = false;
break;
}
if (true === $mFound) {
return $aEntry;
}
return $_aItemCache;
}
}
return null;
@ -169,11 +144,10 @@ class cItemCache {
/**
* Adds passed item data to internal cache
*
* @param mixed $mId
* @param array $aData Usually the recordset
* @return void
*/
public function addItem($mId, array $aData) {
public function addItem(mixed $mId, array $aData) {
if (!$this->_bEnable) {
return null;
}
@ -181,7 +155,7 @@ class cItemCache {
if (isset($this->_aItemsCache[$this->_iFrame])) {
$aTmpItemsArray = $this->_aItemsCache[$this->_iFrame];
if ($this->_iMaxItemsToCache == count($aTmpItemsArray)) {
if ($this->_iMaxItemsToCache == (is_countable($aTmpItemsArray) ? count($aTmpItemsArray) : 0)) {
// we have reached the maximum number of cached items, remove first entry
$firstEntryKey = array_shift($aTmpItemsArray);
if (is_array($firstEntryKey))
@ -197,10 +171,9 @@ class cItemCache {
/**
* Removes existing cache entry by it's key
*
* @param mixed $mId
* @return void
*/
public function removeItem($mId) {
public function removeItem(mixed $mId) {
if (!$this->_bEnable) {
return null;
}
@ -211,4 +184,4 @@ class cItemCache {
}
}
}
}

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -0,0 +1,9 @@
<?php
namespace ConLite\GenericDb;
use Exception;
class ItemException extends Exception {
}

Datei anzeigen

@ -0,0 +1,7 @@
<?php
namespace ConLite\Html;
class Html extends HtmlCommon
{
}

Datei anzeigen

@ -0,0 +1,42 @@
<?php
namespace ConLite\Html;
abstract class HtmlCommon implements \ArrayAccess
{
protected string|array|null $attributes = null;
public function __construct(array|string|null $attributes = null)
{
$this->attributes = $attributes;
}
#[\ReturnTypeWillChange]
public function offsetExists(mixed $offset): bool
{
return isset($this->attributes[strtolower($offset)]);
}
#[\ReturnTypeWillChange]
public function offsetGet(mixed $offset)
{
return $this->getAttribute($offset);
}
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value): void
{
if (null !== $offset) {
$this->setAttribute($offset, $value);
} else {
$this->setAttribute($value);
}
}
#[\ReturnTypeWillChange]
public function offsetUnset($offset): void
{
$this->removeAttribute($offset);
}
}

306
conlite/classes/Log/Log.php Normale Datei
Datei anzeigen

@ -0,0 +1,306 @@
<?php
namespace ConLite\Log;
use ConLite\Exceptions\InvalidArgumentException;
use cString;
use ReflectionClass;
class Log
{
/**
* logging level
*
* @var int
*/
const EMERG = 0;
/**
* logging level
*
* @var int
*/
const ALERT = 1;
/**
* logging level
*
* @var int
*/
const CRIT = 2;
/**
* logging level
*
* @var int
*/
const ERR = 3;
/**
* logging level
*
* @var int
*/
const WARN = 4;
/**
* logging level
*
* @var int
*/
const NOTICE = 5;
/**
* logging level
*
* @var int
*/
const INFO = 6;
/**
* logging level
*
* @var int
*/
const DEBUG = 7;
protected $writer;
protected $shortcutHandlers = [];
protected $priorities = [];
protected $defaultPriorities = [];
protected $buffer = [];
/**
* @throws InvalidArgumentException
*/
public function __construct(LogWriter $writer = null)
{
$createWriter = false;
if(!$writer) {
$createWriter = true;
} elseif (!is_object($writer) || !($writer instanceof LogWriter)) {
cWarning(__FILE__, __LINE__, 'The passed class is not a subclass of ConLite LogWriter. Creating new one.');
$createWriter = true;
}
if($createWriter) {
$options = ['destination' => \cRegistry::getConfigValue('path', 'logs') . 'conlite.log'];
$writer = LogWriter::factory('File', $options);
}
$this->setWriter($writer);
$this->setShortcutHandler('%date', [$this, 'shDate']);
$this->setShortcutHandler('%level', [$this, 'shLevel']);
$this->setShortcutHandler('%message', [$this, 'shMessage']);
$this->getWriter()->setOption('log_format', '[%date] [%level] %message', false);
$reflection = new ReflectionClass($this);
$this->priorities = $this->defaultPriorities = array_flip($reflection->getConstants());
}
public function getWriter() {
return $this->writer;
}
public function setWriter(LogWriter $writer): void
{
$this->writer = $writer;
}
/**
* @throws InvalidArgumentException
*/
public function setShortcutHandler($shortcut, $handler): bool
{
if ($shortcut == '') {
throw new InvalidArgumentException('The shortcut name must not be empty.');
}
if (cString::getPartOfString($shortcut, 0, 1) == '%') {
$shortcut = cString::getPartOfString($shortcut, 1);
}
if (!is_callable($handler)) {
throw new InvalidArgumentException('The specified shortcut handler does not exist.');
}
if (array_key_exists($shortcut, $this->shortcutHandlers)) {
throw new InvalidArgumentException('The shortcut ' . $shortcut . ' is already in use!');
}
$this->shortcutHandlers[$shortcut] = $handler;
return true;
}
public function unsetShortcutHandler($shortcut)
{
if(!in_array($shortcut, $this->shortcutHandlers)) {
throw new InvalidArgumentException('The specified shortcut handler does not exist.');
}
unset($this->shortcutHandlers[$shortcut]);
return true;
}
public function buffer(string $message, $priority = null): void
{
$this->buffer[] = [$message, $priority];
}
public function commit(bool $clearBuffer = true)
{
if (count($this->buffer) == 0) {
cWarning(__FILE__, __LINE__, 'There are no buffered messages to commit.');
return false;
}
foreach ($this->buffer as $bufferInfo) {
$this->log($bufferInfo[0], $bufferInfo[1]);
}
if ($clearBuffer) {
$this->clearBuffer();
}
}
public function clearBuffer(): void
{
$this->buffer = [];
}
public function log(string $message, $priority = null): void
{
if ($priority && !is_int($priority) && in_array($priority, $this->priorities)) {
$priority = array_search($priority, $this->priorities);
}
if ($priority === null || !array_key_exists($priority, $this->priorities)) {
$priority = $this->getWriter()->getOption('default_priority');
}
$logMessage = $this->getWriter()->getOption('log_format');
$lineEnding = $this->getWriter()->getOption('line_ending');
foreach ($this->shortcutHandlers as $shortcut => $handler) {
if (cString::getPartOfString($shortcut, 0, 1) != '%') {
$shortcut = '%' . $shortcut;
}
$info = [
'message' => $message,
'priority' => $priority
];
$value = call_user_func($handler, $info);
$logMessage = str_replace($shortcut, $value, $logMessage);
}
$this->getWriter()->write($logMessage . $lineEnding, $priority);
}
/**
* @throws InvalidArgumentException
*/
public function addPriority(string $name, int $value): void
{
if ($name == '') {
throw new InvalidArgumentException('Priority name must not be empty.');
}
if (in_array($name, $this->priorities)) {
throw new InvalidArgumentException('The given priority name already exists.');
}
if (array_key_exists($value, $this->priorities)) {
throw new InvalidArgumentException('The priority value already exists.');
}
$this->priorities[$value] = $name;
}
/**
* @throws InvalidArgumentException
*/
public function removePriority(string $name): void
{
if ($name == '') {
throw new InvalidArgumentException('Priority name must not be empty.');
}
if (!in_array($name, $this->priorities)) {
throw new InvalidArgumentException('Priority name does not exist.');
}
if (in_array($name, $this->defaultPriorities)) {
throw new InvalidArgumentException('Removing default priorities is not allowed.');
}
$priorityIndex = array_search($name, $this->priorities);
unset($this->priorities[$priorityIndex]);
}
/**
* @throws InvalidArgumentException
*/
public function __call(string $method, array $arguments) {
$priorityName = cString::toUpperCase($method);
if (!in_array($priorityName, $this->priorities)) {
throw new InvalidArgumentException('The given priority ' . $priorityName . ' is not supported.');
}
$priorityIndex = array_search($priorityName, $this->priorities);
$this->log($arguments[0], $priorityIndex);
}
/**
* Shortcut Handler Date.
* Returns the current date.
*
* @return string
* The current date
*/
public function shDate(): string
{
return date('Y-m-d H:i:s');
}
/**
* Shortcut Handler Level.
* Returns the canonical name of the priority.
* The canonical name is padded to 10 characters to achieve a better
* formatting.
*
* @param array $info
* @return string
* The canonical log level
*/
public function shLevel(array $info): string
{
$logLevel = $info['priority'];
return str_pad($this->priorities[$logLevel], 10, ' ', STR_PAD_BOTH);
}
/**
* Shortcut Handler Message.
* Returns the log message.
*
* @param array $info
* @return string
* The log message
*/
public function shMessage(array $info): string
{
return $info['message'];
}
}

Datei anzeigen

@ -0,0 +1,66 @@
<?php
namespace ConLite\Log;
use ConLite\Exceptions\InvalidArgumentException;
abstract class LogWriter
{
/**
* @param array $options
*/
public function __construct(
protected array $options = []
)
{
$this->setOptions($options);
$this->setOption('default_priority', Log::INFO, false);
$this->setOption('line_ending', PHP_EOL, false);
}
/**
* @throws invalidArgumentException
*/
public static function factory($writerName, array $writerOptions): LogWriter
{
$logWriterClassName = __NAMESPACE__ . '\\LogWriter' . ucfirst($writerName);
if(!class_exists($logWriterClassName)) {
throw new InvalidArgumentException('Unknown ConLite LogWriter class: ' . $logWriterClassName);
}
$writer = new $logWriterClassName($writerOptions);
if(!($writer instanceof LogWriter)) {
throw new InvalidArgumentException('Provided class is not an instance of ConLite LogWriter');
}
return $writer;
}
public function getOptions(): array
{
return $this->options;
}
public function getOption($option) {
return $this->options[$option];
}
public function setOptions(array $options): void
{
$this->options = $options;
}
public function setOption($option, $value, $force = false) {
if (!$force && isset($this->options[$option])) {
return;
}
$this->options[$option] = $value;
}
public function removeOption($option) {
unset($this->options[$option]);
}
abstract function write($message, $priority);
}

Datei anzeigen

@ -0,0 +1,135 @@
<?php
namespace ConLite\Log;
use ConLite\Exceptions\Exception;
use ConLite\Exceptions\FileNotFoundException;
use DirectoryIterator;
class LogWriterFile extends LogWriter
{
/**
* @var resource
*/
protected $handle = NULL;
/**
* @var int
*/
protected int $maxLogFileSize = 1024;
/**
* @var int
*/
protected int $maxRotationFiles = 10;
/**
* @throws FileNotFoundException
* @throws Exception
*/
public function __construct(array $options = []) {
parent::__construct($options);
$logFileSize = (int) getEffectiveSetting('log', 'writer-file-size-' . basename($this->getOption('destination')), $this->getOption('logFileSize') ?? 0);
if($logFileSize > 0) {
$this->maxLogFileSize = $logFileSize;
}
$this->createHandle();
}
/**
* @param string $message
* @param int $priority
* @return bool
*/
public function write($message, $priority): bool
{
$this->rotateLog();
return fwrite($this->handle, $message) != false;
}
public function __destruct()
{
$this->closeHandle();
}
/**
* @throws Exception
* @throws FileNotFoundException
*/
protected function createHandle(): void
{
$destination = $this->getOption('destination');
if ($destination == '') {
throw new Exception('No destination was specified.');
}
if (($this->handle = fopen($destination, 'a')) === false) {
throw new FileNotFoundException('Destination handle could not be created.');
}
}
protected function closeHandle(): void
{
fclose($this->handle);
}
protected function rotateLog()
{
$logfile = $this->getOption('destination');
if(!file_exists($logfile)) {
cWarning(__FILE__, __LINE__, 'Logfile ' . $logfile . ' not found.');
return false;
} elseif (!is_readable($logfile)) {
cWarning(__FILE__, __LINE__, 'Logfile ' . $logfile . ' not readable.');
return false;
}
if (filesize($logfile) >= $this->maxLogFileSize * 1024) {
$pathInfo = pathinfo($logfile);
$baseDirectory = $pathInfo['dirname'];
$baseName = $pathInfo['basename'];
$numMap = [];
foreach (new DirectoryIterator($baseDirectory) as $fileInfo) {
if ($fileInfo->isDot() || !$fileInfo->isFile()) {
continue;
}
if (preg_match('/^' . $baseName . '\.?([0-9]*)$/', $fileInfo->getFilename(), $matches)) {
$num = $matches[1];
$file2move = $fileInfo->getFilename();
if ($num == '') {
$num = 0;
}
$numMap[$num] = $file2move;
}
}
krsort($numMap);
foreach ($numMap as $num => $file2move) {
$targetN = $num + 1;
if($targetN > $this->maxRotationFiles) {
unlink($baseDirectory . DIRECTORY_SEPARATOR . $file2move);
continue;
}
rename($baseDirectory . DIRECTORY_SEPARATOR . $file2move, $baseDirectory . DIRECTORY_SEPARATOR .$baseName . '.' . $targetN);
}
return true;
}
return false;
}
public function getMaxLogFileSize(): int
{
return $this->maxLogFileSize;
}
public function setMaxLogFileSize(int $maxLogFileSize): void
{
$this->maxLogFileSize = $maxLogFileSize;
}
}

Datei anzeigen

@ -0,0 +1,8 @@
<?php
namespace ConLite\Log;
class ModuleLog extends Log
{
}

Datei anzeigen

@ -186,6 +186,8 @@ class Contenido_UrlBuilder_MR extends Contenido_UrlBuilder
// get pretty url parts
$oMRUrlStack = ModRewriteUrlStack::getInstance();
$aPretty = $oMRUrlStack->getPrettyUrlParts('front_content.php?' . $sQuery);
ModRewriteDebugger::add($aPretty, 'Contenido_UrlBuilder_MR::_buildUrl() getPrettyUrlParts');
// get all non contenido related query parameter
$sQuery = $this->_createUrlQueryPart($aParams);
@ -209,6 +211,9 @@ class Contenido_UrlBuilder_MR extends Contenido_UrlBuilder
$aParts[] = $sPath;
}
$sPath = implode('/', $aParts) . '/';
ModRewriteDebugger::add($aParts, 'Contenido_UrlBuilder_MR::_buildUrl() $aParts');
ModRewriteDebugger::add($sPath, 'Contenido_UrlBuilder_MR::_buildUrl() $sPath');
// get pagename part of the url
$sArticle = $this->_getArticleName($aPretty, $aParams);
@ -343,7 +348,7 @@ class Contenido_UrlBuilder_MR extends Contenido_UrlBuilder
*/
private function _getPath(array $aPretty)
{
$sPath = (isset($aPretty['urlpath'])) ? $aPretty['urlpath'] : '';
$sPath = (!empty($aPretty['urlpath'])) ? $aPretty['urlpath'] : '';
// check start directory settings
if ($this->_aMrCfg['startfromroot'] == 0 && (strlen($sPath) > 0)) {

Datei anzeigen

@ -36,7 +36,7 @@ class cApiUploadCollection extends ItemCollection {
public function sync($dir, $file) {
global $client;
if (strstr(strtolower($_ENV["OS"]), 'windows') === FALSE) {
if (!empty($_ENV["OS"]) && strstr(strtolower($_ENV["OS"]), 'windows') === FALSE) {
#Unix style OS distinguish between lower and uppercase file names, i.e. test.gif is not the same as Test.gif
$this->select("dirname = BINARY '$dir' AND filename = BINARY '$file' AND idclient = '$client'");
} else {

Datei anzeigen

@ -5,27 +5,22 @@
*
* Description:
* Base Class for all cHTML Elements
*
*
* @category ConLite
* @package Core
* @subpackage cHTML
* @version $Rev$
* @since 2.0
* @author Ortwin Pinke <o.pinke@conlite.org>
* @copyright (c) 2012, conlite.org
* @license http://www.gnu.de/documents/gpl.en.html GPL v3 (english version)
* @license http://www.gnu.de/documents/gpl.de.html GPL v3 (deutsche Version)
* @link http://www.conlite.org ConLite.org
*
* $Id$
*/
// security check
defined('CON_FRAMEWORK') or die('Illegal call');
if (!class_exists("HTML_Common2")) {
cInclude("pear", "HTML/Common2.php");
}
/* Global ID counter */
$cHTMLIDCount = 0;
@ -34,11 +29,12 @@ $cHTMLIDCount = 0;
*
* @author Ortwin Pinke <o.pinke@conlite.org>
*/
class cHTML extends HTML_Common2 {
class cHTML extends cHTML5Common
{
/**
* Storage of the open SGML tag template
* @var string
* @var string
*/
protected $_skeleton_open;
@ -62,15 +58,15 @@ class cHTML extends HTML_Common2 {
/**
* Defines the style definitions
* @var string
* @var array
*/
protected $_styledefs;
protected $_styledefs = [];
/**
* Defines all scripts which are required by the current element
* @var array
*/
protected $_requiredScripts;
protected $_requiredScripts = [];
/**
* @var boolean Defines if the current tag is a contentless tag
@ -80,31 +76,32 @@ class cHTML extends HTML_Common2 {
/**
* @var array Defines which JS events contain which scripts
*/
protected $_aEventDefinitions;
protected $_aEventDefinitions = [];
/**
* @var array Style definitions
*/
protected $_aStyleDefinitions;
* @var array Style definitions
*/
protected $_aStyleDefinitions = [];
/**
* @var string The content itself
*/
* @var string The content itself
*/
protected $_content;
protected $_aCfg;
/**
* Constructor Function
* Initializes the SGML open/close tags
*
* @param none
* @return void
*/
public function __construct() {
global $cfg;
$this->_aCfg = $cfg;
* Constructor Function
* Initializes the SGML open/close tags
*
* @param none
* @return void
*/
public function __construct()
{
$this->_aCfg = cRegistry::getConfig();
parent::__construct();
$this->_skeleton_open = '<%s%s>';
$this->_skeleton_close = '</%s>';
@ -113,50 +110,52 @@ class cHTML extends HTML_Common2 {
/* Cache the XHTML setting for performance reasons */
if (!is_array($this->_aCfg) || !array_key_exists("generate_xhtml", $this->_aCfg)) {
if (function_exists("getEffectiveSetting")) {
$bXhtml = (getEffectiveSetting("generator", "xhtml") == 'true'
|| getEffectiveSetting("generator", "xhtml") === TRUE)?true:false;
$bXhtml = (getEffectiveSetting("generator", "xhtml") == 'true'
|| getEffectiveSetting("generator", "xhtml") === TRUE) ? true : false;
$this->_aCfg["generate_xhtml"] = $bXhtml;
} else {
$this->_aCfg["generate_xhtml"] = false;
$this->_aCfg["generate_xhtml"] = false;
}
}
if($this->_aCfg["generate_xhtml"] === true) {
if ($this->_aCfg["generate_xhtml"] === true) {
$this->_skeleton_single = '<%s%s />';
} else {
$this->_skeleton_single = '<%s%s>';
}
$this->_styledefs = array ();
$this->_aStyleDefinitions = array();
$this->_styledefs = [];
$this->_aStyleDefinitions = [];
$this->setContentlessTag();
$this->advanceID();
$this->_requiredScripts = array ();
$this->_aEventDefinitions = array ();
$this->_requiredScripts = [];
$this->_aEventDefinitions = [];
}
/**
*
* @param type $contentlessTag
* @param type $contentlessTag
*/
public function setContentlessTag($contentlessTag = true) {
public function setContentlessTag($contentlessTag = true)
{
$this->_contentlessTag = $contentlessTag;
}
/**
* advances to the next ID available in the system.
*
*
* This function is useful if you need to use HTML elements
* in a loop, but don't want to re-create new objects each time.
*
* @return void
* @return void
*/
public function advanceID() {
public function advanceID()
{
global $cHTMLIDCount;
$cHTMLIDCount ++;
$this->updateAttributes(array ("id" => "m".$cHTMLIDCount));
$cHTMLIDCount++;
$this->updateAttributes(array("id" => "m" . $cHTMLIDCount));
}
/**
@ -164,24 +163,26 @@ class cHTML extends HTML_Common2 {
*
* @return string current ID
*/
public function getID() {
public function getID()
{
return $this->getAttribute("id");
}
/**
* setAlt: sets the alt and title attributes
*
* Sets the "alt" and "title" tags. Usually, "alt" is used
* Sets the "alt" and "title" tags. Usually, "alt" is used
* for accessibility and "title" for mouse overs.
*
*
* To set the text for all browsers for mouse over, set "alt"
* and "title". IE behaves incorrectly and shows "alt" on
* and "title". IE behaves incorrectly and shows "alt" on
* mouse over. Mozilla browsers only show "title" as mouse over.
*
* @param string $alt Text to set as the "alt" attribute
*/
public function setAlt($alt) {
$attributes = array ("alt" => $alt, "title" => $alt);
public function setAlt($alt)
{
$attributes = array("alt" => $alt, "title" => $alt);
$this->updateAttributes($attributes);
}
@ -190,8 +191,9 @@ class cHTML extends HTML_Common2 {
*
* @param string $class Text to set as the "id"
*/
public function setID($id) {
$this->updateAttributes(array ("id" => $id));
public function setID($id)
{
$this->updateAttributes(array("id" => $id));
}
/**
@ -199,8 +201,9 @@ class cHTML extends HTML_Common2 {
*
* @param string $class Text to set as the "class" attribute
*/
public function setClass($class) {
$this->updateAttributes(array ("class" => $class));
public function setClass($class)
{
$this->updateAttributes(array("class" => $class));
}
/**
@ -208,8 +211,9 @@ class cHTML extends HTML_Common2 {
*
* @param $class string Text to set as the "style" attribute
*/
public function setStyle($style) {
$this->updateAttributes(array ("style" => $style));
public function setStyle($style)
{
$this->updateAttributes(array("style" => $style));
}
/**
@ -221,11 +225,12 @@ class cHTML extends HTML_Common2 {
* @param $event string Type of the event
* @param $action string Function or action to call (JavaScript Code)
*/
public function setEvent($event, $action) {
public function setEvent($event, $action)
{
if (substr($event, 0, 2) != "on") {
$this->updateAttributes(array ("on".$event => $action));
$this->updateAttributes(array("on" . $event => $action));
} else {
$this->updateAttributes(array ($event => $action));
$this->updateAttributes(array($event => $action));
}
}
@ -237,9 +242,10 @@ class cHTML extends HTML_Common2 {
*
* @param $event string Type of the event
*/
public function unsetEvent($event) {
public function unsetEvent($event)
{
if (substr($event, 0, 2) != "on") {
$this->removeAttribute("on".$event);
$this->removeAttribute("on" . $event);
} else {
$this->removeAttribute($event);
}
@ -247,7 +253,7 @@ class cHTML extends HTML_Common2 {
/**
* fillSkeleton: Fills the open SGML tag skeleton
*
*
* fillSkeleton fills the SGML opener tag with the
* specified attributes. Attributes need to be passed
* in the stringyfied variant.
@ -255,11 +261,12 @@ class cHTML extends HTML_Common2 {
* @param $attributes string Attributes to set
* @return string filled SGML opener skeleton
*/
public function fillSkeleton($attributes) {
public function fillSkeleton($attributes)
{
if ($this->_contentlessTag == true) {
return sprintf($this->_skeleton_single, $this->_tag, $attributes);
} else {
return sprintf($this->_skeleton_open, $this->_tag, $attributes);
return is_null($this->_skeleton_open) ? '' : sprintf($this->_skeleton_open, $this->_tag, $attributes);
}
}
@ -269,63 +276,68 @@ class cHTML extends HTML_Common2 {
* @param none
* @return string filled SGML closer skeleton
*/
public function fillCloseSkeleton() {
return sprintf($this->_skeleton_close, $this->_tag);
public function fillCloseSkeleton()
{
return is_null($this->_skeleton_close) ? '' : sprintf($this->_skeleton_close, $this->_tag);
}
/**
* addStyleDefinition
*
* @deprecated name change, use attachStyleDefinition
* @param $entity string Entity to define
* @param $definition string Definition for the given entity
* @param $definition string Definition for the given entity
* @return string filled SGML closing skeleton
* @deprecated name change, use attachStyleDefinition
*/
public function setStyleDefinition($entity, $definition) {
public function setStyleDefinition($entity, $definition)
{
$this->_styledefs[$entity] = $definition;
}
/**
* attachStyleDefinition: Attaches a style definition.
*
*
* This function is not restricted to a single style, e.g.
* you can set multiple style definitions as-is to the handler.
*
*
* $example->attachStyle("myIdentifier",
* "border: 1px solid black; white-space: nowrap");
* "border: 1px solid black; white-space: nowrap");
* $example->attachStyle("myIdentifier2",
* "padding: 0px");
*
* "padding: 0px");
*
* Results in:
*
*
* style="border: 1px solid black; white-space: nowrap; padding: 0px;"
*
* @param $sName string Name for a style definition
* @param $sDefinition string Definition for the given entity
* @param $sName string Name for a style definition
* @param $sDefinition string Definition for the given entity
* @return string filled SGML closing skeleton
*/
public function attachStyleDefinition($sName, $sDefinition) {
public function attachStyleDefinition($sName, $sDefinition)
{
$this->_aStyleDefinitions[$sName] = $sDefinition;
}
/**
*
*
* @param string $script
*/
public function addRequiredScript($script) {
public function addRequiredScript($script)
{
if (!is_array($this->_requiredScripts)) {
$this->_requiredScripts = array ();
$this->_requiredScripts = [];
}
$this->_requiredScripts[] = $script;
$this->_requiredScripts = array_unique($this->_requiredScripts);
}
/**
*
*
* @param array $aAttributes
* @return array
*/
public function updateAttributes($aAttributes) {
public function updateAttributes($aAttributes)
{
return $this->mergeAttributes($aAttributes);
}
@ -335,20 +347,21 @@ class cHTML extends HTML_Common2 {
* @param $content string/object String with the content or an object to render.
*
*/
public function _setContent($content) {
public function _setContent($content)
{
$this->setContentlessTag(false);
/* Is it an array? */
if(is_array($content)) {
if (is_array($content)) {
unset ($this->_content);
$this->_content = "";
foreach($content as $item) {
if(is_object($item)) {
if(method_exists($item, "render")) {
foreach ($content as $item) {
if (is_object($item)) {
if (method_exists($item, "render")) {
$this->_content .= $item->render();
}
if(count($item->_requiredScripts) > 0) {
if (count($item->_requiredScripts) > 0) {
$this->_requiredScripts = array_merge($this->_requiredScripts, $item->_requiredScripts);
}
} else {
@ -356,12 +369,12 @@ class cHTML extends HTML_Common2 {
}
}
} else {
if(is_object($content)) {
if(method_exists($content, "render")) {
if (is_object($content)) {
if (method_exists($content, "render")) {
$this->_content = $content->render();
}
if(count($content->_requiredScripts) > 0) {
if (is_countable($content->_requiredScripts) && count($content->_requiredScripts) > 0) {
$this->_requiredScripts = array_merge($this->_requiredScripts, $content->_requiredScripts);
}
return;
@ -373,92 +386,95 @@ class cHTML extends HTML_Common2 {
/**
* attachEventDefinition: Attaches the code for an event
*
*
* Example to attach an onClick handler:
* setEventDefinition("foo", "onClick", "alert('foo');");
*
*
* @param $sName string defines the name of the event
* @param $sEvent string defines the event (e.g. onClick)
* @param $sCode string defines the code
*/
public function attachEventDefinition($sName, $sEvent, $sCode) {
public function attachEventDefinition($sName, $sEvent, $sCode)
{
$this->_aEventDefinitions[strtolower($sEvent)][$sName] = $sCode;
}
/**
* setAttribte: Sets a specific attribute
*
*
* @param $sAttributeName string Name of the attribute
* @param $sValue string Value of the attribute
*/
public function setAttribute($sAttributeName, $sValue = NULL) {
public function setAttribute($sAttributeName, $sValue = NULL)
{
$sAttributeName = strtolower($sAttributeName);
if (is_null($sValue)) {
$sValue = $sAttributeName;
}
$this->updateAttributes(array ($sAttributeName => $sValue));
$this->updateAttributes(array($sAttributeName => $sValue));
}
/**
*
*
* @return string
*/
public function __toString() {
public function __toString()
{
return $this->toHtml();
}
/**
* Renders the output
* If the tag
*/
public function toHTML() {
/* Fill style definition */
$style = $this->getAttribute("style");
/* If the style doesn't end with a semicolon, append one */
if(is_string($style)) {
$style = trim($style);
if (substr($style, strlen($style) - 1) != ";") {
$style .= ";";
}
}
foreach($this->_aStyleDefinitions as $sEntry) {
$style .= $sEntry;
if (substr($style, strlen($style) - 1) != ";") {
$style .= ";";
}
}
foreach($this->_aEventDefinitions as $sEventName => $sEntry) {
$aFullCode = array();
foreach ($sEntry as $sName => $sCode) {
$aFullCode[] = $sCode;
}
$this->setAttribute($sEventName, $this->getAttribute($sEventName).implode(" ", $aFullCode));
}
/* Apply all stored styles */
foreach ($this->_styledefs as $key => $value) {
$style .= "$key: $value;";
}
if ($style != "") {
$this->setStyle($style);
}
if ($this->_content != "" || $this->_contentlessTag == false) {
$attributes = $this->getAttributes(true);
return $this->fillSkeleton($attributes).$this->_content.$this->fillCloseSkeleton();
} else {
/* This is a single style tag */
$attributes = $this->getAttributes(true);
return $this->fillSkeleton($attributes);
}
}
/**
* Renders the output
* If the tag
*/
public function toHTML()
{
/* Fill style definition */
$style = $this->getAttribute("style");
/* If the style doesn't end with a semicolon, append one */
if (!empty($style) && is_string($style)) {
$style = trim($style);
if (substr($style, strlen($style) - 1) != ";") {
$style .= ";";
}
}
foreach ($this->_aStyleDefinitions as $sKey => $sEntry) {
$style .= $sKey . ': ' . $sEntry;
if (substr($style, strlen($style) - 1) != ";") {
$style .= ";";
}
}
/* Apply all stored styles */
foreach ($this->_styledefs as $key => $value) {
$style .= "$key: $value;";
}
if ($style != "") {
$this->setStyle($style);
}
foreach ($this->_aEventDefinitions as $sEventName => $sEntry) {
$aFullCode = [];
foreach ($sEntry as $sName => $sCode) {
$aFullCode[] = $sCode;
}
$this->setAttribute($sEventName, $this->getAttribute($sEventName) . implode(" ", $aFullCode));
}
if ($this->_content != "" || $this->_contentlessTag == false) {
$attributes = $this->getAttributes(true);
return $this->fillSkeleton($attributes) . $this->_content . $this->fillCloseSkeleton();
} else {
/* This is a single style tag */
$attributes = $this->getAttributes(true);
return $this->fillSkeleton($attributes);
}
}
/**
* render(): Alias for toHtml
@ -466,8 +482,8 @@ class cHTML extends HTML_Common2 {
* @param none
* @return string Rendered HTML
*/
public function render() {
public function render()
{
return $this->toHtml();
}
}
?>
}

Datei anzeigen

@ -6,17 +6,15 @@
* Description:
* cHTML Meta
*
* @category ConLite
* @package Core
* @subpackage cHTML
* @version $Rev$
* @since 2.0
* @author Ortwin Pinke <o.pinke@conlite.org>
* @copyright (c) 2015, conlite.org
* @license http://www.gnu.de/documents/gpl.en.html GPL v3 (english version)
* @license http://www.gnu.de/documents/gpl.de.html GPL v3 (deutsche Version)
* @link http://www.conlite.org ConLite.org
*
* $Id$
*/
// security check

Datei anzeigen

@ -0,0 +1,584 @@
<?php
/**
* @category ConLite
* @package Core
* @subpackage cHTML5
* @since 2.2
* @author Ortwin Pinke <o.pinke@conlite.org>
* @copyright (c) 2022, conlite.org
* @license http://www.gnu.de/documents/gpl.en.html GPL v3 (english version)
* @license http://www.gnu.de/documents/gpl.de.html GPL v3 (deutsche Version)
* @link http://www.conlite.org ConLite.org
*/
/*
* HTML_Common2: port of HTML_Common package to PHP5
*
* PHP version 5
*
* LICENSE:
*
* Copyright (c) 2004-2012, Alexey Borzov <avb@php.net>
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * The names of the authors may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @category HTML
* @package HTML_Common2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version SVN: $Id$
* @link http://pear.php.net/package/HTML_Common2
*/
/*
* Base class for HTML classes
*
* Implements methods for working with HTML attributes, parsing and generating
* attribute strings. Port of HTML_Common class for PHP4 originally written by
* Adam Daniel with contributions from numerous other developers.
*
* @category HTML
* @package HTML_Common2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version Release: 2.1.0
* @link http://pear.php.net/package/HTML_Common2
*/
abstract class cHTML5Common implements ArrayAccess
{
/**
* Associative array of attributes
* @var array
*/
protected $attributes = array();
/**
* Changes to attributes in this list will be announced via onAttributeChange()
* method rather than performed by HTML_Common2 class itself
* @var array
* @see onAttributeChange()
*/
protected $watchedAttributes = array();
/**
* Indentation level of the element
* @var int
*/
private $_indentLevel = 0;
/**
* Comment associated with the element
* @var string
*/
private $_comment = null;
/**
* Global options for all elements generated by subclasses of HTML_Common2
*
* Preset options are
* - 'charset': charset parameter used in htmlspecialchars() calls,
* defaults to 'ISO-8859-1'
* - 'indent': string used to indent HTML elements, defaults to "\11"
* - 'linebreak': string used to indicate linebreak, defaults to "\12"
*
* @var array
*/
private static $_options = array(
'charset' => 'ISO-8859-1',
'indent' => "\11",
'linebreak' => "\12"
);
/**
* Sets global option(s)
*
* @param string|array $nameOrOptions Option name or array ('option name' => 'option value')
* @param mixed $value Option value, if first argument is not an array
*/
public static function setOption($nameOrOptions, $value = null)
{
if (is_array($nameOrOptions)) {
foreach ($nameOrOptions as $k => $v) {
self::setOption($k, $v);
}
} else {
$linebreaks = array('win' => "\15\12", 'unix' => "\12", 'mac' => "\15");
if ('linebreak' == $nameOrOptions && isset($linebreaks[$value])) {
$value = $linebreaks[$value];
}
self::$_options[$nameOrOptions] = $value;
}
}
/**
* Returns global option(s)
*
* @param string $name Option name
*
* @return mixed Option value, null if option does not exist,
* array of all options if $name is not given
*/
public static function getOption($name = null)
{
if (null === $name) {
return self::$_options;
} else {
return isset(self::$_options[$name])? self::$_options[$name]: null;
}
}
/**
* Parses the HTML attributes given as string
*
* @param string $attrString HTML attribute string
*
* @return array An associative array of attributes
*/
protected static function parseAttributes($attrString)
{
$attributes = array();
if (preg_match_all(
"/(([A-Za-z_:]|[^\\x00-\\x7F])([A-Za-z0-9_:.-]|[^\\x00-\\x7F])*)" .
"([ \\n\\t\\r]+)?(=([ \\n\\t\\r]+)?(\"[^\"]*\"|'[^']*'|[^ \\n\\t\\r]*))?/",
$attrString,
$regs
)) {
for ($i = 0; $i < count($regs[1]); $i++) {
$name = trim($regs[1][$i]);
$check = trim($regs[0][$i]);
$value = trim($regs[7][$i]);
if ($name == $check) {
$attributes[strtolower($name)] = strtolower($name);
} else {
if (!empty($value) && ($value[0] == '\'' || $value[0] == '"')) {
$value = substr($value, 1, -1);
}
$attributes[strtolower($name)] = $value;
}
}
}
return $attributes;
}
/**
* Creates a valid attribute array from either a string or an array
*
* @param string|array $attributes Array of attributes or HTML attribute string
*
* @return array An associative array of attributes
*/
protected static function prepareAttributes($attributes)
{
$prepared = array();
if (is_string($attributes)) {
return self::parseAttributes($attributes);
} elseif (is_array($attributes)) {
foreach ($attributes as $key => $value) {
if (is_int($key)) {
$key = strtolower($value);
$prepared[$key] = $key;
} else {
$prepared[strtolower($key)] = (string)$value;
}
}
}
return $prepared;
}
/**
* Removes an attribute from an attribute array
*
* @param array &$attributes Attribute array
* @param string $name Name of attribute to remove
*/
protected static function removeAttributeArray(array &$attributes, $name)
{
unset($attributes[strtolower($name)]);
}
/**
* Creates HTML attribute string from array
*
* @param array $attributes Attribute array
*
* @return string Attribute string
*/
protected static function getAttributesString(array $attributes)
{
$str = '';
$charset = self::getOption('charset');
foreach ($attributes as $key => $value) {
$str .= ' ' . $key . '="' . htmlspecialchars($value, ENT_QUOTES, $charset) . '"';
}
return $str;
}
/**
* Class constructor, sets default attributes
*
* @param array|string $attributes Array of attribute 'name' => 'value' pairs
* or HTML attribute string
*/
public function __construct($attributes = null)
{
$this->mergeAttributes($attributes);
}
/**
* Sets the value of the attribute
*
* @param string $name Attribute name
* @param string $value Attribute value (will be set to $name if omitted)
*
* @return HTML_Common2
*/
public function setAttribute($name, $value = null)
{
$name = strtolower($name);
if (is_null($value)) {
$value = $name;
}
if (in_array($name, $this->watchedAttributes)) {
$this->onAttributeChange($name, $value);
} else {
$this->attributes[$name] = (string)$value;
}
return $this;
}
/**
* Returns the value of an attribute
*
* @param string $name Attribute name
*
* @return string|null Attribute value, null if attribute does not exist
*/
public function getAttribute($name)
{
$name = strtolower($name);
return isset($this->attributes[$name])? $this->attributes[$name]: '';
}
/**
* Sets the attributes
*
* @param string|array $attributes Array of attribute 'name' => 'value' pairs
* or HTML attribute string
*
* @return HTML_Common2
*/
public function setAttributes($attributes)
{
$attributes = self::prepareAttributes($attributes);
$watched = array();
foreach ($this->watchedAttributes as $watchedKey) {
if (isset($attributes[$watchedKey])) {
$this->setAttribute($watchedKey, $attributes[$watchedKey]);
unset($attributes[$watchedKey]);
} else {
$this->removeAttribute($watchedKey);
}
if (isset($this->attributes[$watchedKey])) {
$watched[$watchedKey] = $this->attributes[$watchedKey];
}
}
$this->attributes = array_merge($watched, $attributes);
return $this;
}
/**
* Returns the attribute array or string
*
* @param bool $asString Whether to return attributes as string
*
* @return array|string
*/
public function getAttributes($asString = false)
{
if ($asString) {
return self::getAttributesString($this->attributes);
} else {
return $this->attributes;
}
}
/**
* Merges the existing attributes with the new ones
*
* @param array|string $attributes Array of attribute 'name' => 'value' pairs
* or HTML attribute string
*
* @return HTML_Common2
*/
public function mergeAttributes($attributes)
{
$attributes = self::prepareAttributes($attributes);
foreach ($this->watchedAttributes as $watchedKey) {
if (isset($attributes[$watchedKey])) {
$this->onAttributeChange($watchedKey, $attributes[$watchedKey]);
unset($attributes[$watchedKey]);
}
}
$this->attributes = array_merge($this->attributes, $attributes);
return $this;
}
/**
* Removes an attribute
*
* @param string $attribute Name of attribute to remove
*
* @return HTML_Common2
*/
public function removeAttribute($attribute)
{
if (in_array(strtolower($attribute), $this->watchedAttributes)) {
$this->onAttributeChange(strtolower($attribute), null);
} else {
self::removeAttributeArray($this->attributes, $attribute);
}
return $this;
}
/**
* Sets the indentation level
*
* @param int $level Indentation level
*
* @return HTML_Common2
*/
public function setIndentLevel($level)
{
$level = intval($level);
if (0 <= $level) {
$this->_indentLevel = $level;
}
return $this;
}
/**
* Gets the indentation level
*
* @return int
*/
public function getIndentLevel()
{
return $this->_indentLevel;
}
/**
* Returns the string to indent the element
*
* @return string
*/
protected function getIndent()
{
return str_repeat(self::getOption('indent'), $this->getIndentLevel());
}
/**
* Sets the comment for the element
*
* @param string $comment String to output as HTML comment
*
* @return HTML_Common2
*/
public function setComment($comment)
{
$this->_comment = $comment;
return $this;
}
/**
* Returns the comment associated with the element
*
* @return string
*/
public function getComment()
{
return $this->_comment;
}
/**
* Checks whether the element has given CSS class
*
* @param string $class CSS Class name
*
* @return bool
*/
public function hasClass($class)
{
$regex = '/(^|\s)' . preg_quote($class, '/') . '(\s|$)/';
return (bool)preg_match($regex, $this->getAttribute('class'));
}
/**
* Adds the given CSS class(es) to the element
*
* @param string|array $class Class name, multiple class names separated by
* whitespace, array of class names
*
* @return HTML_Common2
*/
public function addClass($class)
{
if (!is_array($class)) {
$class = preg_split('/\s+/', $class, null, PREG_SPLIT_NO_EMPTY);
}
$curClass = preg_split(
'/\s+/', $this->getAttribute('class'), null, PREG_SPLIT_NO_EMPTY
);
foreach ($class as $c) {
if (!in_array($c, $curClass)) {
$curClass[] = $c;
}
}
$this->setAttribute('class', implode(' ', $curClass));
return $this;
}
/**
* Removes the given CSS class(es) from the element
*
* @param string|array $class Class name, multiple class names separated by
* whitespace, array of class names
*
* @return HTML_Common2
*/
public function removeClass($class)
{
if (!is_array($class)) {
$class = preg_split('/\s+/', $class, null, PREG_SPLIT_NO_EMPTY);
}
$curClass = array_diff(
preg_split(
'/\s+/', $this->getAttribute('class'), null, PREG_SPLIT_NO_EMPTY
),
$class
);
if (0 == count($curClass)) {
$this->removeAttribute('class');
} else {
$this->setAttribute('class', implode(' ', $curClass));
}
return $this;
}
/**
* Returns the HTML representation of the element
*
* This magic method allows using the instances of HTML_Common2 in string
* contexts
*
* @return string
*/
abstract public function __toString();
/**
* Called if trying to change an attribute with name in $watchedAttributes
*
* This method is called for each attribute whose name is in the
* $watchedAttributes array and which is being changed by setAttribute(),
* setAttributes() or mergeAttributes() or removed via removeAttribute().
* Note that the operation for the attribute is not carried on after calling
* this method, it is the responsibility of this method to change or remove
* (or not) the attribute.
*
* @param string $name Attribute name
* @param string $value Attribute value, null if attribute is being removed
*/
protected function onAttributeChange($name, $value = null)
{
}
/**
* Whether or not an offset (HTML attribute) exists
*
* @param string $offset An offset to check for.
*
* @return boolean Returns true on success or false on failure.
* @link http://php.net/manual/en/arrayaccess.offsetexists.php
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->attributes[strtolower($offset)]);
}
/**
* Returns the value at specified offset (i.e. attribute name)
*
* @param string $offset The offset to retrieve.
*
* @return string|null
* @link http://php.net/manual/en/arrayaccess.offsetget.php
* @see getAttribute()
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->getAttribute($offset);
}
/**
* Assigns a value to the specified offset (i.e. attribute name)
*
* @param string $offset The offset to assign the value to
* @param string $value The value to set
*
* @return void
* @link http://php.net/manual/en/arrayaccess.offsetset.php
* @see setAttribute()
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
if (null !== $offset) {
$this->setAttribute($offset, $value);
} else {
// handles $foo[] = 'disabled';
$this->setAttribute($value);
}
}
/**
* Unsets an offset (i.e. removes an attribute)
*
* @param string $offset The offset to unset
*
* @return void
* @link http://php.net/manual/en/arrayaccess.offsetunset.php
* @see removeAttribute
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
$this->removeAttribute($offset);
}
}

Datei anzeigen

@ -7,17 +7,15 @@
* Description:
* cHTML List Element
*
* @category ConLite
* @package Core
* @subpackage cHTML
* @version $Rev$
* @since 2.0
* @author Ortwin Pinke <o.pinke@conlite.org>
* @copyright (c) 2015, conlite.org
* @license http://www.gnu.de/documents/gpl.en.html GPL v3 (english version)
* @license http://www.gnu.de/documents/gpl.de.html GPL v3 (deutsche Version)
* @link http://www.conlite.org ConLite.org
*
* $Id$
*/
// security check
defined('CON_FRAMEWORK') or die('Illegal call');

Datei anzeigen

@ -6,17 +6,15 @@
* Description:
* cHTML List
*
* @category ConLite
* @package Core
* @subpackage cHTML
* @version $Rev$
* @since 2.0
* @author Ortwin Pinke <o.pinke@conlite.org>
* @copyright (c) 2015, conlite.org
* @license http://www.gnu.de/documents/gpl.en.html GPL v3 (english version)
* @license http://www.gnu.de/documents/gpl.de.html GPL v3 (deutsche Version)
* @link http://www.conlite.org ConLite.org
*
* $Id$
*/
// security check

Datei anzeigen

@ -6,17 +6,15 @@
* Description:
* cHTML Meta
*
* @category ConLite
* @package Core
* @subpackage cHTML
* @version $Rev$
* @since 2.0
* @author Ortwin Pinke <o.pinke@conlite.org>
* @copyright (c) 2015, conlite.org
* @license http://www.gnu.de/documents/gpl.en.html GPL v3 (english version)
* @license http://www.gnu.de/documents/gpl.de.html GPL v3 (deutsche Version)
* @link http://www.conlite.org ConLite.org
*
* $Id$
*/
// security check

Datei anzeigen

@ -1,7 +1,28 @@
<?php
/**
* Article Collector Class
*
* This is an helper class to collect articles for article list etc.
*
* @category ConLite
* @package Core
* @subpackage clHelper
* @since 2.1
* @author Ortwin Pinke <o.pinke@conlite.org>
* @copyright (c) 2019, conlite.org
* @license http://www.gnu.de/documents/gpl.en.html GPL v3 (english version)
* @license http://www.gnu.de/documents/gpl.de.html GPL v3 (deutsche Version)
* @link http://www.conlite.org ConLite.org
*/
defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
/**
* Class Article Collector
*
* @author Ortwin Pinke <o.pinke@conlite.org>
*/
class cArticleCollector implements SeekableIterator, Countable {
/**
@ -13,7 +34,7 @@ class cArticleCollector implements SeekableIterator, Countable {
protected $_aStartArticles = array();
protected $_aOptions = array();
protected $_aOptionsDefault = array();
private $_bAsObject = TRUE;
private $_bAsObject = true;
/**
*
@ -44,14 +65,12 @@ class cArticleCollector implements SeekableIterator, Countable {
}
if (count($this->_aStartArticles) > 0) {
print_r($this->_aStartArticles);
if ($this->_aOptions['start'] == false) {
$oArtLangColl->setWhere("cApiArticleLanguageCollection.idartlang", $this->_aStartArticles, "NOTIN");
//$sqlStartArticles = "a.idartlang NOT IN ('" . implode("','", $this->_startArticles) . "') AND ";
}
if ($this->_aOptions['startonly'] == true) {
echo "startonly";
$oArtLangColl->setWhere("cApiArticleLanguageCollection.idartlang", $this->_aStartArticles, "IN");
//$sqlStartArticles = "a.idartlang IN ('" . implode("','", $this->_startArticles) . "') AND ";
}
@ -68,7 +87,6 @@ class cArticleCollector implements SeekableIterator, Countable {
$oArtLangColl->setWhere("cApiArticleLanguageCollection.idlang", $this->_aOptions['lang']);
$oArtLangColl->query();
echo $oArtLangColl->_lastSQL;
if ($oArtLangColl->count() > 0) {
$aTable = $oArtLangColl->fetchTable();
//echo $oArtLangColl->_lastSQL;
@ -76,7 +94,6 @@ class cArticleCollector implements SeekableIterator, Countable {
foreach ($aTable as $aItem) {
$this->_aArticles[] = $aItem['idartlang'];
}
print_r($this->_aArticles);
}
}
@ -141,7 +158,7 @@ class cArticleCollector implements SeekableIterator, Countable {
*
* @return cApiArticleLanguage|int returns article language object or idartlang
*/
public function current() {
public function current() :cApiArticleLanguage|int{
$iIdartlang = $this->_aArticles[$this->_iCurrentPosition];
if ($this->_bAsObject) {
$oArticle = new cApiArticleLanguage($iIdartlang);

Datei anzeigen

@ -247,9 +247,11 @@ class Article extends Item
* @param string Property name
* @return mixed Property value
*/
public function getField($name)
{
return urldecode($this->values[$name]);
public function getField($name) {
if(!is_null($name) && !empty($this->values[$name])) {
return urldecode($this->values[$name]);
}
}
/**
@ -283,7 +285,7 @@ class Article extends Item
*/
public function getContent($type, $id = NULL)
{
if ($type == '') {
if (empty($type)) {
return 'Class ' . get_class($this) . ': content-type must be specified!';
}
@ -295,7 +297,7 @@ class Article extends Item
if (is_null($id)) {
// return Array
return $this->content[$type];
return (empty($this->content[$type]))?'':$this->content[$type];
}
// return String

Datei anzeigen

@ -238,7 +238,7 @@ class cAutoload {
* @return (string|null) Path and filename or null
*/
private static function _getContenidoClassFile($className) {
$file = isset(self::$_includeFiles[$className]) ? self::$_conRootPath . self::$_includeFiles[$className] : null;
$file = isset(self::$_includeFiles[$className]) ? self::$_conRootPath . self::$_includeFiles[$className] : '';
return self::_validateClassAndFile($className, $file);
}
@ -247,7 +247,7 @@ class cAutoload {
*
* @param string $className
* @param string $filePathName
* @return (string|null) The file if validation was successfull, otherwhise null
* @return (string) The file if validation was successfull, otherwhise empty
*/
private static function _validateClassAndFile($className, $filePathName) {
if (class_exists($className)) {
@ -256,14 +256,14 @@ class cAutoload {
'file' => str_replace(self::$_conRootPath, '', $filePathName),
'error' => self::ERROR_CLASS_EXISTS
);
return null;
return '';
} elseif (!is_file($filePathName)) {
self::$_errors[] = array(
'class' => $className,
'file' => str_replace(self::$_conRootPath, '', $filePathName),
'error' => self::ERROR_FILE_NOT_FOUND
);
return null;
return '';
}
return $filePathName;

Datei anzeigen

@ -327,7 +327,7 @@ class clDbBackup {
}
$f = @fopen($this->_sLogFile, 'a+');
if (is_resource($f)) {
@fputs($f, date("m.d.Y g:ia") . " " . $_SERVER['REMOTE_ADDR'] . " " . $sMessage . "\n");
@fputs($f, date("d.m.Y g:ia") . " " . $_SERVER['REMOTE_ADDR'] . " " . $sMessage . "\n");
@fclose($f);
}
}

Datei anzeigen

@ -7,9 +7,6 @@
* Description:
* Contenido XML Parser
*
* Requirements:
* @con_php_req 5.0
*
*
* @package Contenido_XML
* @version 1.0.9
@ -19,79 +16,17 @@
* @link http://www.4fb.de
* @link http://www.contenido.org
* @since file available since contenido release <= 4.6
*
* {@internal
* created unknown
* modified 2008-06-30, Dominik Ziegler, add security fix
*
* $Id$:
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
/**
* Class for parsing XML documents using SAX
*
* This class is a abstraction class for the PHP Expat XML functions.
*
* You can define handler functions/objects for start, end, PI and data sections (1.) or
* your can define path which will trigger the defined event when encountered (2.)
*
* Example:
*
* 1.) $parser->setEvents(array("startElement"=> "myFunction",
* "endElement"=> "myFunction",
* "characterData"=> "myFunction",
* "processingInstruction" => "myFunction");
*
* The value can also be an array with the object reference and the method to call.
* i.e. "startElement"=>array(&$myObj, "myMethod") instead of "startelement"=>"myFunction"
*
* 2.) $parser->setEvents(array("/root/foo/bar"=>"myFunction"));
*
* Valid array keys are: 'startElement', 'endElement', 'characterData', 'processingInstruction' and paths
* folowing the scheme '/root/element'. The path MUST begin from the root element and MUST start with '/'.
*
* The value can also be an array with the object reference and the method to call.
* i.e. "/foo/bar"=>array(&$myObj, "myMethod") instead of "/foo/bar"=>"myFunction"
*
* It has 3 public methods:
*
* setEventHandlers - Set specific handlers for the xml parser
* parseFile - Used to parse a XML file
* parse - Used to parse a XML string
*
* A small example:
*
* include ("class.xmlparser.php");
*
* // The XML String
* $xml = '
* <?xml version="1.0"?>
* <foo>
* <bar>some text</bar>
* <bar>another text</bar>
* </foo>';
*
* function myHandler($name, $attribs, $content)
* {
* echo "<b style='color:red'>HIT</b>: [ <b>$name</b> ] [ $content ]<br/>";
* }
*
* $parser = new XmlParser; // Parser instance
* $parser->setEventHandlers(array("/foo/bar"=>"myHandler")); // Define our handler
* $parser->parse($xml); // Parse the XML string
*
* Report bugs to: jan.lengowski@4fb.de
*
/**
* @author Jan Lengowski <Jan.Lengowski@4fb.de>
* @copyright four for business AG <www.4fb.de>
* @version 1.0
*/
class XmlParser {
class clXmlParser {
/**
* XML Parser autofree

Datei anzeigen

@ -382,7 +382,8 @@ class DBFSItem extends Item {
parent::store();
}
public function setField($field, $value, $safe = true) {
public function setField($field, $value, $safe = true): bool
{
if ($field == "dirname" || $field == "filename" || $field == "mimetype") {
// Don't do safe encoding
$safe = false;
@ -391,7 +392,7 @@ class DBFSItem extends Item {
$value = str_replace('"', "", $value);
}
parent::setField($field, $value, $safe);
return parent::setField($field, $value, $safe);
}
}

Datei anzeigen

@ -157,12 +157,12 @@ class FrontendUser extends Item
* @param string $field Specifies the field to set
* @param string $value Specifies the value to set
*/
public function setField($field, $value, $safe = true)
public function setField($field, $value, $safe = true): bool
{
if ($field == "password") {
parent::setField($field, md5($value), $safe);
return parent::setField($field, md5($value), $safe);
} else {
parent::setField($field, $value, $safe);
return parent::setField($field, $value, $safe);
}
}

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -57,8 +57,7 @@ class cHTMLFormElement extends cHTML {
if (is_string($id) && !empty($id)) {
$this->updateAttributes(array("id" => $id));
}
$this->setClass("text_medium"); // TODO: Remove this...
$this->setDisabled($disabled);
$this->setTabindex($tabindex);
$this->setAccessKey($accesskey);
@ -594,7 +593,7 @@ class cHTMLSelectElement extends cHTMLFormElement {
* All cHTMLOptionElements
* @var array
*/
var $_options;
var $_options = [];
/**
* Constructor. Creates an HTML select field (aka "DropDown").
@ -672,7 +671,7 @@ class cHTMLSelectElement extends cHTMLFormElement {
*/
function setDefault($lvalue) {
$bSet = false;
$lvalue = cString::nullToString($lvalue);
if (is_array($this->_options)) {
foreach ($this->_options as $key => $value) {
if (strcmp($value->getAttribute("value"), $lvalue) == 0) {
@ -867,6 +866,7 @@ class cHTMLRadiobutton extends cHTMLFormElement {
* @access private
*/
var $_value;
protected string $_labelText;
/**
* Constructor. Creates an HTML radio button element.
@ -931,7 +931,7 @@ class cHTMLRadiobutton extends cHTMLFormElement {
*/
function toHtml($renderLabel = true) {
$attributes = $this->getAttributes(true);
//print_r($attributes);
if ($renderLabel == false) {
return $this->fillSkeleton($attributes);
}
@ -1029,37 +1029,30 @@ class cHTMLCheckbox extends cHTMLFormElement {
* @return string Rendered HTML
*/
function toHtml($renderlabel = true) {
$attributes = $this->getAttributes(true);
if ($renderlabel == false) {
return $this->fillSkeleton($attributes);
}
$id = $this->getAttribute("id");
$renderedLabel = "";
if ($renderlabel == true) {
if ($id != "") {
$label = new cHTMLLabel($this->_value, $this->getAttribute("id"));
if ($id != "") {
$label = new cHTMLLabel($this->_value, $this->getAttribute("id"));
$label->setClass($this->getAttribute("class"));
if ($this->_labelText != "") {
$label->setLabelText($this->_labelText);
}
$renderedLabel = $label->toHtml();
} else {
$renderedLabel = $this->_value;
if ($this->_labelText != "") {
$label = new cHTMLLabel($this->_value, $this->getAttribute("id"));
$label->setLabelText($this->_labelText);
$renderedLabel = $label->toHtml();
}
if ($this->_labelText != "") {
$label->setLabelText($this->_labelText);
}
return '<table border="0" cellspacing="0" cellpadding="0"><tr><td nowrap="nowrap">' . parent::toHTML() . '</td><td nowrap="nowrap">' . $renderedLabel . '</td></tr></table>';
$renderedLabel = $label->toHtml();
} else {
return parent::toHTML();
$renderedLabel = $this->_value;
}
}
return $this->fillSkeleton($attributes) . $renderedLabel;
}
}
/**
@ -1162,6 +1155,8 @@ class cHTMLLink extends cHTML {
/* Stores the custom entries */
var $_custom;
protected $_type;
/**
* Constructor. Creates an HTML link.
@ -1449,6 +1444,9 @@ class cHTMLImage extends cHTML {
* @access private
*/
var $_height;
protected $_border;
protected $_type;
/**
* Constructor. Creates an HTML IMG element.

Datei anzeigen

@ -191,7 +191,7 @@ class HtmlParser {
if ($this->iHtmlTextIndex >= $this->iHtmlTextLength) {
return -1;
}
return $this->iHtmlText{$this->iHtmlTextIndex};
return $this->iHtmlText[$this->iHtmlTextIndex];
}
function moveNext() {

Datei anzeigen

@ -130,12 +130,7 @@ class cI18n {
// Is emulator to use?
if (!$cfg['native_i18n']) {
$ret = self::emulateGettext($string, $domain);
// hopefully a proper replacement for
// mb_convert_encoding($string, 'HTML-ENTITIES', 'utf-8');
// see http://stackoverflow.com/q/11974008
$ret = htmlspecialchars_decode(utf8_decode(conHtmlentities($ret, ENT_COMPAT, 'utf-8', false)));
return $ret;
return self::emulateGettext($string, $domain);
}
// Try to use native gettext implementation

Datei anzeigen

@ -255,7 +255,7 @@ class InUseCollection extends ItemCollection
}
if (!is_object($notification)) {
$notification = new Contenido_Notification;
$notification = new Contenido_Notification();
}
$noti = $notification->messageBox("warning", $message.$override, 0);
@ -293,6 +293,4 @@ class InUseItem extends Item
$this->loadByPrimaryKey($mId);
}
}
}
?>
}

Datei anzeigen

@ -447,7 +447,7 @@ class PropertyItem extends Item
* @param string $value
* @param bool $safe Flag to run filter on passed value
*/
public function setField($field, $value, $safe = true)
public function setField($field, $value, $safe = true): bool
{
if (array_key_exists($field, $this->maximumLength)) {
if (strlen($value) > $this->maximumLength[$field]) {
@ -455,7 +455,7 @@ class PropertyItem extends Item
}
}
parent::setField($field, $value, $safe);
return parent::setField($field, $value, $safe);
}
}

Datei anzeigen

@ -225,13 +225,13 @@ class Index extends SearchBaseAbstract {
*
* @var array
*/
var $cms_type = array();
protected static $_cms_type = [];
/**
* the suffix of all available cms types
* @var array
*/
var $cms_type_suffix = array();
protected static $_cms_type_suffix = [];
/**
* Constructor, set object properties
@ -270,6 +270,8 @@ class Index extends SearchBaseAbstract {
$this->idart = $idart;
}
$this->_debug('Start Index for ', $this->idart);
$this->place = $place;
$this->keycode = $aContent;
$this->setStopwords($aStopwords);
@ -283,7 +285,14 @@ class Index extends SearchBaseAbstract {
$old_keys = array_keys($this->keywords_old);
$this->keywords_del = array_diff($old_keys, $new_keys);
/*
echo '<pre>';
print_r($new_keys);
print_r($old_keys);
print_r($this->keywords_del);
echo '</pre>';
*
*/
if (count($this->keywords_del) > 0) {
$this->deleteKeywords();
}
@ -312,7 +321,7 @@ class Index extends SearchBaseAbstract {
foreach ($this->keycode as $idtype => $data) {
if ($this->checkCmsType($idtype)) {
foreach ($data as $typeid => $code) {
$this->_debug('code', $code);
$this->_debug('createKeywords: raw code from data array', $code);
$code = stripslashes($code); // remove backslash
$code = str_ireplace(array('<br>', '<br />'), "\n", $code); // replace HTML line breaks with newlines
@ -320,13 +329,18 @@ class Index extends SearchBaseAbstract {
if (strlen($code) > 0) {
$code = clHtmlEntityDecode($code);
}
$this->_debug('code', $code);
$this->_debug('createKeywords: code after clean', $code);
$tmp_keys = preg_split('/[\s,]+/', trim($code)); // split content by any number of commas or space characters
$this->_debug('tmp_keys', $tmp_keys);
$this->_debug('createKeywords: tmp_keys', $tmp_keys);
foreach ($tmp_keys as $value) {
$value = strtolower($value); // index terms are stored with lower case
$value = preg_replace('/[^\w]+/u', '', $value);
if (empty(trim($value))) {
continue;
}
if (!in_array($value, $this->stopwords)) {
// eliminate stopwords
@ -335,6 +349,7 @@ class Index extends SearchBaseAbstract {
if (strlen($value) > 1) {
// do not index single characters
$this->keywords[$value] = $this->keywords[$value] . $idtype . '-' . $typeid . ' ';
$this->_debug('createKeywords: entry array keywords', $this->keywords);
}
}
}
@ -345,7 +360,7 @@ class Index extends SearchBaseAbstract {
}
}
$this->_debug('keywords', $this->keywords);
$this->_debug('createKeywords: keywords returned', $this->keywords);
}
/**
@ -357,9 +372,10 @@ class Index extends SearchBaseAbstract {
$tmp_count = array();
foreach ($this->keywords as $keyword => $count) {
$bProceed = true;
$this->_debug('keyword', $keyword);
$tmp_count = preg_split('/[\s]/', trim($count));
$this->_debug('tmp_count', $tmp_count);
$occurrence = count($tmp_count);
$tmp_count = array_unique($tmp_count);
$cms_types = implode(',', $tmp_count);
@ -376,8 +392,12 @@ class Index extends SearchBaseAbstract {
('" . Contenido_Security::escapeDB($keyword, $this->db) . "', '" . Contenido_Security::escapeDB($index_string, $this->db) . "', " . Contenido_Security::toInteger($this->lang) . ", " . Contenido_Security::toInteger($nextid) . ")";
} else {
// if keyword allready exists, create new index_string
if (preg_match("/&$this->idart=/", $this->keywords_old[$keyword])) {
$index_string = preg_replace("/&$this->idart=[0-9]+\([\w-,]+\)/", $index_string, $this->keywords_old[$keyword]);
if (preg_match("/&" . $this->idart . "=/", $this->keywords_old[$keyword])) {
$index_string = preg_replace("/&" . $this->idart . "=[0-9]+\([,\w-]+\)/", $index_string, $this->keywords_old[$keyword]);
if ($index_string === $this->keywords_old[$keyword]) {
$bProceed = false;
$this->_debug('db update', 'no update needed');
}
} else {
$index_string = $this->keywords_old[$keyword] . $index_string;
}
@ -386,9 +406,11 @@ class Index extends SearchBaseAbstract {
SET " . $this->place . " = '" . $index_string . "'
WHERE idlang='" . Contenido_Security::toInteger($this->lang) . "' AND keyword='" . Contenido_Security::escapeDB($keyword, $this->db) . "'";
}
$this->_debug('sql', $sql);
$this->db->query($sql);
if ($bProceed) {
$this->_debug('sql', $sql);
$this->db->query($sql);
}
}
}
@ -431,7 +453,7 @@ class Index extends SearchBaseAbstract {
idlang=" . Contenido_Security::toInteger($this->lang) . " AND
(keyword IN ('" . $keys . "') OR " . $this->place . " REGEXP '&" . Contenido_Security::toInteger($this->idart) . "=')";
$this->_debug('sql', $sql);
$this->_debug('getKeywords: sql', $sql);
$this->db->query($sql);
@ -440,6 +462,8 @@ class Index extends SearchBaseAbstract {
while ($this->db->next_record()) {
$this->keywords_old[$this->db->f('keyword')] = $this->db->f($place);
}
$this->_debug('getKeywords: array keywords_old', $this->keywords_old);
}
/**
@ -448,6 +472,7 @@ class Index extends SearchBaseAbstract {
* @return $key
*/
function removeSpecialChars($key) {
$aSpecialChars = array(
"-", "_", "'", ".", "!", "\"", "#", "$", "%", "&", "(", ")", "*", "+", ",", "/",
":", ";", "<", "=", ">", "?", "@", "[", "\\", "]", "^", "`", "{", "|", "}", "~"
@ -461,6 +486,7 @@ class Index extends SearchBaseAbstract {
// a client and should not be treated in this method.
// modified 2007-10-01, H. Librenz - added as hotfix for encoding problems (doesn't find any words with
// umlaut vowels in it since you turn on UTF-8 as language encoding)
$sEncoding = getEncodingByLanguage($this->db, $this->lang, $this->cfg);
if (strtolower($sEncoding) != 'iso-8859-2') {
@ -486,6 +512,9 @@ class Index extends SearchBaseAbstract {
$key = clHtmlEntityDecode($key);
$key = str_replace($aSpecialChars, '', $key);
ini_set('mbstring.substitute_character', "none");
$key = mb_convert_encoding($key, 'UTF-8', 'UTF-8');
return $key;
}
@ -516,6 +545,21 @@ class Index extends SearchBaseAbstract {
return $key;
}
/**
*
* @return array array with arrays of type and typesuffix
*/
public function getContentTypes(): array {
if (empty(self::$_cms_type)) {
$this->setContentTypes();
}
return array(
'cms_type' => self::$_cms_type,
'cms_type_suffix' => self::$_cms_type_suffix
);
}
/**
* set the array of stopwords which should not be indexed
* @param array $aStopwords
@ -537,8 +581,8 @@ class Index extends SearchBaseAbstract {
$this->_debug('sql', $sql);
$this->db->query($sql);
while ($this->db->next_record()) {
$this->cms_type[$this->db->f('type')] = $this->db->f('idtype');
$this->cms_type_suffix[$this->db->f('idtype')] = substr($this->db->f('type'), 4, strlen($this->db->f('type')));
self::$_cms_type[$this->db->f('type')] = $this->db->f('idtype');
self::$_cms_type_suffix[$this->db->f('idtype')] = substr($this->db->f('type'), 4, strlen($this->db->f('type')));
}
}
@ -554,11 +598,11 @@ class Index extends SearchBaseAbstract {
if (strlen($opt) > 0) {
if (!stristr($opt, 'cms_')) {
if (in_array($opt, $this->cms_type_suffix)) {
if (in_array($opt, $this->getContentTypes()['cms_type_suffix'])) {
$this->cms_options[$opt] = 'CMS_' . $opt;
}
} else {
if (array_key_exists($opt, $this->cms_type)) {
if (array_key_exists($opt, $this->getContentTypes()['cms_type'])) {
$this->cms_options[$opt] = $opt;
}
}
@ -788,8 +832,8 @@ class Search extends SearchBaseAbstract {
$this->index = new Index($oDB);
$this->cms_type = $this->index->cms_type;
$this->cms_type_suffix = $this->index->cms_type_suffix;
$this->cms_type = $this->index->getContentTypes()['cms_type'];
$this->cms_type_suffix = $this->index->getContentTypes()['cms_type_suffix'];
$this->search_option = (array_key_exists('db', $options)) ? strtolower($options['db']) : 'regexp';
$this->search_combination = (array_key_exists('combine', $options)) ? strtolower($options['combine']) : 'or';
@ -1339,11 +1383,11 @@ class SearchResult extends SearchBaseAbstract {
$cms_type = strtoupper($cms_type);
if (strlen($cms_type) > 0) {
if (!stristr($cms_type, 'cms_')) {
if (in_array($cms_type, $this->index->cms_type_suffix)) {
if (in_array($cms_type, $this->index->getContentTypes()['cms_type'])) {
$cms_type = 'CMS_' . $cms_type;
}
} else {
if (!array_key_exists($cms_type, $this->index->cms_type)) {
if (!array_key_exists($cms_type, $this->index->getContentTypes()['cms_type_suffix'])) {
return array();
}
}

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -0,0 +1,405 @@
<?php
/**
* This file contains the multi byte wrapper class for strings.
*
* @package Core
* @subpackage Util
* @author Frederic Schneider <frederic.schneider@4fb.de>
* @author Marcus Gnaß <marcus.gnass@4fb.de>
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*/
defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
/**
* Wrapper class for mbstring functions to be used with strings.
*
* Each method is a wrapper for a mbstring function that implements a fallback
* to the regular string function if the mbstring function does not exist
* or the mbstring extension itself is not available.
*
* @package Core
* @subpackage Util
* @todo add mb_chr(), mb_ord()
*/
class cStringMultiByteWrapper {
/**
* Checks if a given mbstring function exists.
*
* Caches informations about existing mbstring functions for better
* performance.
*
* @param string $functionName
* @return bool
*/
protected static function _functionExists($functionName) {
static $cache;
if (!isset($cache)) {
$cache = array();
foreach (array(
'mb_strtolower', 'mb_strtoupper', 'mb_strlen', 'mb_substr',
'mb_substr_count', 'mb_send_mail', 'mb_strpos', 'mb_strrpos', 'mb_stripos',
'mb_strripos', 'mb_stristr', 'mb_strrchr'
) as $function) {
$cache[$function] = function_exists($function);
}
}
return isset($cache[$functionName]) ? $cache[$functionName] : false;
}
/**
* Determines multi byte encoding to be used for various mbstring functions.
*
* If NULL is given the encoding for the current language is used
* which tends to be awfully slow as it requires a database lookup!
*
* If none could be determined the current set encoding is used.
*
* @param string|null $encoding
* - give a string to use a specific encoding
* - give null to use the encoding of the current language
* @return string
*/
protected static function _getEncoding($encoding = null) {
if (!is_string($encoding)) {
$encoding = mb_internal_encoding();
}
return $encoding;
}
/**
* Make a string lowercase
*
* @param string $string
* The string being lowercased
* @param string|null $encoding
* encoding parameter, standard: cRegistry::getEncoding()
* @return string
* with all alphabetic characters converted to lowercases
* @link http://php.net/manual/de/function.mb-strtolower.php
*/
public static function toLowerCase($string, $encoding = null) {
if (self::_functionExists('mb_strtolower')) {
$result = mb_strtolower($string, self::_getEncoding($encoding));
} else {
$result = strtolower($string);
}
return $result;
}
/**
* Make a string uppercase
*
* @param string $string
* The string being uppercased
* @param string|null $encoding
* encoding parameter, standard: cRegistry::getEncoding()
* @return string
* with all alphabetic characters converted to uppercases
* @link http://php.net/manual/de/function.mb-strtoupper.php
*/
public static function toUpperCase($string, $encoding = null) {
if (self::_functionExists('mb_strtoupper')) {
$result = mb_strtoupper($string, self::_getEncoding($encoding));
} else {
$result = strtoupper($string);
}
return $result;
}
/**
* Get string length
*
* @param string $string
* The string being checked for length
* @param string|null $encoding
* encoding parameter, standard: cRegistry::getEncoding()
* @return int
* Returns the number of characters
* @link http://php.net/manual/de/function.mb-strlen.php
*/
public static function getStringLength($string, $encoding = null) {
if (self::_functionExists('mb_strlen')) {
$result = mb_strlen($string, self::_getEncoding($encoding));
} else {
$result = strlen($string);
}
return $result;
}
/**
* Get string length
*
* @param string $string
* The string to extract the substring form
* @param int $start
* @param int $length [Optional]
* Maximum number of characters to use from $string, standard is NULL
* @param string|null $encoding
* encoding parameter, standard: cRegistry::getEncoding()
* @return string
* Returns the number of characters
* @link http://php.net/manual/de/function.mb-substr.php
*/
public static function getPartOfString($string, $start, $length = null, $encoding = null) {
if (self::_functionExists('mb_substr')) {
$result = mb_substr($string, $start, $length, self::_getEncoding($encoding));
} else {
$result = substr($string, $start, $length);
}
return $result;
}
/**
* Count the number of substring occurences
*
* @param string $haystack
* The string being checked
* @param string $needle
* The string being found
* @param string|null $encoding
* encoding parameter, standard: cRegistry::getEncoding()
* @return int
* The number of times the needle substring occurs in the haystack string.
* @link http://php.net/manual/de/function.mb-substr-count.php
*/
public static function countSubstring($haystack, $needle, $encoding = null) {
if (self::_functionExists('mb_substr_count')) {
$result = mb_substr_count($haystack, $needle, self::_getEncoding($encoding));
} else {
$result = substr_count($haystack, $needle);
}
return $result;
}
/**
* Send encoded mail
*
* @param string $to
* The mail addresses being sent to (multiple recipents comma separated)
* @param string $subject
* The subject of the mail
* @param string $message
* The message of the mail
* @param string $additional_headers [Optional]
* @param string $additional_parameter [Optional]
* @return boolean
* true or false
* @link http://php.net/manual/de/function.mb-send-mail.php
*/
public static function mail($to, $subject, $message, $additional_headers = null, $additional_parameter = null) {
if (self::_functionExists('mb_send_mail')) {
$result = mb_send_mail($to, $subject, $message, $additional_headers, $additional_parameter);
} else {
$result = mail($to, $subject, $message, $additional_headers, $additional_parameter);
}
return $result;
}
/**
* Find the position of first occurence of string in a string
*
* @param string $haystack
* @param string $needle
* @param integer $offset [Optional]
* @param string|null $encoding
* encoding parameter, standard: cRegistry::getEncoding()
* @return int
* Returns the numeric position of the first occurrence of needle in the haystack string
* @link http://php.net/manual/de/function.mb-strpos.php
*/
public static function findFirstPos($haystack, $needle, $offset = 0, $encoding = null) {
if (self::_functionExists('mb_strpos')) {
$result = mb_strpos($haystack, $needle, $offset, self::_getEncoding($encoding));
} else {
$result = strpos($haystack, $needle, $offset);
}
return $result;
}
/**
* Find the position of last occurence of string in a string
*
* @param string $haystack
* @param string $needle
* @param integer $offset [Optional]
* @param string|null $encoding
* encoding parameter, standard: cRegistry::getEncoding()
* @return int
* Returns the numeric position of the last occurrence of needle in the haystack string
* @link http://php.net/manual/de/function.mb-strrpos.php
*/
public static function findLastPos($haystack, $needle, $offset = 0, $encoding = null) {
if (self::_functionExists('mb_strrpos')) {
$result = mb_strrpos($haystack, $needle, $offset, self::_getEncoding($encoding));
} else {
$result = strrpos($haystack, $needle, $offset);
}
return $result;
}
/**
* Finds position of first occurrence of a string within another, case insensitive
*
* @param string $haystack
* @param string $needle
* @param integer $offset [Optional]
* @param string|null $encoding
* encoding parameter, standard: cRegistry::getEncoding()
* @return int
* Returns the numeric position of the first occurrence of needle in the haystack string
* @link http://php.net/manual/de/function.mb-stripos.php
*/
public static function findFirstPosCI($haystack, $needle, $offset = 0, $encoding = null) {
if (self::_functionExists('mb_stripos')) {
$result = mb_stripos($haystack, $needle, $offset, self::_getEncoding($encoding));
} else {
$result = stripos($haystack, $needle, $offset);
}
return $result;
}
/**
* Finds position of last occurrence of a string within another, case insensitive
*
* @param string $haystack
* @param string $needle
* @param integer $offset [Optional]
* @param string|null $encoding
* encoding parameter, standard: cRegistry::getEncoding()
* @return int
* Returns the numeric position of the last occurrence of needle in the haystack string
* @link http://php.net/manual/de/function.mb-strripos.php
*/
public static function findLastPosCI($haystack, $needle, $offset = 0, $encoding = null) {
if (self::_functionExists('mb_strripos')) {
$result = mb_strripos($haystack, $needle, $offset, self::_getEncoding($encoding));
} else {
$result = strripos($haystack, $needle, $offset);
}
return $result;
}
/**
* Finds first occurrence of a string within another, case insensitive
*
* @param string $haystack
* @param string $needle
* @param boolean $before_needle [Optional]
* @param string|null $encoding
* encoding parameter, standard: cRegistry::getEncoding()
* @return string
* Returns the portion of haystack, or FALSE if needle is not found.
* @link http://php.net/manual/de/function.mb-stristr.php
*/
public static function findFirstOccurrenceCI($haystack, $needle, $before_needle = false, $encoding = null) {
if (self::_functionExists('mb_stristr')) {
$result = mb_stristr($haystack, $needle, $before_needle, self::_getEncoding($encoding));
} else {
$result = stristr($haystack, $needle, $before_needle);
}
return $result;
}
/**
* Finds first occurrence of a string within another, case insensitive
*
* @param string $haystack
* @param string $needle
* @param boolean $part [Optional]
* @param string|null $encoding
* encoding parameter, standard: cRegistry::getEncoding()
* @return string
* Returns the portion of haystack, or FALSE if needle is not found.
* @link http://php.net/manual/de/function.mb-strrchr.php
*/
public static function findLastOccurrence($haystack, $needle, $part = false, $encoding = null) {
if (self::_functionExists('mb_strrchr')) {
$result = mb_strrchr($haystack, $needle, $part, self::_getEncoding($encoding));
} elseif (!$part) {
$result = strrchr($haystack, $needle);
} else {
// TODO strrchr canot handle $part = true
$result = null;
}
return $result;
}
/**
* Regular expression match
*
* @param string $pattern
* @param string $string
* @param array $regs [Optional]
* @return int
* @link http://php.net/manual/de/function.mb-ereg.php
*/
public static function ereg($pattern, $string, &$regs = array()) {
// TODO provide fallback multibyte extension is missing
return mb_ereg($pattern, $string, $regs);
}
/**
* Regular expression match ignoring case
*
* @param string $pattern
* @param string $string
* @param array $regs [Optional]
* @return int Returns the byte length of the matched string if a match for pattern was found in string
* @link http://php.net/manual/de/function.mb-eregi.php
*/
public static function eregi($pattern, $string, &$regs = array()) {
// TODO provide fallback multibyte extension is missing
return mb_eregi($pattern, $string, $regs);
}
/**
* Replace regular expression
*
* @param string $pattern
* @param string $replacement
* @param string $string
* @param string $option [Optional]
* @return false|string Returns the byte length of the matched string if a match for pattern was found in string
* @link http://php.net/manual/de/function.mb-ereg-replace.php
*/
public static function ereg_replace($pattern, $replacement, $string, $option = 'msr') {
// TODO provide fallback multibyte extension is missing
return mb_ereg_replace($pattern, $replacement, $string, $option);
}
/**
* Replace regular expression ignoring case
*
* @param string $pattern
* @param string $replacement
* @param string $string
* @param string $option [Optional]
* @return false|string Returns the byte length of the matched string if a match for pattern was found in string
* @link http://php.net/manual/de/function.mb-eregi-replace.php
*/
public static function eregi_replace($pattern, $replacement, $string, $option = 'msr') {
// TODO provide fallback multibyte extension is missing
return mb_eregi_replace($pattern, $replacement, $string, $option);
}
/**
* Split string using regular expression
*
* @param string $pattern
* @param string $string
* @param integer $limit [Optional]
* @return string[] The result as an array
* @link http://php.net/manual/de/function.mb-split.php
*/
public static function split($pattern, $string, $limit = -1) {
// TODO provide fallback multibyte extension is missing
return mb_split($pattern, $string, $limit);
}
}

Datei anzeigen

@ -0,0 +1,733 @@
<?php
/**
* This file contains the string utility class.
*
* @package Core
* @subpackage Util
* @author Murat Purc <murat@purc.de>
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*/
defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
/**
* String helper class.
*
* @package Core
* @subpackage Util
*/
class cString extends cStringMultiByteWrapper {
/**
* Replaces a string only once.
*
* Caution: This function only takes strings as parameters, not arrays!
*
* @param string $find
* String to find
* @param string $replace
* String to replace
* @param string $subject
* String to process
* @return string
* Processed string
*/
public static function iReplaceOnce($find, $replace, $subject) {
$start = parent::findFirstPos(parent::toLowerCase($subject), parent::toLowerCase($find));
if ($start === false) {
return $subject;
}
$end = $start + parent::getStringLength($find);
$first = parent::getPartOfString($subject, 0, $start);
$last = parent::getPartOfString($subject, $end, parent::getStringLength($subject) - $end);
$result = $first . $replace . $last;
return $result;
}
/**
* Replaces a string only once, in reverse direction.
*
* Caution: This function only takes strings as parameters, not arrays!
*
* @param string $find
* String to find
* @param string $replace
* String to replace
* @param string $subject
* String to process
* @return string
* Processed string
*/
public static function iReplaceOnceReverse($find, $replace, $subject) {
$start = self::posReverse(parent::toLowerCase($subject), parent::toLowerCase($find));
if ($start === false) {
return $subject;
}
$end = $start + parent::getStringLength($find);
$first = parent::getPartOfString($subject, 0, $start);
$last = parent::getPartOfString($subject, $end, parent::getStringLength($subject) - $end);
$result = $first . $replace . $last;
return $result;
}
/**
* Finds a string position in reverse direction.
*
* NOTE: The original cString::findLastPos-function of PHP4 only finds a single character
* as needle.
*
* @param string $haystack
* String to search in
* @param string $needle
* String to search for
* @param int $start [optional]
* Offset
* @return int
* String position
*/
public static function posReverse($haystack, $needle, $start = 0) {
$tempPos = parent::findFirstPos($haystack, $needle, $start);
if ($tempPos === false) {
if ($start == 0) {
// Needle not in string at all
return false;
} else {
// No more occurances found
return $start - parent::getStringLength($needle);
}
} else {
// Find the next occurance
return self::posReverse($haystack, $needle, $tempPos + parent::getStringLength($needle));
}
}
/**
* Adds slashes to passed variable or array.
*
* @param string|array $value
* Either a string or a multi-dimensional array of values
* @return string|array
*/
public static function addSlashes($value) {
$value = is_array($value) ? array_map(array('cString', 'addSlashes'), $value) : addslashes($value);
return $value;
}
/**
* Removes slashes from passed variable or array.
*
* @param string|array $value
* Either a string or a multi-dimensional array of values
* @return string|array
*/
public static function stripSlashes($value) {
$value = is_array($value) ? array_map(array('cString', 'stripSlashes'), $value) : stripslashes($value);
return $value;
}
/**
* Checks if the string haystack ends with needle.
*
* @param string $haystack
* The string to check
* @param string $needle
* The string with which it should end
* @return bool
*/
public static function endsWith($haystack, $needle) {
$length = parent::getStringLength($needle);
if ($length == 0) {
return true;
}
return parent::getPartOfString($haystack, -$length) === $needle;
}
/**
* Returns true if needle can be found in haystack.
*
* @param string $haystack
* String to be searched
* @param string $needle
* String to search for
* @return bool
*/
public static function contains($haystack, $needle) {
return !(parent::findFirstPos($haystack, $needle) === false);
}
/**
* Implementation of PHP 5.3's strstr with beforeNeedle.
*
* @param string $haystack
* String to be searched
* @param string $needle
* String to search for
* @param bool $beforeNeedle [optional]
* If true, return everything BEFORE needle
* @return string
* @link http://php.net/manual/de/function.mb-strstr.php
* @link http://php.net/manual/de/function.strstr.php
*/
public static function strstr($haystack, $needle, $beforeNeedle = false) {
if (!$beforeNeedle) {
if (self::_functionExists('mb_strstr')) {
return mb_strstr($haystack, $needle);
} else {
return strstr($haystack, $needle);
}
} else {
return strtok($haystack, $needle);
}
}
/**
* This function checks if a given format is accepted by php's date function.
*
* @param string $format
* format according to date function specification
* @return bool
* true if format is correct, false otherwise
*/
public static function validateDateFormat($format) {
// try to create a DateTime instance based on php's date function format specification
// return true if date is valid (no wrong format)
return false !== DateTime::createFromFormat($format, date($format, time()));
}
/**
* Extract a number from a string.
*
* @param string $string
* String var by reference
* @return string
*/
public static function extractNumber(&$string) {
$string = preg_replace('/[^0-9]/', '', $string);
return $string;
}
/**
* Returns whether a string is UTF-8 encoded or not.
*
* @param string $input
* @return bool
*/
public static function isUtf8($input) {
$len = parent::getStringLength($input);
for ($i = 0; $i < $len; $i++) {
$char = ord($input[$i]);
if ($char < 0x80) {
// ASCII char
continue;
} else if (($char & 0xE0) === 0xC0 && $char > 0xC1) {
// 2 byte long char
$n = 1;
} else if (($char & 0xF0) === 0xE0) {
// 3 byte long char
$n = 2;
} else if (($char & 0xF8) === 0xF0 && $char < 0xF5) {
// 4 byte long char
$n = 3;
} else {
return false;
}
for ($j = 0; $j < $n; $j++) {
$i++;
if ($i == $len || (ord($input[$i]) & 0xC0) !== 0x80) {
return false;
}
}
}
return true;
}
/**
* Checks if a value is alphanumeric.
*
* @param mixed $test
* Value to test
* @param bool $umlauts [optional]
* Use german umlauts
* @return bool
* Value is alphanumeric
*/
public static function isAlphanumeric($test, $umlauts = true) {
if ($umlauts == true) {
$match = "/^[a-z0-9ÄäÖöÜüß ]+$/i";
} else {
$match = "/^[a-z0-9 ]+$/i";
}
return preg_match($match, $test);
}
/**
* Trims a string to a given length and makes sure that all words up to
* $maxlen are preserved, without exceeding $maxlen.
*
* Warning: Currently, this function uses a regular ASCII-Whitespace to do
* the separation test. If you are using '&nbsp' to create spaces, this
* function will fail.
*
* Example:
* $string = "This is a simple test";
* echo cString::trimAfterWord($string, 15);
*
* This would output "This is a", since this function respects word
* boundaries and doesn't operate beyond the limit given by $maxlen.
*
* @param string $string
* The string to operate on
* @param int $maxlen
* The maximum number of characters
* @return string
* The resulting string
*/
public static function trimAfterWord($string, $maxlen) {
// If the string is smaller than the maximum lenght, it makes no sense to
// process it any further. Return it.
if (parent::getStringLength($string) < $maxlen) {
return $string;
}
// If the character after the $maxlen position is a space, we can return
// the string until $maxlen.
if (parent::getPartOfString($string, $maxlen, 1) == ' ') {
return parent::getPartOfString($string, 0, $maxlen);
}
// Cut the string up to $maxlen so we can use cString::findLastPos (reverse str position)
$cutted_string = parent::getPartOfString($string, 0, $maxlen);
// Extract the end of the last word
$last_word_position = cString::findLastPos($cutted_string, ' ');
return parent::getPartOfString($cutted_string, 0, $last_word_position);
}
/**
* Trims a string to a specific length.
*
* If the string is longer than $maxlen, dots are inserted ("...") right
* before $maxlen.
*
* Example:
* $string = "This is a simple test";
* echo cString::trimHard ($string, 15);
*
* This would output "This is a si...", since the string is longer than
* $maxlen and the resulting string matches 15 characters including the dots.
*
* @param string $string
* The string to operate on
* @param int $maxlen
* The maximum number of characters
* @param string $fillup [optional]
* @return string
* The resulting string
*/
public static function trimHard($string, $maxlen, $fillup = '...') {
// If the string is smaller than the maximum lenght, it makes no sense to
// process it any further. Return it.
if (parent::getStringLength($string) < $maxlen) {
return $string;
}
// Calculate the maximum text length
$maximum_text_length = $maxlen - parent::getStringLength($fillup);
// If text length is over zero cut it
if ($maximum_text_length > 0) {
if (preg_match('/(*UTF8)^.{0,' . $maximum_text_length . '}/', $string, $result_array)) {
$cutted_string = $result_array[0];
} else if (preg_match('/^.{0,' . $maximum_text_length . '}/u', $string, $result_array)) {
$cutted_string = $result_array[0];
} else {
$cutted_string = parent::getPartOfString($string, 0, $maximum_text_length);
}
} else {
$cutted_string = $string;
}
// Append the fillup string
$cutted_string .= $fillup;
return $cutted_string;
}
/**
* Trims a string to a approximate length preserving sentence boundaries.
*
* The algorithm inside calculates the sentence length to the previous and
* next sentences. The distance to the next sentence which is smaller will
* be taken to trim the string to match the approximate length parameter.
*
* Example:
*
* $string = "This contains two sentences. ";
* $string .= "Lets play around with them. ";
*
* echo cString::trimSentence($string, 40);
* echo cString::trimSentence($string, 50);
*
* The first example would only output the first sentence, the second
* example both sentences.
*
* Explanation:
*
* To match the given max length closely, the function calculates the
* distance to the next and previous sentences. Using the maxlength of 40
* characters, the distance to the previous sentence would be 8 characters,
* and to the next sentence it would be 19 characters. Therefore, only the
* previous sentence is displayed.
*
* The second example displays the second sentence also, since the distance
* to the next sentence is only 9 characters, but to the previous it is 18
* characters.
*
* If you specify the boolean flag "$hard", the limit parameter creates a
* hard limit instead of calculating the distance.
*
* This function ensures that at least one sentence is returned.
*
* @param string $string
* The string to operate on
* @param int $approxlen
* The approximate number of characters
* @param bool $hard [optional]
* If true, use a hard limit for the number of characters
* @return string
* The resulting string
*/
public static function trimSentence($string, $approxlen, $hard = false) {
// If the string is smaller than the maximum lenght, it makes no sense to
// process it any further. Return it.
if (parent::getStringLength($string) < $approxlen) {
return $string;
}
// Find out the start of the next sentence
$next_sentence_start = parent::findFirstPos($string, '.', $approxlen);
// If there's no next sentence (somebody forgot the dot?), set it to the end
// of the string.
if ($next_sentence_start === false) {
$next_sentence_start = parent::getStringLength($string);
}
// Cut the previous sentence so we can use cString::findLastPos
$previous_sentence_cutted = parent::getPartOfString($string, 0, $approxlen);
// Get out the previous sentence start
$previous_sentence_start = cString::findLastPos($previous_sentence_cutted, '.');
// If the sentence doesn't contain a dot, use the text start.
if ($previous_sentence_start === false) {
$previous_sentence_start = 0;
}
// If we have a hard limit, we only want to process everything before
// $approxlen
if (($hard == true) && ($next_sentence_start > $approxlen)) {
return parent::getPartOfString($string, 0, $previous_sentence_start + 1);
}
// Calculate next and previous sentence distances
$distance_previous_sentence = $approxlen - $previous_sentence_start;
$distance_next_sentence = $next_sentence_start - $approxlen;
// Sanity: Return at least one sentence.
$sanity = parent::getPartOfString($string, 0, $previous_sentence_start + 1);
if (parent::findFirstPos($sanity, '.') === false) {
return parent::getPartOfString($string, 0, $next_sentence_start + 1);
}
// Decide wether the next or previous sentence is nearer
if ($distance_previous_sentence > $distance_next_sentence) {
return parent::getPartOfString($string, 0, $next_sentence_start + 1);
} else {
return parent::getPartOfString($string, 0, $previous_sentence_start + 1);
}
}
/**
* Converts diactritics to english characters whenever possible.
*
* For german umlauts, this function converts the umlauts to their ASCII
* equivalents (e.g. ä => ae).
*
* For more information about diacritics, refer to
* http://en.wikipedia.org/wiki/Diacritic
*
* For other languages, the diacritic marks are removed, if possible.
*
* @param string $string
* The string to operate on
* @param string $sourceEncoding [optional; default: UTF-8]
* The source encoding
* @param string $targetEncoding [optional; default: UTF-8]
* The target encoding
*
* @return string
* The resulting string
* @throws cInvalidArgumentException
*/
public static function replaceDiacritics($string, $sourceEncoding = 'UTF-8', $targetEncoding = 'UTF-8') {
if ($sourceEncoding != 'UTF-8') {
$string = self::recodeString($string, $sourceEncoding, "UTF-8");
}
// replace regular german umlauts and other common characters with
// diacritics
static $search, $replace;
if (!isset($search)) {
$search = array(
'Ä',
'Ö',
'Ü',
'ä',
'ö',
'ü',
'ß',
'Á',
'À',
'Â',
'á',
'à',
'â',
'É',
'È',
'Ê',
'é',
'è',
'ê',
'Í',
'Ì',
'Î',
'í',
'ì',
'î',
'Ó',
'Ò',
'Ô',
'ó',
'ò',
'ô',
'Ú',
'Ù',
'Û',
'ú',
'ù',
'û'
);
$replace = array(
'Ae',
'Oe',
'Ue',
'ae',
'oe',
'ue',
'ss',
'A',
'A',
'A',
'a',
'a',
'a',
'E',
'E',
'E',
'e',
'e',
'e',
'I',
'I',
'I',
'i',
'i',
'i',
'O',
'O',
'O',
'o',
'o',
'o',
'U',
'U',
'U',
'u',
'u',
'u'
);
}
$string = str_replace($search, $replace, $string);
// TODO: Additional converting
return self::recodeString($string, "UTF-8", $targetEncoding);
}
/**
* Converts a string to another encoding.
*
* This function tries to detect which function to use (either recode or
* iconv).
*
* If $sourceEncoding and $targetEncoding are the same, this function
* returns immediately.
*
* For more information about encodings, refer to
* http://en.wikipedia.org/wiki/Character_encoding
*
* For more information about the supported encodings in recode, refer to
* http://www.delorie.com/gnu/docs/recode/recode_toc.html
*
* Note: depending on whether recode or iconv is used, the supported
* charsets differ. The following ones are commonly used and are most likely
* supported by both converters:
*
* - ISO-8859-1 to ISO-8859-15
* - ASCII
* - UTF-8
*
* @todo Check if the charset names are the same for both converters
* @todo Implement a converter and charset checker to ensure compilance.
*
* @param string $string
* The string to operate on
* @param string $sourceEncoding
* The source encoding
* @param string $targetEncoding
* The target encoding (if false, use source encoding)
*
* @return string
* The resulting string
* @throws cInvalidArgumentException
*/
public static function recodeString($string, $sourceEncoding, $targetEncoding) {
// If sourceEncoding and targetEncoding are the same, return
if (parent::toLowerCase($sourceEncoding) == parent::toLowerCase($targetEncoding)) {
return $string;
}
// Check for the "recode" support
if (function_exists('recode')) {
$sResult = recode_string("$sourceEncoding..$targetEncoding", $string);
return $sResult;
}
// Check for the "iconv" support
if (function_exists('iconv')) {
$sResult = iconv($sourceEncoding, $targetEncoding, $string);
return $sResult;
}
// No charset converters found; return with warning
cWarning(__FILE__, __LINE__, 'cString::recodeString could not find either recode or iconv to do charset conversion.');
return $string;
}
/**
* Removes or converts all "evil" URL characters.
*
* This function removes or converts all characters which can make an URL
* invalid.
*
* Clean characters include:
* - All characters between 32 and 126 which are not alphanumeric and
* aren't one of the following: _-.
*
* @param string $string
* The string to operate on
* @param bool $replace [optional]
* If true, all "unclean" characters are replaced
*
* @return string
* The resulting string
* @throws cInvalidArgumentException
*/
public static function cleanURLCharacters($string, $replace = false) {
$string = self::replaceDiacritics($string);
$string = str_replace(' ', '-', $string);
$string = str_replace('/', '-', $string);
$string = str_replace('&', '-', $string);
$string = str_replace('+', '-', $string);
$iStrLen = parent::getStringLength($string);
$sResultString = '';
for ($i = 0; $i < $iStrLen; $i++) {
$sChar = parent::getPartOfString($string, $i, 1);
if (preg_match('/^[a-z0-9]*$/i', $sChar) || $sChar == '-' || $sChar == '_' || $sChar == '.') {
$sResultString .= $sChar;
} else {
if ($replace == true) {
$sResultString .= '_';
}
}
}
return $sResultString;
}
/**
* Normalizes line endings in passed string.
*
* @param string $string
* @param string $lineEnding [optional]
* Feasible values are "\n", "\r" or "\r\n"
* @return string
*/
public static function normalizeLineEndings($string, $lineEnding = "\n") {
if ($lineEnding !== "\n" && $lineEnding !== "\r" && $lineEnding !== "\r\n") {
$lineEnding = "\n";
}
$string = str_replace("\r\n", "\n", $string);
$string = str_replace("\r", "\n", $string);
if ($lineEnding !== "\n") {
$string = str_replace("\n", $lineEnding, $string);
}
return $string;
}
/**
* Convert null string to empty string
*
* @param string $string
* @return string
*/
public static function nullToString($string) {
//var_dump($string);
if(empty($string) || is_null($string)) {
$string = '';
}
//var_dump($string);
return $string;
}
}

Datei anzeigen

@ -174,10 +174,10 @@ class UI_Menu {
foreach ($this->link as $key => $value) {
if ($value != NULL) {
if ($this->imagewidth[$key] != 0) {
if (!empty($this->imagewidth[$key]) && !empty ($this->image[$key])) {
$value->setContent('<img border="0" src="' . $this->image[$key] . '" width="' . $this->imagewidth[$key] . '">');
$img = $value->render();
} else {
} else if(!empty ($this->image[$key])) {
$value->setContent('<img border="0" src="' . $this->image[$key] . '">');
$img = $value->render();
}
@ -186,14 +186,12 @@ class UI_Menu {
} else {
$link = $this->title[$key];
if ($this->image[$key] != "") {
if (!empty($this->image[$key])) {
if ($this->imagewidth[$key] != 0) {
$img = '<img border="0" src="' . $this->image[$key] . '" width="' . $this->imagewidth[$key] . '">';
} else {
$img = '<img border="0" src="' . $this->image[$key] . '">';
}
} else {
$img = "&nbsp;";
}
}
@ -212,21 +210,24 @@ class UI_Menu {
$bgColor = $cfg["color"]["table_light_active"];
}
if ($this->extra[$key] == 'id="marked" ') {
if (!empty($this->extra[$key]) && $this->extra[$key] == 'id="marked" ') {
$bgColor = $cfg["color"]["table_light_active"];
}
}
$tpl->set('d', 'NAME', $link);
if ($this->image[$key] == "") {
if (empty($this->image[$key])) {
$tpl->set('d', 'ICON', '');
} else {
$tpl->set('d', 'ICON', $img);
}
if ($this->extra[$key] != "" || $this->rowmark == true) {
if (!empty($this->extra[$key]) || $this->rowmark == true) {
$extraadd = "";
if(empty($this->extra[$key])) {
$this->extra[$key] = '';
}
if ($this->rowmark == true) {
$extraadd = 'onmouseover="row.over(this)" onmouseout="row.out(this)" onclick="row.click(this)"';
@ -439,7 +440,7 @@ class UI_Table_Form {
if (is_array($this->items)) {
foreach ($this->items as $key => $value) {
if ($this->itemType[$key] == 'subheader') {
if (isset($this->itemType[$key]) && $this->itemType[$key] == 'subheader') {
$subheader = '<tr class="text_medium" style="background-color: ' . $cfg["color"]["table_header"] . ';">';
$subheader .= '<td colspan="2" valign="top" style="border: 0px;border-top: 0px; border-bottom:0px; border-right:1px;border-color: ' . $cfg["color"]["table_border"] . '; border-style: solid;">' . $this->captions[$key] . '</td></tr>';
@ -703,6 +704,7 @@ class UI_Page {
class Link {
var $alt = '';
var $link;
var $title;
var $targetarea;
@ -770,7 +772,8 @@ class Link {
function render() {
global $sess, $cfg;
$custom = '';
$attributes = '';
if ($this->alt != "") {
$alt = 'alt="' . $this->alt . '" title="' . $this->alt . '" ';
} else {
@ -819,7 +822,7 @@ class Link {
break;
}
if ($this->images == '') {
if (empty($this->images)) {
return ($link . $this->content . "</a>");
} else {
list($this->img_width, $this->img_height, $this->img_type, $this->img_attr) = getimagesize($cfg['path']['contenido'] . $this->images);
@ -910,6 +913,7 @@ class UI_List {
$colcount = 0;
if (is_array($this->cells)) {
$dark = true;
foreach ($this->cells as $row => $cells) {
$thefont = '';
$unne = '';
@ -928,7 +932,7 @@ class UI_List {
$bgColor = $cfg["color"]["table_light"];
}
if ($this->bgcolor[$row] != "") {
if (!empty($this->bgcolor[$row])) {
$bgColor = $this->bgcolor[$row];
}
@ -936,7 +940,7 @@ class UI_List {
$count = 0;
foreach ($cells as $key => $value) {
$thefontDispl = $thefont . $this->extra[$row][$key];
$thefontDispl = $thefont . (empty($this->extra[$row][$key]))?'':$this->extra[$row][$key];
$count++;
$tpl2->reset();
@ -966,7 +970,7 @@ class UI_List {
$tpl2->set('s', 'ALIGN', 'left');
}
if ($this->cellvalignment[$row][$key] != "") {
if (!empty($this->cellvalignment[$row][$key])) {
$tpl2->set('s', 'VALIGN', $this->cellvalignment[$row][$key]);
} else {
$tpl2->set('s', 'VALIGN', 'top');
@ -1027,10 +1031,10 @@ class cScrollList {
var $listStart;
/**
* sortable flag
* @var string
* sortable array
* @var array
*/
var $sortable;
protected $_aSortable;
/**
* sortlink
@ -1080,7 +1084,7 @@ class cScrollList {
$this->resultsPerPage = 0;
$this->listStart = 1;
$this->sortable = false;
$this->_aSortable = [];
$this->objTable = new cHTMLTable();
if ($defaultstyle == true) {
@ -1126,7 +1130,7 @@ class cScrollList {
* @param $sortable boolean true or false
*/
function setSortable($key, $sortable) {
$this->sortable[$key] = $sortable;
$this->_aSortable[$key] = $sortable;
}
/**
@ -1298,8 +1302,7 @@ class cScrollList {
$this->sortkey = $field;
$this->sortmode = $order;
$field = $field + 1;
$field = intval($field) + 1;
$this->data = array_csort($this->data, "$field", $order);
}
@ -1330,8 +1333,8 @@ class cScrollList {
/* Render header */
foreach ($this->header as $key => $value) {
if (is_array($this->sortable)) {
if (array_key_exists($key, $this->sortable) && $this->sortable[$key] == true) {
if (is_array($this->_aSortable)) {
if (array_key_exists($key, $this->_aSortable) && $this->_aSortable[$key] == true) {
$this->sortlink->setContent($value);
$this->sortlink->setCustom("sortby", $key);

Datei anzeigen

@ -508,23 +508,47 @@ class Contenido_UpdateNotifier {
$response = false;
if ($this->_bUseCurl) {
if ($bCheckCon) {
$ch = $this->_checkCon2Host($sHost);
} else {
$ch = curl_init("http://" . $sHost);
}
if (is_resource($ch)) {
curl_setopt($ch, CURLOPT_URL, "http://" . $sHost . $sFile);
$sUrl = "https://" . $sHost . $sFile;
$ch = $this->_checkCon2Host($sUrl);
if ($ch !== false) {
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: close'));
curl_setopt($ch, CURLOPT_TIMEOUT, 2);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
//Check for errors.
if (curl_errno($ch)) {
throw new Exception(curl_error($ch));
}
curl_close($ch);
}
/*
if ($bCheckCon) {
$ch = $this->_checkCon2Host($sHost);
} else {
$ch = curl_init("https://" . $sHost);
}
if (is_resource($ch)) {
curl_setopt($ch, CURLOPT_URL, "https://" . $sHost . $sFile);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: close'));
curl_setopt($ch, CURLOPT_TIMEOUT, 2);
$response = curl_exec($ch);
curl_close($ch);
} */
} else {
$source = file_get_contents("http://" . $sHost . $sFile);
if ($source !== false AND ! empty($source)) {
$arrContextOptions = array(
"ssl" => array(
"verify_peer" => false,
"verify_peer_name" => false,
)
);
$source = file_get_contents("https://" . $sHost . $sFile, false, stream_context_create($arrContextOptions));
if ($source !== false AND !empty($source)) {
$response = $source;
}
}
@ -539,13 +563,12 @@ class Contenido_UpdateNotifier {
* @param string $sHost
* @return obj|boolean curl object or false
*/
protected function _checkCon2Host($sHost) {
$ch = curl_init("http://" . $sHost);
if (!is_resource($ch)) {
protected function _checkCon2Host($sUrl) {
$ch = curl_init($sUrl);
if ($ch === false) {
$sErrorMessage = i18n('Unable to check for updates!') . " "
. sprintf(i18n('Connection to %s failed!'), $sHost);
$this->sErrorOutput = $this->renderOutput($sErrorMessage);
return false;
}
return $ch;
}
@ -700,7 +723,7 @@ class Contenido_UpdateNotifier {
if (strlen($sText) > 150) {
$sText = capiStrTrimAfterWord($sText, 150) . '...';
}
//echo $aItem->title;
//echo $aItem->title;
$oTpl->set("d", "NEWS_DATE", $aItem->pubDate);
$oTpl->set("d", "NEWS_TITLE", utf8_decode($aItem->title));
$oTpl->set("d", "NEWS_TEXT", $sText);

Datei anzeigen

@ -377,6 +377,10 @@ class User {
*/
function getUserProperty($type, $name, $group = false) {
global $cfg, $perm;
if(empty($this->values)) {
return false;
}
if (!is_object($perm)) {
$perm = new Contenido_Perm();

Datei anzeigen

@ -443,15 +443,13 @@ class cFileHandler {
* true if the given filename is valid, false otherwise
*/
public static function validateFilename($filename, $notifyAndExitOnFailure = true) {
$notification = new Contenido_Notification();
// check if filename only contains valid characters
if (preg_match('/[^a-z0-9._-]/i', $filename)) {
// validation failure...
if ($notifyAndExitOnFailure) {
// display notification and exit
cRegistry::addErrorMessage(i18n('Wrong file name.'));
$page = new cGuiPage('generic_page');
$page->abortRendering();
$page->render();
$notification->displayNotification("error", i18n("Please insert file name."));
exit();
}
@ -463,7 +461,6 @@ class cFileHandler {
// validation failure...
if ($notifyAndExitOnFailure) {
// display notification and exit
$notification = new cGuiNotification();
$notification->displayNotification("error", i18n("Please insert file name."));
exit();
}

Datei anzeigen

@ -32,7 +32,7 @@ class cRegistry {
*/
public static function getBackendPath() {
$cfg = self::getConfig();
return $cfg['path']['contenido'];
return $cfg['path']['conlite'];
}
/**
@ -46,6 +46,36 @@ class cRegistry {
return $cfg['path']['contenido_fullhtml'];
}
/**
* Function which returns path after the last possible place changing via
* configuration file.
* The path point to the current client
*
* @author konstantinos.katikakis
* @return string
* path
*/
public static function getFrontendPath() {
$cfgClient = self::getClientConfig();
$client = self::getClientId();
return (empty($cfgClient))?'':$cfgClient[$client]['path']['frontend'];
}
/**
* Function which returns URL after the last possible place changing via
* configuration file.
* The path point to the current client
*
* @author konstantinos.katikakis
* @return string
* URL
*/
public static function getFrontendUrl() {
$cfgClient = self::getClientConfig();
$client = self::getClientId();
return $cfgClient[$client]['path']['htmlpath'];
}
/**
* Returns the client configuration array stored in the global variable
* "cfgClient".
@ -189,6 +219,11 @@ class cRegistry {
return self::_fetchGlobalVariable('edit', FALSE);
}
public static function getCurrentModule()
{
return self::_fetchGlobalVariable('cCurrentModule', 0);
}
/**
* Fetches the global variable requested.
* If variable is not set, the default value is returned.
@ -216,5 +251,4 @@ class cRegistry {
return new $apiClassName($objectId);
}
}
?>
}

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* File:
* class.articlelanguage.php
@ -18,14 +19,12 @@
*
* $Id$
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
class cApiArticleLanguageCollection extends ItemCollection {
public function __construct($select = false) {
global $cfg;
parent::__construct($cfg["tab"]["art_lang"], "idartlang");
@ -36,26 +35,26 @@ class cApiArticleLanguageCollection extends ItemCollection {
$this->select($select);
}
}
public function getIdArtLang($iIdart, $iIdlang) {
$this->setWhere('idart', Contenido_Security::toInteger($iIdart));
$this->setWhere('idlang', Contenido_Security::toInteger($iIdlang));
if($this->query() && $this->count() > 0) {
if ($this->query() && $this->count() > 0) {
return $this->next()->get('idartlang');
}
return false;
}
}
class cApiArticleLanguage extends Item {
class cApiArticleLanguage extends Item
{
/**
* Constructor Function
* @param mixed $mId Specifies the ID of item to load
*
* @global type $cfg
* @param type $mId
*/
public function __construct($mId = false)
{
public function __construct($mId = false) {
global $cfg;
parent::__construct($cfg["tab"]["art_lang"], "idartlang");
$this->setFilters(array(), array());
@ -63,24 +62,23 @@ class cApiArticleLanguage extends Item
$this->loadByPrimaryKey($mId);
}
}
public function loadByArticleAndLanguageId($idart, $idlang) {
$result = true;
if (!$this->isLoaded()) {
if (!$this->isLoaded()) {
$idartlang = $this->_getIdArtLang($idart, $idlang);
$result = $this->loadByPrimaryKey($idartlang);
}
return $result;
}
protected function _getIdArtLang($idart, $idlang) {
$sql = sprintf('SELECT idartlang FROM `%s` WHERE idart = %d AND idlang = %d', cRegistry::getConfigValue('tab', 'art_lang'), $idart, $idlang);
$this->db->query($sql);
$this->db->next_record();
return $this->db->f('idartlang');
}
public function getContent($type = '', $id = NULL) {
if (NULL === $this->content) {
$this->_loadArticleContent();
@ -108,16 +106,16 @@ class cApiArticleLanguage extends Item
// return String
return (isset($this->content[$type][$id])) ? $this->content[$type][$id] : '';
}
protected function _loadArticleContent() {
if (NULL !== $this->content) {
return;
}
$sql = "SELECT b.type, a.typeid, a.value FROM `".cRegistry::getConfigValue('tab', 'content')
."` AS a, `".cRegistry::getConfigValue('tab', 'type')
."` AS b WHERE a.idartlang = ".$this->get('idartlang')
." AND b.idtype = a.idtype ORDER BY a.idtype, a.typeid";
$sql = "SELECT b.type, a.typeid, a.value FROM `" . cRegistry::getConfigValue('tab', 'content')
. "` AS a, `" . cRegistry::getConfigValue('tab', 'type')
. "` AS b WHERE a.idartlang = " . $this->get('idartlang')
. " AND b.idtype = a.idtype ORDER BY a.idtype, a.typeid";
$this->db->query($sql);
@ -126,5 +124,7 @@ class cApiArticleLanguage extends Item
$this->content[strtolower($this->db->f('type'))][$this->db->f('typeid')] = urldecode($this->db->f('value'));
}
}
}
?>

Datei anzeigen

@ -52,6 +52,4 @@ class cApiCategory extends Item {
}
}
}
?>
}

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen