@@ -41,8 +41,7 @@ |
||
| 41 | 41 | $leftNum = (int) preg_replace($pat, $rep, $left); |
| 42 | 42 | $rightNum = (int) preg_replace($pat, $rep, $right); |
| 43 | 43 | return ($left != $leftNum && $right != $rightNum) ? |
| 44 | - $leftNum - $rightNum : |
|
| 45 | - strcmp($left, $right); |
|
| 44 | + $leftNum - $rightNum : strcmp($left, $right); |
|
| 46 | 45 | } |
| 47 | 46 | |
| 48 | 47 | |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * @author Zilvinas Vaira |
| 8 | 8 | * |
| 9 | 9 | */ |
| 10 | -class Attribute implements HtmlElementInterface{ |
|
| 10 | +class Attribute implements HtmlElementInterface { |
|
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * |
@@ -26,15 +26,15 @@ discard block |
||
| 26 | 26 | * @param string $name |
| 27 | 27 | * @param string $value |
| 28 | 28 | */ |
| 29 | - public function __construct($name, $value){ |
|
| 29 | + public function __construct($name, $value) { |
|
| 30 | 30 | $this->name = str_replace('"', '', $name); |
| 31 | 31 | $this->value = str_replace('"', '', $value); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - public function __toString(){ |
|
| 35 | - if(!empty($this->name) && $this->value!=''){ |
|
| 34 | + public function __toString() { |
|
| 35 | + if (!empty($this->name) && $this->value != '') { |
|
| 36 | 36 | return ' ' . $this->name . '="' . $this->value . '"'; |
| 37 | - }else{ |
|
| 37 | + } else { |
|
| 38 | 38 | return ''; |
| 39 | 39 | } |
| 40 | 40 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | } |
| 123 | 123 | break; |
| 124 | 124 | case "boolean": |
| 125 | - $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>" . ($content == "on" ? _("on") : _("off") ) . "</strong></td></tr>"; |
|
| 125 | + $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>" . ($content == "on" ? _("on") : _("off")) . "</strong></td></tr>"; |
|
| 126 | 126 | break; |
| 127 | 127 | default: |
| 128 | 128 | $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>$content</strong></td></tr>"; |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | |
| 192 | 192 | $details['name'] = preg_replace('/(.)\/(.)/', "$1<br/>$2", $details['name']); |
| 193 | 193 | $details['name'] = preg_replace('/\//', "", $details['name']); |
| 194 | - $certstatus = ( $details['root'] == 1 ? "R" : "I"); |
|
| 194 | + $certstatus = ($details['root'] == 1 ? "R" : "I"); |
|
| 195 | 195 | if ($details['ca'] == 0 && $details['root'] != 1) { |
| 196 | 196 | return "<div class='ca-summary' style='background-color:red'><div style='position:absolute; right: 0px; width:20px; height:20px; background-color:maroon; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>S</div></div>" . _("This is a <strong>SERVER</strong> certificate!") . "<br/>" . $details['name'] . "</div>"; |
| 197 | 197 | } |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | * @author Zilvinas Vaira |
| 7 | 7 | * |
| 8 | 8 | */ |
| 9 | -interface TabbedElementInterface extends PageElementInterface{ |
|
| 9 | +interface TabbedElementInterface extends PageElementInterface { |
|
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | 12 | * @return boolean |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | * @author Zilvinas Vaira |
| 11 | 11 | * |
| 12 | 12 | */ |
| 13 | -class TabbedPanelsBox implements PageElementInterface{ |
|
| 13 | +class TabbedPanelsBox implements PageElementInterface { |
|
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * |
@@ -41,8 +41,8 @@ discard block |
||
| 41 | 41 | * @param integer $index |
| 42 | 42 | * @return string |
| 43 | 43 | */ |
| 44 | - private function composeTabId($index){ |
|
| 45 | - return PageElementInterface::TABS_CLASS.'-'.($index+1); |
|
| 44 | + private function composeTabId($index) { |
|
| 45 | + return PageElementInterface::TABS_CLASS . '-' . ($index + 1); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
@@ -50,15 +50,15 @@ discard block |
||
| 50 | 50 | * @param string $title |
| 51 | 51 | * @param TabbedElementInterface $element |
| 52 | 52 | */ |
| 53 | - public function addTabbedPanel($title, $element){ |
|
| 53 | + public function addTabbedPanel($title, $element) { |
|
| 54 | 54 | $li = new CompositeTag('li'); |
| 55 | 55 | $a = new Tag('a'); |
| 56 | - $a->addAttribute('href', '#'.$this->composeTabId($this->index)); |
|
| 56 | + $a->addAttribute('href', '#' . $this->composeTabId($this->index)); |
|
| 57 | 57 | $a->addText($title); |
| 58 | 58 | $li->addTag($a); |
| 59 | 59 | $this->titles [$this->index] = $li; |
| 60 | 60 | $this->elements [$this->index] = $element; |
| 61 | - if($element->isActive()){ |
|
| 61 | + if ($element->isActive()) { |
|
| 62 | 62 | $this->active = $this->index; |
| 63 | 63 | } |
| 64 | 64 | $this->index++; |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | * {@inheritDoc} |
| 70 | 70 | * @see \web\lib\admin\view\PageElementInterface::render() |
| 71 | 71 | */ |
| 72 | - public function render(){ |
|
| 72 | + public function render() { |
|
| 73 | 73 | ?> |
| 74 | 74 | <div id="<?php echo PageElementInterface::TABS_CLASS; ?>" active="<?php echo $this->active; ?>"> |
| 75 | 75 | <ul> |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * {@inheritDoc} |
| 32 | 32 | * @see \web\lib\admin\view\MessageReceiverInterface::hasMessages() |
| 33 | 33 | */ |
| 34 | - public function hasMessages(){ |
|
| 34 | + public function hasMessages() { |
|
| 35 | 35 | return $this->box->size() > 0; |
| 36 | 36 | } |
| 37 | 37 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * {@inheritDoc} |
| 42 | 42 | * @see MessageReceiverInterface::receiveMessage() |
| 43 | 43 | */ |
| 44 | - public function receiveMessage($message){ |
|
| 44 | + public function receiveMessage($message) { |
|
| 45 | 45 | $p = new Tag('p'); |
| 46 | 46 | $p->addAttribute('class', $message->getClass($this->class)); |
| 47 | 47 | $p->addText($message->getText()); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | /** |
| 52 | 52 | * |
| 53 | 53 | */ |
| 54 | - public function render(){ |
|
| 54 | + public function render() { |
|
| 55 | 55 | echo $this->__toString(); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -60,10 +60,10 @@ discard block |
||
| 60 | 60 | * {@inheritDoc} |
| 61 | 61 | * @see HtmlElementInterface::__toString() |
| 62 | 62 | */ |
| 63 | - public function __toString(){ |
|
| 64 | - if($this->hasMessages()){ |
|
| 63 | + public function __toString() { |
|
| 64 | + if ($this->hasMessages()) { |
|
| 65 | 65 | return $this->box->__toString(); |
| 66 | - }else{ |
|
| 66 | + } else { |
|
| 67 | 67 | return ''; |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | * @author Zilvinas Vaira |
| 7 | 7 | * |
| 8 | 8 | */ |
| 9 | -abstract class AbstractForm implements TabbedElementInterface{ |
|
| 9 | +abstract class AbstractForm implements TabbedElementInterface { |
|
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | 12 | * @var string |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * |
| 41 | 41 | * @return boolean |
| 42 | 42 | */ |
| 43 | - public function isActive(){ |
|
| 43 | + public function isActive() { |
|
| 44 | 44 | return $this->messageBox->hasMessages(); |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | * @author Zilvinas Vaira |
| 10 | 10 | * |
| 11 | 11 | */ |
| 12 | -class AddNewUserForm extends AbstractForm{ |
|
| 12 | +class AddNewUserForm extends AbstractForm { |
|
| 13 | 13 | |
| 14 | 14 | const ADDNEWUSER_CLASS = 'sb-add-new-user'; |
| 15 | 15 | |
@@ -28,11 +28,11 @@ discard block |
||
| 28 | 28 | * {@inheritDoc} |
| 29 | 29 | * @see \web\lib\admin\view\PageElementInterface::render() |
| 30 | 30 | */ |
| 31 | - public function render(){ |
|
| 31 | + public function render() { |
|
| 32 | 32 | ?> |
| 33 | - <form method="post" action="<?php echo $this->action;?>" accept-charset="utf-8"> |
|
| 33 | + <form method="post" action="<?php echo $this->action; ?>" accept-charset="utf-8"> |
|
| 34 | 34 | <div class="<?php echo self::ADDNEWUSER_CLASS; ?>"> |
| 35 | - <?php $this->messageBox->render();?> |
|
| 35 | + <?php $this->messageBox->render(); ?> |
|
| 36 | 36 | <label for="<?php echo AddUserCommand::PARAM_NAME; ?>"><?php echo $this->description; ?></label> |
| 37 | 37 | <div style="margin: 5px 0px 10px 0px;"> |
| 38 | 38 | <input type="text" name="<?php echo AddUserCommand::PARAM_NAME; ?>"> |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | } |
| 185 | 185 | $lookFor .= "$name"; |
| 186 | 186 | } |
| 187 | - $finding = preg_match("/^(".$lookFor."):(.*)/", $oneRow->user_id, $matches); |
|
| 187 | + $finding = preg_match("/^(" . $lookFor . "):(.*)/", $oneRow->user_id, $matches); |
|
| 188 | 188 | if ($finding === 0 || $finding === FALSE) { |
| 189 | 189 | return FALSE; |
| 190 | 190 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | case $providerStrings[3]: |
| 207 | 207 | case $providerStrings[4]: |
| 208 | 208 | case $providerStrings[5]: |
| 209 | - if (!in_array(User::PROVIDER_STRINGS[$matches[1]],$listOfProviders)) { |
|
| 209 | + if (!in_array(User::PROVIDER_STRINGS[$matches[1]], $listOfProviders)) { |
|
| 210 | 210 | $listOfProviders[] = User::PROVIDER_STRINGS[$matches[1]]; |
| 211 | 211 | } |
| 212 | 212 | break; |