Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
justinfreeman (Agileware)
Core
Commits
dafd2d75
Commit
dafd2d75
authored
11 years ago
by
colemanw
Browse files
Options
Downloads
Patches
Plain Diff
CRM-14165 - Improve lookup and styling of options edit link
parent
54df0f0c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CRM/Core/Form.php
+4
-4
4 additions, 4 deletions
CRM/Core/Form.php
CRM/Core/Form/Renderer.php
+6
-8
6 additions, 8 deletions
CRM/Core/Form/Renderer.php
css/civicrm.css
+24
-0
24 additions, 0 deletions
css/civicrm.css
with
34 additions
and
12 deletions
CRM/Core/Form.php
+
4
−
4
View file @
dafd2d75
...
...
@@ -919,11 +919,12 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
if
(
!
isset
(
$props
[
'data-api-field'
]))
{
$props
[
'data-api-field'
]
=
strrpos
(
$name
,
'['
)
?
rtrim
(
substr
(
$name
,
1
+
strrpos
(
$name
,
'['
)),
']'
)
:
$name
;
}
$
options
=
civicrm_api3
(
$props
[
'data-api-entity'
],
'getoptions'
,
array
(
$
info
=
civicrm_api3
(
$props
[
'data-api-entity'
],
'getoptions'
,
array
(
'field'
=>
$props
[
'data-api-field'
],
'options'
=>
array
(
'metadata'
=>
array
(
'fields'
))
)
);
$options
=
$
options
[
'values'
];
$options
=
$
info
[
'values'
];
if
(
!
array_key_exists
(
'placeholder'
,
$props
))
{
$props
[
'placeholder'
]
=
$required
?
ts
(
'- select -'
)
:
ts
(
'- none -'
);
}
...
...
@@ -939,8 +940,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
}
// Core field
else
{
$getFields
=
civicrm_api3
(
$props
[
'data-api-entity'
],
'getfields'
);
foreach
(
$getFields
[
'values'
]
as
$uniqueName
=>
$fieldSpec
)
{
foreach
(
$info
[
'metadata'
][
'fields'
]
as
$uniqueName
=>
$fieldSpec
)
{
if
(
$uniqueName
===
$props
[
'data-api-field'
]
||
CRM_Utils_Array
::
value
(
'name'
,
$fieldSpec
)
===
$props
[
'data-api-field'
]
||
...
...
This diff is collapsed.
Click to expand it.
CRM/Core/Form/Renderer.php
+
6
−
8
View file @
dafd2d75
...
...
@@ -137,9 +137,9 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty {
*
* @access private
*
* @param
object An
HTML_QuickForm_element object
* @param bool Whether an element is required
* @param string Error associated with the element
* @param
$element
HTML_QuickForm_element object
* @param
$required
bool Whether an element is required
* @param
$error
string Error associated with the element
*
* @return array
* @static
...
...
@@ -164,14 +164,12 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty {
if
(
$type
==
'text'
)
{
$size
=
$element
->
getAttribute
(
'size'
);
if
(
!
empty
(
$size
))
{
if
(
array_key_exists
(
$size
,
self
::
$_sizeMapper
))
{
$class
.
=
' '
.
self
::
$_sizeMapper
[
$size
];
}
$class
=
CRM_Utils_Array
::
value
(
$size
,
self
::
$_sizeMapper
);
}
}
}
$class
.
=
(
$class
?
' '
:
''
)
.
'crm-form-'
.
$type
;
$class
=
(
$class
?
"
$class
"
:
''
)
.
'crm-form-'
.
$type
;
if
(
$required
)
{
$class
.
=
' required'
;
...
...
@@ -216,7 +214,7 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty {
*/
function
addOptionsEditLink
(
&
$el
,
$field
)
{
if
(
CRM_Core_Permission
::
check
(
'administer CiviCRM'
))
{
$el
[
'html'
]
.
=
'
<a href="#" class="crm-edit-optionvalue-link" title="'
.
ts
(
'Edit Options'
)
.
'" data-option-group-url="'
.
$field
->
getAttribute
(
'data-option-group-url'
)
.
'"><span class="
batch-edit
"></span></a>'
;
$el
[
'html'
]
.
=
' <a href="#" class="crm-edit-optionvalue-link
crm-hover-button
" title="'
.
ts
(
'Edit Options'
)
.
'" data-option-group-url="'
.
$field
->
getAttribute
(
'data-option-group-url'
)
.
'"><span class="
icon edit-icon
"></span></a>'
;
}
}
}
...
...
This diff is collapsed.
Click to expand it.
css/civicrm.css
+
24
−
0
View file @
dafd2d75
...
...
@@ -2622,6 +2622,30 @@ div.grippie {
background-position
:
-32px
-32px
;
}
/* Icon hover-buttons */
.crm-container
.crm-hover-button
{
display
:
inline-block
;
}
.crm-container
.crm-hover-button
:hover
,
.crm-container
.crm-hover-button
:active
{
background
:
#ccc
;
background-image
:
-webkit-gradient
(
linear
,
left
bottom
,
left
top
,
color-stop
(
0
,
#eee
),
color-stop
(
1
,
#ccc
));
background-image
:
-webkit-linear-gradient
(
center
bottom
,
#eee
0%
,
#ccc
100%
);
background-image
:
-moz-linear-gradient
(
center
bottom
,
#eee
0%
,
#ccc
100%
);
filter
:
progid
:
DXImageTransform
.
Microsoft
.
gradient
(
startColorstr
=
'#cccccc'
,
endColorstr
=
'#eeeeee'
,
GradientType
=
0
);
background-image
:
linear-gradient
(
top
,
#eee
0%
,
#ccc
100%
);
border
:
1px
solid
#AAAAAA
;
border-radius
:
4px
;
}
.crm-container
.crm-hover-button
.icon
{
margin-left
:
3px
;
margin-top
:
2px
;
vertical-align
:
middle
;
}
.crm-container
.crm-hover-button
:hover
.icon
,
.crm-container
.crm-hover-button
:active
.icon
{
background-image
:
url("../i/icons/jquery-ui-2786C2.png")
;
}
/* accordion styles */
.crm-container
.crm-accordion-header
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment