Skip to content

Commit 4a339eb

Browse files
committed
Fix Scrut bugs
1 parent d75a731 commit 4a339eb

File tree

17 files changed

+61
-22
lines changed

17 files changed

+61
-22
lines changed

Ajax/bootstrap/html/HtmlButtontoolbar.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ public function getLastGroup() {
7070
return $bg;
7171
}
7272

73-
/*
74-
* (non-PHPdoc)
75-
* @see \Ajax\bootstrap\html\HtmlButtongroups::getElement()
73+
74+
/**
75+
* @return HtmlButtongroups|HtmlButton
7676
*/
7777
public function getElement($index) {
7878
$element=null;

Ajax/bootstrap/html/HtmlModal.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ public function setDraggable($value) {
201201
* @return HtmlModal
202202
*/
203203
public function setBackdrop($value) {
204-
return $this->backdrop=$value;
204+
$this->backdrop=$value;
205+
return $this;
205206
}
206207
}

Ajax/common/html/traits/BaseHtmlEventsTrait.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
namespace Ajax\common\html\traits;
33
use Ajax\JsUtils;
44
use Ajax\service\AjaxCall;
5-
use Ajax\common\components\SimpleExtComponent;
65
use Ajax\service\Javascript;
76
use Ajax\common\html\BaseHtml;
87

Ajax/common/traits/JsUtilsInternalTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ protected function _addToCompile($jsScript) {
1515
* @param BaseGui $library
1616
* @param mixed $view
1717
*/
18-
protected function _compileLibrary(BaseGui $library=NULL, &$view=NULL){
18+
protected function _compileLibrary(BaseGui $library, &$view=NULL){
1919
if(isset($view))
2020
$library->compileHtml($this, $view);
2121
if ($library->isAutoCompile()) {

Ajax/semantic/html/base/HtmlSemNavElement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct($identifier,$tagName,$baseClass){
3636
/**
3737
* Associate an ajax get to the elements, displayed in $targetSelector
3838
* @param string $targetSelector the target of the get
39-
* @return HtmlNavElement
39+
* @return HtmlSemNavElement
4040
*/
4141
public function autoGetOnClick($targetSelector){
4242
return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr));

Ajax/semantic/html/collections/HtmlGrid.php

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,11 @@ public function colCount() {
205205
public function getCell($row, $col) {
206206
if ($row < 2 && $this->hasOnlyCols($this->count()))
207207
return $this->getItem($col);
208-
$row=$this->getItem($row);
209-
if (isset($row)) {
210-
$col=$row->getItem($col);
208+
$rowO=$this->getItem($row);
209+
if (isset($rowO)) {
210+
$colO=$rowO->getItem($col);
211211
}
212-
return $col;
212+
return $colO;
213213
}
214214

215215
/**
@@ -319,8 +319,17 @@ public function setStretched() {
319319
return $this->addToProperty("class", "stretched");
320320
}
321321

322+
/**
323+
* Adds a divider after the specified col
324+
* @param integer $afterColIndex
325+
* @param boolean $vertical
326+
* @param mixed $content
327+
* @return \Ajax\semantic\html\collections\HtmlGrid
328+
*/
322329
public function addDivider($afterColIndex, $vertical=true, $content=NULL) {
323330
$col=$this->getCell(0, $afterColIndex);
324-
return $col->addDivider($vertical, $content);
331+
if($col instanceof HtmlGridCol)
332+
$col->addDivider($vertical, $content);
333+
return $this;
325334
}
326335
}

Ajax/semantic/html/collections/form/traits/FieldTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function labeledToCorner($icon, $direction=Direction::LEFT) {
6868
}
6969

7070
/**
71-
* @param mixed $action
71+
* @param string $action
7272
* @param string $direction
7373
* @param string $icon
7474
* @param boolean $labeled

Ajax/semantic/html/content/table/HtmlTableContent.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Ajax\service\JArray;
77
use Ajax\common\html\HtmlCollection;
88
use Ajax\common\html\HtmlDoubleElement;
9+
use Ajax\semantic\html\base\traits\BaseTrait;
910

1011
/**
1112
* a table content (thead, tbody or tfoot)
@@ -187,7 +188,9 @@ public function setColValues($colIndex, $values=array()) {
187188
public function addColVariations($colIndex, $variations=array()) {
188189
$count=$this->count();
189190
for($i=0; $i < $count; $i++) {
190-
$this->getCell($i, $colIndex)->addVariations($variations);
191+
$cell=$this->getCell($i, $colIndex);
192+
if($cell instanceof BaseTrait)
193+
$cell->addVariations($variations);
191194
}
192195
return $this;
193196
}

Ajax/semantic/html/content/view/HtmlViewGroups.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ public function setWide($wide) {
4747

4848
abstract public function newItem($identifier);
4949

50+
/**
51+
* @return HtmlViewGroups
52+
*/
53+
public function getItem($index){
54+
return parent::getItem($index);
55+
}
5056

5157
public function getItemContent($itemIndex, $contentIndex) {
5258
$item=$this->getItem($itemIndex);

Ajax/semantic/html/elements/HtmlButton.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ public function asLink($href=NULL,$target=NULL) {
254254
*/
255255
public static function dropdown($identifier,$value,$items=[],$asCombo=false,$icon=null){
256256
$result=new HtmlButtonGroups($identifier,[$value]);
257-
$result->addDropdown($items,$asCombo);
257+
$dd=$result->addDropdown($items,$asCombo);
258258
if(isset($icon))
259-
$result->setIcon($icon);
259+
$dd->setIcon($icon);
260260
return $result;
261261
}
262262
}

0 commit comments

Comments
 (0)