Commit graph

652 commits

Author SHA1 Message Date
euromark
0ece694a75 microptimize options and default merge and other string key array merges 2014-04-08 01:25:14 +02:00
Mark Oberemk
e3a0795bed Update HtmlHelper.php
Updated documentation to include the chained $this return
2014-04-06 21:23:42 -04:00
Mark Oberemk
d5721f10fd Allow chaining in the addCrumb method
For convenience I think it might be valuable to allow addCrumb (and possibly other similar functions) to return $this to permit chained calls such as this:

    $this->Html->addCrumb('Admin', '/admin')->addCrumb('Blogs', '/admin/users')->addCrumb('Add');

as opposed to the considerably more verbose version that needs to be used now:

    $this->Html->addCrumb('Admin', '/admin');
    $this->Html->addCrumb('Blogs', '/admin/users');
    $this->Html->addCrumb('Add');

I'm not sure if this violates some API conventions for helpers but it does seem rather more convenient to work with to me.
2014-04-06 21:23:42 -04:00
euromark
6f53529520 Correct doc blocks 2014-04-06 22:27:51 +02:00
Jose Lorenzo Rodriguez
0d80c92ffb Revert "Merge pull request #3002 from moberemk/patch-2"
This reverts commit 8e3d6cffb7, reversing
changes made to 92800889a6.
2014-04-06 21:48:59 +02:00
José Lorenzo Rodríguez
8e3d6cffb7 Merge pull request #3002 from moberemk/patch-2
Allow chaining in the addCrumb method
2014-04-06 21:09:10 +02:00
mark_story
57b8008dbe Merge branch 'master' into 2.5 2014-03-23 11:01:13 -04:00
Mark Story
90ca41d436 Merge pull request #2941 from lucasff/master
Allow the passing parameter escape of the getCrumbList method
2014-03-23 09:23:06 -04:00
mark_story
afc8587949 Merge branch 'master' into 2.5 2014-03-18 22:12:14 -04:00
mark_story
ee895a8bb1 Add form attribute to hidden inputs when present.
If inputs are placed outside of the form elements the form attribute
needs to be set on the hidden inputs. Without this attribute the empty
state does not submit correctly.

Fixes #3053
2014-03-18 22:11:57 -04:00
Lucas Freitas
4cd6ac2f15 Fix break of the CS on Travis 2014-03-13 00:24:16 -03:00
Mark Oberemk
3f7eff1843 Update HtmlHelper.php
Updated documentation to include the chained $this return
2014-03-12 08:59:12 -04:00
mark_story
c5b6dda82f Merge branch 'master' into 2.5 2014-03-11 21:02:27 -04:00
Mark Oberemk
8a8d2697d1 Allow chaining in the addCrumb method
For convenience I think it might be valuable to allow addCrumb (and possibly other similar functions) to return $this to permit chained calls such as this:

    $this->Html->addCrumb('Admin', '/admin')->addCrumb('Blogs', '/admin/users')->addCrumb('Add');

as opposed to the considerably more verbose version that needs to be used now:

    $this->Html->addCrumb('Admin', '/admin');
    $this->Html->addCrumb('Blogs', '/admin/users');
    $this->Html->addCrumb('Add');

I'm not sure if this violates some API conventions for helpers but it does seem rather more convenient to work with to me.
2014-03-11 10:37:47 -04:00
Kunal Panchal
a77a0f76a1 Documentation correction
TimeHelper::$niceFormat to CakeTime::$niceFormat
2014-03-10 14:05:03 +05:30
Lucas Freitas
b522b1e724 Entire UL element was being outputted directly (escaped), added to the unset list and fixed 2014-03-03 05:28:59 -03:00
Lucas Freitas
d4b91166bc Fixing stupidity and adding the PHPDoc param 2014-03-03 05:10:21 -03:00
Lucas Freitas
7096495943 Allow the passing parameter escape of the getCrumbList method and reflecting that into the outputted link too 2014-03-03 05:01:49 -03:00
ADmad
a0c399e374 Remove whitespace. 2014-02-26 10:40:53 +05:30
mark_story
0f584c0e8b Merge branch 'master' into 2.5 2014-02-24 21:19:17 -05:00
mark_story
0776b87214 Fix postLink() & postButton() with nested data.
Flatten deeply nested array data before generating hidden inputs.
This solves 'Array to string conversion' errors.

