Skip to content

Instantly share code, notes, and snippets.

View sminnee's full-sized avatar

Sam Minnée sminnee

View GitHub Profile
Index: modules/sapphire/branches/airnz/iteration3/core/model/SiteTree.php
===================================================================
--- modules/sapphire/branches/airnz/iteration2/core/model/SiteTree.php (revision 85655)
+++ modules/sapphire/branches/airnz/iteration3/core/model/SiteTree.php (revision 88403)
@@ -93,29 +93,27 @@
static $has_many = array(
"Comments" => "PageComment"
);
<?php
/**
* Filter the SiteTree by pages awaiting approval
*
* @package cmsworkflow
* @subpackage ThreeStep
*/
class CMSWorkflowThreeStepFilters_PagesAwaitingApproval extends CMSSiteTreeFilter {
static function title() {
<?php
/**
* Filter the SiteTree by pages awaiting approval
*
* @package cmsworkflow
* @subpackage ThreeStep
*/
class CMSWorkflowThreeStepFilters_PagesAwaitingApproval extends CMSSiteTreeFilter {
static function title() {
Index: sapphire/core/control/Director.php
===================================================================
--- sapphire/core/control/Director.php (revision 88560)
+++ sapphire/core/control/Director.php (working copy)
@@ -199,10 +199,7 @@
if (@parse_url($url, PHP_URL_HOST) != '') {
$bits = parse_url($url);
$_SERVER['HTTP_HOST'] = $bits['host'];
- // Implementing a custom absolute->relative code snippet as
- // Director::makeRelative() chokes on a url like http://localhost
Index: /Users/sminnee/Sites/airnz1/sapphire/tests/SiteTreeBrokenLinksTest.php
===================================================================
--- /Users/sminnee/Sites/airnz1/sapphire/tests/SiteTreeBrokenLinksTest.php (revision 89880)
+++ /Users/sminnee/Sites/airnz1/sapphire/tests/SiteTreeBrokenLinksTest.php (working copy)
@@ -58,6 +58,69 @@
$this->assertFalse($obj->HasBrokenFile, 'Page does NOT have a broken file');
}
+ function testDeletingMarksBackLinkedPagesAsBroken() {
+ $this->logInWithPermission('ADMIN');
Index: sapphire/tests/SiteTreeBrokenLinksTest.php
===================================================================
--- sapphire/tests/SiteTreeBrokenLinksTest.php (revision 89985)
+++ sapphire/tests/SiteTreeBrokenLinksTest.php (working copy)
@@ -58,6 +58,69 @@
$this->assertFalse($obj->HasBrokenFile, 'Page does NOT have a broken file');
}
+ function testDeletingMarksBackLinkedPagesAsBroken() {
+ $this->logInWithPermission('ADMIN');
Index: sapphire/core/SSViewer.php
===================================================================
--- sapphire/core/SSViewer.php (revision 90546)
+++ sapphire/core/SSViewer.php (working copy)
@@ -517,7 +517,7 @@
$content = ereg_replace('<' . '% +sprintf\(_t\((\'([^\']*)\'|"([^"]*)")(([^)]|\)[^ ]|\) +[^% ])*)\),\<\?= +([^\?]*) +\?\>) +%' . '>', '<?= sprintf(_t(\'\\2\\3\'\\4),\\6) ?>', $content);
// </base> isnt valid html? !?
- $content = ereg_replace('<' . '% +base_tag +%' . '>', '<base href="<?= Director::absoluteBaseURL(); ?>" />', $content);
+ $content = ereg_replace('<' . '% +base_tag +%' . '>', '<?= SSViewer::get_base_tag($val); ?>', $content);
<% control SettingsForm %>
<form $FormAttributes>
<fieldset>
<h3>Page generation time</h3>
<div class="field text">
<label for="$FieldMap.PageExecTimeCritical.ID">Critical threshold (<abbr title="milliseconds">ms</abbr>)</label>
$FieldMap.PageExecTimeCritical
</div>
<div class="field text">
<label for="$FieldMap.PageExecTimeWarning.ID">Warning threshold (<abbr title="milliseconds">ms</abbr>)</label>
Index: sapphire/forms/Form.php
===================================================================
--- sapphire/forms/Form.php (revision 90851)
+++ sapphire/forms/Form.php (working copy)
@@ -905,8 +905,10 @@
* a property or array-key of the passed {@link $data} argument are "left alone",
* meaning they retain any previous values (if present). If this flag is set to true,
* those fields are overwritten with null regardless if they have a match in {@link $data}.
+ * @param $fieldList An optional list of fields to process. This can be useful when you have a
+ * form that has some fields that save to one object, and some that save to another.
diff --git a/app/code/control/Dashboard.php b/app/code/control/Dashboard.php
index 072fd62..e72f9a7 100644
--- a/app/code/control/Dashboard.php
+++ b/app/code/control/Dashboard.php
@@ -359,6 +359,50 @@ class Dashboard extends Controller {
}
/**
+ * Settings form for configuring guardian
+ */