@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | // Set language |
53 | 53 | // |
54 | 54 | if (PMF_Language::isASupportedLanguage($language)) { |
55 | - require PMF_LANGUAGE_DIR . '/language_' . $language . '.php'; |
|
55 | + require PMF_LANGUAGE_DIR.'/language_'.$language.'.php'; |
|
56 | 56 | } else { |
57 | - require PMF_LANGUAGE_DIR . '/language_en.php'; |
|
57 | + require PMF_LANGUAGE_DIR.'/language_en.php'; |
|
58 | 58 | } |
59 | 59 | $faqConfig->setLanguage($Language); |
60 | 60 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | $searchString = PMF_Filter::filterInput(INPUT_GET, 'q', FILTER_SANITIZE_STRIPPED); |
96 | 96 | $searchResults = $search->search($searchString, false); |
97 | - $url = $faqConfig->get('main.referenceURL') . '/index.php?action=artikel&cat=%d&id=%d&artlang=%s'; |
|
97 | + $url = $faqConfig->get('main.referenceURL').'/index.php?action=artikel&cat=%d&id=%d&artlang=%s'; |
|
98 | 98 | |
99 | 99 | $faqSearchResult->reviewResultset($searchResults); |
100 | 100 |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | |
36 | 36 | // Found an article language? |
37 | 37 | $lang = PMF_Filter::filterInput(INPUT_POST, 'artlang', FILTER_SANITIZE_STRING); |
38 | -if (is_null($lang) && !PMF_Language::isASupportedLanguage($lang) ) { |
|
38 | +if (is_null($lang) && !PMF_Language::isASupportedLanguage($lang)) { |
|
39 | 39 | $lang = PMF_Filter::filterInput(INPUT_GET, 'artlang', FILTER_SANITIZE_STRING); |
40 | - if (is_null($lang) && !PMF_Language::isASupportedLanguage($lang) ) { |
|
40 | + if (is_null($lang) && !PMF_Language::isASupportedLanguage($lang)) { |
|
41 | 41 | $lang = $LANGCODE; |
42 | 42 | } |
43 | 43 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | // authenticate with session information |
57 | 57 | $user = PMF_User_CurrentUser::getFromCookie($faqConfig); |
58 | -if (! $user instanceof PMF_User_CurrentUser) { |
|
58 | +if (!$user instanceof PMF_User_CurrentUser) { |
|
59 | 59 | $user = PMF_User_CurrentUser::getFromSession($faqConfig); |
60 | 60 | } |
61 | 61 | if ($user instanceof PMF_User_CurrentUser) { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | // Get current user and group id - default: -1 |
84 | 84 | if (!is_null($user) && $user instanceof PMF_User_CurrentUser) { |
85 | - $current_user = $user->getUserId(); |
|
85 | + $current_user = $user->getUserId(); |
|
86 | 86 | if ($user->perm instanceof PMF_Perm_Medium) { |
87 | 87 | $current_groups = $user->perm->getUserGroups($current_user); |
88 | 88 | } else { |
@@ -138,14 +138,14 @@ discard block |
||
138 | 138 | $faq->getRecord($id); |
139 | 139 | $faq->faqRecord['category_id'] = $currentCategory; |
140 | 140 | |
141 | - $filename = 'FAQ-' . $id . '-' . $lang . '.pdf'; |
|
141 | + $filename = 'FAQ-'.$id.'-'.$lang.'.pdf'; |
|
142 | 142 | $pdfFile = $pdf->generateFile($faq->faqRecord, $filename); |
143 | 143 | } |
144 | 144 | |
145 | 145 | if (preg_match("/MSIE/i", $_SERVER["HTTP_USER_AGENT"])) { |
146 | 146 | $headers[] = "Content-type: application/pdf"; |
147 | 147 | $headers[] = "Content-Transfer-Encoding: binary"; |
148 | - $headers[] = "Content-Disposition: attachment; filename=" . $filename; |
|
148 | + $headers[] = "Content-Disposition: attachment; filename=".$filename; |
|
149 | 149 | } else { |
150 | 150 | $headers[] = "Content-Type: application/pdf"; |
151 | 151 | } |
@@ -75,8 +75,9 @@ |
||
75 | 75 | // check user rights, set them TRUE |
76 | 76 | $allUserRights = $user->perm->getAllUserRights($user->getUserId()); |
77 | 77 | foreach ($allRights as $right) { |
78 | - if (in_array($right['right_id'], $allUserRights)) |
|
79 | - $permission[$right['name']] = true; |
|
78 | + if (in_array($right['right_id'], $allUserRights)) { |
|
79 | + $permission[$right['name']] = true; |
|
80 | + } |
|
80 | 81 | } |
81 | 82 | } |
82 | 83 |
@@ -20,10 +20,10 @@ |
||
20 | 20 | |
21 | 21 | if (!defined('IS_VALID_PHPMYFAQ')) { |
22 | 22 | $protocol = 'http'; |
23 | - if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON'){ |
|
23 | + if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') { |
|
24 | 24 | $protocol = 'https'; |
25 | 25 | } |
26 | - header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME'])); |
|
26 | + header('Location: '.$protocol.'://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME'])); |
|
27 | 27 | exit(); |
28 | 28 | } |
29 | 29 |
@@ -19,10 +19,10 @@ discard block |
||
19 | 19 | |
20 | 20 | if (!defined('IS_VALID_PHPMYFAQ')) { |
21 | 21 | $protocol = 'http'; |
22 | - if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON'){ |
|
22 | + if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') { |
|
23 | 23 | $protocol = 'https'; |
24 | 24 | } |
25 | - header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME'])); |
|
25 | + header('Location: '.$protocol.'://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME'])); |
|
26 | 26 | exit(); |
27 | 27 | } |
28 | 28 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $tpl->parse( |
80 | 80 | 'writeContent', |
81 | 81 | array( |
82 | - 'categoryHeader' => $PMF_LANG['msgEntriesIn'] . $catName, |
|
82 | + 'categoryHeader' => $PMF_LANG['msgEntriesIn'].$catName, |
|
83 | 83 | 'categoryDescription' => $catDescription, |
84 | 84 | 'categoryFaqsHeader' => $PMF_LANG['msgEntries'], |
85 | 85 | 'categoryContent' => $records, |
@@ -21,10 +21,10 @@ discard block |
||
21 | 21 | |
22 | 22 | if (!defined('IS_VALID_PHPMYFAQ')) { |
23 | 23 | $protocol = 'http'; |
24 | - if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON'){ |
|
24 | + if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') { |
|
25 | 25 | $protocol = 'https'; |
26 | 26 | } |
27 | - header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME'])); |
|
27 | + header('Location: '.$protocol.'://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME'])); |
|
28 | 28 | exit(); |
29 | 29 | } |
30 | 30 | |
@@ -41,14 +41,14 @@ discard block |
||
41 | 41 | $newsId = PMF_Filter::filterInput(INPUT_GET, 'newsid', FILTER_VALIDATE_INT); |
42 | 42 | |
43 | 43 | if (is_null($newsId)) { |
44 | - header('Location: http://'.$_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME'])); |
|
44 | + header('Location: http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME'])); |
|
45 | 45 | exit(); |
46 | 46 | } |
47 | 47 | |
48 | 48 | $faqsession->userTracking('news_view', $categoryId); |
49 | 49 | |
50 | 50 | // Define the header of the page |
51 | -$newsMainHeader = $faqConfig->get('main.titleFAQ') . $PMF_LANG['msgNews']; |
|
51 | +$newsMainHeader = $faqConfig->get('main.titleFAQ').$PMF_LANG['msgNews']; |
|
52 | 52 | $newsFeed = ' <a href="feed/news/rss.php" target="_blank"><img id="newsRSS" src="assets/img/feed.png" width="16" height="16" alt="RSS" /></a>'; |
53 | 53 | |
54 | 54 | // Get all data from the news record |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | 'writeContent' => $newsContent, |
116 | 116 | 'writeDateMsg' => $newsDate, |
117 | 117 | 'msgAboutThisNews' => $PMF_LANG['msgAboutThisNews'], |
118 | - 'writeAuthor' => ($news['active'] && (!$expired)) ? $PMF_LANG['msgAuthor'] . ': ' . $news['authorName'] : '', |
|
118 | + 'writeAuthor' => ($news['active'] && (!$expired)) ? $PMF_LANG['msgAuthor'].': '.$news['authorName'] : '', |
|
119 | 119 | 'editThisEntry' => $editThisEntry, |
120 | 120 | 'writeCommentMsg' => $commentMessage, |
121 | 121 | 'msgWriteComment' => $PMF_LANG['newsWriteComment'], |
@@ -224,7 +224,7 @@ |
||
224 | 224 | } |
225 | 225 | |
226 | 226 | $fileTpl = sprintf($fileTpl, $langDesc, $authorTpl, date('Y-m-d'), $langCode, date('Y'), |
227 | - $langCharset, strtolower($langCode), $langName, $langDir, $langNPlurals); |
|
227 | + $langCharset, strtolower($langCode), $langName, $langDir, $langNPlurals); |
|
228 | 228 | |
229 | 229 | $retval = @file_put_contents(PMF_ROOT_DIR.'/lang/language_'.strtolower($langCode).'.php', $fileTpl); |
230 | 230 | echo intval($retval); |
@@ -39,170 +39,170 @@ discard block |
||
39 | 39 | |
40 | 40 | switch ($ajax_action) { |
41 | 41 | |
42 | - case 'save_page_buffer': |
|
43 | - /** |
|
42 | + case 'save_page_buffer': |
|
43 | + /** |
|
44 | 44 | * Build language variable definitions |
45 | 45 | * @todo Change input handling using PMF_Filter |
46 | 46 | */ |
47 | - foreach ((array)@$_POST['PMF_LANG'] as $key => $val) { |
|
47 | + foreach ((array)@$_POST['PMF_LANG'] as $key => $val) { |
|
48 | 48 | |
49 | - if (is_string($val)) { |
|
50 | - $val = str_replace(array('\\\\', '\"', '\\\''), array('\\', '"', "'"), $val); |
|
51 | - $val = str_replace("'", "\\'", $val); |
|
52 | - $_SESSION['trans']['rightVarsOnly']["PMF_LANG[$key]"] = $val; |
|
53 | - } elseif (is_array($val)) { |
|
54 | - /** |
|
49 | + if (is_string($val)) { |
|
50 | + $val = str_replace(array('\\\\', '\"', '\\\''), array('\\', '"', "'"), $val); |
|
51 | + $val = str_replace("'", "\\'", $val); |
|
52 | + $_SESSION['trans']['rightVarsOnly']["PMF_LANG[$key]"] = $val; |
|
53 | + } elseif (is_array($val)) { |
|
54 | + /** |
|
55 | 55 | * Here we deal with a two dimensional array |
56 | 56 | */ |
57 | - foreach ($val as $key2 => $val2) { |
|
58 | - $val2 = str_replace(array('\\\\', '\"', '\\\''), array('\\', '"', "'"), $val2); |
|
59 | - $val2 = str_replace("'", "\\'", $val2); |
|
60 | - $_SESSION['trans']['rightVarsOnly']["PMF_LANG[$key][$key2]"] = $val2; |
|
57 | + foreach ($val as $key2 => $val2) { |
|
58 | + $val2 = str_replace(array('\\\\', '\"', '\\\''), array('\\', '"', "'"), $val2); |
|
59 | + $val2 = str_replace("'", "\\'", $val2); |
|
60 | + $_SESSION['trans']['rightVarsOnly']["PMF_LANG[$key][$key2]"] = $val2; |
|
61 | + } |
|
61 | 62 | } |
62 | 63 | } |
63 | - } |
|
64 | 64 | |
65 | - foreach ((array)@$_POST['LANG_CONF'] as $key => $val) { |
|
66 | - // if string like array(blah-blah-blah), extract the contents inside the brackets |
|
67 | - if (preg_match('/^\s*array\s*\(\s*(\d+.+)\s*\).*$/',$val,$matches1)) { |
|
68 | - // split the resulting string of delimiters such as "number =>" |
|
69 | - $valArr = preg_split( |
|
70 | - '/\s*(\d+)\s*\=\>\s*/', |
|
71 | - $matches1[1], |
|
72 | - null, |
|
73 | - PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY |
|
74 | - ); |
|
75 | - // in an array $valArr contents like "number substring", "substring", "number substring", "substring", ... |
|
76 | - $numVal = count($valArr); |
|
77 | - if ($numVal > 1) { |
|
78 | - $newValArr = array(); |
|
79 | - for ($i = 0; $i < $numVal; $i += 2) { |
|
80 | - if (is_numeric($valArr[$i])) { |
|
81 | - // clearing quotes |
|
82 | - if (preg_match('/^\s*\\\\*[\"|\'](.+)\\\\*[\"|\'][\s\,]*$/', $valArr[$i + 1], $matches2)) { |
|
83 | - $subVal = $matches2[1]; |
|
84 | - // normalize quotes |
|
85 | - $subVal = str_replace(array('\\\\', '\"', '\\\''), array('\\', '"', "'"), $subVal); |
|
86 | - $subVal = str_replace("'", "\\'", $subVal); |
|
87 | - // assembly of the original substring back |
|
88 | - $newValArr[] = $valArr[$i].' => \''.$subVal.'\''; |
|
65 | + foreach ((array)@$_POST['LANG_CONF'] as $key => $val) { |
|
66 | + // if string like array(blah-blah-blah), extract the contents inside the brackets |
|
67 | + if (preg_match('/^\s*array\s*\(\s*(\d+.+)\s*\).*$/',$val,$matches1)) { |
|
68 | + // split the resulting string of delimiters such as "number =>" |
|
69 | + $valArr = preg_split( |
|
70 | + '/\s*(\d+)\s*\=\>\s*/', |
|
71 | + $matches1[1], |
|
72 | + null, |
|
73 | + PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY |
|
74 | + ); |
|
75 | + // in an array $valArr contents like "number substring", "substring", "number substring", "substring", ... |
|
76 | + $numVal = count($valArr); |
|
77 | + if ($numVal > 1) { |
|
78 | + $newValArr = array(); |
|
79 | + for ($i = 0; $i < $numVal; $i += 2) { |
|
80 | + if (is_numeric($valArr[$i])) { |
|
81 | + // clearing quotes |
|
82 | + if (preg_match('/^\s*\\\\*[\"|\'](.+)\\\\*[\"|\'][\s\,]*$/', $valArr[$i + 1], $matches2)) { |
|
83 | + $subVal = $matches2[1]; |
|
84 | + // normalize quotes |
|
85 | + $subVal = str_replace(array('\\\\', '\"', '\\\''), array('\\', '"', "'"), $subVal); |
|
86 | + $subVal = str_replace("'", "\\'", $subVal); |
|
87 | + // assembly of the original substring back |
|
88 | + $newValArr[] = $valArr[$i].' => \''.$subVal.'\''; |
|
89 | + } |
|
89 | 90 | } |
90 | 91 | } |
92 | + $_SESSION['trans']['rightVarsOnly']["LANG_CONF[$key]"] = 'array('.implode(", ",$newValArr).')'; |
|
91 | 93 | } |
92 | - $_SESSION['trans']['rightVarsOnly']["LANG_CONF[$key]"] = 'array('.implode(", ",$newValArr).')'; |
|
94 | + } else { // compatibility for old behavior |
|
95 | + $val = str_replace(array('\\\\', '\"', '\\\''), array('\\', '"', "'"), $val); |
|
96 | + $val = str_replace("'", "\\'", $val); |
|
97 | + $_SESSION['trans']['rightVarsOnly']["LANG_CONF[$key]"] = $val; |
|
93 | 98 | } |
94 | - } else { // compatibility for old behavior |
|
95 | - $val = str_replace(array('\\\\', '\"', '\\\''), array('\\', '"', "'"), $val); |
|
96 | - $val = str_replace("'", "\\'", $val); |
|
97 | - $_SESSION['trans']['rightVarsOnly']["LANG_CONF[$key]"] = $val; |
|
98 | 99 | } |
99 | - } |
|
100 | 100 | |
101 | - print 1; |
|
102 | - break; |
|
101 | + print 1; |
|
102 | + break; |
|
103 | 103 | |
104 | - case 'save_translated_lang': |
|
104 | + case 'save_translated_lang': |
|
105 | 105 | |
106 | - if (!$permission["edittranslation"]) { |
|
107 | - print $PMF_LANG['err_NotAuth']; |
|
108 | - exit; |
|
109 | - } |
|
106 | + if (!$permission["edittranslation"]) { |
|
107 | + print $PMF_LANG['err_NotAuth']; |
|
108 | + exit; |
|
109 | + } |
|
110 | 110 | |
111 | - $lang = strtolower($_SESSION['trans']['rightVarsOnly']["PMF_LANG[metaLanguage]"]); |
|
112 | - $filename = PMF_ROOT_DIR . "/lang/language_" . $lang . ".php"; |
|
111 | + $lang = strtolower($_SESSION['trans']['rightVarsOnly']["PMF_LANG[metaLanguage]"]); |
|
112 | + $filename = PMF_ROOT_DIR . "/lang/language_" . $lang . ".php"; |
|
113 | 113 | |
114 | - if (!is_writable(PMF_ROOT_DIR . "/lang")) { |
|
115 | - print 0; |
|
116 | - exit; |
|
117 | - } |
|
114 | + if (!is_writable(PMF_ROOT_DIR . "/lang")) { |
|
115 | + print 0; |
|
116 | + exit; |
|
117 | + } |
|
118 | 118 | |
119 | - if (!copy($filename, PMF_ROOT_DIR . "/lang/language_" . $lang . ".bak.php")) { |
|
120 | - print 0; |
|
121 | - exit; |
|
122 | - } |
|
119 | + if (!copy($filename, PMF_ROOT_DIR . "/lang/language_" . $lang . ".bak.php")) { |
|
120 | + print 0; |
|
121 | + exit; |
|
122 | + } |
|
123 | 123 | |
124 | - $newFileContents = ''; |
|
125 | - $tmpLines = array(); |
|
124 | + $newFileContents = ''; |
|
125 | + $tmpLines = array(); |
|
126 | 126 | |
127 | - // Read in the head of the file we're writing to |
|
128 | - $fh = fopen($filename, 'r'); |
|
129 | - do { |
|
130 | - $line = fgets($fh); |
|
131 | - array_push($tmpLines, rtrim($line)); |
|
132 | - } |
|
133 | - while ('*/' != substr(trim($line), -2)); |
|
134 | - fclose($fh); |
|
127 | + // Read in the head of the file we're writing to |
|
128 | + $fh = fopen($filename, 'r'); |
|
129 | + do { |
|
130 | + $line = fgets($fh); |
|
131 | + array_push($tmpLines, rtrim($line)); |
|
132 | + } |
|
133 | + while ('*/' != substr(trim($line), -2)); |
|
134 | + fclose($fh); |
|
135 | 135 | |
136 | - // Construct lines with variable definitions |
|
137 | - foreach ($_SESSION['trans']['rightVarsOnly'] as $key => $val) { |
|
138 | - if (0 === strpos($key, 'PMF_LANG')) { |
|
139 | - $val = "'$val'"; |
|
136 | + // Construct lines with variable definitions |
|
137 | + foreach ($_SESSION['trans']['rightVarsOnly'] as $key => $val) { |
|
138 | + if (0 === strpos($key, 'PMF_LANG')) { |
|
139 | + $val = "'$val'"; |
|
140 | + } |
|
141 | + array_push($tmpLines, '$' . str_replace(array('[', ']'), array("['", "']"), $key) . " = $val;"); |
|
140 | 142 | } |
141 | - array_push($tmpLines, '$' . str_replace(array('[', ']'), array("['", "']"), $key) . " = $val;"); |
|
142 | - } |
|
143 | 143 | |
144 | - $newFileContents .= implode("\n", $tmpLines); |
|
144 | + $newFileContents .= implode("\n", $tmpLines); |
|
145 | 145 | |
146 | - unset($_SESSION['trans']); |
|
146 | + unset($_SESSION['trans']); |
|
147 | 147 | |
148 | - $retval = file_put_contents($filename, $newFileContents); |
|
149 | - print intval($retval); |
|
150 | - break; |
|
148 | + $retval = file_put_contents($filename, $newFileContents); |
|
149 | + print intval($retval); |
|
150 | + break; |
|
151 | 151 | |
152 | - case 'remove_lang_file': |
|
152 | + case 'remove_lang_file': |
|
153 | 153 | |
154 | - if (!$permission['deltranslation']) { |
|
155 | - print $PMF_LANG['err_NotAuth']; |
|
156 | - exit; |
|
157 | - } |
|
154 | + if (!$permission['deltranslation']) { |
|
155 | + print $PMF_LANG['err_NotAuth']; |
|
156 | + exit; |
|
157 | + } |
|
158 | 158 | |
159 | - $lang = PMF_Filter::filterInput(INPUT_GET, 'translang', FILTER_SANITIZE_STRING); |
|
159 | + $lang = PMF_Filter::filterInput(INPUT_GET, 'translang', FILTER_SANITIZE_STRING); |
|
160 | 160 | |
161 | - if (!is_writable(PMF_ROOT_DIR . "/lang")) { |
|
162 | - print 0; |
|
163 | - exit; |
|
164 | - } |
|
161 | + if (!is_writable(PMF_ROOT_DIR . "/lang")) { |
|
162 | + print 0; |
|
163 | + exit; |
|
164 | + } |
|
165 | 165 | |
166 | - if (!copy(PMF_ROOT_DIR . "/lang/language_$lang.php", PMF_ROOT_DIR . "/lang/language_$lang.bak.php")) { |
|
167 | - print 0; |
|
168 | - exit; |
|
169 | - } |
|
166 | + if (!copy(PMF_ROOT_DIR . "/lang/language_$lang.php", PMF_ROOT_DIR . "/lang/language_$lang.bak.php")) { |
|
167 | + print 0; |
|
168 | + exit; |
|
169 | + } |
|
170 | 170 | |
171 | - if (!unlink(PMF_ROOT_DIR . "/lang/language_$lang.php")) { |
|
172 | - print 0; |
|
173 | - exit; |
|
174 | - } |
|
171 | + if (!unlink(PMF_ROOT_DIR . "/lang/language_$lang.php")) { |
|
172 | + print 0; |
|
173 | + exit; |
|
174 | + } |
|
175 | 175 | |
176 | - print 1; |
|
177 | - break; |
|
176 | + print 1; |
|
177 | + break; |
|
178 | 178 | |
179 | - case 'save_added_trans': |
|
179 | + case 'save_added_trans': |
|
180 | 180 | |
181 | - if (!$permission["addtranslation"]) { |
|
182 | - print $PMF_LANG['err_NotAuth']; |
|
183 | - exit; |
|
184 | - } |
|
181 | + if (!$permission["addtranslation"]) { |
|
182 | + print $PMF_LANG['err_NotAuth']; |
|
183 | + exit; |
|
184 | + } |
|
185 | 185 | |
186 | - if (!is_writable(PMF_ROOT_DIR . "/lang")) { |
|
187 | - print 0; |
|
188 | - exit; |
|
189 | - } |
|
186 | + if (!is_writable(PMF_ROOT_DIR . "/lang")) { |
|
187 | + print 0; |
|
188 | + exit; |
|
189 | + } |
|
190 | 190 | |
191 | - $langCode = PMF_Filter::filterInput(INPUT_POST, 'translang', FILTER_SANITIZE_STRING); |
|
192 | - $langName = @$languageCodes[$langCode]; |
|
193 | - $langCharset = "UTF-8"; |
|
194 | - $langDir = PMF_Filter::filterInput(INPUT_POST, 'langdir', FILTER_SANITIZE_STRING); |
|
195 | - $langNPlurals= strval(PMF_Filter::filterVar(@$_POST['langnplurals'], FILTER_VALIDATE_INT, -1)); |
|
196 | - $langDesc = PMF_Filter::filterInput(INPUT_POST, 'langdesc', FILTER_SANITIZE_STRING); |
|
197 | - $author = (array) @$_POST['author']; |
|
191 | + $langCode = PMF_Filter::filterInput(INPUT_POST, 'translang', FILTER_SANITIZE_STRING); |
|
192 | + $langName = @$languageCodes[$langCode]; |
|
193 | + $langCharset = "UTF-8"; |
|
194 | + $langDir = PMF_Filter::filterInput(INPUT_POST, 'langdir', FILTER_SANITIZE_STRING); |
|
195 | + $langNPlurals= strval(PMF_Filter::filterVar(@$_POST['langnplurals'], FILTER_VALIDATE_INT, -1)); |
|
196 | + $langDesc = PMF_Filter::filterInput(INPUT_POST, 'langdesc', FILTER_SANITIZE_STRING); |
|
197 | + $author = (array) @$_POST['author']; |
|
198 | 198 | |
199 | - if(empty($langCode) || empty($langName) || empty($langCharset) || |
|
200 | - empty($langDir) || empty($langDesc) || empty($author)) { |
|
201 | - print 0; |
|
202 | - exit; |
|
203 | - } |
|
199 | + if(empty($langCode) || empty($langName) || empty($langCharset) || |
|
200 | + empty($langDir) || empty($langDesc) || empty($author)) { |
|
201 | + print 0; |
|
202 | + exit; |
|
203 | + } |
|
204 | 204 | |
205 | - $fileTpl = <<<FILE |
|
205 | + $fileTpl = <<<FILE |
|
206 | 206 | <?php |
207 | 207 | /** |
208 | 208 | * %s |
@@ -228,41 +228,41 @@ discard block |
||
228 | 228 | \$PMF_LANG['nplurals'] = '%s'; |
229 | 229 | FILE; |
230 | 230 | |
231 | - $authorTpl = ''; |
|
232 | - foreach ($author as $authorData) { |
|
233 | - $authorTpl .= " * @author $authorData\n"; |
|
234 | - } |
|
231 | + $authorTpl = ''; |
|
232 | + foreach ($author as $authorData) { |
|
233 | + $authorTpl .= " * @author $authorData\n"; |
|
234 | + } |
|
235 | 235 | |
236 | - $fileTpl = sprintf($fileTpl, $langDesc, $authorTpl, date('Y-m-d'), $langCode, date('Y'), |
|
237 | - $langCharset, strtolower($langCode), $langName, $langDir, $langNPlurals); |
|
236 | + $fileTpl = sprintf($fileTpl, $langDesc, $authorTpl, date('Y-m-d'), $langCode, date('Y'), |
|
237 | + $langCharset, strtolower($langCode), $langName, $langDir, $langNPlurals); |
|
238 | 238 | |
239 | - $retval = @file_put_contents(PMF_ROOT_DIR . '/lang/language_' . strtolower($langCode) . '.php', $fileTpl); |
|
240 | - print intval($retval); |
|
241 | - break; |
|
239 | + $retval = @file_put_contents(PMF_ROOT_DIR . '/lang/language_' . strtolower($langCode) . '.php', $fileTpl); |
|
240 | + print intval($retval); |
|
241 | + break; |
|
242 | 242 | |
243 | 243 | |
244 | - case 'send_translated_file': |
|
244 | + case 'send_translated_file': |
|
245 | 245 | |
246 | - $lang = PMF_Filter::filterInput(INPUT_GET, 'translang', FILTER_SANITIZE_STRING); |
|
247 | - $filename = PMF_ROOT_DIR . "/lang/language_" . $lang . ".php"; |
|
246 | + $lang = PMF_Filter::filterInput(INPUT_GET, 'translang', FILTER_SANITIZE_STRING); |
|
247 | + $filename = PMF_ROOT_DIR . "/lang/language_" . $lang . ".php"; |
|
248 | 248 | |
249 | - if (!file_exists($filename)) { |
|
250 | - print 0; |
|
251 | - exit; |
|
252 | - } |
|
249 | + if (!file_exists($filename)) { |
|
250 | + print 0; |
|
251 | + exit; |
|
252 | + } |
|
253 | 253 | |
254 | - $letterTpl = ''; |
|
254 | + $letterTpl = ''; |
|
255 | 255 | |
256 | - $mail = new PMF_Mail($faqConfig); |
|
257 | - $mail->subject = 'New phpMyFAQ language file submitted'; |
|
258 | - $mail->message = sprintf('The file below was sent by %s, which is using phpMyFAQ %s on %s', |
|
259 | - $user->userdata->get('email'), |
|
260 | - $faqConfig->get('main.currentVersion'), |
|
261 | - $_SERVER['HTTP_HOST']); |
|
256 | + $mail = new PMF_Mail($faqConfig); |
|
257 | + $mail->subject = 'New phpMyFAQ language file submitted'; |
|
258 | + $mail->message = sprintf('The file below was sent by %s, which is using phpMyFAQ %s on %s', |
|
259 | + $user->userdata->get('email'), |
|
260 | + $faqConfig->get('main.currentVersion'), |
|
261 | + $_SERVER['HTTP_HOST']); |
|
262 | 262 | |
263 | - $mail->addTo('[email protected]'); |
|
264 | - $mail->addAttachment($filename, null, 'text/plain'); |
|
263 | + $mail->addTo('[email protected]'); |
|
264 | + $mail->addAttachment($filename, null, 'text/plain'); |
|
265 | 265 | |
266 | - print (int) $mail->send(); |
|
267 | - break; |
|
266 | + print (int) $mail->send(); |
|
267 | + break; |
|
268 | 268 | } |
@@ -20,17 +20,17 @@ discard block |
||
20 | 20 | |
21 | 21 | if (!defined('IS_VALID_PHPMYFAQ')) { |
22 | 22 | $protocol = 'http'; |
23 | - if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON'){ |
|
23 | + if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') { |
|
24 | 24 | $protocol = 'https'; |
25 | 25 | } |
26 | - header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME'])); |
|
26 | + header('Location: '.$protocol.'://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME'])); |
|
27 | 27 | exit(); |
28 | 28 | } |
29 | 29 | |
30 | 30 | $ajax_action = PMF_Filter::filterInput(INPUT_GET, 'ajaxaction', FILTER_SANITIZE_STRING); |
31 | -$csrfToken = PMF_Filter::filterInput(INPUT_POST, 'csrf', FILTER_SANITIZE_STRING); |
|
31 | +$csrfToken = PMF_Filter::filterInput(INPUT_POST, 'csrf', FILTER_SANITIZE_STRING); |
|
32 | 32 | if (is_null($csrfToken)) { |
33 | - $csrfToken = PMF_Filter::filterInput(INPUT_GET, 'csrf', FILTER_SANITIZE_STRING); |
|
33 | + $csrfToken = PMF_Filter::filterInput(INPUT_GET, 'csrf', FILTER_SANITIZE_STRING); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | if (!isset($_SESSION['phpmyfaq_csrf_token']) || $_SESSION['phpmyfaq_csrf_token'] !== $csrfToken) { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | if (is_string($val)) { |
50 | 50 | $val = str_replace(array('\\\\', '\"', '\\\''), array('\\', '"', "'"), $val); |
51 | 51 | $val = str_replace("'", "\\'", $val); |
52 | - $_SESSION['trans']['rightVarsOnly']["PMF_LANG[$key]"] = $val; |
|
52 | + $_SESSION['trans']['rightVarsOnly']["PMF_LANG[$key]"] = $val; |
|
53 | 53 | } elseif (is_array($val)) { |
54 | 54 | /** |
55 | 55 | * Here we deal with a two dimensional array |
@@ -64,13 +64,13 @@ discard block |
||
64 | 64 | |
65 | 65 | foreach ((array)@$_POST['LANG_CONF'] as $key => $val) { |
66 | 66 | // if string like array(blah-blah-blah), extract the contents inside the brackets |
67 | - if (preg_match('/^\s*array\s*\(\s*(\d+.+)\s*\).*$/',$val,$matches1)) { |
|
67 | + if (preg_match('/^\s*array\s*\(\s*(\d+.+)\s*\).*$/', $val, $matches1)) { |
|
68 | 68 | // split the resulting string of delimiters such as "number =>" |
69 | 69 | $valArr = preg_split( |
70 | 70 | '/\s*(\d+)\s*\=\>\s*/', |
71 | 71 | $matches1[1], |
72 | 72 | null, |
73 | - PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY |
|
73 | + PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY |
|
74 | 74 | ); |
75 | 75 | // in an array $valArr contents like "number substring", "substring", "number substring", "substring", ... |
76 | 76 | $numVal = count($valArr); |
@@ -89,12 +89,12 @@ discard block |
||
89 | 89 | } |
90 | 90 | } |
91 | 91 | } |
92 | - $_SESSION['trans']['rightVarsOnly']["LANG_CONF[$key]"] = 'array('.implode(", ",$newValArr).')'; |
|
92 | + $_SESSION['trans']['rightVarsOnly']["LANG_CONF[$key]"] = 'array('.implode(", ", $newValArr).')'; |
|
93 | 93 | } |
94 | 94 | } else { // compatibility for old behavior |
95 | 95 | $val = str_replace(array('\\\\', '\"', '\\\''), array('\\', '"', "'"), $val); |
96 | 96 | $val = str_replace("'", "\\'", $val); |
97 | - $_SESSION['trans']['rightVarsOnly']["LANG_CONF[$key]"] = $val; |
|
97 | + $_SESSION['trans']['rightVarsOnly']["LANG_CONF[$key]"] = $val; |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
@@ -109,14 +109,14 @@ discard block |
||
109 | 109 | } |
110 | 110 | |
111 | 111 | $lang = strtolower($_SESSION['trans']['rightVarsOnly']["PMF_LANG[metaLanguage]"]); |
112 | - $filename = PMF_ROOT_DIR . "/lang/language_" . $lang . ".php"; |
|
112 | + $filename = PMF_ROOT_DIR."/lang/language_".$lang.".php"; |
|
113 | 113 | |
114 | - if (!is_writable(PMF_ROOT_DIR . "/lang")) { |
|
114 | + if (!is_writable(PMF_ROOT_DIR."/lang")) { |
|
115 | 115 | print 0; |
116 | 116 | exit; |
117 | 117 | } |
118 | 118 | |
119 | - if (!copy($filename, PMF_ROOT_DIR . "/lang/language_" . $lang . ".bak.php")) { |
|
119 | + if (!copy($filename, PMF_ROOT_DIR."/lang/language_".$lang.".bak.php")) { |
|
120 | 120 | print 0; |
121 | 121 | exit; |
122 | 122 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | if (0 === strpos($key, 'PMF_LANG')) { |
139 | 139 | $val = "'$val'"; |
140 | 140 | } |
141 | - array_push($tmpLines, '$' . str_replace(array('[', ']'), array("['", "']"), $key) . " = $val;"); |
|
141 | + array_push($tmpLines, '$'.str_replace(array('[', ']'), array("['", "']"), $key)." = $val;"); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | $newFileContents .= implode("\n", $tmpLines); |
@@ -158,17 +158,17 @@ discard block |
||
158 | 158 | |
159 | 159 | $lang = PMF_Filter::filterInput(INPUT_GET, 'translang', FILTER_SANITIZE_STRING); |
160 | 160 | |
161 | - if (!is_writable(PMF_ROOT_DIR . "/lang")) { |
|
161 | + if (!is_writable(PMF_ROOT_DIR."/lang")) { |
|
162 | 162 | print 0; |
163 | 163 | exit; |
164 | 164 | } |
165 | 165 | |
166 | - if (!copy(PMF_ROOT_DIR . "/lang/language_$lang.php", PMF_ROOT_DIR . "/lang/language_$lang.bak.php")) { |
|
166 | + if (!copy(PMF_ROOT_DIR."/lang/language_$lang.php", PMF_ROOT_DIR."/lang/language_$lang.bak.php")) { |
|
167 | 167 | print 0; |
168 | 168 | exit; |
169 | 169 | } |
170 | 170 | |
171 | - if (!unlink(PMF_ROOT_DIR . "/lang/language_$lang.php")) { |
|
171 | + if (!unlink(PMF_ROOT_DIR."/lang/language_$lang.php")) { |
|
172 | 172 | print 0; |
173 | 173 | exit; |
174 | 174 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | exit; |
184 | 184 | } |
185 | 185 | |
186 | - if (!is_writable(PMF_ROOT_DIR . "/lang")) { |
|
186 | + if (!is_writable(PMF_ROOT_DIR."/lang")) { |
|
187 | 187 | print 0; |
188 | 188 | exit; |
189 | 189 | } |
@@ -192,17 +192,17 @@ discard block |
||
192 | 192 | $langName = @$languageCodes[$langCode]; |
193 | 193 | $langCharset = "UTF-8"; |
194 | 194 | $langDir = PMF_Filter::filterInput(INPUT_POST, 'langdir', FILTER_SANITIZE_STRING); |
195 | - $langNPlurals= strval(PMF_Filter::filterVar(@$_POST['langnplurals'], FILTER_VALIDATE_INT, -1)); |
|
195 | + $langNPlurals = strval(PMF_Filter::filterVar(@$_POST['langnplurals'], FILTER_VALIDATE_INT, -1)); |
|
196 | 196 | $langDesc = PMF_Filter::filterInput(INPUT_POST, 'langdesc', FILTER_SANITIZE_STRING); |
197 | - $author = (array) @$_POST['author']; |
|
197 | + $author = (array)@$_POST['author']; |
|
198 | 198 | |
199 | - if(empty($langCode) || empty($langName) || empty($langCharset) || |
|
199 | + if (empty($langCode) || empty($langName) || empty($langCharset) || |
|
200 | 200 | empty($langDir) || empty($langDesc) || empty($author)) { |
201 | 201 | print 0; |
202 | 202 | exit; |
203 | 203 | } |
204 | 204 | |
205 | - $fileTpl = <<<FILE |
|
205 | + $fileTpl = <<<FILE |
|
206 | 206 | <?php |
207 | 207 | /** |
208 | 208 | * %s |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $fileTpl = sprintf($fileTpl, $langDesc, $authorTpl, date('Y-m-d'), $langCode, date('Y'), |
237 | 237 | $langCharset, strtolower($langCode), $langName, $langDir, $langNPlurals); |
238 | 238 | |
239 | - $retval = @file_put_contents(PMF_ROOT_DIR . '/lang/language_' . strtolower($langCode) . '.php', $fileTpl); |
|
239 | + $retval = @file_put_contents(PMF_ROOT_DIR.'/lang/language_'.strtolower($langCode).'.php', $fileTpl); |
|
240 | 240 | print intval($retval); |
241 | 241 | break; |
242 | 242 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | case 'send_translated_file': |
245 | 245 | |
246 | 246 | $lang = PMF_Filter::filterInput(INPUT_GET, 'translang', FILTER_SANITIZE_STRING); |
247 | - $filename = PMF_ROOT_DIR . "/lang/language_" . $lang . ".php"; |
|
247 | + $filename = PMF_ROOT_DIR."/lang/language_".$lang.".php"; |
|
248 | 248 | |
249 | 249 | if (!file_exists($filename)) { |
250 | 250 | print 0; |
@@ -263,6 +263,6 @@ discard block |
||
263 | 263 | $mail->addTo('[email protected]'); |
264 | 264 | $mail->addAttachment($filename, null, 'text/plain'); |
265 | 265 | |
266 | - print (int) $mail->send(); |
|
266 | + print (int)$mail->send(); |
|
267 | 267 | break; |
268 | 268 | } |
@@ -664,14 +664,14 @@ |
||
664 | 664 | $PMF_LANG['ad_entry_visibility'] = 'Objavi?'; |
665 | 665 | |
666 | 666 | // added v2.0.0 - 2006-01-02 by Lars |
667 | -$PMF_LANG['ad_user_error_password'] = "Molimo unesite lozinku. "; |
|
668 | -$PMF_LANG['ad_user_error_passwordsDontMatch'] = "Lozinke se ne poklapaju. "; |
|
669 | -$PMF_LANG['ad_user_error_loginInvalid'] = "Unešeno korisničko ime nije nađeno."; |
|
670 | -$PMF_LANG['ad_user_error_noEmail'] = "Unesite važeću email adresu. "; |
|
671 | -$PMF_LANG['ad_user_error_noRealName'] = "Unesite Vaše pravo ime. "; |
|
672 | -$PMF_LANG['ad_user_error_delete'] = "Korisnički nalog ne može biti izbrisan. "; |
|
673 | -$PMF_LANG['ad_user_error_noId'] = "Nije priložen ID. "; |
|
674 | -$PMF_LANG['ad_user_error_protectedAccount'] = "Korisnički nalog je zaštićen. "; |
|
667 | +$PMF_LANG['ad_user_error_password'] = "Molimo unesite lozinku. "; |
|
668 | +$PMF_LANG['ad_user_error_passwordsDontMatch'] = "Lozinke se ne poklapaju. "; |
|
669 | +$PMF_LANG['ad_user_error_loginInvalid'] = "Unešeno korisničko ime nije nađeno."; |
|
670 | +$PMF_LANG['ad_user_error_noEmail'] = "Unesite važeću email adresu. "; |
|
671 | +$PMF_LANG['ad_user_error_noRealName'] = "Unesite Vaše pravo ime. "; |
|
672 | +$PMF_LANG['ad_user_error_delete'] = "Korisnički nalog ne može biti izbrisan. "; |
|
673 | +$PMF_LANG['ad_user_error_noId'] = "Nije priložen ID. "; |
|
674 | +$PMF_LANG['ad_user_error_protectedAccount'] = "Korisnički nalog je zaštićen. "; |
|
675 | 675 | $PMF_LANG['ad_user_deleteUser'] = "Obriši korisnika"; |
676 | 676 | $PMF_LANG['ad_user_status'] = "Status:"; |
677 | 677 | $PMF_LANG['ad_user_lastModified'] = "zadnji put menjano:"; |
@@ -184,7 +184,7 @@ |
||
184 | 184 | * |
185 | 185 | * @param string $val Value |
186 | 186 | * |
187 | - * @return boolean |
|
187 | + * @return integer |
|
188 | 188 | */ |
189 | 189 | public function isValIgnorable($val) |
190 | 190 | { |
@@ -574,10 +574,10 @@ discard block |
||
574 | 574 | } |
575 | 575 | |
576 | 576 | /** |
577 | - * print the static tree with the number of records |
|
578 | - * |
|
579 | - * @return string |
|
580 | - */ |
|
577 | + * print the static tree with the number of records |
|
578 | + * |
|
579 | + * @return string |
|
580 | + */ |
|
581 | 581 | public function viewTree() |
582 | 582 | { |
583 | 583 | global $sids, $PMF_LANG, $plr; |
@@ -1225,7 +1225,7 @@ discard block |
||
1225 | 1225 | PMF_Db::getTablePrefix(), |
1226 | 1226 | $category_id); |
1227 | 1227 | if (!$delete_all) { |
1228 | - $query .= " AND lang = '".$category_lang."'"; |
|
1228 | + $query .= " AND lang = '".$category_lang."'"; |
|
1229 | 1229 | } |
1230 | 1230 | $this->_config->getDb()->query($query); |
1231 | 1231 | |
@@ -1249,7 +1249,7 @@ discard block |
||
1249 | 1249 | PMF_Db::getTablePrefix(), |
1250 | 1250 | $category_id); |
1251 | 1251 | if (!$delete_all) { |
1252 | - $query .= " AND category_lang = '".$category_lang."'"; |
|
1252 | + $query .= " AND category_lang = '".$category_lang."'"; |
|
1253 | 1253 | } |
1254 | 1254 | $this->_config->getDb()->query($query); |
1255 | 1255 | |
@@ -1273,7 +1273,7 @@ discard block |
||
1273 | 1273 | $translated = array(); |
1274 | 1274 | |
1275 | 1275 | foreach ($existcatlang as $language) { |
1276 | - $query = sprintf(" |
|
1276 | + $query = sprintf(" |
|
1277 | 1277 | SELECT |
1278 | 1278 | name, description |
1279 | 1279 | FROM |
@@ -1282,13 +1282,13 @@ discard block |
||
1282 | 1282 | id = %d |
1283 | 1283 | AND |
1284 | 1284 | lang = '%s'", |
1285 | - PMF_Db::getTablePrefix(), |
|
1286 | - $category_id, |
|
1287 | - $language); |
|
1288 | - $result = $this->_config->getDb()->query($query); |
|
1289 | - if ($row = $this->_config->getDb()->fetchArray($result)) { |
|
1290 | - $translated[$languageCodes[strtoupper($language)]] = $row['name'].('' == $row['description'] ? '' : ' ('.$row['description'].')'); |
|
1291 | - } |
|
1285 | + PMF_Db::getTablePrefix(), |
|
1286 | + $category_id, |
|
1287 | + $language); |
|
1288 | + $result = $this->_config->getDb()->query($query); |
|
1289 | + if ($row = $this->_config->getDb()->fetchArray($result)) { |
|
1290 | + $translated[$languageCodes[strtoupper($language)]] = $row['name'].('' == $row['description'] ? '' : ' ('.$row['description'].')'); |
|
1291 | + } |
|
1292 | 1292 | } |
1293 | 1293 | ksort($translated); |
1294 | 1294 | |
@@ -1342,9 +1342,9 @@ discard block |
||
1342 | 1342 | $result = $this->_config->getDb()->query($query); |
1343 | 1343 | while ($row = $this->_config->getDb()->fetchArray($result)) { |
1344 | 1344 | if (!array_key_exists($row['id'],$this->categoryName)) { |
1345 | - $this->categoryName[$row['id']] = $row; |
|
1346 | - $this->categories[] =& $this->categoryName[$row['id']]; |
|
1347 | - $this->children[$row['parent_id']][$row['id']] =& $this->categoryName[$row['id']]; |
|
1345 | + $this->categoryName[$row['id']] = $row; |
|
1346 | + $this->categories[] =& $this->categoryName[$row['id']]; |
|
1347 | + $this->children[$row['parent_id']][$row['id']] =& $this->categoryName[$row['id']]; |
|
1348 | 1348 | } |
1349 | 1349 | } |
1350 | 1350 | } |
@@ -1540,8 +1540,8 @@ discard block |
||
1540 | 1540 | fd.lang = fcr.category_lang |
1541 | 1541 | ORDER BY |
1542 | 1542 | fcr.category_id, fd.id', |
1543 | - PMF_Db::getTablePrefix(), |
|
1544 | - PMF_Db::getTablePrefix()); |
|
1543 | + PMF_Db::getTablePrefix(), |
|
1544 | + PMF_Db::getTablePrefix()); |
|
1545 | 1545 | $result = $this->_config->getDb()->query($query); |
1546 | 1546 | |
1547 | 1547 | if ($this->_config->getDb()->numRows($result) > 0) { |
@@ -232,9 +232,9 @@ discard block |
||
232 | 232 | |
233 | 233 | while ($row = $this->_config->getDb()->fetchArray($result)) { |
234 | 234 | $this->categoryName[$row['id']] = $row; |
235 | - $this->categories[] =& $this->categoryName[$row['id']]; |
|
236 | - $this->children[$row['parent_id']][$row['id']] =& $this->categoryName[$row['id']]; |
|
237 | - $this->owner[$row['id']] =& $row['user_id']; |
|
235 | + $this->categories[] = & $this->categoryName[$row['id']]; |
|
236 | + $this->children[$row['parent_id']][$row['id']] = & $this->categoryName[$row['id']]; |
|
237 | + $this->owner[$row['id']] = & $row['user_id']; |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | return $this->categories; |
@@ -398,8 +398,8 @@ discard block |
||
398 | 398 | $symbol = 'minus'; |
399 | 399 | } else { |
400 | 400 | $temp = isset($this->children[$thisParent_id]) ? array_keys($this->children[$thisParent_id]) : array(); |
401 | - if (isset($temp[count($temp)-1])) { |
|
402 | - $symbol = ($id == $temp[count($temp)-1]) ? 'angle' : 'medium'; |
|
401 | + if (isset($temp[count($temp) - 1])) { |
|
402 | + $symbol = ($id == $temp[count($temp) - 1]) ? 'angle' : 'medium'; |
|
403 | 403 | } |
404 | 404 | } |
405 | 405 | |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | $childs = array(); |
473 | 473 | |
474 | 474 | if (isset($this->children[$id])) { |
475 | - foreach(array_keys($this->children[$id]) as $childId) { |
|
475 | + foreach (array_keys($this->children[$id]) as $childId) { |
|
476 | 476 | $childs = array_merge($childs, array($childId)); |
477 | 477 | $childs = array_merge($childs, $this->getChildNodes($childId)); |
478 | 478 | } |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | $open = 0; |
626 | 626 | $this->expandAll(); |
627 | 627 | |
628 | - for ($y = 0 ;$y < $this->height(); $y = $this->getNextLineTree($y)) { |
|
628 | + for ($y = 0; $y < $this->height(); $y = $this->getNextLineTree($y)) { |
|
629 | 629 | |
630 | 630 | list($categoryName, $parent, $description) = $this->getLineDisplay($y); |
631 | 631 | $level = $this->treeTab[$y]['level']; |
@@ -667,14 +667,14 @@ discard block |
||
667 | 667 | $num_entries = ''; |
668 | 668 | } else { |
669 | 669 | $totFaqRecords += $number[$parent]; |
670 | - $num_entries = '<span class="rssCategoryLink"> ('.$plr->GetMsg('plmsgEntries',$number[$parent]); |
|
670 | + $num_entries = '<span class="rssCategoryLink"> ('.$plr->GetMsg('plmsgEntries', $number[$parent]); |
|
671 | 671 | $num_entries .= sprintf( |
672 | 672 | ' <a href="feed/category/rss.php?category_id=%d&category_lang=%s" target="_blank"><img id="category_%d_RSS" src="assets/img/feed.png" width="16" height="16" alt="RSS"></a>', |
673 | 673 | $parent, |
674 | 674 | $this->language, |
675 | 675 | $parent |
676 | 676 | ); |
677 | - $num_entries .= ')</span>'; |
|
677 | + $num_entries .= ')</span>'; |
|
678 | 678 | } |
679 | 679 | |
680 | 680 | $url = sprintf( |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | $oLink->text = $categoryName; |
689 | 689 | $oLink->tooltip = $description; |
690 | 690 | |
691 | - $output .= $oLink->toHtmlAnchor() . $num_entries; |
|
691 | + $output .= $oLink->toHtmlAnchor().$num_entries; |
|
692 | 692 | $open = $level; |
693 | 693 | } |
694 | 694 | |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | return $l + 1; |
732 | 732 | } else { |
733 | 733 | for ($i = $l + 1; $i < $this->height(); $i++) { |
734 | - if ($this->treeTab[$i]["level"]<=$this->treeTab[$l]["level"]) { |
|
734 | + if ($this->treeTab[$i]["level"] <= $this->treeTab[$l]["level"]) { |
|
735 | 735 | return $i; |
736 | 736 | } |
737 | 737 | } |
@@ -771,7 +771,7 @@ discard block |
||
771 | 771 | ); |
772 | 772 | |
773 | 773 | $oLink = new PMF_Link($url, $this->_config); |
774 | - $oLink->id = 'category_' . $categoryId; |
|
774 | + $oLink->id = 'category_'.$categoryId; |
|
775 | 775 | $oLink->itemTitle = $categoryName; |
776 | 776 | $oLink->text = $categoryName; |
777 | 777 | |
@@ -852,7 +852,7 @@ discard block |
||
852 | 852 | return sprintf( |
853 | 853 | '<ul class="%s">%s</ul>', |
854 | 854 | $useCssClass, |
855 | - implode('<li class="divider">' . $separator . '</li>', $temp) |
|
855 | + implode('<li class="divider">'.$separator.'</li>', $temp) |
|
856 | 856 | ); |
857 | 857 | } else { |
858 | 858 | return implode($separator, $temp); |
@@ -1302,7 +1302,7 @@ discard block |
||
1302 | 1302 | if ($lang == $selected_lang) { |
1303 | 1303 | $output .= " selected=\"selected\""; |
1304 | 1304 | } |
1305 | - $output .= ">".$langname."</option>\n"; |
|
1305 | + $output .= ">".$langname."</option>\n"; |
|
1306 | 1306 | } |
1307 | 1307 | } |
1308 | 1308 | |
@@ -1329,10 +1329,10 @@ discard block |
||
1329 | 1329 | $query .= ' ORDER BY id'; |
1330 | 1330 | $result = $this->_config->getDb()->query($query); |
1331 | 1331 | while ($row = $this->_config->getDb()->fetchArray($result)) { |
1332 | - if (!array_key_exists($row['id'],$this->categoryName)) { |
|
1332 | + if (!array_key_exists($row['id'], $this->categoryName)) { |
|
1333 | 1333 | $this->categoryName[$row['id']] = $row; |
1334 | - $this->categories[] =& $this->categoryName[$row['id']]; |
|
1335 | - $this->children[$row['parent_id']][$row['id']] =& $this->categoryName[$row['id']]; |
|
1334 | + $this->categories[] = & $this->categoryName[$row['id']]; |
|
1335 | + $this->children[$row['parent_id']][$row['id']] = & $this->categoryName[$row['id']]; |
|
1336 | 1336 | } |
1337 | 1337 | } |
1338 | 1338 | } |
@@ -20,10 +20,10 @@ |
||
20 | 20 | |
21 | 21 | if (!defined('IS_VALID_PHPMYFAQ')) { |
22 | 22 | $protocol = 'http'; |
23 | - if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON'){ |
|
23 | + if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') { |
|
24 | 24 | $protocol = 'https'; |
25 | 25 | } |
26 | - header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME'])); |
|
26 | + header('Location: '.$protocol.'://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME'])); |
|
27 | 27 | exit(); |
28 | 28 | } |
29 | 29 |