Closes #2894
2014-02-24 21:17:31 -05:00
mark_story
a80cbc205a Simplify conditionals.
Set default values to remove else cases.
2014-02-19 21:46:53 -05:00
jalbertocr
8b2e1ab9e5 Don't do assignments inside conditionals. 2014-02-19 22:41:33 -03:00
jalbertocr
cdeb51167b Fix types in docblocks. 2014-02-19 20:54:00 -03:00
jalbertocr
35f152b333 Make sure a datetime instance is valid to avoid fatal errors. 2014-02-19 20:50:30 -03:00
mark_story
3433f4a1f0 Clean up changes code standards and tests.
Refs #2582
2014-02-17 11:03:49 -05:00
Jonas
b32deed4aa changed FormHelper::secure() and FormHelper::end() to support attributes in the hidden CSRF-protection tags that are being generated for SecurityComponent to allow specification of additional html attributes like HTML5s "form" attribute. This allows separation of Form instantiation/controls and form data - for instance within html tables
improved tests for testing against additional attributes for Form::secure()

improved tests for testing against additional attributes for Form::end()

removed array cast, fixed test

fixed docblock format

format

Fixed a bug, this won't work as some forms are just empty
2014-02-17 10:54:02 -05:00
ADmad
9de3418079 Merge branch 'master' into 2.5
Conflicts:
	lib/Cake/Model/Permission.php
2014-02-11 18:17:59 +05:30
Eric Martins
2793dca671 Fix ApiGen errors 2014-02-07 18:29:54 -02:00
mark_story
be8ebfc005 Merge branch 'master' into 2.5 2014-02-05 09:22:46 -05:00
AD7six
adc0bf3ded BC fix for checkbox ids
Revert to previous behavior for id generation of checkboxes, This commit
can be reverted for 2.5+ is desired

Fixes #2733
2014-02-03 17:57:26 +00:00
mark_story
ecf5aec1ae Add '@' to the list of characters removed from radio/checkbox ID.
This character can easily show up in email addresses and can cause
invalid HTML.

Refs #2733
2014-02-02 21:20:31 -05:00
mark_story
605351d0c9 Allow empty values in checkboxes.
Allow the checkbox value attribute to be empty. This is required to make
checkboxes with a value of 0.

Fixes #2717
2014-01-30 21:12:06 -05:00
Walter Nasich
a7f50e0ce7 Using sprintf to convert number into non-scientific notation 2014-01-30 19:07:23 -03:00
Walter Nasich
43604f64d5 Rendering a proper value for html5 attribute 'step' 2014-01-30 17:17:50 -03:00
ADmad
c093804b35 Merge branch 'master' into 2.5 2014-01-26 17:39:50 +05:30
Giampaolo Falqui
ef08534460 Improves next() and prev() documentation
Adds the explanation for the URL available option, which is really useful when dealing with non-default CakePHP routes, now lacking from the official documentation.
2014-01-26 11:38:11 +01:00
mark_story
75dd2ff1fb Merge branch 'master' into 2.5 2014-01-16 15:20:40 -05:00
mark_story
f25e84f4fb Don't select year 0 when there are all 0's.
Year 0 is almost never a 'good' selection value and causes odd behavior
when paired with MySQL.

Fixes #2658
2014-01-15 10:23:45 -05:00
mark_story
3cee3b0e99 Merge branch 'master' into 2.5
Conflicts:
	lib/Cake/VERSION.txt
2013-12-30 21:28:22 -05:00
Mark Story
1cb7e4f0ff Merge pull request #1635 from dereuromark/master-dom-ids
Fix duplicate ID generation of for multiple checkboxes.
2013-12-24 07:02:38 -08:00
mark_story
7e5c0f7185 Merge branch 'master' into 2.5 2013-12-20 14:15:35 -05:00
mark_story
5bddc477a3 Fix incorrectly handled time values around 12:00:00
When using 12 hour formats & intervals, values around 12:00 were
incorrecly converted to midnight.

Fixes #2507
2013-12-19 17:36:27 -05:00
mark_story
30e139412d Fix input type inference when type=>checkbox
FormHelper should not infer types when the explicit type is checkbox.
Instead the provided type should be used.

Fixes #2491
2013-12-16 23:26:20 -05:00
euromark
8ebf004450 Also make DOM ids for radio element values unique. 2013-12-04 02:14:08 +01:00
euromark
587a04ab84 prevent possible XSS attack via form helper selects and unescaped output. 2013-12-04 01:51:39 +01:00
euromark
aae0f762dd Collision free approach to resolve the DOM ID issue in a clean way. Fix to generation of ids for multiple checkboxes. Resolves ticket 4064. 2013-12-04 01:30:57 +01:00
mark_story
8578708e76 Merge branch 'master' into 2.5 2013-12-01 21:37:37 -05:00
mark_story
a9ca1bdc58 Add tests and fix other cases where autoLinkEmail would fail.
Refs #2403
2013-11-29 22:57:43 -05:00
mark_story
7c66d0db50 Fix autoLink() when URLs contain email addresses.
Add whitespace lookbehind to ensure the email address is preceded by
whitespace, this obviously means that emails starting with word/symbols
are not detected, however those symbols are generally valid in an email
address anyways, and will form the local part.

