@@ -98,8 +98,8 @@ |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | // Check the Metadata if and only if we are configured to do so. |
| 101 | - if ( is_object($this->object) |
|
| 102 | - && ( midcom::get()->config->get('show_hidden_objects') == false |
|
| 101 | + if (is_object($this->object) |
|
| 102 | + && (midcom::get()->config->get('show_hidden_objects') == false |
|
| 103 | 103 | || midcom::get()->config->get('show_unapproved_objects') == false)) { |
| 104 | 104 | // Check Hiding, Scheduling and Approval |
| 105 | 105 | $metadata = $this->object->metadata; |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | public function is_readable_by($user_id) |
| 30 | 30 | { |
| 31 | - return ( empty($this->object) |
|
| 31 | + return (empty($this->object) |
|
| 32 | 32 | || !$this->guid |
| 33 | 33 | || !$user_id |
| 34 | 34 | || midcom::get()->auth->acl->can_do_byguid('midgard:read', $this->guid, $this->object->__midcom_class_name__, $user_id)); |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | |
| 40 | 40 | public function resolve_object_link(midcom_db_topic $topic, midcom_core_dbaobject $object) |
| 41 | 41 | { |
| 42 | - if ( $object instanceof org_openpsa_documents_document_dba |
|
| 42 | + if ($object instanceof org_openpsa_documents_document_dba |
|
| 43 | 43 | && $object->topic == $topic->id) { |
| 44 | 44 | return "document/{$object->guid}/"; |
| 45 | 45 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | { |
| 171 | 171 | debug_add("task->start() called with user #" . midcom_connection::get_user()); |
| 172 | 172 | //PONDER: Check actual status objects for more accurate logic ? |
| 173 | - if ( $task->status >= org_openpsa_projects_task_status_dba::STARTED |
|
| 173 | + if ($task->status >= org_openpsa_projects_task_status_dba::STARTED |
|
| 174 | 174 | && $task->status <= org_openpsa_projects_task_status_dba::APPROVED) { |
| 175 | 175 | //We already have started status |
| 176 | 176 | debug_add('Task has already been started'); |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | |
| 383 | 383 | private static function is_manager($task) |
| 384 | 384 | { |
| 385 | - return ( $task->manager == 0 |
|
| 385 | + return ($task->manager == 0 |
|
| 386 | 386 | || midcom_connection::get_user() == $task->manager); |
| 387 | 387 | } |
| 388 | 388 | } |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $counter = 0; |
| 135 | 135 | |
| 136 | 136 | foreach ($result as $object_guid => $empty_copy) { |
| 137 | - if ( $this->_user_id |
|
| 137 | + if ($this->_user_id |
|
| 138 | 138 | && !midcom::get()->auth->acl->can_do_byguid('midgard:read', $object_guid, $classname, $this->_user_id)) { |
| 139 | 139 | debug_add("Failed to load result, read privilege on {$object_guid} not granted for the current user.", MIDCOM_LOG_INFO); |
| 140 | 140 | continue; |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | if ($counter <= $this->_offset) { |
| 146 | 146 | continue; |
| 147 | 147 | } |
| 148 | - if ( $this->_limit |
|
| 148 | + if ($this->_limit |
|
| 149 | 149 | && $counter > ($this->_offset + $this->_limit)) { |
| 150 | 150 | break; |
| 151 | 151 | } |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | |
| 224 | 224 | public function get_subkey($key, $property) |
| 225 | 225 | { |
| 226 | - if ( $this->_user_id |
|
| 226 | + if ($this->_user_id |
|
| 227 | 227 | && !midcom::get()->auth->acl->can_do_byguid('midgard:read', $key, $this->_real_class, $this->_user_id)) { |
| 228 | 228 | midcom_connection::set_error(MGD_ERR_ACCESS_DENIED); |
| 229 | 229 | return false; |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | |
| 234 | 234 | public function get($key) |
| 235 | 235 | { |
| 236 | - if ( $this->_user_id |
|
| 236 | + if ($this->_user_id |
|
| 237 | 237 | && !midcom::get()->auth->acl->can_do_byguid('midgard:read', $key, $this->_real_class, $this->_user_id)) { |
| 238 | 238 | midcom_connection::set_error(MGD_ERR_ACCESS_DENIED); |
| 239 | 239 | return false; |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | $config = $this->get_config_for_topic($topic); |
| 71 | - if ( $object->name == 'index' |
|
| 71 | + if ($object->name == 'index' |
|
| 72 | 72 | && !$config->get('autoindex')) { |
| 73 | 73 | return ''; |
| 74 | 74 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | public function _on_creating() |
| 44 | 44 | { |
| 45 | - return ( $this->validate_tag($this->tag) |
|
| 45 | + return ($this->validate_tag($this->tag) |
|
| 46 | 46 | && $this->_check_duplicates() == 0); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | midcom::get()->uimessages->add(midcom::get()->i18n->get_string('net.nemein.tag', 'net.nemein.tag'), sprintf(midcom::get()->i18n->get_string('tag "%s" is not valid. tags may not be numeric', 'net.nemein.tag'), $tag), 'info'); |
| 67 | 67 | return false; |
| 68 | 68 | } |
| 69 | - if ( strstr($tag, '"') |
|
| 69 | + if (strstr($tag, '"') |
|
| 70 | 70 | || strstr($tag, "'")) { |
| 71 | 71 | midcom::get()->uimessages->add(midcom::get()->i18n->get_string('net.nemein.tag', 'net.nemein.tag'), sprintf(midcom::get()->i18n->get_string('tag "%s" is not valid. tags may not contain quotes', 'net.nemein.tag'), $tag), 'info'); |
| 72 | 72 | return false; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | public function _on_updating() |
| 79 | 79 | { |
| 80 | - return ( $this->validate_tag($this->tag) |
|
| 80 | + return ($this->validate_tag($this->tag) |
|
| 81 | 81 | && $this->_check_duplicates() == 0); |
| 82 | 82 | } |
| 83 | 83 | |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | <h1>Merge tags</h1> |
| 5 | 5 | |
| 6 | 6 | <?php |
| 7 | -if ( isset($_POST['from']) |
|
| 7 | +if (isset($_POST['from']) |
|
| 8 | 8 | && isset($_POST['to'])) { |
| 9 | 9 | if (net_nemein_tag_handler::merge_tags($_POST['from'], $_POST['to'])) { |
| 10 | 10 | echo "<p>Successfully merged tag \"{$_POST['from']}\" to \"{$_POST['to']}\"</p>\n"; |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | |
| 42 | 42 | public function resolve_object_link(midcom_db_topic $topic, midcom_core_dbaobject $object) |
| 43 | 43 | { |
| 44 | - if ( $object instanceof midcom_db_article |
|
| 44 | + if ($object instanceof midcom_db_article |
|
| 45 | 45 | && $topic->id == $object->topic) { |
| 46 | 46 | if ($object->name == 'index') { |
| 47 | 47 | return ''; |