[gen] Replaced, in PXs, function 'img' by function 'url', that returns the URL of an external resource to be included in the XHTML, like an image, a Javascript file or a CSS file.

This commit is contained in:
Gaetan Delannay 2013-07-20 19:56:17 +02:00
parent f2b19e4141
commit efd918f175
11 changed files with 83 additions and 85 deletions

View file

@ -36,12 +36,12 @@ class Action(Field):
<input if="field.confirm" type="button" class="button"
var="labelConfirm=_(field.labelId + '_confirm')"
value=":ztool.truncateValue(label)" title=":label"
style=":img('buttonAction', bg=True)"
style=":url('buttonAction', bg=True)"
onclick=":'askConfirm(%s,%s,%s)' % (q('form'), q(formId), \
q(labelConfirm))"/>
<input if="not field.confirm" type="submit" class="button" name="do"
value=":ztool.truncateValue(label)" title=":label"
style=":img('buttonAction', bg=True)"/>
style=":url('buttonAction', bg=True)"/>
</form>''')
# It is not possible to edit an action, not to search it.

View file

@ -47,7 +47,7 @@ class Calendar(Field):
goForward=not endDate or (endDate.strftime(fmt) &gt; \
grid[-1][-1].strftime(fmt))">
<!-- Go to the previous month -->
<img class="clickable" if="goBack" src=":img('arrowLeftSimple')"
<img class="clickable" if="goBack" src=":url('arrowLeftSimple')"
onclick=":'askMonthView(%s,%s,%s,%s)' % \
(q(ajaxHookId),q(objUrl),q(field.name),q(previousMonth))"/>
<!-- Go back to the default date -->
@ -60,7 +60,7 @@ class Calendar(Field):
q(objUrl), q(field.name), q(defaultDateMonth))"
disabled=":defaultDate.strftime(fmt)==monthDayOne.strftime(fmt)"/>
<!-- Go to the next month -->
<img class="clickable" if="goForward" src=":img('arrowRightSimple')"
<img class="clickable" if="goForward" src=":url('arrowRightSimple')"
onclick=":'askMonthView(%s, %s, %s, %s)' % (q(ajaxHookId), \
q(objUrl), q(field.name), q(nextMonth))"/>
<span>:_('month_%s' % monthDayOne.aMonth())</span>
@ -107,14 +107,14 @@ class Calendar(Field):
<img class="clickable" style="visibility:hidden"
var="info=field.getApplicableEventsTypesAt(contextObj, date, \
allEventTypes, preComputed, True)"
if="info['eventTypes']" src=":img('plus')"
if="info['eventTypes']" src=":url('plus')"
onclick=":'openEventPopup(%s, %s, %s, null, %s, %s)' % \
(q('new'), q(field.name), q(dayString), q(info['eventTypes']),\
q(info['message']))"/>
</x>
<!-- Icon for deleting an event -->
<img if="mayDelete" class="clickable" style="visibility:hidden"
src=":img('delete')"
src=":url('delete')"
onclick=":'openEventPopup(%s, %s, %s, %s, null, null)' % \
(q('del'), q(field.name), q(dayString), q(str(spansDays)))"/>
<!-- A single event is allowed for the moment -->

View file

@ -56,7 +56,7 @@ class Date(Field):
<!-- The icon for displaying the calendar popup -->
<x if="field.calendar">
<input type="hidden" id=":name" name=":name"/>
<img id=":'%s_img' % name" src=":img('calendar.gif')"/>
<img id=":'%s_img' % name" src=":url('calendar.gif')"/>
<script type="text/javascript">:field.getJsInit(name, years)</script>
</x>
@ -111,7 +111,7 @@ class Date(Field):
<!-- The icon for displaying the calendar popup -->
<x if="field.calendar">
<input type="hidden" id=":fromName" name=":fromName"/>
<img id=":'%s_img' % fromName" src=":img('calendar.gif')"/>
<img id=":'%s_img' % fromName" src=":url('calendar.gif')"/>
<script type="text/javascript">:field.getJsInit(fromName, years)
</script>
</x>
@ -144,7 +144,7 @@ class Date(Field):
<!-- The icon for displaying the calendar popup -->
<x if="widget.calendar">
<input type="hidden" id=":toName" name=":toName"/>
<img id=":'%s_img' % toName" src=":img('calendar.gif')"/>
<img id=":'%s_img' % toName" src=":url('calendar.gif')"/>
<script type="text/javascript">:field.getJsInit(toName, years)">
</script>
</x>

View file

@ -33,7 +33,7 @@ class List(Field):
widgetName='%s*%d' % (field.name, rowIndex)">:field.pxView</td>
<!-- Icon for removing the row -->
<td if="layoutType=='edit'" align=":dright">
<img class="clickable" src=":img(delete')" title=":_('object_delete')"
<img class="clickable" src=":url(delete')" title=":_('object_delete')"
onclick=":'deleteRow(%s, this)' % q('list_%s' % name)"/>
</td>
</tr>''')
@ -47,7 +47,7 @@ class List(Field):
<th for="info in field.fields">::_(info[1].labelId)</th>
<!-- Icon for adding a new row. -->
<th if="isEdit">
<img class="clickable" src=":img('plus')" title=":_('add_ref')"
<img class="clickable" src=":url('plus')" title=":_('add_ref')"
onclick=":'insertRow(%s)' % q('list_%s' % name)"/>
</th>
</tr>