Fixes #2403
2013-11-29 22:24:03 -05:00
mark_story
3b8208be2e Merge branch 'master' into 2.5 2013-11-18 21:49:13 -05:00
Matheus Pedroso
4677ddf490 Fix duplicated webroot path on HtmlHelper::meta('icon'). 2013-11-18 23:38:01 -02:00
ADmad
dda6080579 Merge branch 'master' into 2.5 2013-11-19 00:27:12 +05:30
Marc Würth
7cfa0116f4 Removed "PHP 5" from file header DocBlocks
This statement does not serve a purpose anymore.
In a long forgotten world it indicated the main version number of PHP which the code in the file was compatible to.
http://pear.php.net/manual/en/standards.sample.php
But since PHP 5.1 and later this is only marginally true.
Thus I propose to remove it from CakePHP.
2013-11-13 22:58:39 +01:00
mark_story
a07608cbb9 Fix incorrect CSRF token fields when using postLink()
Creating a postLink after creating a GET form would result in the
incorrect fields being generated.

Fixes #2308
2013-11-11 21:56:55 -05:00
mark_story
3561929be7 Merge branch 'master' into 2.5 2013-11-10 21:53:09 -05:00
mark_story
8d38861a2e Fix missing HTML encoding on URL's generated by Html->meta().
The input URL was not correctly handled as an asset URL and thus was
not correctly HTML or URL escaped. This created invalid HTML when
favicon URLs included query string arguments.

Refs #2233
2013-11-09 14:31:09 -05:00
ADmad
d647fe8a91 Added buffering of form tags generated by FormHelper::postLink() 2013-11-03 23:11:11 +05:30
mark_story
afd182898f Merge branch 'master' into 2.5 2013-11-01 16:54:57 -04:00
Bryan Crowe
94d7ac1dd6 Correct spelling of retrieve 2013-10-30 23:13:07 -04:00
mark_story
aaac360833 Merge branch 'master' into 2.5 2013-10-30 14:58:20 -04:00
mark_story
525efcb808 Remove use of deprecated constants.
Fixes #2232
2013-10-29 17:49:16 -04:00
ADmad
d9ca148499 Merge branch 'master' into 2.5
Conflicts:
	CONTRIBUTING.md
	lib/Cake/Model/Model.php
	lib/Cake/VERSION.txt
2013-10-30 02:34:09 +05:30
José Lorenzo Rodríguez
45bd01fdc0 Merge pull request #2132 from dereuromark/2.5-paginator-sort
Ability to use PaginatorHelper::sort() with only one direction.
2013-10-24 05:40:42 -07:00
Bryan Crowe
a943ea5c34 Add space between classname(s) 2013-10-22 22:59:50 -04:00
Bryan Crowe
d39ced8381 Correct 'an URL' to 'a URL' in docblocks 2013-10-22 00:09:34 -04:00
euromark
def015108d Ability to use PaginatorHelper::sort() with only one direction. 2013-10-19 12:44:50 +02:00
Cameri
bb33d52cc6 Added 'xhr' as callback in JqueryEngineHelper::request() so it formats as Javascript. 2013-10-17 18:26:39 -04:00
Marc Würth
bf8a13a77c Added binary type to field type map, defaulting to file input field
Refs  https://github.com/cakephp/cakephp/issues/2071
2013-10-15 22:25:51 +02:00
Bryan Crowe
f9435aff27 Add missing return tags 2013-10-14 22:43:17 -04:00
Mark Story
ce74153389 Merge pull request #1691 from uzyn/2.5-decimal
Add support for decimal type in Schema.

