|
8 | 8 | * |
9 | 9 | * @author Jens Krumsieck |
10 | 10 | * @copyright 2013 - 2015 codeQuake |
11 | | - * @license GNU Lesser General Public License <http://www.gnu.org/licenses/lgpl-3.0.txt> |
| 11 | + * @license GNU Lesser General Public License |
| 12 | + * <http://www.gnu.org/licenses/lgpl-3.0.txt> |
12 | 13 | * @package de.codequake.cms |
13 | 14 | */ |
14 | 15 |
|
15 | | -$id = ObjectTypeCache::getInstance ()->getObjectTypeIDByName ( 'de.codequake.cms.content.type', 'de.codequake.cms.content.type.headline' ); |
16 | | -$list = new ContentList (); |
17 | | -$list->getConditionBuilder ()->add ( 'content.position', array ( |
18 | | - 'sidebar' |
19 | | -) ); |
20 | | -$list->getConditionBuilder ()->add ( 'content.contentTypeID', array ( |
21 | | - $id |
22 | | -) ); |
23 | | -$list->readObjects (); |
| 16 | +$id = ObjectTypeCache::getInstance()->getObjectTypeIDByName( |
| 17 | + 'de.codequake.cms.content.type', |
| 18 | + 'de.codequake.cms.content.type.headline'); |
| 19 | +$list = new ContentList(); |
| 20 | +$list->getConditionBuilder()->add('content.position', array( |
| 21 | + 'sidebar' |
| 22 | +)); |
| 23 | +$list->getConditionBuilder()->add('content.contentTypeID', array( |
| 24 | + $id |
| 25 | +)); |
| 26 | +$list->readObjects(); |
24 | 27 |
|
25 | | -$affectedObjects = $list->getObjects (); |
| 28 | +$affectedObjects = $list->getObjects(); |
26 | 29 |
|
27 | 30 | // delete all headlines |
28 | | -$action = new ContentAction ( $affectedObjects, 'delete', array () ); |
29 | | -$action->executeAction (); |
| 31 | +$action = new ContentAction($affectedObjects, 'delete', array()); |
| 32 | +$action->executeAction(); |
30 | 33 |
|
31 | | -$id = ObjectTypeCache::getInstance ()->getObjectTypeIDByName ( 'de.codequake.cms.content.type', 'de.codequake.cms.content.type.template' ); |
32 | | -$list = new ContentList (); |
33 | | -$list->getConditionBuilder ()->add ( 'content.contentTypeID', array ( |
34 | | - $id |
35 | | -) ); |
36 | | -$list->readObjects (); |
37 | | -$affectedObjects = $list->getObjects (); |
| 34 | +$id = ObjectTypeCache::getInstance()->getObjectTypeIDByName( |
| 35 | + 'de.codequake.cms.content.type', |
| 36 | + 'de.codequake.cms.content.type.template'); |
| 37 | +$list = new ContentList(); |
| 38 | +$list->getConditionBuilder()->add('content.contentTypeID', array( |
| 39 | + $id |
| 40 | +)); |
| 41 | +$list->readObjects(); |
| 42 | +$affectedObjects = $list->getObjects(); |
38 | 43 |
|
39 | 44 | // clear compiled |
40 | | -foreach ( $affectedObjects as $content ) { |
41 | | - if (! empty ( $content->compiled )) { |
42 | | - $contentData = $content->contentData; |
43 | | - $tmpArray = unserialze ( $contentData ); |
44 | | - unset ( $tmpArray ['compiled'] ); |
45 | | - $contentData = serialze ( $tmpArray ); |
46 | | - |
47 | | - $contentEditor = new ContentEditor ( $content ); |
48 | | - $contentEditor->update ( array ( |
49 | | - 'contentData' => $contentData |
50 | | - ) ); |
51 | | - } |
| 45 | +foreach ($affectedObjects as $content) { |
| 46 | + if (! empty($content->compiled)) { |
| 47 | + $contentData = $content->contentData; |
| 48 | + $tmpArray = unserialze($contentData); |
| 49 | + unset($tmpArray['compiled']); |
| 50 | + $contentData = serialze($tmpArray); |
| 51 | + |
| 52 | + $contentEditor = new ContentEditor($content); |
| 53 | + $contentEditor->update(array( |
| 54 | + 'contentData' => $contentData |
| 55 | + )); |
| 56 | + } |
52 | 57 | } |
0 commit comments