From 71f5fabf949ad98d39b1353633a000403cc709cd Mon Sep 17 00:00:00 2001 From: Dario Faniglione Date: Sat, 18 Oct 2014 11:43:41 +0100 Subject: [PATCH 1/4] Fixes for Symphony 2.5 --- extension.driver.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/extension.driver.php b/extension.driver.php index b521cba..ca8bc47 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -6,12 +6,12 @@ public function about() { return array( 'name' => 'Author Roles', - 'version' => '1.2', + 'version' => '1.3', 'release-date' => '2012-10-04', 'author' => array( - 'name' => 'Twisted Interactive', - 'website' => 'http://www.twisted.nl'), - 'description' => 'Author Roles for Symphony 2.2 and above' + 'name' => 'Dario Faniglione', + 'website' => 'http://dario.faniglione.com'), + 'description' => 'Author Roles for Symphony 2.5 and above' ); } @@ -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; } @@ -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) { @@ -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 721b7186b0c68699674efad4e9e3c56c65e48586 Mon Sep 17 00:00:00 2001 From: Dario Faniglione Date: Sat, 18 Oct 2014 11:44:38 +0100 Subject: [PATCH 2/4] Fixes for Symphony 2.5 --- content/content.index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/content.index.php b/content/content.index.php index 71b033f..5e4c251 100644 --- a/content/content.index.php +++ b/content/content.index.php @@ -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) @@ -118,4 +118,4 @@ public function __viewIndex() $this->Form->appendChild($tableActions); } } -?> \ No newline at end of file +?> From 496959e9ac5133815334591711c2af57dc7f7a80 Mon Sep 17 00:00:00 2001 From: Dario Faniglione Date: Sat, 18 Oct 2014 11:46:44 +0100 Subject: [PATCH 3/4] Revert to original authorship --- extension.driver.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extension.driver.php b/extension.driver.php index ca8bc47..9774463 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -7,10 +7,10 @@ public function about() return array( 'name' => 'Author Roles', 'version' => '1.3', - 'release-date' => '2012-10-04', + 'release-date' => '2014-10-18', 'author' => array( - 'name' => 'Dario Faniglione', - 'website' => 'http://dario.faniglione.com'), + 'name' => 'Twisted Interactive', + 'website' => 'http://www.twisted.nl'), 'description' => 'Author Roles for Symphony 2.5 and above' ); } From b636491ff27c5453a76160ccd16efaa0189691e1 Mon Sep 17 00:00:00 2001 From: Dario Faniglione Date: Sat, 18 Oct 2014 18:14:19 +0100 Subject: [PATCH 4/4] Updates for 2.5 compatibility --- extension.driver.php | 1 + 1 file changed, 1 insertion(+) diff --git a/extension.driver.php b/extension.driver.php index 9774463..6a650bd 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -256,6 +256,7 @@ private function adjustIndex($context, $callback) { $children = current($context['oPage']->Context->getChildrenByName('ul'))->getChildrenByName('li'); foreach($children as $key => $child) { + $child = $child->getValue(); if(strpos($child->getValue(),__('Create New')) !== false) { $value = $child->getValue(); $child->setValue(''.strip_tags(str_replace(__('Create New'), '', $value)).'');