Completed
Push — master ( ab500e...03e9d9 )
by Jean-Christophe
04:23
created
Ajax/php/laravel/JsUtils.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -4,24 +4,24 @@  discard block
 block discarded – undo
4 4
 
5 5
 use Illuminate\Support\Facades\App;
6 6
 
7
-class JsUtils extends \Ajax\JsUtils{
8
-	public function getUrl($url){
7
+class JsUtils extends \Ajax\JsUtils {
8
+	public function getUrl($url) {
9 9
 		return \url($url);
10 10
 	}
11
-	public function addViewElement($identifier,$content,&$view){
11
+	public function addViewElement($identifier, $content, &$view) {
12 12
 		$controls=$view->__get("q");
13
-		if (isset($controls) === false) {
14
-			$controls=array ();
13
+		if (isset($controls)===false) {
14
+			$controls=array();
15 15
 		}
16 16
 		$controls[$identifier]=$content;
17 17
 		$view->__set("q", $controls);
18 18
 	}
19 19
 
20
-	public function createScriptVariable(&$view,$view_var, $output){
21
-		$view->__set($view_var,$output);
20
+	public function createScriptVariable(&$view, $view_var, $output) {
21
+		$view->__set($view_var, $output);
22 22
 	}
23 23
 
24
-	public function forward($initialControllerInstance,$controllerName,$actionName,$params=NULL){
24
+	public function forward($initialControllerInstance, $controllerName, $actionName, $params=NULL) {
25 25
 		\ob_start();
26 26
 		App::make($controllerName)->{$actionName}($params);
27 27
 		$result=\ob_get_contents();
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
 		return $result;
30 30
 	}
31 31
 
32
-	public function renderContent($initialControllerInstance,$viewName, $params=NULL) {
33
-		return \view()->make($viewName,$params)->render();
32
+	public function renderContent($initialControllerInstance, $viewName, $params=NULL) {
33
+		return \view()->make($viewName, $params)->render();
34 34
 	}
35 35
 
36
-	public function fromDispatcher($dispatcher){
36
+	public function fromDispatcher($dispatcher) {
37 37
 		return $dispatcher->segments();
38 38
 	}
39 39
 }
40 40
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/php/phalcon/JsUtils.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 use Phalcon\Mvc\View;
8 8
 use Phalcon\Mvc\Controller;
9 9
 
10
-class JsUtils extends \Ajax\JsUtils implements InjectionAwareInterface{
10
+class JsUtils extends \Ajax\JsUtils implements InjectionAwareInterface {
11 11
 	protected $_di;
12 12
 	public function setDi(DiInterface $di) {
13 13
 		$this->_di=$di;
@@ -18,50 +18,50 @@  discard block
 block discarded – undo
18 18
 		return $this->_di;
19 19
 	}
20 20
 
21
-	public function getUrl($url){
21
+	public function getUrl($url) {
22 22
 		return $this->_di->get("url")->get($url);
23 23
 	}
24 24
 
25
-	public function addViewElement($identifier,$content,&$view){
25
+	public function addViewElement($identifier, $content, &$view) {
26 26
 		$controls=$view->getVar("q");
27
-		if (isset($controls) === false) {
28
-			$controls=array ();
27
+		if (isset($controls)===false) {
28
+			$controls=array();
29 29
 		}
30 30
 		$controls[$identifier]=$content;
31 31
 		$view->setVar("q", $controls);
32 32
 	}
33 33
 
34
-	public function createScriptVariable(&$view,$view_var, $output){
35
-		$view->setVar($view_var,$output);
34
+	public function createScriptVariable(&$view, $view_var, $output) {
35
+		$view->setVar($view_var, $output);
36 36
 	}
37 37
 
38
-	public function forward($initialController,$controller,$action,$params=array()){
39
-		$dispatcher = $initialController->dispatcher;
38
+	public function forward($initialController, $controller, $action, $params=array()) {
39
+		$dispatcher=$initialController->dispatcher;
40 40
 		$dispatcher->setControllerName($controller);
41 41
 		$dispatcher->setActionName($action);
42 42
 		$dispatcher->dispatch();
43
-		$template=$initialController->view->getRender($dispatcher->getControllerName(), $dispatcher->getActionName(),$dispatcher->getParams(), function ($view) {
43
+		$template=$initialController->view->getRender($dispatcher->getControllerName(), $dispatcher->getActionName(), $dispatcher->getParams(), function($view) {
44 44
 			$view->setRenderLevel(View::LEVEL_ACTION_VIEW);
45 45
 		});
46 46
 		return $template;
47 47
 	}
48 48
 
49
-	public function renderContent($initialControllerInstance,$viewName, $params=NULL) {
50
-		list($controller,$action)=\explode("@", $viewName);
51
-		$template=$initialControllerInstance->view->getRender($controller, $action, $params, function ($view) {
49
+	public function renderContent($initialControllerInstance, $viewName, $params=NULL) {
50
+		list($controller, $action)=\explode("@", $viewName);
51
+		$template=$initialControllerInstance->view->getRender($controller, $action, $params, function($view) {
52 52
 			$view->setRenderLevel(View::LEVEL_ACTION_VIEW);
53 53
 		});
54 54
 		return $template;
55 55
 	}
56 56
 
57
-	public function fromDispatcher($dispatcher){
57
+	public function fromDispatcher($dispatcher) {
58 58
 		$params=$dispatcher->getParams();
59 59
 		$action=$dispatcher->getActionName();
60 60
 		$items=array($dispatcher->getControllerName());
61
-		if(\sizeof($params)>0 || \strtolower($action)!="index" ){
61
+		if (\sizeof($params)>0 || \strtolower($action)!="index") {
62 62
 			$items[]=$action;
63
-			foreach ($params as $p){
64
-				if(\is_object($p)===false)
63
+			foreach ($params as $p) {
64
+				if (\is_object($p)===false)
65 65
 					$items[]=$p;
66 66
 			}
67 67
 		}
Please login to merge, or discard this patch.
Ajax/lib/CDN.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2
-return array (
3
-		"JQuery" => array (
4
-				"MaxCDN" => array (
2
+return array(
3
+		"JQuery" => array(
4
+				"MaxCDN" => array(
5 5
 						"url" => "http://code.jquery.com/jquery-%version%.min.js",
6
-						"versions" => array (
6
+						"versions" => array(
7 7
 								"2.2.3",
8 8
 								"2.2.1",
9 9
 								"2.1.4",
@@ -11,9 +11,9 @@  discard block
 block discarded – undo
11 11
 								"1.11.2"
12 12
 						)
13 13
 				),
14
-				"Google" => array (
14
+				"Google" => array(
15 15
 						"url" => "https://ajax.googleapis.com/ajax/libs/jquery/%version%/jquery.min.js",
16
-						"versions" => array (
16
+						"versions" => array(
17 17
 								"2.2.2",
18 18
 								"2.2.1",
19 19
 								"2.2.0",
@@ -25,17 +25,17 @@  discard block
 block discarded – undo
25 25
 						)
26 26
 				)
27 27
 		),
28
-		"JQueryUI" => array (
29
-				"MaxCDN" => array (
28
+		"JQueryUI" => array(
29
+				"MaxCDN" => array(
30 30
 						"core" => "http://code.jquery.com/ui/%version%/jquery-ui.min.js",
31 31
 						"css" => "http://code.jquery.com/ui/%version%/themes/%theme%/jquery-ui.css",
32
-						"versions" => array (
32
+						"versions" => array(
33 33
 								"1.11.4",
34 34
 								"1.11.3",
35 35
 								"1.11.2",
36 36
 								"1.10.4"
37 37
 						),
38
-						"themes" => array (
38
+						"themes" => array(
39 39
 								"black-tie",
40 40
 								"blitzer",
41 41
 								"cupertino",
@@ -62,10 +62,10 @@  discard block
 block discarded – undo
62 62
 								"vader"
63 63
 						)
64 64
 				),
65
-				"Google" => array (
65
+				"Google" => array(
66 66
 						"core" => "https://ajax.googleapis.com/ajax/libs/jqueryui/%version%/jquery-ui.min.js",
67 67
 						"css" => "https://ajax.googleapis.com/ajax/libs/jqueryui/%version%/themes/%theme%/jquery-ui.css",
68
-						"versions" => array (
68
+						"versions" => array(
69 69
 								"1.11.4",
70 70
 								"1.11.3",
71 71
 								"1.11.2",
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 								"1.10.4",
75 75
 								"1.10.0"
76 76
 						),
77
-						"themes" => array (
77
+						"themes" => array(
78 78
 								"black-tie",
79 79
 								"blitzer",
80 80
 								"cupertino",
@@ -102,25 +102,25 @@  discard block
 block discarded – undo
102 102
 						)
103 103
 				)
104 104
 		),
105
-		"Bootstrap" => array (
106
-				"MaxCDN" => array (
105
+		"Bootstrap" => array(
106
+				"MaxCDN" => array(
107 107
 						"core" => "http://maxcdn.bootstrapcdn.com/bootstrap/%version%/js/bootstrap.min.js",
108 108
 						"css" => "http://maxcdn.bootstrapcdn.com/bootstrap/%version%/css/bootstrap.min.css",
109
-						"versions" => array (
109
+						"versions" => array(
110 110
 								"3.3.6",
111 111
 								"3.3.5"
112 112
 						),
113
-						"themes" => array ()
113
+						"themes" => array()
114 114
 				)
115 115
 		),
116
-		"Semantic" => array (
117
-				"cdnjs" => array (
116
+		"Semantic" => array(
117
+				"cdnjs" => array(
118 118
 						"core" => "https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/%version%/semantic.min.js",
119 119
 						"css" => "https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/%version%/semantic.min.css",
120
-						"versions" => array (
120
+						"versions" => array(
121 121
 								"2.1.8"
122 122
 						),
123
-						"themes" => array ()
123
+						"themes" => array()
124 124
 				)
125 125
 		)
126 126
 );
127 127
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/lib/CDNCoreCss.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 	protected $localCss;
10 10
 	protected $framework;
11 11
 
12
-	public function __construct($framework,$version, $provider="MaxCDN") {
12
+	public function __construct($framework, $version, $provider="MaxCDN") {
13 13
 		parent::__construct($version, $provider);
14 14
 		$this->framework=$framework;
15 15
 		$this->data=$this->data [$framework];
Please login to merge, or discard this patch.
Ajax/lib/CDNBase.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,10 +60,10 @@
 block discarded – undo
60 60
 
61 61
 	protected function replaceVersionAndTheme($url, $version, $theme) {
62 62
 		if (isset($theme))
63
-			return str_ireplace(array (
63
+			return str_ireplace(array(
64 64
 					"%theme%",
65 65
 					"%version%" 
66
-			), array (
66
+			), array(
67 67
 					$theme,
68 68
 					$version 
69 69
 			), $url);
Please login to merge, or discard this patch.
Ajax/php/cakephp/JsUtilsComponent.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@
 block discarded – undo
11 11
 	 * @var Ajax\php\cakephp\_JsUtils
12 12
 	 */
13 13
 	public $jquery;
14
-	public function initialize(array $config){
14
+	public function initialize(array $config) {
15 15
 		\extract($config);
16 16
 		$this->jquery=new _JsUtils();
17
-		if(isset($semantic)){
17
+		if (isset($semantic)) {
18 18
 			$this->jquery->semantic(new Semantic());
19 19
 		}
20 20
 	}
Please login to merge, or discard this patch.
Ajax/php/micro/JsUtils.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -4,34 +4,34 @@
 block discarded – undo
4 4
 
5 5
 use micro\controllers\Startup;
6 6
 use micro\utils\RequestUtils;
7
-class JsUtils extends \Ajax\JsUtils{
7
+class JsUtils extends \Ajax\JsUtils {
8 8
 
9
-	public function getUrl($url){
9
+	public function getUrl($url) {
10 10
 		return RequestUtils::getUrl($url);
11 11
 	}
12 12
 
13
-	public function addViewElement($identifier,$content,&$view){
13
+	public function addViewElement($identifier, $content, &$view) {
14 14
 		$controls=$view->getVar("q");
15
-		if (isset($controls) === false) {
16
-			$controls=array ();
15
+		if (isset($controls)===false) {
16
+			$controls=array();
17 17
 		}
18 18
 		$controls[$identifier]=$content;
19 19
 		$view->setVar("q", $controls);
20 20
 	}
21 21
 
22
-	public function createScriptVariable(&$view,$view_var, $output){
23
-		$view->setVar($view_var,$output);
22
+	public function createScriptVariable(&$view, $view_var, $output) {
23
+		$view->setVar($view_var, $output);
24 24
 	}
25 25
 
26
-	public function forward($initialController,$controller,$action,$params=array()){
27
-		return $initialController->forward($controller,$action,$params,true,true,true);
26
+	public function forward($initialController, $controller, $action, $params=array()) {
27
+		return $initialController->forward($controller, $action, $params, true, true, true);
28 28
 	}
29 29
 
30
-	public function renderContent($initialControllerInstance,$viewName, $params=NULL) {
31
-		return $initialControllerInstance->loadView($viewName,$params,true);
30
+	public function renderContent($initialControllerInstance, $viewName, $params=NULL) {
31
+		return $initialControllerInstance->loadView($viewName, $params, true);
32 32
 	}
33 33
 
34
-	public function fromDispatcher($dispatcher){
34
+	public function fromDispatcher($dispatcher) {
35 35
 		return Startup::$urlParts;
36 36
 	}
37 37
 }
38 38
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlAccordion.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -6,31 +6,31 @@  discard block
 block discarded – undo
6 6
 use Ajax\semantic\html\content\HtmlAccordionItem;
7 7
 use Ajax\JsUtils;
8 8
 
9
-class HtmlAccordion extends HtmlSemCollection{
9
+class HtmlAccordion extends HtmlSemCollection {
10 10
 
11 11
 	protected $params=array();
12 12
 
13
-	public function __construct( $identifier, $tagName="div", $baseClass="ui"){
14
-		parent::__construct( $identifier, "div", "ui accordion");
13
+	public function __construct($identifier, $tagName="div", $baseClass="ui") {
14
+		parent::__construct($identifier, "div", "ui accordion");
15 15
 	}
16 16
 
17 17
 
18
-	protected function createItem($value){
18
+	protected function createItem($value) {
19 19
 		$count=$this->count();
20 20
 		$title=$value;
21 21
 		$content=NULL;
22
-		if(\is_array($value)){
23
-			$title=@$value[0];$content=@$value[1];
22
+		if (\is_array($value)) {
23
+			$title=@$value[0]; $content=@$value[1];
24 24
 		}
25
-		return new HtmlAccordionItem("item-".$this->identifier."-".$count, $title,$content);
25
+		return new HtmlAccordionItem("item-".$this->identifier."-".$count, $title, $content);
26 26
 	}
27 27
 
28
-	protected function createCondition($value){
28
+	protected function createCondition($value) {
29 29
 		return ($value instanceof HtmlAccordionItem)===false;
30 30
 	}
31 31
 
32
-	public function addPanel($title,$content){
33
-		return $this->addItem([$title,$content]);
32
+	public function addPanel($title, $content) {
33
+		return $this->addItem([$title, $content]);
34 34
 	}
35 35
 
36 36
 	/**
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 	 * @param string $action a Phalcon action
43 43
 	 * @param array $params
44 44
 	 */
45
-	public function forwardPanel(JsUtils $js,$title,$initialController,$controller,$action,$params=array()){
46
-		return $this->addPanel($title, $js->forward($initialController, $controller, $action,$params));
45
+	public function forwardPanel(JsUtils $js, $title, $initialController, $controller, $action, $params=array()) {
46
+		return $this->addPanel($title, $js->forward($initialController, $controller, $action, $params));
47 47
 	}
48 48
 
49 49
 	/**
@@ -54,30 +54,30 @@  discard block
 block discarded – undo
54 54
 	 * @param string $viewName
55 55
 	 * @param $params The parameters to pass to the view
56 56
 	 */
57
-	public function renderViewPanel(JsUtils $js,$title,$initialController, $viewName, $params=array()) {
58
-		return $this->addPanel($title, $js->renderContent($initialController, $viewName,$params));
57
+	public function renderViewPanel(JsUtils $js, $title, $initialController, $viewName, $params=array()) {
58
+		return $this->addPanel($title, $js->renderContent($initialController, $viewName, $params));
59 59
 	}
60 60
 	/*
61 61
 	 * (non-PHPdoc)
62 62
 	 * @see BaseHtml::run()
63 63
 	 */
64 64
 	public function run(JsUtils $js) {
65
-		if(isset($this->_bsComponent)===false)
66
-			$this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params);
65
+		if (isset($this->_bsComponent)===false)
66
+			$this->_bsComponent=$js->semantic()->accordion("#".$this->identifier, $this->params);
67 67
 			$this->addEventsOnRun($js);
68 68
 			return $this->_bsComponent;
69 69
 	}
70 70
 
71
-	public function setStyled(){
71
+	public function setStyled() {
72 72
 		return $this->addToProperty("class", "styled");
73 73
 	}
74 74
 
75
-	public function activate($index){
75
+	public function activate($index) {
76 76
 		$this->getItem($index)->setActive(true);
77 77
 		return $this;
78 78
 	}
79 79
 
80
-	public function setExclusive($value){
80
+	public function setExclusive($value) {
81 81
 		$this->params["exclusive"]=$value;
82 82
 	}
83 83
 }
84 84
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlForm.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
 	public function __construct($identifier) {
16 16
 		parent::__construct($identifier, "form");
17 17
 		$this->_template='<form id="%identifier%" name="%identifier%" %properties%>%content%</form>';
18
-		$this->futureElements=array ();
19
-		$this->formGroups=array ();
18
+		$this->futureElements=array();
19
+		$this->formGroups=array();
20 20
 	}
21 21
 
22 22
 	/*
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
27 27
 		if (isset($js)) {
28 28
 			$this->formElementsPrefix=$js->config()->getVar("formElementsPrefix");
29
-			foreach ( $this->futureElements as $futureElement ) {
29
+			foreach ($this->futureElements as $futureElement) {
30 30
 				$futureElementValue=$this->getPrefix($futureElement);
31 31
 				$futureElementValues=explode("_", $futureElementValue);
32
-				switch($futureElementValues [0]) {
32
+				switch ($futureElementValues [0]) {
33 33
 					case "input":
34 34
 						$control=new HtmlInput($futureElement);
35 35
 						$control->setClass("form-control");
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 						$control->setLabel($label, false);
48 48
 						break;
49 49
 					case "select":
50
-						$control=new HtmlSelect($futureElement,"");
50
+						$control=new HtmlSelect($futureElement, "");
51 51
 						$control->setProperty("size", $futureElementValues [1]);
52 52
 						$control->setClass("form-control");
53 53
 						//$control->setLabel($this->getPart($futureElement));
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 				$this->addElement($control);
63 63
 			}
64 64
 		}
65
-		foreach ( $this->formGroups as $group ) {
65
+		foreach ($this->formGroups as $group) {
66 66
 			$this->addContent($group);
67 67
 		}
68 68
 		return parent::compile($js, $view);
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 
91 91
 	private function getPrefix($element) {
92 92
 		$result="input_text";
93
-		foreach ( $this->formElementsPrefix as $k => $v ) {
93
+		foreach ($this->formElementsPrefix as $k => $v) {
94 94
 			if (Text::startsWith($element, $k)) {
95 95
 				$result=$v;
96 96
 				break;
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
 	public function getElement($name) {
122 122
 		$element=null;
123
-		foreach ( $this->formGroups as $group ) {
123
+		foreach ($this->formGroups as $group) {
124 124
 		}
125 125
 		return $element;
126 126
 	}
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 * @see \Ajax\bootstrap\html\base\HtmlSingleElement::fromArray()
131 131
 	 */
132 132
 	public function fromArray($array) {
133
-		foreach ( $array as $value ) {
133
+		foreach ($array as $value) {
134 134
 			if (is_string($value)) {
135 135
 				$this->futureElements []=$value;
136 136
 			}
Please login to merge, or discard this patch.