source: products/qPloneDropDownMenu/branches/0.2/skins/qPloneDropDownMenu/qpdm_add.py @ 1

Last change on this file since 1 was 1, checked in by myroslav, 16 years ago

Building directory structure

  • Property svn:eol-style set to native
File size: 2.7 KB
Line 
1## Script (Python) "qpdm_add"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters= submenu_path, title, url='', num
8##title=
9##
10
11from Products.CMFCore.utils import getToolByName
12
13menu_tool = getToolByName(context, 'portal_dropdownmenu')
14menu_tool.manage_addMenuItem(submenu_path, title, url)
15
16params = {'submenu_path':submenu_path, 'title':title, 'url':url, 'num':num, 'portal_url':context.portal_url()}
17
18return """
19<li id="tabslist_%(title)s">
20    <div class="deleteHover">
21        <input name="submenu_path" value="%(submenu_path)s/%(num)s" type="hidden">
22        <img src="./images/live_tree_transparent_pixel.gif" alt="&gt;" class="item_icon collapsed_icon">
23        <img class="drag-handle" src="./images/drag.gif" alt="" height="11" width="25">
24        <span>%(title)s</span>
25        <a class="delete" href="#">Delete</a>
26        <div class="reorder-controls"><a href="#" class="reorder">Reorder</a></div>
27        <div class="sort-controls"><a href="#" class="save">Save</a> | <a href="#" class="cancel">Cancel</a></div>
28        <form class="editform" method="post" action="%(portal_url)s/prefs_dropdownmenu_edit_form" name="f%(num)s">
29            <input name="idx" value="%(num)s" type="hidden">
30            <dl>
31              <dt><label>Name</label></dt>
32              <dd><input value="%(title)s" name="i%(num)s_title" type="text"></dd>
33            </dl>
34            <dl>
35              <dt><label>URL</label></dt>
36              <dd><input value="%(url)s" name="i%(title)s_url" size="30" type="text"></dd>
37
38            </dl>
39            <div>
40              <input class="editsave" value="Save" type="submit">
41              <input class="editcancel" value="Cancel" type="submit">
42            </div>
43        </form>
44    </div>
45    <div class="sub-items">
46      <ul class="tabslist hideLevel">
47        <li class="addItem">
48          <form class="addform" method="post" action="%(portal_url)s/prefs_dropdownmenu_edit_form">
49            <input name="submenu_path" value="%(submenu_path)s/%(num)s" type="hidden">
50            <dl class="field-title"><dt><label>Name</label></dt>
51              <dd><img src="./images/live_tree_transparent_pixel.gif" alt="&gt;" class="item_icon">
52                  <input class="acttitle" value="" name="title" type="text"></dd></dl>
53            <dl class="field-url"><dt><label>URL</label></dt>
54              <dd><input class="acturl" value="" size="30" name="url" type="text"></dd></dl>
55            <div class="add-controls">
56              <input class="buttonadd" value="Add" type="submit">
57              <input class="buttoncancel" value="Cancel" type="submit">
58            </div>
59          </form>
60        </li>
61      </ul>
62    </div>
63</li>\n""" % params
Note: See TracBrowser for help on using the repository browser.