@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | { |
| 464 | 464 | // Complete fields |
| 465 | 465 | $this->indexed = time(); |
| 466 | - if ( $this->author == '' |
|
| 466 | + if ($this->author == '' |
|
| 467 | 467 | && isset($this->creator->name)) { |
| 468 | 468 | $this->author = $this->creator->name; |
| 469 | 469 | } |
@@ -606,7 +606,7 @@ discard block |
||
| 606 | 606 | public function read_metadata_from_object($object) |
| 607 | 607 | { |
| 608 | 608 | // Published is set to non-empty value, use it as creation data |
| 609 | - if ( !empty($object->metadata->published) |
|
| 609 | + if (!empty($object->metadata->published) |
|
| 610 | 610 | && !preg_match('/0{1,4}-0{1,2}0{1,2}\s+0{1,2}:0{1,2}:0{1,2}/', $object->metadata->published)) { |
| 611 | 611 | $this->created = $this->read_unixtime($object->metadata->published); |
| 612 | 612 | } elseif (isset($object->metadata->created)) { |
@@ -645,7 +645,7 @@ discard block |
||
| 645 | 645 | return @strtotime($stamp); |
| 646 | 646 | } |
| 647 | 647 | // Unix timestamp |
| 648 | - return (int)$stamp; |
|
| 648 | + return (int) $stamp; |
|
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | /** |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | $qb->add_constraint('name', '<>', ''); |
| 47 | 47 | |
| 48 | 48 | // Unless in Auto-Index mode or the index article is hidden, we skip the index article. |
| 49 | - if ( !$this->_config->get('autoindex') |
|
| 49 | + if (!$this->_config->get('autoindex') |
|
| 50 | 50 | && !$this->_config->get('indexinnav')) { |
| 51 | 51 | $qb->add_constraint('name', '<>', 'index'); |
| 52 | 52 | } |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | $qb = midcom::get()->dbfactory->new_query_builder($this->config['type_config']['mapping_class_name']); |
| 100 | 100 | $qb->add_constraint($this->config['type_config']['master_fieldname'], '=', $this->get_master_foreign_key()); |
| 101 | 101 | |
| 102 | - if ( $this->config['type_config']['sortable'] |
|
| 102 | + if ($this->config['type_config']['sortable'] |
|
| 103 | 103 | && preg_match('/^(ASC|DESC)/i', $this->config['type_config']['sortable_sort_order'], $regs)) { |
| 104 | 104 | $order = strtoupper($regs[1]); |
| 105 | 105 | $qb->add_order('metadata.score', $order); |
@@ -336,7 +336,7 @@ |
||
| 336 | 336 | public function update_cache() |
| 337 | 337 | { |
| 338 | 338 | // Check if the attachment can be read anonymously |
| 339 | - if ( midcom::get()->config->get('attachment_cache_enabled') |
|
| 339 | + if (midcom::get()->config->get('attachment_cache_enabled') |
|
| 340 | 340 | && !$this->can_do('midgard:read', 'EVERYONE')) { |
| 341 | 341 | // Not public file, ensure it is removed |
| 342 | 342 | $filename = $this->get_cache_path(); |
@@ -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 | } |
@@ -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 ''; |