Completed
Push — master ( 73e21a...085edf )
by Jean-Christophe
04:37
created
Ajax/bootstrap/html/HtmlModal.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 class HtmlModal extends BaseHtml {
17 17
 	protected $title="Titre de ma boîte";
18 18
 	protected $content="";
19
-	protected $buttons=array ();
19
+	protected $buttons=array();
20 20
 	protected $showOnStartup=false;
21 21
 	protected $draggable=false;
22 22
 	protected $validCondition=NULL;
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
 	public function __construct($identifier, $title="", $content="", $buttonCaptions=array()) {
30 30
 		parent::__construct($identifier);
31 31
 		$this->_template=include 'templates/tplModal.php';
32
-		$this->buttons=array ();
32
+		$this->buttons=array();
33 33
 		$this->title=$title;
34 34
 		$this->content=$content;
35
-		foreach ( $buttonCaptions as $button ) {
35
+		foreach ($buttonCaptions as $button) {
36 36
 			$this->addButton($button);
37 37
 		}
38 38
 	}
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 * @param string $value
68 68
 	 * @return HtmlButton
69 69
 	 */
70
-	public function addOkayButton($value="Okay",$jsCode="") {
70
+	public function addOkayButton($value="Okay", $jsCode="") {
71 71
 		$btn=$this->addButton($value, "btn-primary");
72 72
 		$btn->onClick("if(".$this->getValidCondition()."){ ".$jsCode."$('#".$this->identifier."').modal('hide');}");
73 73
 		return $btn;
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	public function getValidCondition() {
85 85
 		if ($this->validCondition==NULL) {
86 86
 			return $this->getDefaultValidCondition();
87
-		} else {
87
+		}else {
88 88
 			return $this->validCondition;
89 89
 		}
90 90
 	}
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 	 * @param string $action a Phalcon action
118 118
 	 * @param $params The parameters to pass to the view
119 119
 	 */
120
-	public function renderContent($initialController,$view, $controller, $action, $params=NULL) {
121
-		$this->content=$initialController->jquery->renderContent($view, $controller, $action,$params);
120
+	public function renderContent($initialController, $view, $controller, $action, $params=NULL) {
121
+		$this->content=$initialController->jquery->renderContent($view, $controller, $action, $params);
122 122
 	}
123 123
 
124 124
 	/**
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	 * @param string $controller a Phalcon controller
128 128
 	 * @param string $action a Phalcon action
129 129
 	 */
130
-	public function forward($initialController,$controller,$action){
130
+	public function forward($initialController, $controller, $action) {
131 131
 		$this->content=$initialController->jquery->forward($initialController, $controller, $action);
132 132
 	}
133 133
 
@@ -136,10 +136,10 @@  discard block
 block discarded – undo
136 136
 	 * @see BaseHtml::run()
137 137
 	 */
138 138
 	public function run(JsUtils $js) {
139
-		if($this->content instanceof BaseHtml){
139
+		if ($this->content instanceof BaseHtml) {
140 140
 			$this->content->run($js);
141 141
 		}
142
-		$this->_bsComponent=$js->bootstrap()->modal("#".$this->identifier, array (
142
+		$this->_bsComponent=$js->bootstrap()->modal("#".$this->identifier, array(
143 143
 				"show" => $this->showOnStartup
144 144
 		));
145 145
 		if ($this->draggable)
Please login to merge, or discard this patch.
Ajax/bootstrap/html/base/HtmlNavElement.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
 	protected $attr;
20 20
 
21 21
 
22
-	public function __construct($identifier,$tagName){
23
-		parent::__construct($identifier,$tagName);
22
+	public function __construct($identifier, $tagName) {
23
+		parent::__construct($identifier, $tagName);
24 24
 		$this->root="";
25 25
 		$this->attr="data-ajax";
26 26
 	}
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
 	 * @param string $attr the html attribute used to build the elements url
33 33
 	 * @return HtmlNavElement
34 34
 	 */
35
-	public function autoGetOnClick($targetSelector){
36
-		return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr));
35
+	public function autoGetOnClick($targetSelector) {
36
+		return $this->getOnClick($this->root, $targetSelector, array("attr"=>$this->attr));
37 37
 	}
38 38
 
39
-	public function contentAsString(){
39
+	public function contentAsString() {
40 40
 		return implode("", $this->content);
41 41
 	}
42 42
 
@@ -44,15 +44,15 @@  discard block
 block discarded – undo
44 44
 	 * Generate the jquery script to set the elements to the HtmlNavElement
45 45
 	 * @param JsUtils $jsUtils
46 46
 	 */
47
-	public function jsSetContent(JsUtils $jsUtils){
48
-		$jsUtils->html("#".$this->identifier,str_replace("\"","'", $this->contentAsString()),true);
47
+	public function jsSetContent(JsUtils $jsUtils) {
48
+		$jsUtils->html("#".$this->identifier, str_replace("\"", "'", $this->contentAsString()), true);
49 49
 	}
50 50
 
51 51
 	public function getRoot() {
52 52
 		return $this->root;
53 53
 	}
54 54
 	public function setRoot($root) {
55
-		$this->root = $root;
55
+		$this->root=$root;
56 56
 		return $this;
57 57
 	}
58 58
 	public function getAttr() {
@@ -65,12 +65,12 @@  discard block
 block discarded – undo
65 65
 	 * @return HtmlNavElement
66 66
 	 */
67 67
 	public function setAttr($attr) {
68
-		$this->attr = $attr;
68
+		$this->attr=$attr;
69 69
 		return $this;
70 70
 	}
71 71
 
72 72
 	public function __call($method, $args) {
73
-		if(isset($this->$method) && is_callable($this->$method)) {
73
+		if (isset($this->$method) && is_callable($this->$method)) {
74 74
 			return call_user_func_array(
75 75
 					$this->$method,
76 76
 					$args
@@ -78,6 +78,6 @@  discard block
 block discarded – undo
78 78
 		}
79 79
 	}
80 80
 
81
-	public abstract function fromDispatcher(JsUtils $js,$dispatcher,$startIndex=0);
81
+	public abstract function fromDispatcher(JsUtils $js, $dispatcher, $startIndex=0);
82 82
 
83 83
 }
84 84
\ No newline at end of file
Please login to merge, or discard this patch.