Skip to content

Commit 727fe85

Browse files
committed
Fix phpMv-UI bug site
1 parent 0bebef6 commit 727fe85

File tree

8 files changed

+25
-19
lines changed

8 files changed

+25
-19
lines changed

Ajax/JsUtils.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,16 +172,21 @@ public function config($config=NULL) {
172172
* @param mixed $injected optional param for Symfony/Ubiquity
173173
*/
174174
public function __construct($params=array(),$injected=NULL) {
175-
$defaults=['debug'=>true,'defer'=>false,'ajax'=>
176-
['ajaxTransition'=>null,'attr'=>'','historize'=>false,'jsCallback'=>null,'hasLoader'=>true,'jqueryDone'=>'html',
177-
'async'=>true,'params'=>null,'headers'=>null,'jsCondition'=>null,'ajaxLoader'=>null],
175+
$ajaxDefault=['ajaxTransition'=>null,'attr'=>'','historize'=>false,'jsCallback'=>null,'hasLoader'=>true,'jqueryDone'=>'html',
176+
'async'=>true,'params'=>null,'headers'=>null,'jsCondition'=>null,'ajaxLoader'=>null];
177+
$defaults=['debug'=>true,'defer'=>false,'ajax'=>$ajaxDefault,
178178
'historize'=>true,'autoActiveLinks'=>true
179179
];
180180
foreach ( $defaults as $key => $val ) {
181181
if (isset($params[$key])===false || $params[$key]==="") {
182182
$params[$key]=$defaults[$key];
183183
}
184184
}
185+
foreach ( $ajaxDefault as $key=>$val){
186+
if (isset($params["ajax"][$key])===false || $params["ajax"][$key]==="") {
187+
$params["ajax"][$key]=$ajaxDefault[$key];
188+
}
189+
}
185190

186191
if(\array_key_exists("semantic", $params)){
187192
$this->semantic(new Semantic());

Ajax/common/html/HtmlCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function insertItem($item,$position=0){
8080
* @return \Ajax\common\html\HtmlDoubleElement
8181
*/
8282
public function getItem($index) {
83-
if (is_int($index))
83+
if (is_int($index)&& isset($this->content[$index]))
8484
return $this->content[$index];
8585
else {
8686
$elm=$this->getElementById($index, $this->content);

Ajax/common/html/traits/BaseHtmlPropertiesTrait.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,11 @@ public function addToProperty($name, $value, $separator=" ") {
5151
} else if ($value !== "" && $this->_self->propertyContains($name, $value) === false) {
5252
if(isset($this->_self->properties[$name])){
5353
$v=$this->_self->properties[$name];
54-
if (isset($v) && $v !== "")
55-
$v=$v . $separator . $value;
56-
else
57-
$v=$value;
58-
59-
return $this->_self->setProperty($name, $v);
54+
if (isset($v) && $v !== ""){
55+
$value=$v . $separator . $value;
56+
}
6057
}
58+
return $this->_self->setProperty($name, $value);
6159
}
6260
return $this;
6361
}

Ajax/semantic/html/collections/HtmlBreadcrumb.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,6 @@ public function addItem($item) {
209209
return $itemO;
210210
}
211211

212-
public function asLinks() {
213-
$this->contentAs("a");
214-
}
215-
216212
public function asTexts() {
217213
$this->contentAs("div");
218214
}

Ajax/semantic/html/collections/form/HtmlFormField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function setContainer($_container) {
117117
}
118118

119119
public function setReadonly(){
120-
$this->getField()->setProperty("readonly", "");
120+
$this->getDataField()->setProperty("readonly", "");
121121
}
122122

123123
public function addRule($type,$prompt=NULL,$value=NULL){

Ajax/semantic/html/content/HtmlAbsractItem.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ public function setImage($image){
3636
}
3737

3838
private function _getContent($key="content",$baseClass="content"){
39+
if(!is_array($this->content)){
40+
$this->content=[$this->content];
41+
}
3942
if(\array_key_exists($key, $this->content)===false){
4043
$this->content[$key]=new HtmlSemDoubleElement($key."-".$this->identifier,"div",$baseClass);
4144
}

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ public function mergeCol($colIndex=0) {
123123
}
124124

125125
public function mergeRow($colIndex=0) {
126-
return $this->getItem($colIndex)->mergeRow();
126+
$row=$this->getItem($colIndex);
127+
if(isset($row)){
128+
$this->getItem($colIndex)->mergeRow();
129+
}
130+
return $this;
127131
}
128132

129133
public function getColPosition($colIndex) {

Ajax/semantic/traits/SemanticWidgetsTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ abstract public function addHtmlComponent(BaseHtml $htmlComponent);
1919
* @param array $instances
2020
* @return DataTable
2121
*/
22-
public function dataTable($identifier,$model, $instances){
22+
public function dataTable($identifier,$model, $instances=null){
2323
return $this->addHtmlComponent(new DataTable($identifier,$model,$instances));
2424
}
2525

@@ -29,7 +29,7 @@ public function dataTable($identifier,$model, $instances){
2929
* @param array $instances
3030
* @return JsonDataTable
3131
*/
32-
public function jsonDataTable($identifier,$model, $instances){
32+
public function jsonDataTable($identifier,$model, $instances=null){
3333
return $this->addHtmlComponent(new JsonDataTable($identifier,$model,$instances));
3434
}
3535

@@ -38,7 +38,7 @@ public function jsonDataTable($identifier,$model, $instances){
3838
* @param object $instance
3939
* @return DataElement
4040
*/
41-
public function dataElement($identifier, $instance){
41+
public function dataElement($identifier, $instance=null){
4242
return $this->addHtmlComponent(new DataElement($identifier,$instance));
4343
}
4444

0 commit comments

Comments
 (0)