Fixes #3171
2013-10-14 08:36:15 -07:00
Jose Lorenzo Rodriguez
df549898ad Merge remote-tracking branch 'origin/2.5' into k-halaburda-master 2013-10-12 01:05:02 +02:00
Bryan Crowe
c1dd0e4393 Changed url to URL where appropriate 2013-10-07 23:17:58 -04:00
mark_story
60b0893c79 Merge branch 'master' into 2.5 2013-10-06 23:49:32 -03:00
ADmad
aa60b8791a Fixed setting "required" attribute for file input. Closes #4124
In general fixed the issue where enabling SECURE_SKIP for a field
skipped "required" attribute check altogether. Instead now "required"
is set to false for hidden fields by default.
2013-10-04 20:35:38 +05:30
euromark
eb98770304 Remove leftover of pageTitle. 2013-10-04 00:35:56 +02:00
U-Zyn Chua
4806d09d7e Setting of step for decimal field based on precision. 2013-09-29 22:44:50 +08:00
U-Zyn Chua
091658a752 Decimal support for FormHelper. 2013-09-29 22:40:35 +08:00
euromark
bd87ef45f2 complete autoLinkEmail() 2013-09-27 15:01:46 +02:00
euromark
205f7a504b also fix autoLinkEmail() 2013-09-27 14:56:53 +02:00
euromark
2a954b6095 Make TextHelper::autoLink() work properly with umlauts. 2013-09-27 14:48:57 +02:00
Bryan Crowe
915b51b239 Updated JavaScript casing and JsHelper references in doc blocks 2013-09-25 22:46:38 -04:00
euromark
2455af09c5 Resolves ticket #4100 2013-09-25 14:01:35 +02:00
euromark
12f2f729c8 more cs 2013-09-17 14:53:07 +02:00
euromark
382f75dbfc cs corrections, bool to boolean and int to integer. 2013-09-17 14:44:34 +02:00
mark_story
5ec9b145bf Fix label element for attributes not matching their inputs.
Radio elements would contain ModelModelFieldValue instead of
ModelFieldValue like they should. This was caused by the fix for #3936
and lack of tests for create() + radio().

Fixes #4071
2013-09-16 22:38:28 -04:00
mark_story
3c9500a3cb Fix whitespace error. 2013-09-05 10:21:24 -04:00
aread22
cb056a5cbe Use FormHelper->label instead of HtmlHelper->useTag
Implementing suggested fix by mark_story
2013-09-04 13:32:36 -04:00
aread22
4ab1c8c225 Format to CakePHP code sniffs 2013-09-01 21:08:17 -04:00
aread22
64bb74a7e8 Potential Fix for LightHouse Ticket #3936
I believe I found a fix for this issue. I am here at #CakeFest2013 and during the #HourOfContribution I ran across this issue.

Currently in CakePHP 2.4 on Line 1522 - 1524 you can see the following code:

@@@ php
if ($label) {
	$optTitle = $this->Html->useTag('label', $tagName, '', $optTitle);
}
@@@

The $label variable here the is the $label array passed into the input method in Sethathi example above. The problem is that the $label array is completely ignored and instead a label is created using the HtmlHelper->useTag method.

I have what I believe is a fix for this issue but it hasn't been extensively tested. I tested against Sethathi example in the ticket and it produced the correct result.

The fix is simple. We detect if an array is passed in and then send it to the FormHelper label method instead of the HtmlHelper useTag method. The FormHelper label methods accepts an options array, so we pass in the $label array.

This will probably need to be fixed for checkbox also

"ask":https://cakephp.lighthouseapp.com/users/235987 helped me with this fix
2013-09-01 20:56:44 -04:00
euromark
361980fade remove code, class names and paths from translation strings. 2013-08-21 00:05:53 +02:00
mark_story
0f2d59d987 Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Network/CakeResponse.php
	lib/Cake/TestSuite/CakeTestCase.php
2013-08-18 23:10:08 -04:00
euromark
6cf147e8c8 unify null checks - avoid method call in favor of strict check 2013-08-16 20:12:49 +02:00
dmromanov
56ef44f495 Excluded method names from several tanslation strings
Removed unnecessary sprintfs
2013-08-16 13:42:28 +04:00
Alexander Hofbauer
80e589f19d Correctly encode confirm handlers
With encode set to false the onclick handler will be sent through
h() regardless, making links and postLinks work again.
2013-08-13 10:11:22 +02:00
euromark
f3018cc532 refactor methods to avoid else block on returning early 2013-08-12 19:06:34 +02:00
José Lorenzo Rodríguez
890d4a9e2c Merge pull request #1478 from aleho/2.4
Use a protected method to generate confirm() links
2013-08-11 13:51:29 -07:00
euromark
fc2d28974b remove undocumented code and uncessary in_array() checks + cleanup 2013-08-08 03:56:58 +02:00
ADmad
faa4262969 Merge pull request #1305 from jrbasso/2.4-fix-asset-full-url
Fixed full urls on asset methods
2013-08-07 10:29:11 -07:00
Mark
6c30851783 Merge pull request #1424 from dereuromark/2.4-form-helper-datetime-rounding
provide ability for rounding - closes #1986
2013-08-07 10:15:35 -07:00