Skip to content

Commit 7cb090c

Browse files
author
mutec
committed
format code
1 parent 2b446d4 commit 7cb090c

File tree

1 file changed

+37
-32
lines changed

1 file changed

+37
-32
lines changed

files/acp/update_210rc3.php

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,45 +8,50 @@
88
*
99
* @author Jens Krumsieck
1010
* @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>
1213
* @package de.codequake.cms
1314
*/
1415

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();
2427

25-
$affectedObjects = $list->getObjects ();
28+
$affectedObjects = $list->getObjects();
2629

2730
// delete all headlines
28-
$action = new ContentAction ( $affectedObjects, 'delete', array () );
29-
$action->executeAction ();
31+
$action = new ContentAction($affectedObjects, 'delete', array());
32+
$action->executeAction();
3033

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();
3843

3944
// 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+
}
5257
}

0 commit comments

Comments
 (0)