Permalink
Browse files

Merge pull request #9 from sheadawson/master

added support for static publisher
  • Loading branch information...
2 parents d35a8b6 + 199c39d commit 7606f48fb5a443a3854607daf070284778481ec6 @nyeholt committed Mar 26, 2012
Showing with 31 additions and 1 deletion.
  1. +21 −1 code/pages/NewsArticle.php
  2. +10 −0 code/pages/NewsHolder.php
@@ -179,9 +179,29 @@ public function Link($action='') {
}
return parent::Link($action);
}
+
+
+ /**
+ * Pages to update cache file for static publisher
+ *
+ * @return Array
+ */
+ public function pagesAffectedByChanges() {
+ $parent = $this->Parent();
+ $urls = array($this->Link());
+
+ // add all parent (holders)
+ while($parent && $parent->ParentID > -1){
+ $urls[] = $parent->Link();
+ $parent = $parent->Parent();
+ }
+
+ $this->extend('updatePagesAffectedByChanges', $urls);
+
+ return $urls;
+ }
}
class NewsArticle_Controller extends Page_Controller {
-
}
@@ -207,6 +207,16 @@ public function dateFolder($name, $publish=false) {
}
return $child;
}
+
+ /**
+ * Pages to update cache file for static publisher
+ *
+ * @return Array
+ */
+ public function pagesAffectedByChanges() {
+ $urls = array($this->Link());
+ return $urls;
+ }
}

0 comments on commit 7606f48

Please sign in to comment.