Skip to content

Commit 555729a

Browse files
committed
fix scrut bugs
1 parent 35deb2a commit 555729a

File tree

9 files changed

+42
-22
lines changed

9 files changed

+42
-22
lines changed

Ajax/bootstrap/html/HtmlGlyphicon.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace Ajax\bootstrap\html;
44

55
use Ajax\common\html\HtmlSingleElement;
6-
use Ajax\service\PhalconUtils;
76
use Ajax\bootstrap\html\base\CssGlyphicon;
7+
use Ajax\service\JString;
88

99
/**
1010
* Composant Twitter Bootstrap Glyphicon
@@ -32,7 +32,7 @@ public function setGlyphicon($glyphicon) {
3232
}
3333
} else {
3434
$glyphicon=strtolower($glyphicon);
35-
if (PhalconUtils::startsWith($glyphicon, "glyphicon-")===false) {
35+
if (JString::startsWith($glyphicon, "glyphicon-")===false) {
3636
$glyphicon="glyphicon-".$glyphicon;
3737
}
3838
}

Ajax/bootstrap/html/HtmlNavbar.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
use Ajax\JsUtils;
66
use Ajax\bootstrap\components\Scrollspy;
7-
use Ajax\service\PhalconUtils;
87
use Ajax\bootstrap\html\content\HtmlNavzone;
98
use Ajax\bootstrap\html\base\CssNavbar;
109
use Ajax\common\html\BaseHtml;
10+
use Ajax\common\html\html5\HtmlImg;
1111
/**
1212
* Twitter Bootstrap HTML Navbar component
1313
* @author jc
@@ -60,10 +60,7 @@ public function setBrandTarget($brandTarget) {
6060
}
6161

6262
public function setBrandImage($imageSrc) {
63-
$this->brandImage=PhalconUtils::image(array (
64-
$imageSrc,
65-
"alt" => $this->brand
66-
));
63+
$this->brandImage=new HtmlImg("brand-img-".$this->_identifier,$imageSrc,$this->brand);
6764
$this->brand="";
6865
return $this;
6966
}

Ajax/bootstrap/html/HtmlPanel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Ajax\bootstrap\html\base\HtmlBsDoubleElement;
66
use Ajax\bootstrap\html\base\CssRef;
77
use Ajax\JsUtils;
8-
use Ajax\service\PhalconUtils;
8+
use Ajax\service\JString;
99

1010
/**
1111
* Composant Twitter Bootstrap panel
@@ -89,7 +89,7 @@ public function addFooter($content) {
8989
* @return \Ajax\bootstrap\html\HtmlPanel default : "panel-default"
9090
*/
9191
public function setStyle($cssStyle) {
92-
if (!PhalconUtils::startsWith($cssStyle, "panel"))
92+
if (!JString::startsWith($cssStyle, "panel"))
9393
$cssStyle="panel".$cssStyle;
9494
return $this->addToPropertyCtrl("class", $cssStyle, CssRef::Styles("panel"));
9595
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace Ajax\common\html\html5;
4+
5+
class HtmlUtils {
6+
public static function javascriptInclude($url){
7+
return '<script src="'.$url.'"></script>';
8+
}
9+
10+
public static function stylesheetInclude($url){
11+
return '<link rel="stylesheet" type="text/css" href="'.$url.'">';
12+
}
13+
}

Ajax/common/html/traits/BaseHtmlPropertiesTrait.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
use Ajax\service\JString;
55
use Ajax\common\html\BaseHtml;
6-
use Ajax\common\html\BaseWidget;
76

87
/**
98
* @author jc
@@ -21,7 +20,7 @@ public function getProperties() {
2120

2221
/**
2322
* @param array $properties
24-
* @return BaseHtml
23+
* @return $this
2524
*/
2625
public function setProperties($properties) {
2726
$this->_self->properties=$properties;
@@ -38,6 +37,12 @@ public function getProperty($name) {
3837
return $this->_self->properties[$name];
3938
}
4039

40+
/**
41+
* @param string $name
42+
* @param mixed $value
43+
* @param string $separator
44+
* @return $this
45+
*/
4146
public function addToProperty($name, $value, $separator=" ") {
4247
if (\is_array($value)) {
4348
foreach ( $value as $v ) {

Ajax/lib/CDNBase.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
namespace Ajax\lib;
44

5-
use Ajax\service\PhalconUtils;
5+
6+
use Ajax\service\JString;
67

78
abstract class CDNBase {
89
protected $version;
@@ -26,7 +27,7 @@ public function getJsUrl() {
2627
public function setJsUrl($jsUrl, $local=null) {
2728
$this->jsUrl=$jsUrl;
2829
if (isset($local)===false) {
29-
$local=PhalconUtils::startsWith($jsUrl, "http")===false;
30+
$local=JString::startsWith($jsUrl, "http")===false;
3031
}
3132
$this->setLocal($local);
3233
return $this;

Ajax/lib/CDNCoreCss.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
namespace Ajax\lib;
44

5-
use Ajax\service\PhalconUtils;
5+
6+
use Ajax\service\JString;
7+
use Ajax\common\html\html5\HtmlUtils;
68

79
class CDNCoreCss extends CDNBase {
810
protected $cssUrl;
@@ -26,14 +28,13 @@ public function getCss() {
2628
public function __toString() {
2729
$url=$this->getUrl();
2830
$css=$this->getCss();
29-
return PhalconUtils::javascriptInclude($url, $this->local)."\n".PhalconUtils::stylesheetLink($css, $this->localCss);
30-
;
31+
return HtmlUtils::javascriptInclude($url)."\n".HtmlUtils::stylesheetInclude($css);
3132
}
3233

3334
public function setCssUrl($cssUrl, $local=null) {
3435
$this->cssUrl=$cssUrl;
3536
if (isset($local)===false) {
36-
$local=PhalconUtils::startsWith($cssUrl, "http")===false;
37+
$local=JString::startsWith($cssUrl, "http")===false;
3738
}
3839
$this->setLocalCss($local);
3940
return $this;

Ajax/lib/CDNGuiGen.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
namespace Ajax\lib;
44

5-
use Ajax\service\PhalconUtils;
5+
6+
use Ajax\service\JString;
7+
use Ajax\common\html\html5\HtmlUtils;
68

79
class CDNGuiGen extends CDNBase {
810
protected $theme;
@@ -60,13 +62,13 @@ public function getCss() {
6062
public function __toString() {
6163
$url=$this->getUrl();
6264
$css=$this->getCss();
63-
return PhalconUtils::javascriptInclude($url, $this->local)."\n".PhalconUtils::stylesheetLink($css, $this->localCss);
65+
return HtmlUtils::javascriptInclude($url)."\n".HtmlUtils::stylesheetInclude($css);
6466
}
6567

6668
public function setCssUrl($cssUrl, $local=null) {
6769
$this->cssUrl=$cssUrl;
6870
if (isset($local)===false) {
69-
$local=PhalconUtils::startsWith($cssUrl, "http")===false;
71+
$local=JString::startsWith($cssUrl, "http")===false;
7072
}
7173
$this->setLocalCss($local);
7274
return $this;

Ajax/lib/CDNJQuery.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
namespace Ajax\lib;
44

5-
use Ajax\service\PhalconUtils;
5+
6+
use Ajax\common\html\html5\HtmlUtils;
67

78
class CDNJQuery extends CDNBase {
89

@@ -17,6 +18,6 @@ public function getUrl() {
1718

1819
public function __toString() {
1920
$url=$this->getUrl();
20-
return PhalconUtils::javascriptInclude($url, $this->local);
21+
return HtmlUtils::javascriptInclude($url);
2122
}
2223
}

0 commit comments

Comments
 (0)