From 94eb234d9239ab6b983ca39388e6d7ef13fd4745 Mon Sep 17 00:00:00 2001 From: Kirk Strobeck Date: Tue, 17 May 2016 15:27:35 -0700 Subject: [PATCH 1/6] https://github.com/TwistedInteractive/author_roles/issues/28 --- extension.driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension.driver.php b/extension.driver.php index b521cba..77d75d0 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -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) { From 131d5d4d6211bd3691d260db6df2c93d9b4b7a81 Mon Sep 17 00:00:00 2001 From: Kirk Strobeck Date: Tue, 17 May 2016 16:04:54 -0700 Subject: [PATCH 2/6] https://github.com/TwistedInteractive/author_roles/issues/28 --- extension.driver.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/extension.driver.php b/extension.driver.php index 77d75d0..527ba91 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -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; } @@ -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'))); @@ -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; } @@ -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: @@ -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; } @@ -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; } @@ -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; } @@ -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'); From d5ed18a8841d12fd1d3d7b23e136b05ad82f2b26 Mon Sep 17 00:00:00 2001 From: Kirk Strobeck Date: Tue, 17 May 2016 16:10:26 -0700 Subject: [PATCH 3/6] https://github.com/TwistedInteractive/author_roles/issues/28 --- content/content.index.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/content/content.index.php b/content/content.index.php index 71b033f..c936b7d 100644 --- a/content/content.index.php +++ b/content/content.index.php @@ -1,6 +1,6 @@ Author->isDeveloper()) { + if(Administration::instance()->Author()->isDeveloper()) { if($_POST['with-selected'] == 'delete' && is_array($_POST['items'])) { foreach($_POST['items'] as $id_role => $value) @@ -41,7 +41,7 @@ public function view() $this->setTitle('Symphony – Roles'); $this->__viewIndex(); } - + // The Index: public function __viewIndex() { @@ -51,16 +51,16 @@ public function __viewIndex() __('Create New'), $this->_uri.'roles/new/', __('Create a new role'), 'create button' )); - + // Set the table head: $tableHead = array( array(__('Role Name'), 'col'), array(__('Authors with this role'), 'col') ); - + // Set the table body: $tableBody = array(); - + // Fill the table with available roles: $roles = $this->_driver->getRoles(); if(empty($roles)) @@ -76,7 +76,7 @@ public function __viewIndex() $td = new XMLElement('td', ''.$role['name'].''); $td->appendChild(Widget::Input('items['.$role['id'].']', NULL, 'checkbox')); $row->appendChild($td); - + // Authors: $authors = $this->_driver->getAuthors($role['id']); if(empty($authors)) { @@ -96,10 +96,10 @@ public function __viewIndex() $tableBody[] = $row; } } - + // Create the table element: $table = Widget::Table( - Widget::TableHead($tableHead), null, + Widget::TableHead($tableHead), null, Widget::TableBody($tableBody), 'selectable' ); $this->Form->appendChild($table); @@ -118,4 +118,4 @@ public function __viewIndex() $this->Form->appendChild($tableActions); } } -?> \ No newline at end of file +?> From 254af9f949834dde6ab72d7cf88e90982d0aa142 Mon Sep 17 00:00:00 2001 From: Kirk Strobeck Date: Tue, 17 May 2016 18:31:20 -0700 Subject: [PATCH 4/6] Add meta --- extension.meta.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extension.meta.xml b/extension.meta.xml index 0e2920b..75d2803 100644 --- a/extension.meta.xml +++ b/extension.meta.xml @@ -21,5 +21,8 @@ to Symphony to make sure the 'Author Roles'-extension is executed as last, after all other extensions have made their possible modifications to the navigation. Read the readme for more details. + + Updated `...nce()->Author->isD...` to `...nce()->Author()->isD...` per [migration guide](https://github.com/symphonycms/symphony-2/wiki/Migration-Guide-to-2.5-for-Developers#properties). + From 89bb69c86b41db6f9b05500d9520ef26fb262cf2 Mon Sep 17 00:00:00 2001 From: Kirk Strobeck Date: Tue, 17 May 2016 18:55:14 -0700 Subject: [PATCH 5/6] max --- extension.meta.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension.meta.xml b/extension.meta.xml index 75d2803..584db12 100644 --- a/extension.meta.xml +++ b/extension.meta.xml @@ -21,7 +21,7 @@ to Symphony to make sure the 'Author Roles'-extension is executed as last, after all other extensions have made their possible modifications to the navigation. Read the readme for more details. - + Updated `...nce()->Author->isD...` to `...nce()->Author()->isD...` per [migration guide](https://github.com/symphonycms/symphony-2/wiki/Migration-Guide-to-2.5-for-Developers#properties). From d549691ab6ae8c47da175223b086c4b8b11c616b Mon Sep 17 00:00:00 2001 From: Kirk Strobeck Date: Tue, 17 May 2016 18:56:43 -0700 Subject: [PATCH 6/6] new on top. 1.3 --- extension.meta.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extension.meta.xml b/extension.meta.xml index 584db12..db00940 100644 --- a/extension.meta.xml +++ b/extension.meta.xml @@ -13,16 +13,16 @@ - - + + Updated `...nce()->Author->isD...` to `...nce()->Author()->isD...` per [migration guide](https://github.com/symphonycms/symphony-2/wiki/Migration-Guide-to-2.5-for-Developers#properties). + Added functionality to hide menu elements created by other extensions. __Important:__ Since extensions can not (yet) influence the execution order of extensions in Symphony, you need to apply a tiny little 'hack' to Symphony to make sure the 'Author Roles'-extension is executed as last, after all other extensions have made their possible modifications to the navigation. Read the readme for more details. - - Updated `...nce()->Author->isD...` to `...nce()->Author()->isD...` per [migration guide](https://github.com/symphonycms/symphony-2/wiki/Migration-Guide-to-2.5-for-Developers#properties). - + +