bonethug 0.0.37 → 0.0.38
Sign up to get free protection for your applications and to get access to all the features.
data/config/deploy.rb
CHANGED
@@ -184,7 +184,7 @@ task :deploy => :environment do
|
|
184
184
|
queue! %[php #{deploy_to}/shared/composer.phar install] if use_composer
|
185
185
|
|
186
186
|
# update bower
|
187
|
-
queue! %[cd #{deploy_to}/current && bower install] if use_bower
|
187
|
+
queue! %[cd #{deploy_to}/current && bower install --allow-root] if use_bower
|
188
188
|
|
189
189
|
# build the vhosts
|
190
190
|
vh_cnf = conf.get('apache.'+env)
|
data/lib/bonethug/version.rb
CHANGED
data/scripts/ubuntu_setup.sh
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
<?php
|
2
2
|
class Page extends SiteTree {
|
3
3
|
|
4
|
+
protected static $page_cache = array();
|
5
|
+
|
4
6
|
private static $can_be_root = true;
|
5
7
|
|
6
8
|
private static $db = array(
|
@@ -21,6 +23,35 @@ class Page extends SiteTree {
|
|
21
23
|
return $fields;
|
22
24
|
}
|
23
25
|
|
26
|
+
// Helper functions
|
27
|
+
// -----------------
|
28
|
+
|
29
|
+
public static function get_a($pageType = 'Page') {
|
30
|
+
$page = null;
|
31
|
+
if (!empty(self::$page_cache[$pageType])) $page = self::$page_cache[$pageType];
|
32
|
+
else if ($page = DataObject::get_one($pageType)) self::$page_cache[$pageType] = $page;
|
33
|
+
return $page;
|
34
|
+
}
|
35
|
+
|
36
|
+
public function IsA ($className) {
|
37
|
+
return is_a($this, $className);
|
38
|
+
}
|
39
|
+
|
40
|
+
public function AreSamePage ($page1, $page2) {
|
41
|
+
return $page1->ID == $page2->ID;
|
42
|
+
}
|
43
|
+
|
44
|
+
public function PaginatedChildren($limit = null, $order = 'Created DESC', $hitsOptions = null){
|
45
|
+
|
46
|
+
if ($limit === null) $limit = self::$hits_per_page;
|
47
|
+
|
48
|
+
$do = new DataObject;
|
49
|
+
$do->DataSet = AbcPaginator::get($limit)->fetch('Page', "ParentID = ".$this->ID, $order);
|
50
|
+
$do->Paginator = $do->DataSet->Paginator->dataForTemplate($do->DataSet->unlimitedRowCount, 2, null, $hitsOptions);
|
51
|
+
$do->HitsSelector = $do->Paginator->HitsSelector;
|
52
|
+
return $do;
|
53
|
+
}
|
54
|
+
|
24
55
|
}
|
25
56
|
class Page_Controller extends ContentController {
|
26
57
|
|