File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,25 @@ public function getBlockInfo($identifier)
45
45
return false ;
46
46
}
47
47
48
+ /**
49
+ * get page info
50
+ * @param $identifier
51
+ * @return bool|mixed
52
+ */
53
+ public function getPageInfo ($ identifier )
54
+ {
55
+ if ($ this ->isEnabled ()){
56
+ $ pageModel = Mage::getModel ('cms/page ' )->load ($ identifier , 'identifier ' );
57
+
58
+ if ($ pageModel ){
59
+
60
+ return $ pageModel ->getData ();
61
+ }
62
+ }
63
+ return false ;
64
+
65
+ }
66
+
48
67
/**
49
68
* check if the block/page exists in remote
50
69
* @param $identifier
Original file line number Diff line number Diff line change @@ -28,11 +28,11 @@ public function sync($pageId)
28
28
$ remotePage = $ proxy ->call ($ sessionId , 'cms_api.page_info ' , $ pageModel ->getIdentifier ());// array of info for the remote block
29
29
30
30
if ($ remotePage ){
31
-
31
+ echo ' update page ' ;
32
32
// update page
33
33
$ proxy ->call ($ sessionId , 'cms_api.page_update ' , array ($ pageModel ->getData ()));
34
34
}else {
35
-
35
+ echo ' create page ' ;
36
36
// create new block
37
37
$ proxy ->call ($ sessionId , 'cms_api.page_create ' , array ($ pageModel ->getData ()));
38
38
}
You can’t perform that action at this time.
0 commit comments