View file

@ -38,7 +38,7 @@ class Ogone(Field):
<input type="hidden" for="item in value.items()" if="item[0] != 'env'"
id=":item[0]" name=":item[0]" value=":item[1]"/>
<!-- Submit image -->
<input type="image" id="submit2" name="submit2" src=":img('ogone.gif')"
<input type="image" id="submit2" name="submit2" src=":url('ogone.gif')"
title=":_('custom_pay')"/>
</form>
</x>''')

View file

@ -43,7 +43,7 @@ class Pod(Field):
<input type="checkbox" name=":doLabel" id=":chekboxId"/>
<label lfor=":chekboxId" class="discreet">:_(doLabel)"></label>
</x>
<img for="fmt in field.getToolInfo(contextObj.appy())[1]" src=":img(fmt)"
<img for="fmt in field.getToolInfo(contextObj.appy())[1]" src=":url(fmt)"
onclick=":'generatePodDocument(%s, %s, %s, %s)' % \
(q(contextObj.UID()), q(name), q(fmt), q(ztool.getQueryInfo()))"
title=":fmt.capitalize()" class="clickable"/>

View file

@ -61,11 +61,11 @@ class Ref(Field):
ajaxBaseCall=navBaseCall.replace('**v**','%s,%s,{%s:%s,%s:%s}'%\
(q(startNumber), q('ChangeRefOrder'), q('refObjectUid'),
q(obj.UID()), q('move'), q('**v**')))">
<img if="objectIndex &gt; 0" class="clickable" src=":img('arrowUp')"
<img if="objectIndex &gt; 0" class="clickable" src=":url('arrowUp')"
title=":_('move_up')"
onclick=":ajaxBaseCall.replace('**v**', 'up')"/>
<img if="objectIndex &lt; (totalNumber-1)" class="clickable"
src=":img('arrowDown')" title=":_('move_down')"
src=":url('arrowDown')" title=":_('move_down')"
onclick=":ajaxBaseCall.replace('**v**', 'down')"/>
</td>
<!-- Workflow transitions -->
@ -76,16 +76,16 @@ class Ref(Field):
<a var="navInfo='ref.%s.%s:%s.%d.%d' % (contextObj.UID(), field.name, \
field.pageName, loop.obj.nb + startNumber, totalNumber)"
href=":obj.getUrl(mode='edit', page='main', nav=navInfo)">
<img src=":img('edit')" title=":_('object_edit')"/></a>
<img src=":url('edit')" title=":_('object_edit')"/></a>
</td>
<!-- Delete -->
<td if="not isBack and field.delete and canWrite and obj.mayDelete()">
<img class="clickable" title=":_('object_delete')"
src=":img('delete')" onclick=":'onDeleteObject(%s)'%q(obj.UID())"/>
src=":url('delete')" onclick=":'onDeleteObject(%s)'%q(obj.UID())"/>
</td>
<!-- Unlink -->
<td if="not isBack and field.unlink and canWrite">
<img class="clickable" title=":_('object_unlink')" src=":img('unlink')"
<img class="clickable" title=":_('object_unlink')" src=":url('unlink')"
onclick=":'onUnlinkObject(%s,%s,%s)' % (q(contextObj.UID()), \
q(field.name), q(obj.UID()))"/>
</td>
@ -109,7 +109,7 @@ class Ref(Field):
noFormCall=not field.addConfirm and noFormCall or \
'askConfirm(%s, %s, %s)' % (q('script'), q(noFormCall), \
q(addConfirmMsg))"
style=":img('buttonAdd', bg=True)" value=":_('add_ref')"
style=":url('buttonAdd', bg=True)" value=":_('add_ref')"
onclick=":field.noForm and noFormCall or formCall"/>''')
# This PX displays, in a cell header from a ref table, icons for sorting the
@ -120,9 +120,9 @@ class Ref(Field):
var2="ajaxBaseCall=navBaseCall.replace('**v**', '%s,%s,{%s:%s,%s:%s}'% \
(q(startNumber), q('SortReference'), q('sortKey'), \
q(field.name), q('reverse'), q('**v**')))">
<img class="clickable" src=":img('sortAsc')"
<img class="clickable" src=":url('sortAsc')"
onclick=":ajaxBaseCall.replace('**v**', 'False')"/>
<img class="clickable" src=":img('sortDesc')"
<img class="clickable" src=":url('sortDesc')"
onclick=":ajaxBaseCall.replace('**v**', 'True')"/>
</x>''')
@ -180,7 +180,7 @@ class Ref(Field):
<x>:field.pxAdd</x>
<!-- The search button if field is queryable -->
<input if="objs and field.queryable" type="button" class="button"
style=":img('buttonSearch', bg=True)" value=":_('search_title')"
style=":url('buttonSearch', bg=True)" value=":_('search_title')"
onclick=":'window.location=%s' % \
q('%s/ui/search?className=%s&amp;ref=%s:%s' % \
(ztool.absolute_url(), linkedPortalType, contextObj.UID(), \