@@ -82,6 +82,12 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | //HACK by domifara |
| 84 | 84 | // public function MyXoopsGroupPermForm($title, $modid, $permname, $permdesc) |
| 85 | + /** |
|
| 86 | + * @param string $title |
|
| 87 | + * @param integer $modid |
|
| 88 | + * @param string $permname |
|
| 89 | + * @param string $permdesc |
|
| 90 | + */ |
|
| 85 | 91 | public function __construct($title, $modid, $permname, $permdesc) |
| 86 | 92 | { |
| 87 | 93 | // $this->XoopsForm($title, 'groupperm_form', XOOPS_URL.'/modules/system/admin/groupperm.php', 'post'); GIJ |
@@ -112,6 +118,9 @@ discard block |
||
| 112 | 118 | * Add appendix |
| 113 | 119 | * |
| 114 | 120 | * @access public |
| 121 | + * @param string $permName |
|
| 122 | + * @param integer $itemId |
|
| 123 | + * @param string $itemName |
|
| 115 | 124 | */ |
| 116 | 125 | public function addAppendix($permName, $itemId, $itemName) |
| 117 | 126 | { |
@@ -251,6 +260,7 @@ discard block |
||
| 251 | 260 | |
| 252 | 261 | /** |
| 253 | 262 | * Constructor |
| 263 | + * @param string $name |
|
| 254 | 264 | */ |
| 255 | 265 | public function MyXoopsGroupFormCheckBox($caption, $name, $groupId, $values = null) |
| 256 | 266 | { |
@@ -29,8 +29,8 @@ discard block |
||
| 29 | 29 | // Project: The XOOPS Project // |
| 30 | 30 | // ------------------------------------------------------------------------- // |
| 31 | 31 | |
| 32 | -if (! defined('XOOPS_ROOT_PATH')) { |
|
| 33 | - exit ; |
|
| 32 | +if (!defined('XOOPS_ROOT_PATH')) { |
|
| 33 | + exit; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelement.php'; |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * Tree structure of items |
| 61 | 61 | * @var array |
| 62 | 62 | */ |
| 63 | - public $_itemTree = array() ; |
|
| 63 | + public $_itemTree = array(); |
|
| 64 | 64 | /** |
| 65 | 65 | * Name of permission |
| 66 | 66 | * @var string |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | * Appendix |
| 76 | 76 | * @var array ('permname'=>,'itemid'=>,'itemname'=>,'selected'=>) |
| 77 | 77 | */ |
| 78 | - public $_appendix = array() ; |
|
| 78 | + public $_appendix = array(); |
|
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | 81 | * Constructor |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | public function addAppendix($permName, $itemId, $itemName) |
| 117 | 117 | { |
| 118 | - $this->_appendix[] = array('permname'=>$permName,'itemid'=>$itemId,'itemname'=>$itemName,'selected'=>false); |
|
| 118 | + $this->_appendix[] = array('permname'=>$permName, 'itemid'=>$itemId, 'itemname'=>$itemName, 'selected'=>false); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | /** |
@@ -149,15 +149,15 @@ discard block |
||
| 149 | 149 | */ |
| 150 | 150 | public function render() |
| 151 | 151 | { |
| 152 | - global $xoopsGTicket ; |
|
| 152 | + global $xoopsGTicket; |
|
| 153 | 153 | |
| 154 | 154 | // load all child ids for javascript codes |
| 155 | 155 | foreach (array_keys($this->_itemTree) as $item_id) { |
| 156 | 156 | $this->_itemTree[$item_id]['allchild'] = array(); |
| 157 | 157 | $this->_loadAllChildItemIds($item_id, $this->_itemTree[$item_id]['allchild']); |
| 158 | 158 | } |
| 159 | - $gperm_handler =& xoops_gethandler('groupperm'); |
|
| 160 | - $member_handler =& xoops_gethandler('member'); |
|
| 159 | + $gperm_handler = & xoops_gethandler('groupperm'); |
|
| 160 | + $member_handler = & xoops_gethandler('member'); |
|
| 161 | 161 | $glist = $member_handler->getGroupList(); |
| 162 | 162 | foreach (array_keys($glist) as $i) { |
| 163 | 163 | // get selected item id(s) for each group |
@@ -166,11 +166,11 @@ discard block |
||
| 166 | 166 | $ele->setOptionTree($this->_itemTree); |
| 167 | 167 | |
| 168 | 168 | // GIJ start |
| 169 | - $ele->setDescription('<input type="checkbox" onclick="with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].name.match(/^perms\[(module_admin|module_read|block_read)\]\[groups\]\['.$i.'\]/)){elements[i].checked=this.checked;}}};">') ; |
|
| 169 | + $ele->setDescription('<input type="checkbox" onclick="with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].name.match(/^perms\[(module_admin|module_read|block_read)\]\[groups\]\['.$i.'\]/)){elements[i].checked=this.checked;}}};">'); |
|
| 170 | 170 | // GIJ_end |
| 171 | 171 | |
| 172 | 172 | foreach ($this->_appendix as $key => $append) { |
| 173 | - $this->_appendix[$key]['selected'] = $gperm_handler->checkRight($append['permname'], $append['itemid'], $i, $this->_modid) ; |
|
| 173 | + $this->_appendix[$key]['selected'] = $gperm_handler->checkRight($append['permname'], $append['itemid'], $i, $this->_modid); |
|
| 174 | 174 | } |
| 175 | 175 | $ele->setAppendix($this->_appendix); |
| 176 | 176 | $this->addElement($ele); |
@@ -180,11 +180,11 @@ discard block |
||
| 180 | 180 | // GIJ start |
| 181 | 181 | $jstray = new XoopsFormElementTray(' '); |
| 182 | 182 | $jsuncheckbutton = new XoopsFormButton('', 'none', _NONE, 'button'); |
| 183 | - $jsuncheckbutton->setExtra("onclick=\"with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].type=='checkbox'){elements[i].checked=false;}}}\"") ; |
|
| 183 | + $jsuncheckbutton->setExtra("onclick=\"with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].type=='checkbox'){elements[i].checked=false;}}}\""); |
|
| 184 | 184 | $jscheckbutton = new XoopsFormButton('', 'all', _ALL, 'button'); |
| 185 | - $jscheckbutton->setExtra("onclick=\"with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].type=='checkbox' && (elements[i].name.indexOf('module_admin')<0 || elements[i].name.indexOf('[groups][1]')>=0)){elements[i].checked=true;}}}\"") ; |
|
| 186 | - $jstray->addElement($jsuncheckbutton) ; |
|
| 187 | - $jstray->addElement($jscheckbutton) ; |
|
| 185 | + $jscheckbutton->setExtra("onclick=\"with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].type=='checkbox' && (elements[i].name.indexOf('module_admin')<0 || elements[i].name.indexOf('[groups][1]')>=0)){elements[i].checked=true;}}}\""); |
|
| 186 | + $jstray->addElement($jsuncheckbutton); |
|
| 187 | + $jstray->addElement($jscheckbutton); |
|
| 188 | 188 | $this->addElement($jstray); |
| 189 | 189 | // GIJ end |
| 190 | 190 | |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | |
| 196 | 196 | $ret = '<h4>'.$this->getTitle().'</h4>'.$this->_permDesc.'<br />'; |
| 197 | 197 | $ret .= "<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n<table width='100%' class='outer' cellspacing='1'>\n"; |
| 198 | - $elements =& $this->getElements(); |
|
| 198 | + $elements = & $this->getElements(); |
|
| 199 | 199 | foreach (array_keys($elements) as $i) { |
| 200 | 200 | if (!is_object($elements[$i])) { |
| 201 | 201 | $ret .= $elements[$i]; |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | * Appendix |
| 248 | 248 | * @var array ('permname'=>,'itemid'=>,'itemname'=>,'selected'=>) |
| 249 | 249 | */ |
| 250 | - public $_appendix = array() ; |
|
| 250 | + public $_appendix = array(); |
|
| 251 | 251 | |
| 252 | 252 | /** |
| 253 | 253 | * Constructor |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | */ |
| 288 | 288 | public function setOptionTree(&$optionTree) |
| 289 | 289 | { |
| 290 | - $this->_optionTree =& $optionTree; |
|
| 290 | + $this->_optionTree = & $optionTree; |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | /** |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | */ |
| 298 | 298 | public function setAppendix($appendix) |
| 299 | 299 | { |
| 300 | - $this->_appendix = $appendix ; |
|
| 300 | + $this->_appendix = $appendix; |
|
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | /** |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | */ |
| 309 | 309 | public function render() |
| 310 | 310 | { |
| 311 | - $ret = '' ; |
|
| 311 | + $ret = ''; |
|
| 312 | 312 | |
| 313 | 313 | if (sizeof($this->_appendix) > 0) { |
| 314 | 314 | $ret .= '<table class="outer"><tr>'; |
@@ -318,11 +318,11 @@ discard block |
||
| 318 | 318 | $ret .= '</tr><tr>'; |
| 319 | 319 | $cols = 1; |
| 320 | 320 | } |
| 321 | - $checked = $append['selected'] ? 'checked="checked"' : '' ; |
|
| 322 | - $name = 'perms['.$append['permname'].']' ; |
|
| 323 | - $itemid = $append['itemid'] ; |
|
| 324 | - $itemid = $append['itemid'] ; |
|
| 325 | - $ret .= "<td class=\"odd\"><input type=\"checkbox\" name=\"{$name}[groups][$this->_groupId][$itemid]\" id=\"{$name}[groups][$this->_groupId][$itemid]\" value=\"1\" $checked />{$append['itemname']}<input type=\"hidden\" name=\"{$name}[parents][$itemid]\" value=\"\" /><input type=\"hidden\" name=\"{$name}[itemname][$itemid]\" value=\"{$append['itemname']}\" /><br /></td>" ; |
|
| 321 | + $checked = $append['selected'] ? 'checked="checked"' : ''; |
|
| 322 | + $name = 'perms['.$append['permname'].']'; |
|
| 323 | + $itemid = $append['itemid']; |
|
| 324 | + $itemid = $append['itemid']; |
|
| 325 | + $ret .= "<td class=\"odd\"><input type=\"checkbox\" name=\"{$name}[groups][$this->_groupId][$itemid]\" id=\"{$name}[groups][$this->_groupId][$itemid]\" value=\"1\" $checked />{$append['itemname']}<input type=\"hidden\" name=\"{$name}[parents][$itemid]\" value=\"\" /><input type=\"hidden\" name=\"{$name}[itemname][$itemid]\" value=\"{$append['itemname']}\" /><br /></td>"; |
|
| 326 | 326 | $cols++; |
| 327 | 327 | } |
| 328 | 328 | $ret .= '</tr></table>'; |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | |
| 331 | 331 | $ret .= '<table class="outer"><tr>'; |
| 332 | 332 | $cols = 1; |
| 333 | - if (! empty($this->_optionTree[0]['children'])) { |
|
| 333 | + if (!empty($this->_optionTree[0]['children'])) { |
|
| 334 | 334 | foreach ($this->_optionTree[0]['children'] as $topitem) { |
| 335 | 335 | if ($cols > 4) { |
| 336 | 336 | $ret .= '</tr><tr>'; |
@@ -441,6 +441,7 @@ discard block |
||
| 441 | 441 | * the two files do not match, and likewise that the last lines do not |
| 442 | 442 | * match. The caller must trim matching lines from the beginning and end |
| 443 | 443 | * of the portions it is going to specify. |
| 444 | + * @param double $nchunks |
|
| 444 | 445 | */ |
| 445 | 446 | public function _diag($xoff, $xlim, $yoff, $ylim, $nchunks) |
| 446 | 447 | { |
@@ -561,6 +562,10 @@ discard block |
||
| 561 | 562 | * |
| 562 | 563 | * Note that XLIM, YLIM are exclusive bounds. All line numbers are |
| 563 | 564 | * origin-0 and discarded lines are not counted. |
| 565 | + * @param integer $xoff |
|
| 566 | + * @param integer $xlim |
|
| 567 | + * @param integer $yoff |
|
| 568 | + * @param integer $ylim |
|
| 564 | 569 | */ |
| 565 | 570 | public function _compareseq($xoff, $xlim, $yoff, $ylim) |
| 566 | 571 | { |
@@ -223,7 +223,7 @@ |
||
| 223 | 223 | * of elements as $to_lines. |
| 224 | 224 | */ |
| 225 | 225 | public function Text_MappedDiff($from_lines, $to_lines, |
| 226 | - $mapped_from_lines, $mapped_to_lines) |
|
| 226 | + $mapped_from_lines, $mapped_to_lines) |
|
| 227 | 227 | { |
| 228 | 228 | assert(count($from_lines) == count($mapped_from_lines)); |
| 229 | 229 | assert(count($to_lines) == count($mapped_to_lines)); |
@@ -281,17 +281,17 @@ |
||
| 281 | 281 | $edits = array(); |
| 282 | 282 | foreach ($diff as $line) { |
| 283 | 283 | switch ($line[0]) { |
| 284 | - case ' ': |
|
| 285 | - $edits[] = new Text_Diff_Op_copy(array(substr($line, 1))); |
|
| 286 | - break; |
|
| 284 | + case ' ': |
|
| 285 | + $edits[] = new Text_Diff_Op_copy(array(substr($line, 1))); |
|
| 286 | + break; |
|
| 287 | 287 | |
| 288 | - case '+': |
|
| 289 | - $edits[] = new Text_Diff_Op_add(array(substr($line, 1))); |
|
| 290 | - break; |
|
| 288 | + case '+': |
|
| 289 | + $edits[] = new Text_Diff_Op_add(array(substr($line, 1))); |
|
| 290 | + break; |
|
| 291 | 291 | |
| 292 | - case '-': |
|
| 293 | - $edits[] = new Text_Diff_Op_delete(array(substr($line, 1))); |
|
| 294 | - break; |
|
| 292 | + case '-': |
|
| 293 | + $edits[] = new Text_Diff_Op_delete(array(substr($line, 1))); |
|
| 294 | + break; |
|
| 295 | 295 | } |
| 296 | 296 | } |
| 297 | 297 | |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | $this->lcs = 0; |
| 468 | - $this->seq[0]= $yoff - 1; |
|
| 468 | + $this->seq[0] = $yoff - 1; |
|
| 469 | 469 | $this->in_seq = array(); |
| 470 | 470 | $ymids[0] = array(); |
| 471 | 471 | |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | } |
| 479 | 479 | } |
| 480 | 480 | |
| 481 | - $x1 = $xoff + (int)(($numer + ($xlim-$xoff)*$chunk) / $nchunks); |
|
| 481 | + $x1 = $xoff + (int)(($numer + ($xlim - $xoff) * $chunk) / $nchunks); |
|
| 482 | 482 | for (; $x < $x1; $x++) { |
| 483 | 483 | $line = $flip ? $this->yv[$x] : $this->xv[$x]; |
| 484 | 484 | if (empty($ymatches[$line])) { |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | $j++; |
| 647 | 647 | } |
| 648 | 648 | |
| 649 | - while ($i < $len && ! $changed[$i]) { |
|
| 649 | + while ($i < $len && !$changed[$i]) { |
|
| 650 | 650 | assert('$j < $other_len && ! $other_changed[$j]'); |
| 651 | 651 | $i++; |
| 652 | 652 | $j++; |
@@ -125,6 +125,12 @@ discard block |
||
| 125 | 125 | return $output . $this->_endDiff(); |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | + /** |
|
| 129 | + * @param integer $xbeg |
|
| 130 | + * @param integer $xlen |
|
| 131 | + * @param integer $ybeg |
|
| 132 | + * @param integer $ylen |
|
| 133 | + */ |
|
| 128 | 134 | public function _block($xbeg, $xlen, $ybeg, $ylen, &$edits) |
| 129 | 135 | { |
| 130 | 136 | $output = $this->_startBlock($this->_blockHeader($xbeg, $xlen, $ybeg, $ylen)); |
@@ -174,6 +180,9 @@ discard block |
||
| 174 | 180 | return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg; |
| 175 | 181 | } |
| 176 | 182 | |
| 183 | + /** |
|
| 184 | + * @param string $header |
|
| 185 | + */ |
|
| 177 | 186 | public function _startBlock($header) |
| 178 | 187 | { |
| 179 | 188 | return $header . "\n"; |
@@ -89,8 +89,8 @@ discard block |
||
| 89 | 89 | $block[] = new Text_Diff_Op_copy($context); |
| 90 | 90 | } |
| 91 | 91 | $output .= $this->_block($x0, $ntrail + $xi - $x0, |
| 92 | - $y0, $ntrail + $yi - $y0, |
|
| 93 | - $block); |
|
| 92 | + $y0, $ntrail + $yi - $y0, |
|
| 93 | + $block); |
|
| 94 | 94 | $block = false; |
| 95 | 95 | } |
| 96 | 96 | } |
@@ -118,8 +118,8 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | if (is_array($block)) { |
| 120 | 120 | $output .= $this->_block($x0, $xi - $x0, |
| 121 | - $y0, $yi - $y0, |
|
| 122 | - $block); |
|
| 121 | + $y0, $yi - $y0, |
|
| 122 | + $block); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | return $output . $this->_endDiff(); |
@@ -131,21 +131,21 @@ |
||
| 131 | 131 | |
| 132 | 132 | foreach ($edits as $edit) { |
| 133 | 133 | switch (strtolower(get_class($edit))) { |
| 134 | - case 'text_diff_op_copy': |
|
| 135 | - $output .= $this->_context($edit->orig); |
|
| 136 | - break; |
|
| 134 | + case 'text_diff_op_copy': |
|
| 135 | + $output .= $this->_context($edit->orig); |
|
| 136 | + break; |
|
| 137 | 137 | |
| 138 | - case 'text_diff_op_add': |
|
| 139 | - $output .= $this->_added($edit->final); |
|
| 140 | - break; |
|
| 138 | + case 'text_diff_op_add': |
|
| 139 | + $output .= $this->_added($edit->final); |
|
| 140 | + break; |
|
| 141 | 141 | |
| 142 | - case 'text_diff_op_delete': |
|
| 143 | - $output .= $this->_deleted($edit->orig); |
|
| 144 | - break; |
|
| 142 | + case 'text_diff_op_delete': |
|
| 143 | + $output .= $this->_deleted($edit->orig); |
|
| 144 | + break; |
|
| 145 | 145 | |
| 146 | - case 'text_diff_op_change': |
|
| 147 | - $output .= $this->_changed($edit->orig, $edit->final); |
|
| 148 | - break; |
|
| 146 | + case 'text_diff_op_change': |
|
| 147 | + $output .= $this->_changed($edit->orig, $edit->final); |
|
| 148 | + break; |
|
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | public function __construct($params = array()) |
| 37 | 37 | { |
| 38 | 38 | foreach ($params as $param => $value) { |
| 39 | - $v = '_' . $param; |
|
| 39 | + $v = '_'.$param; |
|
| 40 | 40 | if (isset($this->$v)) { |
| 41 | 41 | $this->$v = $value; |
| 42 | 42 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $block); |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - return $output . $this->_endDiff(); |
|
| 125 | + return $output.$this->_endDiff(); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | public function _block($xbeg, $xlen, $ybeg, $ylen, &$edits) |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - return $output . $this->_endBlock(); |
|
| 152 | + return $output.$this->_endBlock(); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | public function _startDiff() |
@@ -165,18 +165,18 @@ discard block |
||
| 165 | 165 | public function _blockHeader($xbeg, $xlen, $ybeg, $ylen) |
| 166 | 166 | { |
| 167 | 167 | if ($xlen > 1) { |
| 168 | - $xbeg .= ',' . ($xbeg + $xlen - 1); |
|
| 168 | + $xbeg .= ','.($xbeg + $xlen - 1); |
|
| 169 | 169 | } |
| 170 | 170 | if ($ylen > 1) { |
| 171 | - $ybeg .= ',' . ($ybeg + $ylen - 1); |
|
| 171 | + $ybeg .= ','.($ybeg + $ylen - 1); |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | - return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg; |
|
| 174 | + return $xbeg.($xlen ? ($ylen ? 'c' : 'd') : 'a').$ybeg; |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | public function _startBlock($header) |
| 178 | 178 | { |
| 179 | - return $header . "\n"; |
|
| 179 | + return $header."\n"; |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | public function _endBlock() |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | public function _lines($lines, $prefix = ' ') |
| 188 | 188 | { |
| 189 | - return $prefix . implode("\n$prefix", $lines) . "\n"; |
|
| 189 | + return $prefix.implode("\n$prefix", $lines)."\n"; |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | public function _context($lines) |
@@ -206,6 +206,6 @@ discard block |
||
| 206 | 206 | |
| 207 | 207 | public function _changed($orig, $final) |
| 208 | 208 | { |
| 209 | - return $this->_deleted($orig) . "---\n" . $this->_added($final); |
|
| 209 | + return $this->_deleted($orig)."---\n".$this->_added($final); |
|
| 210 | 210 | } |
| 211 | 211 | } |
@@ -63,6 +63,9 @@ discard block |
||
| 63 | 63 | return $header; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | + /** |
|
| 67 | + * @param string[] $lines |
|
| 68 | + */ |
|
| 66 | 69 | public function _lines($lines, $prefix = ' ', $encode = true) |
| 67 | 70 | { |
| 68 | 71 | if ($encode) { |
@@ -128,6 +131,9 @@ discard block |
||
| 128 | 131 | return str_replace($nl, "\n", $renderer->render($diff)) . "\n"; |
| 129 | 132 | } |
| 130 | 133 | |
| 134 | + /** |
|
| 135 | + * @param string $string |
|
| 136 | + */ |
|
| 131 | 137 | public function _splitOnWords($string, $newlineEscape = "\n") |
| 132 | 138 | { |
| 133 | 139 | $words = array(); |
@@ -118,11 +118,11 @@ |
||
| 118 | 118 | * preserve whitespace as well. Therefore we split on words, |
| 119 | 119 | * but include all blocks of whitespace in the wordlist. */ |
| 120 | 120 | $diff = new Text_Diff($this->_splitOnWords($text1, $nl), |
| 121 | - $this->_splitOnWords($text2, $nl)); |
|
| 121 | + $this->_splitOnWords($text2, $nl)); |
|
| 122 | 122 | |
| 123 | 123 | /* Get the diff in inline format. */ |
| 124 | 124 | $renderer = new Text_Diff_Renderer_inline(array_merge($this->getParams(), |
| 125 | - array('split_level' => 'words'))); |
|
| 125 | + array('split_level' => 'words'))); |
|
| 126 | 126 | |
| 127 | 127 | /* Run the diff and get the output. */ |
| 128 | 128 | return str_replace($nl, "\n", $renderer->render($diff)) . "\n"; |
@@ -72,14 +72,14 @@ discard block |
||
| 72 | 72 | if ($this->_split_level == 'words') { |
| 73 | 73 | return implode('', $lines); |
| 74 | 74 | } else { |
| 75 | - return implode("\n", $lines) . "\n"; |
|
| 75 | + return implode("\n", $lines)."\n"; |
|
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | public function _added($lines) |
| 80 | 80 | { |
| 81 | 81 | array_walk($lines, array(&$this, '_encode')); |
| 82 | - $lines[0] = $this->_ins_prefix . $lines[0]; |
|
| 82 | + $lines[0] = $this->_ins_prefix.$lines[0]; |
|
| 83 | 83 | $lines[count($lines) - 1] .= $this->_ins_suffix; |
| 84 | 84 | return $this->_lines($lines, ' ', false); |
| 85 | 85 | } |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | public function _deleted($lines, $words = false) |
| 88 | 88 | { |
| 89 | 89 | array_walk($lines, array(&$this, '_encode')); |
| 90 | - $lines[0] = $this->_del_prefix . $lines[0]; |
|
| 90 | + $lines[0] = $this->_del_prefix.$lines[0]; |
|
| 91 | 91 | $lines[count($lines) - 1] .= $this->_del_suffix; |
| 92 | 92 | return $this->_lines($lines, ' ', false); |
| 93 | 93 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $orig[0] = substr($orig[0], 1); |
| 106 | 106 | $final[0] = substr($final[0], 1); |
| 107 | 107 | } |
| 108 | - return $prefix . $this->_deleted($orig) . $this->_added($final); |
|
| 108 | + return $prefix.$this->_deleted($orig).$this->_added($final); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | $text1 = implode("\n", $orig); |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | array('split_level' => 'words'))); |
| 126 | 126 | |
| 127 | 127 | /* Run the diff and get the output. */ |
| 128 | - return str_replace($nl, "\n", $renderer->render($diff)) . "\n"; |
|
| 128 | + return str_replace($nl, "\n", $renderer->render($diff))."\n"; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | public function _splitOnWords($string, $newlineEscape = "\n") |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (! defined('XOOPS_TRUST_PATH')) { |
|
| 4 | - die('set XOOPS_TRUST_PATH in mainfile.php') ; |
|
| 3 | +if (!defined('XOOPS_TRUST_PATH')) { |
|
| 4 | + die('set XOOPS_TRUST_PATH in mainfile.php'); |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -$mydirname = basename(dirname(dirname(__FILE__))) ; |
|
| 8 | -$mydirpath = dirname(dirname(__FILE__)) ; |
|
| 7 | +$mydirname = basename(dirname(dirname(__FILE__))); |
|
| 8 | +$mydirpath = dirname(dirname(__FILE__)); |
|
| 9 | 9 | // require $mydirpath.'/mytrustdirname.php' ; // set $mytrustdirname |
| 10 | -$mytrustdirname = 'altsys' ; |
|
| 10 | +$mytrustdirname = 'altsys'; |
|
| 11 | 11 | |
| 12 | -require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/admin_menu.php' ; |
|
| 12 | +require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/admin_menu.php'; |
|
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require '../../../mainfile.php' ; |
|
| 4 | -if (! defined('XOOPS_TRUST_PATH')) { |
|
| 5 | - die('set XOOPS_TRUST_PATH in mainfile.php') ; |
|
| 3 | +require '../../../mainfile.php'; |
|
| 4 | +if (!defined('XOOPS_TRUST_PATH')) { |
|
| 5 | + die('set XOOPS_TRUST_PATH in mainfile.php'); |
|
| 6 | 6 | } |
| 7 | 7 | |
| 8 | -$mydirname = basename(dirname(dirname(__FILE__))) ; |
|
| 9 | -$mydirpath = dirname(dirname(__FILE__)) ; |
|
| 8 | +$mydirname = basename(dirname(dirname(__FILE__))); |
|
| 9 | +$mydirpath = dirname(dirname(__FILE__)); |
|
| 10 | 10 | // require $mydirpath.'/mytrustdirname.php' ; // set $mytrustdirname |
| 11 | -$mytrustdirname = 'altsys' ; |
|
| 11 | +$mytrustdirname = 'altsys'; |
|
| 12 | 12 | |
| 13 | -require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/index.php' ; |
|
| 13 | +require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/index.php'; |
|
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (! defined('XOOPS_TRUST_PATH')) { |
|
| 4 | - die('set XOOPS_TRUST_PATH into mainfile.php') ; |
|
| 3 | +if (!defined('XOOPS_TRUST_PATH')) { |
|
| 4 | + die('set XOOPS_TRUST_PATH into mainfile.php'); |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -$mydirname = basename(dirname(dirname(__FILE__))) ; |
|
| 8 | -$mydirpath = dirname(dirname(__FILE__)) ; |
|
| 7 | +$mydirname = basename(dirname(dirname(__FILE__))); |
|
| 8 | +$mydirpath = dirname(dirname(__FILE__)); |
|
| 9 | 9 | // require $mydirpath.'/mytrustdirname.php' ; // set $mytrustdirname |
| 10 | -$mytrustdirname = 'altsys' ; |
|
| 10 | +$mytrustdirname = 'altsys'; |
|
| 11 | 11 | |
| 12 | -require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/preload.php' ; |
|
| 12 | +require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/preload.php'; |
|
@@ -1,45 +1,45 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$xoopsOption['nocommon'] = 1 ; |
|
| 4 | -define('_LEGACY_PREVENT_LOAD_CORE_', 1) ; |
|
| 3 | +$xoopsOption['nocommon'] = 1; |
|
| 4 | +define('_LEGACY_PREVENT_LOAD_CORE_', 1); |
|
| 5 | 5 | |
| 6 | -include '../../mainfile.php' ; |
|
| 6 | +include '../../mainfile.php'; |
|
| 7 | 7 | |
| 8 | 8 | if (defined('XOOPS_TRUST_PATH') && XOOPS_TRUST_PATH != '' && file_exists(XOOPS_TRUST_PATH.'/libs/altsys')) { |
| 9 | - die('No problem with your XOOPS_TRUST_PATH') ; |
|
| 9 | + die('No problem with your XOOPS_TRUST_PATH'); |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | |
| 13 | 13 | // show the hint if password mathes |
| 14 | -$hint = '' ; |
|
| 14 | +$hint = ''; |
|
| 15 | 15 | if (@$_POST['dbpassword'] == XOOPS_DB_PASS) { |
| 16 | 16 | // find XOOPS_TRUST_PATH |
| 17 | - $xoops_trust_path = '' ; |
|
| 18 | - $base_dirs = array( XOOPS_ROOT_PATH , dirname(XOOPS_ROOT_PATH) , dirname(dirname(XOOPS_ROOT_PATH)) ) ; |
|
| 17 | + $xoops_trust_path = ''; |
|
| 18 | + $base_dirs = array(XOOPS_ROOT_PATH, dirname(XOOPS_ROOT_PATH), dirname(dirname(XOOPS_ROOT_PATH))); |
|
| 19 | 19 | foreach ($base_dirs as $base_dir) { |
| 20 | - $dh = @opendir($base_dir) ; |
|
| 21 | - if (! empty($dh)) { |
|
| 20 | + $dh = @opendir($base_dir); |
|
| 21 | + if (!empty($dh)) { |
|
| 22 | 22 | while (($file = readdir($dh)) !== false) { |
| 23 | 23 | if (substr($file, 0, 1) == '.') { |
| 24 | - continue ; |
|
| 24 | + continue; |
|
| 25 | 25 | } |
| 26 | - $fullpath = $base_dir . '/' . $file ; |
|
| 27 | - if (! is_dir($fullpath)) { |
|
| 28 | - continue ; |
|
| 26 | + $fullpath = $base_dir.'/'.$file; |
|
| 27 | + if (!is_dir($fullpath)) { |
|
| 28 | + continue; |
|
| 29 | 29 | } |
| 30 | 30 | if (is_dir($fullpath.'/libs/altsys')) { |
| 31 | - $xoops_trust_path = $fullpath ; |
|
| 32 | - break 2 ; |
|
| 31 | + $xoops_trust_path = $fullpath; |
|
| 32 | + break 2; |
|
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | // fall back |
| 38 | 38 | if (empty($xoops_trust_path)) { |
| 39 | - $xoops_trust_path = dirname(XOOPS_ROOT_PATH).'/xoops_trust_path' ; |
|
| 39 | + $xoops_trust_path = dirname(XOOPS_ROOT_PATH).'/xoops_trust_path'; |
|
| 40 | 40 | } |
| 41 | 41 | // create the hint |
| 42 | - if (! defined('XOOPS_TRUST_PATH')) { |
|
| 42 | + if (!defined('XOOPS_TRUST_PATH')) { |
|
| 43 | 43 | $hint = "Insert the red line.<br />define('XOOPS_ROOT_PATH', '".htmlspecialchars(XOOPS_ROOT_PATH, ENT_QUOTES)."');<br /><ins style='color:red;'>define('XOOPS_TRUST_PATH', '".htmlspecialchars($xoops_trust_path, ENT_QUOTES)."');</ins>"; |
| 44 | 44 | } else { |
| 45 | 45 | $hint = "<del>define('XOOPS_TRUST_PATH', '');</del><br /><ins style='color:red;'>define('XOOPS_TRUST_PATH', '".htmlspecialchars($xoops_trust_path, ENT_QUOTES)."');</ins>"; |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (! defined('XOOPS_TRUST_PATH')) { |
|
| 4 | - die('set XOOPS_TRUST_PATH into mainfile.php') ; |
|
| 3 | +if (!defined('XOOPS_TRUST_PATH')) { |
|
| 4 | + die('set XOOPS_TRUST_PATH into mainfile.php'); |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -$mydirname = basename(dirname(dirname(__FILE__))) ; |
|
| 8 | -$mydirpath = dirname(dirname(__FILE__)) ; |
|
| 7 | +$mydirname = basename(dirname(dirname(__FILE__))); |
|
| 8 | +$mydirpath = dirname(dirname(__FILE__)); |
|
| 9 | 9 | // require $mydirpath.'/mytrustdirname.php' ; // set $mytrustdirname |
| 10 | -$mytrustdirname = 'altsys' ; |
|
| 10 | +$mytrustdirname = 'altsys'; |
|
| 11 | 11 | |
| 12 | -require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/onupdate.php' ; |
|
| 12 | +require XOOPS_TRUST_PATH.'/libs/'.$mytrustdirname.'/onupdate.php'; |
|