@@ -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 ''; |
@@ -62,7 +62,7 @@ |
||
62 | 62 | { |
63 | 63 | $this->_load_schemadb(); |
64 | 64 | $this->_controller = midcom_helper_datamanager2_controller::create('simple'); |
65 | - $this->_controller->schemadb =& $this->_schemadb; |
|
65 | + $this->_controller->schemadb = & $this->_schemadb; |
|
66 | 66 | $this->_controller->set_storage($this->_page); |
67 | 67 | if (!$this->_controller->initialize()) { |
68 | 68 | throw new midcom_error("Failed to initialize a DM2 controller instance for article {$this->_article->id}."); |
@@ -66,7 +66,8 @@ |
||
66 | 66 | try { |
67 | 67 | $author = new midcom_db_person($wikipage->metadata->revisor); |
68 | 68 | $item->author = $author->name; |
69 | - } catch (midcom_error $e) { |
|
69 | + } |
|
70 | + catch (midcom_error $e) { |
|
70 | 71 | $e->log(); |
71 | 72 | } |
72 | 73 |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | return; |
51 | 51 | } |
52 | 52 | |
53 | - if ( $history['date'] < $from |
|
53 | + if ($history['date'] < $from |
|
54 | 54 | || $history['date'] > $to) { |
55 | 55 | // We can ignore revisions outside the timeframe |
56 | 56 | continue; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $this->_seek_updated($from); |
94 | 94 | |
95 | 95 | $i = 0; |
96 | - while ( $this->_updated_pages < $this->_max_pages |
|
96 | + while ($this->_updated_pages < $this->_max_pages |
|
97 | 97 | && $i < 20) { |
98 | 98 | // Expand seek by another two weeks |
99 | 99 | $to = $from; |
@@ -61,7 +61,7 @@ |
||
61 | 61 | public function get_link($key = 0, $rel = 'alternate') |
62 | 62 | { |
63 | 63 | $link = parent::get_link($key, $rel); |
64 | - if ( $rel !== 'alternate' |
|
64 | + if ($rel !== 'alternate' |
|
65 | 65 | || $key !== 0) { |
66 | 66 | return $link; |
67 | 67 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $this->_article = new midcom_db_article(); |
84 | 84 | $this->_article->topic = $this->_topic->id; |
85 | 85 | |
86 | - if ( array_key_exists('name', $this->_defaults) |
|
86 | + if (array_key_exists('name', $this->_defaults) |
|
87 | 87 | && $this->_defaults['name'] == 'index') { |
88 | 88 | // Store this to article directly in case name field is not editable in schema |
89 | 89 | $this->_article->name = 'index'; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | if (!$this->_article->create()) { |
93 | 93 | debug_print_r('We operated on this object:', $this->_article); |
94 | - throw new midcom_error('Failed to create a new article. Last Midgard error was: '. midcom_connection::get_error_string()); |
|
94 | + throw new midcom_error('Failed to create a new article. Last Midgard error was: ' . midcom_connection::get_error_string()); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | // Callback possibility |
@@ -73,7 +73,7 @@ |
||
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
76 | - if ( $this->_topic->can_do('midgard:update') |
|
76 | + if ($this->_topic->can_do('midgard:update') |
|
77 | 77 | && $this->_topic->can_do('midcom:component_config')) { |
78 | 78 | $buttons[] = $workflow->get_button('config/', array( |
79 | 79 | MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('component configuration'), |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | // Hide the articles that have the publish time in the future and if |
43 | 43 | // the user is not administrator |
44 | - if ( $this->_config->get('enable_scheduled_publishing') |
|
44 | + if ($this->_config->get('enable_scheduled_publishing') |
|
45 | 45 | && !midcom::get()->auth->admin) { |
46 | 46 | // Show the article only if the publishing time has passed or the viewer |
47 | 47 | // is the author |
@@ -83,14 +83,14 @@ discard block |
||
83 | 83 | |
84 | 84 | private function _add_pseudo_leaves(array &$leaves) |
85 | 85 | { |
86 | - if ( $this->_config->get('archive_enable') |
|
86 | + if ($this->_config->get('archive_enable') |
|
87 | 87 | && $this->_config->get('archive_in_navigation')) { |
88 | 88 | $leaves["{$this->_topic->id}_ARCHIVE"] = array( |
89 | 89 | MIDCOM_NAV_URL => "archive/", |
90 | 90 | MIDCOM_NAV_NAME => $this->_l10n->get('archive'), |
91 | 91 | ); |
92 | 92 | } |
93 | - if ( $this->_config->get('rss_enable') |
|
93 | + if ($this->_config->get('rss_enable') |
|
94 | 94 | && $this->_config->get('feeds_in_navigation')) { |
95 | 95 | $leaves[self::LEAFID_FEEDS] = array( |
96 | 96 | MIDCOM_NAV_URL => "feeds/", |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | ); |
99 | 99 | } |
100 | 100 | |
101 | - if ( $this->_config->get('categories_in_navigation') |
|
101 | + if ($this->_config->get('categories_in_navigation') |
|
102 | 102 | && $this->_config->get('categories') != '') { |
103 | 103 | $categories = explode(',', $this->_config->get('categories')); |
104 | 104 | foreach ($categories as $category) { |
@@ -109,14 +109,14 @@ discard block |
||
109 | 109 | } |
110 | 110 | } |
111 | 111 | |
112 | - if ( $this->_config->get('archive_years_in_navigation') |
|
112 | + if ($this->_config->get('archive_years_in_navigation') |
|
113 | 113 | && $this->_config->get('archive_years_enable')) { |
114 | 114 | $qb = midcom_db_article::new_query_builder(); |
115 | 115 | $qb->add_constraint('topic', '=', $this->_topic->id); |
116 | 116 | |
117 | 117 | // Hide the articles that have the publish time in the future and if |
118 | 118 | // the user is not administrator |
119 | - if ( $this->_config->get('enable_scheduled_publishing') |
|
119 | + if ($this->_config->get('enable_scheduled_publishing') |
|
120 | 120 | && !midcom::get()->auth->admin) { |
121 | 121 | // Show the article only if the publishing time has passed or the viewer |
122 | 122 | // is the author |
@@ -218,7 +218,8 @@ |
||
218 | 218 | if ($this->_config->get('comments_topic')) { |
219 | 219 | try { |
220 | 220 | $comments_topic = new midcom_db_topic($this->_config->get('comments_topic')); |
221 | - } catch (midcom_error $e) { |
|
221 | + } |
|
222 | + catch (midcom_error $e) { |
|
222 | 223 | return false; |
223 | 224 | } |
224 | 225 |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $data['page_title'] = $this->_topic->extra; |
63 | 63 | |
64 | 64 | // Filter by categories |
65 | - if ( $handler_id == 'index-category' |
|
65 | + if ($handler_id == 'index-category' |
|
66 | 66 | || $handler_id == 'latest-category') { |
67 | 67 | $data['category'] = trim(strip_tags($args[0])); |
68 | 68 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | midcom::get()->head->set_pagetitle($this->_request_data['page_title']); |
112 | 112 | |
113 | 113 | // Activate correct leaf |
114 | - if ( $this->_config->get('show_navigation_pseudo_leaves') |
|
114 | + if ($this->_config->get('show_navigation_pseudo_leaves') |
|
115 | 115 | && in_array($this->_request_data['category'], $this->_request_data['categories'])) { |
116 | 116 | $this->set_active_leaf($this->_topic->id . '_CAT_' . $this->_request_data['category']); |
117 | 117 | } |