Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated selectable table for 2.4 compatability #26

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions content/content.index.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function __construct(){
*/
public function build($context)
{
if(Administration::instance()->Author->isDeveloper()) {
if(Administration::instance()->Author()->isDeveloper()) {
if($_POST['with-selected'] == 'delete' && is_array($_POST['items']))
{
foreach($_POST['items'] as $id_role => $value)
Expand Down Expand Up @@ -99,8 +99,12 @@ public function __viewIndex()

// Create the table element:
$table = Widget::Table(
Widget::TableHead($tableHead), null,
Widget::TableBody($tableBody), 'selectable'
Widget::TableHead($tableHead),
NULL,
Widget::TableBody($tableBody),
'selectable',
null,
array('role' => 'directory', 'aria-labelledby' => 'symphony-subheading', 'data-interactive' => 'data-interactive')
);
$this->Form->appendChild($table);

Expand All @@ -118,4 +122,4 @@ public function __viewIndex()
$this->Form->appendChild($tableActions);
}
}
?>
?>
18 changes: 9 additions & 9 deletions extension.driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function fetchNavigation() {
public function extendNavigation($context) {
$data = $this->getCurrentAuthorRoleData();

if($data == false || Administration::instance()->Author->isDeveloper()) {
if($data == false || Administration::instance()->Author()->isDeveloper()) {
return;
}

Expand Down Expand Up @@ -153,7 +153,7 @@ public function deleteAuthorRole($context) {
* The context, providing the form and the author object
*/
public function addRolePicker($context) {
if(Administration::instance()->Author->isDeveloper()) {
if(Administration::instance()->Author()->isDeveloper()) {
$group = new XMLElement('fieldset');
$group->setAttribute('class', 'settings');
$group->appendChild(new XMLElement('legend', __('Author Role')));
Expand Down Expand Up @@ -232,7 +232,7 @@ public function checkCallback($context) {
private function adjustIndex($context, $callback) {
$data = $this->getCurrentAuthorRoleData();

if($data == false || Administration::instance()->Author->isDeveloper()) {
if($data == false || Administration::instance()->Author()->isDeveloper()) {
return;
}

Expand Down Expand Up @@ -266,7 +266,7 @@ private function adjustIndex($context, $callback) {
if($rules['own_entries'] == 1 || $rules['edit'] == 0 || $rules['delete'] == 0 || $rules['use_filter'] == 1) {
// For only show entries created by this author:
// Get a list of entry id's created by this author:
$id_author = Administration::instance()->Author->get('id');
$id_author = Administration::instance()->Author()->get('id');

if($rules['own_entries'] == 1) {
// Only get the ID's of the current author to begin with:
Expand Down Expand Up @@ -428,7 +428,7 @@ private function adjustIndex($context, $callback) {
public function makePreAdjustements($context) {
$data = $this->getCurrentAuthorRoleData();

if($data == false || Administration::instance()->Author->isDeveloper()) {
if($data == false || Administration::instance()->Author()->isDeveloper()) {
return;
}

Expand Down Expand Up @@ -493,7 +493,7 @@ private static function replaceChild($parent, $child) {
private function adjustEntryEditor($context, $callback) {
$data = $this->getCurrentAuthorRoleData();

if($data == false || Administration::instance()->Author->isDeveloper()) {
if($data == false || Administration::instance()->Author()->isDeveloper()) {
return;
}

Expand Down Expand Up @@ -580,7 +580,7 @@ private function adjustEntryEditor($context, $callback) {
*/
private function getCurrentAuthorRoleData() {
if(Administration::instance()->isLoggedIn()) {
$id_author = Administration::instance()->Author->get('id');
$id_author = Administration::instance()->Author()->get('id');
$id_role = $this->getAuthorRole($id_author);

if($id_role != false) {
Expand All @@ -601,7 +601,7 @@ private function getCurrentAuthorRoleData() {
public function modifyAreas($context) {
$data = $this->getCurrentAuthorRoleData();

if($data == false || Administration::instance()->Author->isDeveloper()) {
if($data == false || Administration::instance()->Author()->isDeveloper()) {
return;
}

Expand All @@ -622,7 +622,7 @@ public function modifyAreas($context) {
* The context
*/
public function saveAuthorRole($context) {
if(Administration::instance()->Author->isDeveloper()) {
if(Administration::instance()->Author()->isDeveloper()) {
$id_role = intval($_POST['fields']['role']);
$id_author = $context['author']->get('id');

Expand Down