Skip to content

Commit a7fa82f

Browse files
committed
Initial support for field binding. Currently binding needs to be updated using the sync_bindings action which will go through all tables and create appropriate triggers to bind fields together.
1 parent 20a1df8 commit a7fa82f

File tree

4 files changed

+534
-0
lines changed

4 files changed

+534
-0
lines changed

actions.ini.php

+7
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,13 @@ class="featured-action"
582582
url="{$app->url('-action=manage_migrate')}"
583583
label="Migrations"
584584
description="A tool to help migrate to newer versions of Dataface."
585+
586+
[sync_bindings]
587+
permission=manage_sync_bindings
588+
category=management_actions
589+
url="{$app->url('-action=sync_bindings')}"
590+
label="Synchronize Field Bindings"
591+
description="Updates the database triggers for the current field bindings, as declared in the fields.ini files."
585592

586593

587594
[clear_views]

actions/sync_bindings.php

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
error_reporting(E_ALL);
3+
ini_set('display_errors','on');
4+
class dataface_actions_sync_bindings {
5+
function handle(&$params){
6+
import(XFROOT.'xf/db/Binding.php');
7+
xf\db\Binding::updateAllBindings();
8+
echo "All bindings have been synchronized";
9+
}
10+
11+
}

permissions.ini.php

+2
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
manage_migrate = "Manage Migrations"
140140
manage = "Manage Site"
141141
manage_build_index="Manage Build Search Index"
142+
manage_sync_bindings="Synchronize field bindings"
142143
install = "Install and update applications. Administrator only"
143144
expandable = "Whether the record can be expanded in the left nav menu"
144145

@@ -340,4 +341,5 @@
340341
manage_migrate=1
341342
manage_build_index=1
342343
install = 1
344+
manage_sync_bindings=1
343345

0 commit comments

Comments
 (0)