Changeset 1546352
- Timestamp:
- 12/06/2016 10:08:12 AM (9 years ago)
- Location:
- genoo/trunk
- Files:
-
- 5 edited
-
Genoo.php (modified) (1 diff)
-
libs/Genoo/HtmlForm.php (modified) (10 diffs)
-
libs/Genoo/RepositoryThemes.php (modified) (1 diff)
-
libs/Genoo/TemplateRenderer.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
genoo/trunk/Genoo.php
r1527244 r1546352 6 6 Author URI: http://www.genoo.com/ 7 7 Author Email: info@genoo.com 8 Version: 4. 48 Version: 4.5 9 9 License: GPLv2 10 10 Text Domain: genoo -
genoo/trunk/libs/Genoo/HtmlForm.php
r1448709 r1546352 29 29 /** @var */ 30 30 private $form_id; 31 /** @var string */ 32 private $unique; 33 /** @var string */ 34 private $validator; 31 35 /** @var int */ 32 36 static $count = 1; … … 54 58 $this->form = $this->dom->getElementsByTagName("form")->item(0); 55 59 $this->msg = $this->dom->getElementById("genooMsg"); 60 $this->unique = $this->getUniqueId(); 56 61 $this->appendClasses(); 57 62 $this->appendHTTPSIP(); … … 112 117 // Has on submit protection, therefore id 113 118 $this->form_id = filter_var($element->getAttribute('onsubmit'), FILTER_SANITIZE_NUMBER_INT); 119 $this->validator = $element->getAttribute('onsubmit'); 114 120 } elseif($element->hasAttribute('onSubmit')){ 115 121 // Has on submit protection, therefore id 116 122 $this->form_id = filter_var($element->getAttribute('onSubmit'), FILTER_SANITIZE_NUMBER_INT); 123 $this->validator = $element->getAttribute('onSubmit'); 117 124 } 118 125 } … … 159 166 // This one behaves specially 160 167 if($key == 'returnModalUrl'){ 168 // Value 161 169 $this->form_return = $value; 162 $value = self::FORM_RETURN; 170 $value = self::FORM_RETURN; 171 // Append id 172 // TODO: when fixed on api end 173 // $value = $value . '#f' . $this->unique; 163 174 } 164 175 $node = $this->dom->createElement("input"); … … 203 214 $fragment->appendXML($html); 204 215 $this->msg->appendChild($fragment); 216 // Add genoo pop class 217 if(is_object($this->msg) && method_exists($this->msg, 'setAttribute')){ 218 $this->msg->setAttribute('class', 'genooPop'); 219 } 205 220 } else { 206 221 // If for some reason it's not to be found and set, try … … 226 241 $fragment->appendXML($html); 227 242 $element->appendChild($fragment); 243 // Append class genooPop 244 if(is_object($element) && method_exists($element, 'setAttribute')){ 245 $element->setAttribute('class', 'genooPop'); 246 } 228 247 } 229 248 } … … 256 275 } 257 276 277 /** 278 * @return string 279 */ 280 public function getUniqueId() 281 { 282 static $counter = 1; 283 $data = preg_replace('~<(?:!DOCTYPE|/?(?:html|body))[^>]*>\s*~i', '', $this->dom->saveHTML()); 284 $unique_id = '_' . $counter . '_' . sha1($data); 285 $counter++; 286 return $unique_id; 287 } 258 288 259 289 /** … … 273 303 $unique = substr($unique, 0, strpos($unique, ':')); 274 304 $unique = filter_var($unique, FILTER_SANITIZE_NUMBER_INT); 275 // With unique form ID, replace all instances in JS and text276 $unique_id = uniqid('form_');277 305 // Last check of the same number 278 306 if($unique !== $this->form_id){ … … 280 308 $unique = $this->form_id; 281 309 } 282 $data = str_replace($unique, $ unique_id, $data);310 $data = str_replace($unique, $this->unique, $data); 283 311 // And then return the form_key 284 312 $data = str_replace(self::FORM_KEY, $this->form_key, $data); … … 288 316 // Done 289 317 } 318 $unique_id = "f" . $this->unique; 290 319 // Return 291 return $data;320 return "<div id=\"$unique_id\">" . $data . "</div>"; 292 321 } 293 322 -
genoo/trunk/libs/Genoo/RepositoryThemes.php
r1424523 r1546352 196 196 // Here comes the style switching magic 197 197 if(Strings::contains($CSSRuleName, '.genooForm.') && Strings::endsWith($CSSRuleName, '.genooPop')){ 198 // This is modal style. If it has border-ra idous and background, we drop background of overall thing198 // This is modal style. If it has border-radious and background, we drop background of overall thing 199 199 if($rule->hasProperty('border-radius') || $rule->hasProperty('background-color')){ 200 200 // Has background color and border radius 201 // We now need to add canceling s ytle for hte whole modal, to remove the padding and201 // We now need to add canceling style for the whole modal, to remove the padding and 202 202 // background 203 203 $CSS->addRule($CSSNewRule) -
genoo/trunk/libs/Genoo/TemplateRenderer.php
r1527246 r1546352 488 488 $styles = $current_col[0]->style; 489 489 $styles_2 = clone $styles; 490 $partitionBackgrou ndStyle = $this->iterateRowInlineStyleFor($styles, 'background');490 $partitionBackgroudnStyle = $this->iterateRowInlineStyleFor($styles, 'background'); 491 491 $partitionBox = $this->iterateRowInlineStyleFor($styles_2, 'box'); 492 492 } else { 493 $partitionBackgrou ndStyle = '';493 $partitionBackgroudnStyle = ''; 494 494 $partitionBox = ''; 495 495 } -
genoo/trunk/readme.txt
r1527244 r1546352 6 6 License: GPLv2 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-2.0.html 8 Stable tag: 4. 48 Stable tag: 4.5 9 9 10 10 Combine the flexibility of WordPress with the power of Genoo and experience amazing results!
Note: See TracChangeset
for help on using the changeset viewer.